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IAAIE,EAAyB,IAAIpb,IAAIkb,GACrCE,EAAuBlb,MAAM,CAACP,GAC9BN,EAASN,cAAc,CAACkB,GAAG,CAACd,EAAKic,EACnC,CACF,CACF,oPCbA,gBACA,eAEA,IADA,UACY,KAAW,CACvB,GADuB,CACvB,UACA,OACA,YACA,uBACA,KACA,CACA,CACA,cACA,8BAEA,cACA,4BACA,WACA,UACA,UACA,OACA,IACA,2BACA,KAEA,CACA,gBACA,OACA,MACA,OACA,YACA,cACA,QACA,OACA,KACA,QACA,OACA,UACA,iBACA,uBACA,KACA,CACA,CACA,QACA,CACA,gBACA,8BACA,yBAGA,GADA,cAAoB,QACpB,kEACA,IAkIA,EAlIA,aACE,eAAoB,YACtB,cACA,CACA,EAAE,IACF,WACA,UACE,cAAoB,YACtB,gBACA,CACA,CACA,SACA,KACA,IACA,OACA,IACA,KACA,KACA,KACA,KACA,gDACA,oDACA,qDACA,cACA,eAAqC,UAAgB,CACrD,GADqD,OACrD,qBACA,kBACA,KACA,6BACA,YACA,MACA,MACA,CACA,CACA,cAGA,GAFA,KACA,KACA,IACA,eACA,KACA,GACA,eACA,CACA,UACA,WACA,kBACA,EACA,CACA,SACA,KACA,IACA,KACA,aACA,YAEA,sBAGA,CACA,aAEA,GADA,KACA,GACA,uBACA,IACA,SACA,IACA,GACA,KACA,GACA,MACA,KACA,MACA,KACA,QACA,IACA,GAEA,IADA,KAEA,OACA,UACA,CACA,2BAGA,CACA,iBACA,yBACA,gBACA,kBACA,QACA,qBAGA,GADA,mBACA,sBACA,aACA,KACA,KACA,OACA,CACA,eACA,IACA,EAAgB,SAChB,MACA,CACA,qBACA,CACA,UACA,WACA,EACA,EACA,eAEA,IACA,CACA,CACA,OACA,EAAU,OACV,OACA,IACA,IACA,CACA,QACA,CACA,EAAM,OACN,EACA,IACA,IACA,CACA,CACA,CAEA,wBACA,aACA,IACA,OACA,uCACA,yBACA,UACA,oBACA,aACA,mBACA,CACA,EAAE,IACF,aACA,MACA,EACA,gBACA,eACA,mBACA,CAAG,GACH,CACA,uBAA6B,GAC7B,4BAAkC,GAClC,sBAA4B,GAC5B,yBAA+B,GAC/B,oBAA0B,MAC1B,+BAAqC,GACrC,yBAA+B,aAC/B,eACA,EACA,yBAA+B,aAC/B,WACA,cACA,mHAEA,yBACA,EACA,kCAAwC,YACxC,QACA,EACA,eAAqB,aACrB,UACA,OACA,OACA,OACA,QACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,uBAA6B,YAC7B,IACA,EACA,0BAAgC,eAChC,UACA,OACA,OACA,OACA,OACA,OACA,KACA,SACA,GACA,CACA,QACA,IACA,IACA,UACA,EAAI,OACJ,GACA,CACA,EACA,2BAAiC,UACjC,EACA,EACA,GAEA,uBAQA,OALA,EAFA,8BAGA,gBAFA,aAEA,IACA,IACA,EAEA,GACA,OACA,SACA,KACA,QACA,MACA,KACA,QACA,aACA,KACA,QACA,MACA,KACA,SACA,KACA,CA0BA,OAzBA,MACA,GACA,OACA,WACA,gBACA,YACA,iBACA,YACA,EACA,IACA,eACA,OACA,aACA,UACA,GACA,YACA,KACA,WACA,eACA,OACA,GACA,GACA,MACA,GACA,aACA,CACA,EACA,sBAA4B,GAC5B,uBAA6B,aAC7B,QACA,kBACA,QACA,IACA,IACA,8BACA,EAAM,OACN,GACA,CACA,CACA,kHCxUSyD,qCAAAA,KAXT,IAAIA,EAAYC,IAAe,uKCoCfC,iBAAiB,mBAAjBA,GAsIA3I,eAAe,mBAAfA,SAAAA,EACd9Y,CAA2B,CAC3B0G,CAAsB,EAEtB,GAAM,KAAEyC,CAAG,eAAEuY,CAAa,cAAEC,CAAY,cAAEzhB,CAAY,eAAEma,CAAa,CAAE,CACrE3T,EACIzG,EAAmB,CAAC,EACpB,MAAE7B,CAAI,CAAE,CAAG+K,EACXgG,EAAOjG,CAAAA,EAAAA,EAAAA,iBAAAA,EAAkBC,GACzBzI,EAA+B,SAAjBihB,EAOpB,GALA5H,CAAAA,EAA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MAAY,EAAQ,KAA0B,EAC9C,UADmB,CACnB,GACA,oCACA,uBACA,+CACA,YAAoB,mBAAsB,IAC1C,8CACA,CACA,MACA,yBACA,EACA,GAAO,QACP,EACA,gHAEA,CACA,cACA,OACA,GACA,IACA,aACA,mBACA,CAAO,CACP,IACA,IACA,IACA,IACA,IACA,IACA,GACA,CAAK,CACL,IACA,gBACA,CAAG,CACH,6BAYA,EACA,kEACA,sBACA,cACA,mBACA,iCACA,CACA,8DAAoE,CACpE,EACA,cAAoB,eACpB,MACA,4DACA,GACA,IACA,gBACA,gBACA,gBAEA,oBACA,OA9BA,gBACA,MACA,4DACA,OACA,WACA,sBACA,WACA,gBACA,gBACA,CACA,EAoBA,WACA,EACA,WAAiB,aACjB,UACA,MACA,IACA,8BACA,EAAI,OACJ,MACA,MACA,OACA,CACA,EACA,YAAkB,eAClB,oBACA,KAGA,gBAFA,kBAGA,sBACA,EACA,GACA,OACA,KACA,WACA,EACA,aAAmB,aACnB,4BACA,EACA,SAAe,eACf,iDACA,WACA,qBACA,EACA,gDACA,EACA,iCACA,gBACA,MACA,aACA,MACA,EACA,kDACA,CACA,cACA,YACA,eACA,GAEA,cACA,SACA,cACA,YACA,gBACA,6CACA,CAAS,CACT,CACA,EACA,eAAqB,eACrB,uBACA,gCACA,iCACA,QACA,KACA,eAEA,SACA,cACA,UACA,gDACA,6CACA,CAAS,CACT,OACM,kBACN,EACA,SAAe,eACf,GACA,oBACA,oBACA,UACA,sBACA,CACA,WACA,qBACA,WACA,cACA,UACA,gDACA,8CACA,2CACA,cACA,iCACA,gBACA,OACA,eACA,kCACA,iBACA,OACA,YACA,oDACA,WACA,kDACA,6CACA,CAAK,CACL,CACA,EACA,eAAqB,eACrB,uBACA,MACA,4BACA,SACA,GACA,uCACA,KACA,OACA,cACA,UACA,+CACA,CAAO,CACP,EAAM,aACN,EACA,kBAAwB,aACxB,QACA,EACA,yBAA+B,eAC/B,WACA,EACA,cAAoB,iBACpB,8BACA,EACA,eAAqB,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ACE,EAAAA,aAFV,SAEgC,CAACv1B,KAAK,CAAC,GAAoC,CAEhEm1B,CARiD,CAW5DE,CAAS,CAACG,EAAAA,WAFV,SAE8B,CAACx1B,KAAK,CAAC,GAAkC,IANX,qCAKA,4NCnC9D,2CACA,6BACA,+BACA,kCACA,+BACA,+BACA,8BACA,kCACA,+BACA,2BACA,2BACA,kBAQA,GACA,qBACA,QACA,CAAK,CACL,+BAAsC,CACtC,gCAAuC,CACvC,4BACA,CAAG,CACH,gBACA,KACA,kBACA,aACA,eACA,YACA,iBACA,CAgBA,cAEA,kBACA,aACA,eACA,YACA,iBACA,CAtBA,gCACA,mCACA,GACA,oBACA,sBACA,QAEA,YACA,0GAEA,iDACA,EACA,oCACA,qDACA,EAEA,wBAOA,wBACA,gBACA,iBACA,0BACA,oBACA,GAA2B,mCAA6C,CACxE,kCACA,wBAEA,OACA,WACA,OACA,MACA,aALA,UAKA,OACA,OACA,CACA,CAWA,cACA,MACA,oBACA,UACA,cAEA,CAUA,aACA,oBAVA,EACA,EAUA,iDAXA,EAYA,SAXA,GAAwB,mBAExB,IACA,8BACA,YACK,GAOL,cACA,CACA,cA8IA,kBACA,oBACA,SACA,IAIA,OApHA,sBACA,IAlEA,IA/DA,EAiIA,WACA,2CACA,SACA,sBAEA,UACA,aACA,aACA,aACA,KACA,KACA,cACA,mBACA,OACA,OACA,KACA,KACA,QACA,OACA,cAEA,YACA,EACA,EACA,EACA,EAGA,CACA,CACA,KACA,OACA,OACA,EACA,oBACA,KACA,MACA,SACA,GACA,wBACA,uBACA,QACA,EAAW,EACX,SACA,QA9GA,EAgHA,EAhHA,EAiHA,EACA,cACA,iBACA,GACA,mBACA,EACA,OACA,KACA,EAVA,EA9GA,EACA,OACA,EACA,OACA,OACA,OACA,UAoHA,WACA,EAEA,IACA,uBACA,QACA,YAAoB,WAAqB,IACzC,EACA,IADA,OACA,GACA,KACA,EACA,EACA,EACA,EACA,QAEA,wBAzMA,QADA,EA0MA,IAzMA,wBAIA,kBAHA,GACA,SACA,iBACA,MAqMA,EACA,IACA,gBACA,oBAGA,EACA,IADA,UACA,KACA,KACA,EACA,EACA,EACA,EACA,QAEA,iBACA,6BACA,SA3HA,YACA,iBACA,gBACA,mBACA,WACA,uBAEA,OACA,0BACA,YACA,oBACA,OACA,YACA,sBACA,sBACA,UACA,CAAe,CACf,YACA,sBACA,gCACA,EACA,EACA,UAEA,gBACA,mBACA,WACA,eAEA,CACA,OACA,EA6FA,GACA,EACA,EACA,EACA,EAGA,aACA,kDACA,qBAHA,cAIA,mBAA+B,8BAAyC,EACxE,GACA,4EAEA,CACA,QACA,EAKA,sBACA,sBACA,CAAG,EACH,CACA,CACA,cACA,mBACA,gBAEA,CADA,OACA,KACA,YACA,iCACA,yBACA,CAAO,CACP,YACA,iCACA,yBACA,GAEA,yCACA,CACA,gDACA,UAEA,MACA,+BACA,YACA,YACA,GACA,yBACA,qCACA,CACA,qCACA,WACA,cACA,QACA,oBACA,UACA,2BACA,kBACA,UACA,OACA,CAAW,EACX,kCACA,EAAU,OACV,iBAA8B,GAC9B,IADqC,QACrC,OAAgC,EAAO,MAE7B,EAAO,4BACjB,MACA,CACA,gBACA,EACA,cACA,UAAgB,EAChB,MACA,wBACA,EACA,EACA,WACA,uBACA,CAAO,CACP,EAEA,CAAG,CACH,kBACA,QAIA,OAHA,eACA,GACA,CAAK,EACL,CACA,CAAG,CACH,oBACA,OACA,gBACA,QACA,CAAO,MAEJ,CACH,iBACA,SACA,YACA,yEAEA,QACA,CACA,EACA,WAAiB,GACjB,UAAgB,GAChB,UAAgB,GAChB,eAAqB,GACrB,YAAkB,GAClB,UAAgB,GAChB,iEAAuE,CACvE,EACA,oBAA0B,EAC1B,eACA,cACA,0BACA,CACA,EACA,OAAa,aACb,kBACA,8BACA,CACA,EACA,cAAoB,iBACpB,WACA,YACA,+DAEA,UAAuB,UACvB,QACA,SACA,WACA,oCACA,6BACA,EACA,aACA,WACA,cACA,gBACA,6BACA,YACA,yBACA,2BACA,QACA,uBAAkD,IAAc,IAChE,oBACA,YACA,CACA,oCACA,EACA,eAAqB,aAcrB,MAbA,IACA,WACA,gBACA,iBACA,eACA,cACA,aACA,GACA,WACA,YACA,WACA,UACA,EACA,CACA,EACA,eAAqB,iBACrB,MACA,IAAc,CACd,OACA,WACA,wCACA,aACA,WACA,cACA,gBACA,YACA,yBACA,2BACA,QACA,uBAAwD,IAAoB,IAC5E,oBACA,YACA,CACA,qBACA,0BACA,eACA,YACA,kCACA,EACA,WAAiB,YACjB,OAAW,aACX,EACA,YAAkB,aAClB,OAAW,oBACX,EACA,gBAAsB,GACtB,MAAY,aACZ,OACA,WACA,UAAgB,qBAA4B,CAC5C,OACA,CACA,EACA,MAAY,eACZ,OACA,WACA,OACA,yBACA,CACA,EACA,iBAAuB,aACvB,UACA,IACA,OACA,IACA,UACA,KACA,WACA,OACA,oBACA,UACA,2BACA,WACA,CAAI,SACJ,IACA,EAAI,OACJ,KACA,CACA,EACA,0BAAgC,YAChC,4BACA,EACA,KAAW,aACX,iBACA,EACA,gBAAsB,iBACtB,gCACA,EACA,aAAmB,eACnB,2BACA,EACA,YAAkB,aAClB,wBACA,EACA,eAAqB,cACrB,kBAAwB,eACxB,gCACA,EACA,WAAiB,iBACjB,UACA,wBACA,YACA,kEAEA,uBACA,EACA,OAAa,YACb,kBACA,EACA,qBAA2B,iBAC3B,qCACA,EACA,oBAA0B,eAC1B,kCACA,EACA,iBAAuB,eACvB,+BACA,EACA,SAAe,eACf,uBACA,EACA,eAAqB,eACrB,6BACA,EACA,YAAkB,iBAClB,4BACA,EACA,QAAc,aACd,oBACA,EACA,UAAgB,aAChB,sBACA,EACA,sBAA4B,UAC5B,EACA,EACA,GAEA,gCACA,EACA,EACA,EAEA,EACA,eAAqB,YACrB,0BACA,EACA,SAAe,wMC/hBFif,mBAAmB,mBAAnBA,GAEDnV,YAAY,mBAAZA,GAgBIwD,eAAe,mBAAfA,aApBmB,OAEtB2R,EAAsB,gBAE5B,IAAKnV,EAAAA,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,WACA,kBACA,EACA,IACA,EACA,MACA,+DACA,2CACA,2BACA,kBAQA,uBACA,gBACA,wBACA,mBACA,cAmXA,kBACA,SAAyC,aAAsB,CAC/D,CAiBA,oBACA,cACA,aACA,cACA,gBACA,CAyBA,cACA,iBACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,mBACA,UACA,cACA,OACA,SACA,eAEA,CACA,cACA,mCACA,CACA,gBACA,YAAkB,WAAsB,eACxC,CACA,kBACA,iBACA,gBACA,aACA,KACA,eACA,cACA,WACA,YAAwB,WAA6B,IACrD,wBACA,UACA,YACA,MACA,IACA,IACA,WACA,IAEA,yBACQ,WACR,KACA,gBACA,gBACA,CACA,CACA,gBACA,8CACA,sBACA,CACA,eACA,oBACA,WACA,gBACA,CACA,CACA,kBACA,aACA,iBACA,KAAc,wBAA0B,4BAAoC,EAC5E,KACA,EAEA,CACA,kBACA,EACA,EACA,KAAc,wBAA0B,4BAAoC,EAE5E,CACA,gBACA,qDACA,CACA,cACA,WACA,0BACA,UACA,UACA,MACA,SACA,CACA,CACA,gBACA,+CACA,cACA,WACA,2BACA,UACA,UACA,MACA,SACA,CACA,CAvHA,6CACA,+BACA,oBACA,qBACA,QACA,KACA,uBACA,OACA,CACA,oBACA,gBACA,cACA,KACA,eACA,cACA,GACA,wDACA,GACA,2DACA,KACA,SACA,iBACA,CACA,EAiGA,WACA,cACA,QACA,OACA,cACA,mBACA,aACA,cACA,IACA,0CACA,UAKA,GAJA,UACA,cACA,cACA,QACA,UACA,2BACA,aACA,UACA,UACA,MACA,CACA,CACA,qBACA,SACA,CAAI,SACJ,8BACA,EAAI,OACJ,GACA,CACA,CACA,cACA,IACA,gBACA,sBACA,SACA,CAAI,SACJ,8BACA,CACA,CACA,gBACA,aACA,kBACA,8BACA,4BACA,CAAG,CACH,CACA,cACA,OAAW,8BACX,CACA,gBACA,gBACA,WAMA,OALA,GACA,aACA,yCACA,KACA,YACA,CACA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,GAsCA,cACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,CACA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EAEA,OADA,OAzDA,cACA,YAAoB,WAAiB,KACrC,KAAa,gBACb,cADiD,EACjD,YACA,eACA,wCACA,CACA,gBACA,YACA,MACA,CACA,UAEA,aACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,oBAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,EAsBA,GACA,IACA,CACA,oBACA,6BACA,OAhRA,cACA,aACA,4CACA,SACA,uBACA,uBACA,oCACA,uBACA,CAAW,EACX,MACA,CACA,WACA,UAEA,OADA,SACA,CACA,EAiQA,iBACA,MA3uBA,cACA,SACA,OACA,kBACA,CACA,yBAIA,GAHA,QACA,gBACA,mBACA,GACA,YACA,8BACA,EACA,iGAEA,CACA,eACA,oBACA,mBA0tBA,yBACA,MAEA,UACA,2CACA,YAEA,OACA,SACA,cACA,EALA,2BAOA,MACA,OACA,SACA,EAAI,IACJ,KACA,YACA,WACA,WACA,OACA,UACA,EA2CA,OA1CA,OACA,WACA,WACA,YACA,6BACA,gBACA,mBACA,CACA,kBACA,OACA,oCAEA,UACA,0BACA,gBACA,uBAEA,oBAEA,YAEA,SACA,YAEA,OADA,aAEA,sBACA,WACA,qBACA,gBACA,uBACA,CAAK,CACL,YACA,eACA,aACA,UACA,qBACA,GACA,sBACA,MACA,CACA,GAEA,IACA,CACA,sBAEA,eADA,gBACA,QAEA,OADA,WACA,QACA,qBACA,KACA,KACA,uBACA,IACA,CACA,iBACA,gBACA,cACA,QAAmB,WAAuB,KAC1C,KAAe,gBACf,cADmD,GACnD,sBAGA,SACA,EACA,EACA,EACA,EACA,EACA,mBARA,UAUA,UAEA,iBACA,eACA,cACA,qBACA,SACA,OACA,EACA,cACA,kBACA,GACA,YACA,WACA,eACA,OACA,UACA,CAAa,CACb,IAEA,CACA,CACA,gBACA,iBACA,CACA,gBACA,iBACA,CACA,gBACA,4BAAoC,UAAgB,CACpD,CACA,gBACA,eACA,YAAkB,WAAkB,IACpC,0BACA,QACA,CACA,gBACA,2BACA,CACA,gBACA,QACA,CAkGA,aACA,YACA,oHAEA,CACA,WACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEA,IA0aA,EA1aA,SACA,uBACA,8BACA,sBACA,gCACA,yBACA,cACA,eACA,oCACA,oBACA,0DACA,gBACA,gBACA,wBACA,iBACA,gBA2ZA,EA3ZA,KA4ZA,cACA,sBACA,OA5hBA,kBACA,eACA,WACA,OACA,UACA,SACA,IACA,SACA,WACA,WACA,OACA,UACA,EAAW,CACX,EAEA,aACA,QACA,iBACA,SACA,OACA,EACA,MADA,2BAIA,SACA,+CAAiE,EAEjE,WADA,0BAEA,SACA,6BACA,SACA,OACA,EAEA,EAFA,aAIA,EACA,EACA,EAGA,SAGA,GAFA,iBAEA,MADA,gBAEA,YACA,sKAEA,eACA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,OAEA,IADA,aACA,MAEA,SACA,OAEA,IADA,aACA,MAEA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,WACA,SACA,OACA,EACA,EADA,aACA,MAEA,SACA,UACA,SACA,uBACA,SACA,UACA,SACA,MACA,SACA,uCACA,SACA,yBACA,SACA,OACA,EACA,EADA,aACA,MAEA,CACA,CACA,QACA,EA4bA,YACA,iCACA,YACA,IACA,GACA,WACA,UACA,SACA,SACA,WACW,CACX,UAEA,GAEA,GADA,KACA,OACA,UAGA,IADA,yCAEA,aACA,YACA,UACA,KACA,KACA,EAEA,WACA,UACA,MACA,QACQ,IACR,QACA,CACA,QACA,EAhcA,CACA,kBACA,gBACA,UACA,yBACA,yBACA,oCACA,CA6BA,oBACA,gBACA,UACA,GACA,sBACA,WACA,qBACA,UACA,WACA,wBACA,MACA,EACA,yBAEA,CACA,kBACA,WACA,sBACA,OACA,kBACA,GACA,CACA,CAAG,EACH,WACA,SACA,yBACA,SACA,aACA,kBACA,YACA,CAAW,CACX,CAAK,CACL,yBACA,aACA,uCACA,KACA,uBACA,mBACA,QACA,YACA,mBACA,CAAe,CACf,YACA,iBACA,GAEA,IACA,EAAQ,IACR,IACA,WACA,OACA,YACA,mBACA,CAAW,CACX,YACA,iBACA,GAEA,IACA,kBACA,gBACA,MACA,CAAS,CACT,CACA,CAAK,CACL,iBACA,0BACA,CACA,QACA,OACA,kBACA,gBACA,CAAS,CACT,CACA,CAAK,CACL,kBACA,2BACA,CACA,QACA,OACA,kBACA,iBACA,CAAS,CACT,CACA,CACA,CAAG,CACH,CACA,aACA,YAOA,kBACA,SACA,KACA,IACA,IAEA,iBACA,IAZA,EAYA,IACA,MAXA,CADA,GAAW,KADX,EAaA,YACA,cACA,YACA,oFAEA,iBACA,KACA,aACA,YACA,CAAgB,qBAAyB,CACzC,KACA,EAEA,UACA,CACA,cA3BW,EACX,MACA,CA2BA,CAAK,CAEL,EACA,EACA,EACA,WACA,CACA,yBACA,gBACA,WACA,YACA,CAAc,gBAAwB,CACtC,KACA,OAEA,CACA,WACA,UACA,WACA,qBACA,SAA0B,iBAC1B,UACA,QACA,CACA,GACA,CAAO,CACP,yBACA,aACA,OACA,EACA,EACA,IAEA,aACA,GACA,CAAO,CACP,kBASA,IARA,KACA,aACA,OACA,EACA,EACA,IAEA,aACA,IAA+B,YAAgC,EAE/D,OACA,eACA,GAEA,CAAO,CACP,kBAEA,IADA,KAEA,cACA,YACA,YAGA,WACA,CACA,EAEA,CACA,cACA,YACA,wQAGA,OADA,4BACA,CACA,CACA,iBACA,kCAAoE,IAAO,IAC3E,mBACA,oBACA,cAA2B,IAAU,KACrC,WACA,WACA,eACA,CAEA,OADA,WACA,CACA,CACA,YACA,EACA,EACA,EACA,EACA,EACA,GAWA,MALA,QAJA,GACA,gCACA,EACA,SAEA,OACA,aACA,gBAGA,CAgMA,eACA,aACA,KACA,KACA,KACA,oCACA,OACA,OACA,yBACA,sBACA,OAEA,CACA,iBAqFA,cACA,MACA,CACA,oBACA,cAxFA,cACA,cACA,+CACA,CACA,QACA,cACA,WACA,IACA,gBACA,eACA,YACA,WACA,KAEA,CACA,SACA,UACA,OAEA,KADA,WAEA,IACA,EACA,sBACA,QACA,QAEA,KADA,UAEA,QACA,QACA,SACA,QACA,QACA,SACA,QACA,SACA,QACA,SACA,QACA,SACA,OACA,cACA,YACA,QACA,SACA,QACA,cACA,UACA,QACA,QAEA,KADA,WAEA,IACA,EACA,KACA,iBACA,QACA,QACA,kBACA,KACA,QACA,wBACA,CACA,qBACA,QACA,CA7QA,oBACA,UACA,QACA,sBACA,MACA,SACA,wBACA,MACA,UACA,EACA,EACA,EACA,wBAEA,MACA,SACA,gCACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,yBACA,MACA,UACA,0BACA,MACA,SACA,2BACA,MACA,UACA,2BACA,MACA,SACA,4BACA,MACA,UACA,6BACA,MACA,SACA,uBACA,MACA,CACA,IACA,gCACA,WACA,IAEA,oBAEA,OADA,iBACA,GACA,SAjTA,gBACA,gBACA,WACA,4BACA,eArhCA,KACA,MACA,cACA,gBACA,aACA,CAEA,IADA,cAEA,YACA,8BACA,KACA,2GAEA,OAEA,oBACA,oBACA,kBAEA,QACA,EAigCA,oBACA,WACA,MACA,OACA,mBACA,EAAM,IACN,+BACA,WACA,OACA,WACA,aACA,CAAO,CACP,YACA,aACA,EAEA,EAAI,IACJ,EACA,OACA,MACA,EACA,kCAEA,EAuRA,OACA,KACA,SAKA,OAJA,OAEA,aADA,aACA,aACA,MACA,GACA,QACA,OACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,OACA,OACA,aACA,cACA,SACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,eACA,KACA,SACA,mBACA,OACA,IACA,KACA,qBACA,0BAEA,KACA,SACA,mBACA,OACA,cACA,CACA,KACA,SACA,gBACA,SACA,gBAEA,IADA,aACA,QACA,OACA,oCACA,KACA,SAEA,GADA,cACA,8BACA,yBACA,qCACA,KACA,SACA,QACA,QACA,YACA,kMAEA,SACA,cACA,KACA,UACA,eACA,KACA,SACA,UACA,KACA,UACA,UACA,KACA,SACA,sBACA,wBACA,wCACA,KACA,SAEA,IADA,aACA,QACA,OACA,MACA,EACA,iCAEA,EACA,EAwHA,QADA,kCAEA,IACA,WACA,UACA,eACA,CACA,4CACA,UACA,gBACA,KACA,CACA,CAKA,OAJA,cACA,WACA,YACA,eACA,yBACA,CACA,GAKA,QACA,CACA,iBAAuB,eACvB,YASA,OARA,OACA,YACA,YACA,CAAK,CACL,YACA,MACA,GAEA,MACA,EACA,0BAAgC,eAGhC,OADA,GADA,QACA,GACA,MACA,EACA,uBAA6B,eAC7B,aACA,4CACA,aACA,CAEA,OADA,YACA,CACA,EACA,6BAAmC,YACnC,cACA,EACA,aAAmB,eACnB,iCACA,eA38CA,EACA,EACA,EACA,EACA,GAEA,gBACA,YACA,eACA,SACA,aACA,cAEA,EACA,UAGA,OAFA,2BACA,iBACA,oBACA,CAsFA,gBACA,wBACA,uBACA,mBACA,OACA,oCACA,IAtIA,EAgGA,IAyBA,EAEA,EAWA,cACA,cACA,OACA,iBACA,IAEA,CACA,YACA,qJAEA,QACA,aACA,qBACA,oBACA,IACA,IACA,WACA,MACA,SAEA,OADA,SA40CA,GA50CA,KACA,kBACA,CAAY,SACZ,GACA,oBACA,UACA,0BACA,CACA,IACA,UAaA,OAZA,aACA,IACA,aACA,IACA,gBACA,IACA,WACA,CAAkB,SAClB,IACA,CACA,EACA,YACA,kBACA,CAEA,OADA,KACA,IACA,EAAY,OACZ,GACA,CACA,CACA,8BACA,2BACA,IACA,UAYA,OAXA,mBACA,IACA,aACA,MACA,cACA,IACA,WACA,CAAY,SACZ,IACA,CACA,CAAS,IACT,mBACA,CAEA,YADA,cAEA,SACA,SADA,YAGA,qBAEA,SADA,iBAEA,WACA,WACA,YACA,YACA,iBACA,0BACA,2BACA,QAEA,IADA,QACA,IAIA,OAHA,wBACA,eACA,CAAS,EACT,mBACA,CACA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,oBACA,OACA,MACA,qBACA,2BACA,gBACA,oBAEA,4BACA,OACA,gBACA,MACA,2BACA,gBACA,oBAEA,0CACA,2CACA,kCACA,gBACA,2CACA,4CACA,2CACA,4CACA,6CACA,6CACA,8BACA,gBACA,+BACA,gBACA,yCACA,8CACA,OACA,2BACA,MACA,gBACA,oBAEA,KA5QA,QADA,EA6QA,IA5QA,wBAIA,kBAHA,GACA,SACA,iBACA,OAyQA,MACA,gBACA,EACA,OACA,IACA,cACA,GAEA,2BACA,gBACA,qBACA,cAEA,GACA,mCACA,4BAEA,gBAvMA,GACA,IACA,IAxBA,EAgBA,EAEA,EAzCA,EAgBA,EAEA,EACA,EA4BA,eAA4C,YAAc,CAC1D,CAAM,SACN,OA1BA,EA0BA,cAXA,2BACA,IACA,IACA,MACA,cAlBA,cACA,UACA,kBAEA,kBAEA,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAKA,GACA,mBAOA,CACA,OAnDA,EAmDA,EApCA,2BACA,IACA,IACA,MACA,KACA,kCAnBA,cACA,OACA,OACA,0BACA,SACA,IACA,0BAEA,kBAEA,cACA,iBACA,uCACA,EAMA,GACA,mBA+BA,EAgMA,GAEA,qBADA,SAEA,OAlMA,EAkMA,EAlMA,EAkMA,UA1KA,2BACA,IACA,IACA,MACA,QACA,cA5BA,cACA,WACA,oBACA,uBAEA,IACA,gCACA,mBACA,CAAY,SACZ,KACA,MACA,CAEA,YACA,EAAQ,IACR,IACA,gCACA,gBACA,kBACA,CAAU,SACV,IACA,CACA,EAMA,GACA,+BAsKA,GADA,WAEA,GACA,wBACA,CACA,cACA,YACA,6HAEA,UACA,CACA,QACA,CACA,4BACA,4CACA,OACA,qBAGA,gCACA,6BA1SA,gBA0SA,GAzSA,IAySA,GAzSA,QAySA,EAxSA,MAwSA,EAtSA,MAsSA,EArSA,YACA,OAoSA,EAnSA,aACA,OAmSA,iCACA,yBAEA,YADA,aAEA,OACA,sBACA,2BACA,MACA,aACA,oBAEA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,kIAEA,CACA,uBACA,GACA,YACA,qBACA,KACA,IADA,gBAGA,OACA,qBAEA,aACA,gIAEA,CACA,+CACA,aACA,QACA,SACA,yDAEA,CACA,gBAOA,MANA,oBACA,UACA,sBACA,WACA,wBACA,IACA,mBACA,CACA,QACA,IACA,OACA,cACA,IACA,SAKA,OAJA,SACA,KACA,gBACA,aACA,WACA,KACA,KACA,mBACA,CACA,EAumCA,EACA,GACA,yBACA,sBACA,OACA,EACA,GAEA,gBACA,eACA,6BACA,CACA,iBACA,YACA,gCACA,EACA,6BACA,CACA,CACA,CAAG,CACH,EACA,yBAA+B,eAE/B,OADA,YACA,CACA","sources":["webpack://_N_E/../client/normalize-trailing-slash.ts","webpack://_N_E/../../../../../src/client/components/react-dev-overlay/utils/dev-indicator/use-sync-dev-render-indicator.tsx","webpack://_N_E/../../../src/shared/lib/hooks-client-context.shared-runtime.ts","webpack://_N_E/../../../src/client/components/app-router-headers.ts","webpack://_N_E/../../../../src/client/components/router-reducer/handle-mutable.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/has-interception-route-in-current-tree.ts","webpack://_N_E/../../../../src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/html-bots.ts","webpack://_N_E/../../../src/shared/lib/is-plain-object.ts","webpack://_N_E/../client/app-webpack.ts","webpack://_N_E/../../../../src/client/components/globals/patch-console.ts","webpack://_N_E/../../../src/client/react-client-callbacks/on-recoverable-error.ts","webpack://_N_E/./node_modules/@swc/helpers/esm/_interop_require_wildcard.js?4256","webpack://_N_E/../../../../src/shared/lib/utils/reflect-utils.ts","webpack://_N_E/../../../src/shared/lib/segment.ts","webpack://_N_E/../../../../src/shared/lib/router/action-queue.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/is-bot.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-href-from-url.ts","webpack://_N_E/./node_modules/next/dist/compiled/react/index.js","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/client.js","webpack://_N_E/../../../src/shared/lib/server-reference-info.ts","webpack://_N_E/./node_modules/next/dist/build/deployment-id.js?3b2e","webpack://_N_E/../../../src/shared/lib/hash.ts","webpack://_N_E/../../../../src/client/components/errors/enqueue-client-error.ts","webpack://_N_E/./node_modules/next/dist/lib/is-error.js?aaeb","webpack://_N_E/./node_modules/@swc/helpers/esm/_class_private_field_loose_key.js","webpack://_N_E/../../../src/client/components/navigation.ts","webpack://_N_E/../../../../src/shared/lib/page-path/ensure-leading-slash.ts","webpack://_N_E/../../../../src/client/components/router-reducer/clear-cache-node-data-for-segment-path.ts","webpack://_N_E/../../../src/client/components/navigation-untracked.ts","webpack://_N_E/../../../src/shared/lib/encode-uri-path.ts","webpack://_N_E/../../../src/client/components/redirect-boundary.tsx","webpack://_N_E/../client/assign-location.ts","webpack://_N_E/../../../src/client/react-client-callbacks/report-global-error.ts","webpack://_N_E/../../../src/client/lib/is-error-thrown-while-rendering-rsc.ts","webpack://_N_E/../client/flight-data-helpers.ts","webpack://_N_E/../../../src/client/components/is-next-router-error.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/handle-smooth-scroll.ts","webpack://_N_E/../../../src/client/components/redirect-status-code.ts","webpack://_N_E/../../../src/client/components/links.ts","webpack://_N_E/../../../../src/client/components/errors/console-error.ts","webpack://_N_E/../../../src/client/components/is-hydration-error.ts","webpack://_N_E/../../../src/client/components/error-boundary.tsx","webpack://_N_E/../../../src/client/request/params.browser.prod.ts","webpack://_N_E/./node_modules/next/dist/lib/error-telemetry-utils.js?6987","webpack://_N_E/../../../../src/client/components/router-reducer/router-reducer.ts","webpack://_N_E/../../../src/client/components/match-segments.ts","webpack://_N_E/../../../src/client/components/render-from-template-context.tsx","webpack://_N_E/../../../../src/client/components/router-reducer/prefetch-cache-utils.ts","webpack://_N_E/../client/app-find-source-map-url.ts","webpack://_N_E/../../../src/client/request/params.browser.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/client.js","webpack://_N_E/../client/app-next.ts","webpack://_N_E/../../../../src/client/components/router-reducer/should-hard-navigate.ts","webpack://_N_E/./node_modules/@swc/helpers/esm/_class_private_field_loose_base.js","webpack://_N_E/../client/app-bootstrap.ts","webpack://_N_E/../../../../src/client/components/http-access-fallback/http-access-fallback.ts","webpack://_N_E/../../../src/client/components/redirect.ts","webpack://_N_E/./node_modules/next/dist/lib/metadata/metadata-constants.js","webpack://_N_E/../../../src/client/components/not-found.ts","webpack://_N_E/../../../src/client/components/nav-failure-handler.ts","webpack://_N_E/../../../../src/client/components/router-reducer/is-navigating-to-new-root-layout.ts","webpack://_N_E/../../../src/shared/lib/invariant-error.ts","webpack://_N_E/../../../../src/client/components/router-reducer/invalidate-cache-by-router-state.ts","webpack://_N_E/./node_modules/next/dist/compiled/scheduler/cjs/scheduler.production.js","webpack://_N_E/../../../../src/shared/lib/utils/warn-once.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/navigate-reducer.ts","webpack://_N_E/../../../../src/client/components/globals/handle-global-errors.ts","webpack://_N_E/../client/remove-base-path.ts","webpack://_N_E/../../../../src/client/components/router-reducer/refetch-inactive-parallel-segments.ts","webpack://_N_E/../../../../src/shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://_N_E/../../../../src/client/components/http-access-fallback/error-boundary.tsx","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/index.js","webpack://_N_E/../../../../../src/shared/lib/router/utils/interception-routes.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-action-reducer.ts","webpack://_N_E/../../../../src/client/components/errors/attach-hydration-error-state.ts","webpack://_N_E/../client/app-call-server.ts","webpack://_N_E/../../../../src/client/components/router-reducer/ppr-navigations.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/refresh-reducer.ts","webpack://_N_E/../../../src/client/components/app-router.tsx","webpack://_N_E/../../../../../src/shared/lib/router/utils/app-paths.ts","webpack://_N_E/../../../../src/client/components/router-reducer/apply-router-state-patch-to-tree.ts","webpack://_N_E/./node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.js","webpack://_N_E/../../../../src/client/components/router-reducer/set-cache-busting-search-param.ts","webpack://_N_E/../../../../src/client/components/metadata/metadata-boundary.tsx","webpack://_N_E/./node_modules/next/dist/compiled/react/cjs/react.production.js","webpack://_N_E/../../../src/client/components/redirect-error.ts","webpack://_N_E/../../../src/client/components/forbidden.ts","webpack://_N_E/../client/app-index.tsx","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/restore-reducer.ts","webpack://_N_E/../../../../src/client/components/errors/use-error-handler.ts","webpack://_N_E/./node_modules/next/dist/compiled/scheduler/index.js","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-trailing-slash.ts","webpack://_N_E/./node_modules/next/dist/build/polyfills/polyfill-module.js?a8b5","webpack://_N_E/../../../../src/client/components/globals/intercept-console-error.ts","webpack://_N_E/../../../src/client/request/search-params.browser.ts","webpack://_N_E/../../../src/client/components/unstable-rethrow.ts","webpack://_N_E/../../../src/client/components/app-router-announcer.tsx","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/server-patch-reducer.ts","webpack://_N_E/../../../../src/client/components/router-reducer/compute-changed-path.ts","webpack://_N_E/../../../src/client/react-client-callbacks/error-boundary-callbacks.ts","webpack://_N_E/../../../../src/client/components/router-reducer/router-reducer-types.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-path.ts","webpack://_N_E/../../../../src/client/components/router-reducer/apply-flight-data.ts","webpack://_N_E/../../../../src/client/components/metadata/browser-resolved-metadata.tsx","webpack://_N_E/../../../src/client/components/unresolved-thenable.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/find-head-in-cache.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/hmr-refresh-reducer.ts","webpack://_N_E/../../../../src/client/components/metadata/async-metadata.tsx","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/client.browser.js","webpack://_N_E/../../../src/client/components/unstable-rethrow.browser.ts","webpack://_N_E/../../../src/client/components/unauthorized.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/get-segment-value.ts","webpack://_N_E/../../../src/client/components/use-reducer.ts","webpack://_N_E/../../../src/client/components/promise-queue.ts","webpack://_N_E/../../../src/shared/lib/head-manager-context.shared-runtime.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-prefix.ts","webpack://_N_E/../../../src/client/lib/console.ts","webpack://_N_E/../client/app-build-id.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-router-cache-key.ts","webpack://_N_E/../client/add-base-path.ts","webpack://_N_E/../../../src/client/components/segment-cache.ts","webpack://_N_E/./node_modules/next/dist/compiled/react/cjs/react-jsx-runtime.production.js","webpack://_N_E/../client/has-base-path.ts","webpack://_N_E/./node_modules/process/browser.js?b580","webpack://_N_E/../../../src/client/components/layout-router.tsx","webpack://_N_E/../../../src/shared/lib/server-inserted-html.shared-runtime.tsx","webpack://_N_E/./node_modules/@swc/helpers/esm/_interop_require_default.js?5022","webpack://_N_E/../../../src/client/request/search-params.browser.prod.ts","webpack://_N_E/../../../../src/client/components/router-reducer/fetch-server-response.ts","webpack://_N_E/../../../../../src/client/components/router-reducer/reducers/prefetch-reducer.ts","webpack://_N_E/../../../../src/client/components/errors/hydration-error-info.ts","webpack://_N_E/../../../src/client/components/client-page.tsx","webpack://_N_E/../../../../../src/shared/lib/router/utils/path-has-prefix.ts","webpack://_N_E/../../../../src/client/components/router-reducer/create-initial-router-state.ts","webpack://_N_E/../../../src/client/components/client-segment.tsx","webpack://_N_E/../../../src/shared/lib/is-thenable.ts","webpack://_N_E/../../../../src/client/components/errors/stitched-error.ts","webpack://_N_E/./node_modules/next/dist/compiled/react/jsx-runtime.js","webpack://_N_E/../../../src/shared/lib/app-router-context.shared-runtime.ts","webpack://_N_E/../../../../src/client/components/router-reducer/aliased-prefetch-navigations.ts","webpack://_N_E/../../../src/client/components/navigation.react-server.ts","webpack://_N_E/../../../../src/client/components/router-reducer/handle-segment-mismatch.ts","webpack://_N_E/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js"],"sourcesContent":["import { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport { parsePath } from '../shared/lib/router/utils/parse-path'\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = (path: string) => {\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`\n } else {\n return `${pathname}/${query}${hash}`\n }\n }\n\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n}\n","const NOOP = (fn: () => void) => fn()\n\n/**\n * Returns a transition function that can be used to wrap router actions.\n * This allows us to tap into the transition state of the router as an\n * approximation of React render time.\n */\nexport const useSyncDevRenderIndicator = () => {\n let syncDevRenderIndicator = NOOP\n\n if (process.env.NODE_ENV === 'development') {\n const { useSyncDevRenderIndicatorInternal } =\n require('./use-sync-dev-render-indicator-internal') as typeof import('./use-sync-dev-render-indicator-internal')\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n syncDevRenderIndicator = useSyncDevRenderIndicatorInternal()\n }\n\n return syncDevRenderIndicator\n}\n","'use client'\n\nimport { createContext } from 'react'\nimport type { Params } from '../../server/request/params'\n\nexport const SearchParamsContext = createContext(null)\nexport const PathnameContext = createContext(null)\nexport const PathParamsContext = createContext(null)\n\nif (process.env.NODE_ENV !== 'production') {\n SearchParamsContext.displayName = 'SearchParamsContext'\n PathnameContext.displayName = 'PathnameContext'\n PathParamsContext.displayName = 'PathParamsContext'\n}\n","export const RSC_HEADER = 'RSC' as const\nexport const ACTION_HEADER = 'Next-Action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'Next-Router-State-Tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change Next-Router-State-Tree to be a segment path, we can use\n// that instead. Then Next-Router-Prefetch and Next-Router-Segment-Prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'Next-Router-Segment-Prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh' as const\nexport const NEXT_URL = 'Next-Url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\n","import { computeChangedPath } from './compute-changed-path'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n} from './router-reducer-types'\n\nfunction isNotUndefined(value: T): value is Exclude {\n return typeof value !== 'undefined'\n}\n\nexport function handleMutable(\n state: ReadonlyReducerState,\n mutable: Mutable\n): ReducerState {\n // shouldScroll is true by default, can override to false.\n const shouldScroll = mutable.shouldScroll ?? true\n\n let nextUrl = state.nextUrl\n\n if (isNotUndefined(mutable.patchedTree)) {\n // If we received a patched tree, we need to compute the changed path.\n const changedPath = computeChangedPath(state.tree, mutable.patchedTree)\n if (changedPath) {\n // If the tree changed, we need to update the nextUrl\n nextUrl = changedPath\n } else if (!nextUrl) {\n // if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl\n nextUrl = state.canonicalUrl\n }\n // otherwise this will be a no-op and continue to use the existing nextUrl\n }\n\n return {\n // Set href.\n canonicalUrl: isNotUndefined(mutable.canonicalUrl)\n ? mutable.canonicalUrl === state.canonicalUrl\n ? state.canonicalUrl\n : mutable.canonicalUrl\n : state.canonicalUrl,\n pushRef: {\n pendingPush: isNotUndefined(mutable.pendingPush)\n ? mutable.pendingPush\n : state.pushRef.pendingPush,\n mpaNavigation: isNotUndefined(mutable.mpaNavigation)\n ? mutable.mpaNavigation\n : state.pushRef.mpaNavigation,\n preserveCustomHistoryState: isNotUndefined(\n mutable.preserveCustomHistoryState\n )\n ? mutable.preserveCustomHistoryState\n : state.pushRef.preserveCustomHistoryState,\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: shouldScroll\n ? isNotUndefined(mutable?.scrollableSegments)\n ? true\n : state.focusAndScrollRef.apply\n : // If shouldScroll is false then we should not apply scroll and focus management.\n false,\n onlyHashChange: mutable.onlyHashChange || false,\n hashFragment: shouldScroll\n ? // Empty hash should trigger default behavior of scrolling layout into view.\n // #top is handled in layout-router.\n mutable.hashFragment && mutable.hashFragment !== ''\n ? // Remove leading # and decode hash to make non-latin hashes work.\n decodeURIComponent(mutable.hashFragment.slice(1))\n : state.focusAndScrollRef.hashFragment\n : // If shouldScroll is false then we should not apply scroll and focus management.\n null,\n segmentPaths: shouldScroll\n ? mutable?.scrollableSegments ?? state.focusAndScrollRef.segmentPaths\n : // If shouldScroll is false then we should not apply scroll and focus management.\n [],\n },\n // Apply cache.\n cache: mutable.cache ? mutable.cache : state.cache,\n prefetchCache: mutable.prefetchCache\n ? mutable.prefetchCache\n : state.prefetchCache,\n // Apply patched router state.\n tree: isNotUndefined(mutable.patchedTree)\n ? mutable.patchedTree\n : state.tree,\n nextUrl,\n }\n}\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport { isInterceptionRouteAppPath } from '../../../../shared/lib/router/utils/interception-routes'\n\nexport function hasInterceptionRouteInCurrentTree([\n segment,\n parallelRoutes,\n]: FlightRouterState): boolean {\n // If we have a dynamic segment, it's marked as an interception route by the presence of the `i` suffix.\n if (Array.isArray(segment) && (segment[2] === 'di' || segment[2] === 'ci')) {\n return true\n }\n\n // If segment is not an array, apply the existing string-based check\n if (typeof segment === 'string' && isInterceptionRouteAppPath(segment)) {\n return true\n }\n\n // Iterate through parallelRoutes if they exist\n if (parallelRoutes) {\n for (const key in parallelRoutes) {\n if (hasInterceptionRouteInCurrentTree(parallelRoutes[key])) {\n return true\n }\n }\n }\n\n return false\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightSegmentPath } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\n\n/**\n * Fill cache up to the end of the flightSegmentPath, invalidating anything below it.\n */\nexport function invalidateCacheBelowFlightSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n const [parallelRouteKey, segment] = flightSegmentPath\n\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n // In case of last entry don't copy further down.\n if (isLastEntry) {\n childSegmentMap.delete(cacheKey)\n return\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n invalidateCacheBelowFlightSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","// This regex contains the bots that we need to do a blocking render for and can't safely stream the response\n// due to how they parse the DOM. For example, they might explicitly check for metadata in the `head` tag, so we can't stream metadata tags after the `head` was sent.\nexport const HTML_LIMITED_BOT_UA_RE =\n /Mediapartners-Google|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview/i\n","export function getObjectClassLabel(value: any): string {\n return Object.prototype.toString.call(value)\n}\n\nexport function isPlainObject(value: any): boolean {\n if (getObjectClassLabel(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */\n return prototype === null || prototype.hasOwnProperty('isPrototypeOf')\n}\n","// Override chunk URL mapping in the webpack runtime\n// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204\n\nimport { getDeploymentIdQueryOrEmptyString } from '../build/deployment-id'\nimport { encodeURIPath } from '../shared/lib/encode-uri-path'\n\ndeclare const __webpack_require__: any\n\n// If we have a deployment ID, we need to append it to the webpack chunk names\n// I am keeping the process check explicit so this can be statically optimized\nif (process.env.NEXT_DEPLOYMENT_ID) {\n const suffix = getDeploymentIdQueryOrEmptyString()\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args)) + suffix\n\n // eslint-disable-next-line no-undef\n const getChunkCssFilename = __webpack_require__.k\n // eslint-disable-next-line no-undef\n __webpack_require__.k = (...args: any[]) =>\n getChunkCssFilename(...args) + suffix\n\n // eslint-disable-next-line no-undef\n const getMiniCssFilename = __webpack_require__.miniCssF\n // eslint-disable-next-line no-undef\n __webpack_require__.miniCssF = (...args: any[]) =>\n getMiniCssFilename(...args) + suffix\n} else {\n // eslint-disable-next-line no-undef\n const getChunkScriptFilename = __webpack_require__.u\n // eslint-disable-next-line no-undef\n __webpack_require__.u = (...args: any[]) =>\n // We encode the chunk filename because our static server matches against and encoded\n // filename path.\n encodeURIPath(getChunkScriptFilename(...args))\n\n // We don't need to override __webpack_require__.k because we don't modify\n // the css chunk name when not using deployment id suffixes\n\n // WE don't need to override __webpack_require__.miniCssF because we don't modify\n // the mini css chunk name when not using deployment id suffixes\n}\n\nexport {}\n","import { patchConsoleError } from './intercept-console-error'\n\npatchConsoleError()\n","// This module can be shared between both pages router and app router\n\nimport type { HydrationOptions } from 'react-dom/client'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { getReactStitchedError } from '../components/errors/stitched-error'\nimport isError from '../../lib/is-error'\n\nexport const onRecoverableError: HydrationOptions['onRecoverableError'] = (\n error,\n errorInfo\n) => {\n // x-ref: https://github.com/facebook/react/pull/28736\n const cause = isError(error) && 'cause' in error ? error.cause : error\n const stitchedError = getReactStitchedError(cause)\n // In development mode, pass along the component stack to the error\n if (process.env.NODE_ENV === 'development' && errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(cause)) return\n\n reportGlobalError(stitchedError)\n}\n","function _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexport { _interop_require_wildcard as _ };\n","// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\nexport function describeStringPropertyAccess(target: string, prop: string) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``\n}\n\nexport function describeHasCheckingStringProperty(\n target: string,\n prop: string\n) {\n const stringifiedProp = JSON.stringify(prop)\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`\n}\n\nexport const wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n\n // Promise prototype\n // fallthrough\n 'then',\n 'catch',\n 'finally',\n\n // React Promise extension\n // fallthrough\n 'status',\n\n // React introspection\n 'displayName',\n\n // Common tested properties\n // fallthrough\n 'toJSON',\n '$$typeof',\n '__esModule',\n])\n","import type { Segment } from '../../server/app-render/types'\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n} from '../../../client/components/router-reducer/router-reducer-types'\nimport { reducer } from '../../../client/components/router-reducer/router-reducer'\nimport { startTransition } from 'react'\nimport { isThenable } from '../is-thenable'\n\nexport type DispatchStatePromise = React.Dispatch\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n } else {\n // No more actions are pending, check if a refresh is needed\n if (actionQueue.needsRefresh) {\n actionQueue.needsRefresh = false\n actionQueue.dispatch(\n {\n type: ACTION_REFRESH,\n origin: window.location.origin,\n },\n setState\n )\n }\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n // if the pending action was a server action, mark the queue as needing a refresh once events are processed\n if (actionQueue.pending.payload.type === ACTION_SERVER_ACTION) {\n actionQueue.needsRefresh = true\n }\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n","import { HTML_LIMITED_BOT_UA_RE } from './html-bots'\n\n// Bot crawler that will spin up a headless browser and execute JS\nconst HEADLESS_BROWSER_BOT_UA_RE =\n /Googlebot|Google-PageRenderer|AdsBot-Google|googleweblight|Storebot-Google/i\n\nexport const HTML_LIMITED_BOT_UA_RE_STRING = HTML_LIMITED_BOT_UA_RE.source\n\nexport { HTML_LIMITED_BOT_UA_RE }\n\nfunction isDomBotUA(userAgent: string) {\n return HEADLESS_BROWSER_BOT_UA_RE.test(userAgent)\n}\n\nfunction isHtmlLimitedBotUA(userAgent: string) {\n return HTML_LIMITED_BOT_UA_RE.test(userAgent)\n}\n\nexport function isBot(userAgent: string): boolean {\n return isDomBotUA(userAgent) || isHtmlLimitedBotUA(userAgent)\n}\n\nexport function getBotType(userAgent: string): 'dom' | 'html' | undefined {\n if (isDomBotUA(userAgent)) {\n return 'dom'\n }\n if (isHtmlLimitedBotUA(userAgent)) {\n return 'html'\n }\n return undefined\n}\n","export function createHrefFromUrl(\n url: Pick,\n includeHash: boolean = true\n): string {\n return url.pathname + url.search + (includeHash ? url.hash : '')\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom-client.production.js');\n} else {\n module.exports = require('./cjs/react-dom-client.development.js');\n}\n","export interface ServerReferenceInfo {\n type: 'server-action' | 'use-cache'\n usedArgs: [boolean, boolean, boolean, boolean, boolean, boolean]\n hasRestArgs: boolean\n}\n\n/**\n * Extracts info about the server reference for the given server reference ID by\n * parsing the first byte of the hex-encoded ID.\n *\n * ```\n * Bit positions: [7] [6] [5] [4] [3] [2] [1] [0]\n * Bits: typeBit argMask restArgs\n * ```\n *\n * If the `typeBit` is `1` the server reference represents a `\"use cache\"`\n * function, otherwise a server action.\n *\n * The `argMask` encodes whether the function uses the argument at the\n * respective position.\n *\n * The `restArgs` bit indicates whether the function uses a rest parameter. It's\n * also set to 1 if the function has more than 6 args.\n *\n * @param id hex-encoded server reference ID\n */\nexport function extractInfoFromServerReferenceId(\n id: string\n): ServerReferenceInfo {\n const infoByte = parseInt(id.slice(0, 2), 16)\n const typeBit = (infoByte >> 7) & 0x1\n const argMask = (infoByte >> 1) & 0x3f\n const restArgs = infoByte & 0x1\n const usedArgs = Array(6)\n\n for (let index = 0; index < 6; index++) {\n const bitPosition = 5 - index\n const bit = (argMask >> bitPosition) & 0x1\n usedArgs[index] = bit === 1\n }\n\n return {\n type: typeBit === 1 ? 'use-cache' : 'server-action',\n usedArgs: usedArgs as [\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n ],\n hasRestArgs: restArgs === 1,\n }\n}\n\n/**\n * Creates a sparse array containing only the used arguments based on the\n * provided action info.\n */\nexport function omitUnusedArgs(\n args: unknown[],\n info: ServerReferenceInfo\n): unknown[] {\n const filteredArgs = new Array(args.length)\n\n for (let index = 0; index < args.length; index++) {\n if (\n (index < 6 && info.usedArgs[index]) ||\n // This assumes that the server reference info byte has the restArgs bit\n // set to 1 if there are more than 6 args.\n (index >= 6 && info.hasRestArgs)\n ) {\n filteredArgs[index] = args[index]\n }\n }\n\n return filteredArgs\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"getDeploymentIdQueryOrEmptyString\", {\n enumerable: true,\n get: function() {\n return getDeploymentIdQueryOrEmptyString;\n }\n});\nfunction getDeploymentIdQueryOrEmptyString() {\n if (process.env.NEXT_DEPLOYMENT_ID) {\n return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`;\n }\n return '';\n}\n\n//# sourceMappingURL=deployment-id.js.map","// http://www.cse.yorku.ca/~oz/hash.html\n// More specifically, 32-bit hash via djbxor\n// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)\n// This is due to number type differences between rust for turbopack to js number types,\n// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching\n// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation\n// as can gaurantee determinstic output from 32bit hash.\nexport function djb2Hash(str: string) {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = ((hash << 5) + hash + char) & 0xffffffff\n }\n return hash >>> 0\n}\n\nexport function hexHash(str: string) {\n return djb2Hash(str).toString(36).slice(0, 5)\n}\n","// Dedupe the two consecutive errors: If the previous one is same as current one, ignore the current one.\nexport function enqueueConsecutiveDedupedError(\n queue: Array,\n error: Error\n) {\n const previousError = queue[queue.length - 1]\n // Compare the error stack to dedupe the consecutive errors\n if (previousError && previousError.stack === error.stack) {\n return\n }\n queue.push(error)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n default: null,\n getProperError: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n /**\n * Checks whether the given value is a NextError.\n * This can be used to print a more detailed error message with properties like `code` & `digest`.\n */ default: function() {\n return isError;\n },\n getProperError: function() {\n return getProperError;\n }\n});\nconst _isplainobject = require(\"../shared/lib/is-plain-object\");\nfunction isError(err) {\n return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;\n}\nfunction safeStringify(obj) {\n const seen = new WeakSet();\n return JSON.stringify(obj, (_key, value)=>{\n // If value is an object and already seen, replace with \"[Circular]\"\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n return value;\n });\n}\nfunction getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (process.env.NODE_ENV === 'development') {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === 'undefined') {\n return Object.defineProperty(new Error('An undefined error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'), \"__NEXT_ERROR_CODE\", {\n value: \"E98\",\n enumerable: false,\n configurable: true\n });\n }\n if (err === null) {\n return Object.defineProperty(new Error('A null error was thrown, ' + 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'), \"__NEXT_ERROR_CODE\", {\n value: \"E336\",\n enumerable: false,\n configurable: true\n });\n }\n }\n return Object.defineProperty(new Error((0, _isplainobject.isPlainObject)(err) ? safeStringify(err) : err + ''), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n}\n\n//# sourceMappingURL=is-error.js.map","var id = 0;\n\nfunction _class_private_field_loose_key(name) {\n return \"__private_\" + id++ + \"_\" + name;\n}\nexport { _class_private_field_loose_key as _ };\n","import type { FlightRouterState } from '../../server/app-render/types'\nimport type { Params } from '../../server/request/params'\n\nimport { useContext, useMemo } from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n type AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { getSegmentValue } from './router-reducer/reducers/get-segment-value'\nimport { PAGE_SEGMENT_KEY, DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\nimport { ReadonlyURLSearchParams } from './navigation.react-server'\n\nconst useDynamicRouteParams =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/dynamic-rendering') as typeof import('../../server/app-render/dynamic-rendering')\n ).useDynamicRouteParams\n : undefined\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you *read* the current URL's search parameters.\n *\n * Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useSearchParams } from 'next/navigation'\n *\n * export default function Page() {\n * const searchParams = useSearchParams()\n * searchParams.get('foo') // returns 'bar' when ?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)\n */\n// Client components API\nexport function useSearchParams(): ReadonlyURLSearchParams {\n const searchParams = useContext(SearchParamsContext)\n\n // In the case where this is `null`, the compat types added in\n // `next-env.d.ts` will add a new overload that changes the return type to\n // include `null`.\n const readonlySearchParams = useMemo(() => {\n if (!searchParams) {\n // When the router is not ready in pages, we won't have the search params\n // available.\n return null\n }\n\n return new ReadonlyURLSearchParams(searchParams)\n }, [searchParams]) as ReadonlyURLSearchParams\n\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { bailoutToClientRendering } =\n require('./bailout-to-client-rendering') as typeof import('./bailout-to-client-rendering')\n // TODO-APP: handle dynamic = 'force-static' here and on the client\n bailoutToClientRendering('useSearchParams()')\n }\n\n return readonlySearchParams\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the current URL's pathname.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { usePathname } from 'next/navigation'\n *\n * export default function Page() {\n * const pathname = usePathname() // returns \"/dashboard\" on /dashboard?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)\n */\n// Client components API\nexport function usePathname(): string {\n useDynamicRouteParams?.('usePathname()')\n\n // In the case where this is `null`, the compat types added in `next-env.d.ts`\n // will add a new overload that changes the return type to include `null`.\n return useContext(PathnameContext) as string\n}\n\n// Client components API\nexport {\n ServerInsertedHTMLContext,\n useServerInsertedHTML,\n} from '../../shared/lib/server-inserted-html.shared-runtime'\n\n/**\n *\n * This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useRouter } from 'next/navigation'\n *\n * export default function Page() {\n * const router = useRouter()\n * // ...\n * router.push('/dashboard') // Navigate to /dashboard\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)\n */\n// Client components API\nexport function useRouter(): AppRouterInstance {\n const router = useContext(AppRouterContext)\n if (router === null) {\n throw new Error('invariant expected app router to be mounted')\n }\n\n return router\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read a route's dynamic params filled in by the current URL.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useParams } from 'next/navigation'\n *\n * export default function Page() {\n * // on /dashboard/[team] where pathname is /dashboard/nextjs\n * const { team } = useParams() // team === \"nextjs\"\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)\n */\n// Client components API\nexport function useParams(): T {\n useDynamicRouteParams?.('useParams()')\n\n return useContext(PathParamsContext) as T\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\n// Client components API\nfunction getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segments **below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n *\n * import { useSelectedLayoutSegments } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segments = useSelectedLayoutSegments()\n *\n * return (\n *
    \n * {segments.map((segment, index) => (\n *
  • {segment}
  • \n * ))}\n *
\n * )\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)\n */\n// Client components API\nexport function useSelectedLayoutSegments(\n parallelRouteKey: string = 'children'\n): string[] {\n useDynamicRouteParams?.('useSelectedLayoutSegments()')\n\n const context = useContext(LayoutRouterContext)\n // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts\n if (!context) return null\n\n return getSelectedLayoutSegmentPath(context.parentTree, parallelRouteKey)\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segment **one level below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n * import { useSelectedLayoutSegment } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segment = useSelectedLayoutSegment()\n *\n * return

Active segment: {segment}

\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)\n */\n// Client components API\nexport function useSelectedLayoutSegment(\n parallelRouteKey: string = 'children'\n): string | null {\n useDynamicRouteParams?.('useSelectedLayoutSegment()')\n\n const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey)\n\n if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {\n return null\n }\n\n const selectedLayoutSegment =\n parallelRouteKey === 'children'\n ? selectedLayoutSegments[0]\n : selectedLayoutSegments[selectedLayoutSegments.length - 1]\n\n // if the default slot is showing, we return null since it's not technically \"selected\" (it's a fallback)\n // and returning an internal value like `__DEFAULT__` would be confusing.\n return selectedLayoutSegment === DEFAULT_SEGMENT_KEY\n ? null\n : selectedLayoutSegment\n}\n\n// Shared components APIs\nexport {\n notFound,\n forbidden,\n unauthorized,\n redirect,\n permanentRedirect,\n RedirectType,\n ReadonlyURLSearchParams,\n unstable_rethrow,\n} from './navigation.react-server'\n","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */\nexport function ensureLeadingSlash(path: string) {\n return path.startsWith('/') ? path : `/${path}`\n}\n","import type { FlightSegmentPath } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * This will clear the CacheNode data for a particular segment path. This will cause a lazy-fetch in layout router to fill in new data.\n */\nexport function clearCacheNodeDataForSegmentPath(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightSegmentPath: FlightSegmentPath\n): void {\n const isLastEntry = flightSegmentPath.length <= 2\n\n const [parallelRouteKey, segment] = flightSegmentPath\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCache.parallelRoutes.get(parallelRouteKey)\n\n let childSegmentMap = newCache.parallelRoutes.get(parallelRouteKey)\n\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCache.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap?.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n // In case of last segment start off the fetch at this level and don't copy further down.\n if (isLastEntry) {\n if (\n !childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode\n ) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Start fetch in the place where the existing cache doesn't have the data yet.\n if (!childCacheNode) {\n childSegmentMap.set(cacheKey, {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n })\n }\n return\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n return clearCacheNodeDataForSegmentPath(\n childCacheNode,\n existingChildCacheNode,\n getNextFlightSegmentPath(flightSegmentPath)\n )\n}\n","import { useContext } from 'react'\nimport { PathnameContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * This checks to see if the current render has any unknown route parameters.\n * It's used to trigger a different render path in the error boundary.\n *\n * @returns true if there are any unknown route parameters, false otherwise\n */\nfunction hasFallbackRouteParams() {\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) return false\n\n const { fallbackRouteParams } = workStore\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) return false\n\n return true\n }\n\n return false\n}\n\n/**\n * This returns a `null` value if there are any unknown route parameters, and\n * otherwise returns the pathname from the context. This is an alternative to\n * `usePathname` that is used in the error boundary to avoid rendering the\n * error boundary when there are unknown route parameters. This doesn't throw\n * when accessed with unknown route parameters.\n *\n * @returns\n *\n * @internal\n */\nexport function useUntrackedPathname(): string | null {\n // If there are any unknown route parameters we would typically throw\n // an error, but this internal method allows us to return a null value instead\n // for components that do not propagate the pathname to the static shell (like\n // the error boundary).\n if (hasFallbackRouteParams()) {\n return null\n }\n\n // This shouldn't cause any issues related to conditional rendering because\n // the environment will be consistent for the render.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(PathnameContext)\n}\n","export function encodeURIPath(file: string) {\n return file\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')\n}\n","'use client'\nimport React, { useEffect } from 'react'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useRouter } from './navigation'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { RedirectType, isRedirectError } from './redirect-error'\n\ninterface RedirectBoundaryProps {\n router: AppRouterInstance\n children: React.ReactNode\n}\n\nfunction HandleRedirect({\n redirect,\n reset,\n redirectType,\n}: {\n redirect: string\n redirectType: RedirectType\n reset: () => void\n}) {\n const router = useRouter()\n\n useEffect(() => {\n React.startTransition(() => {\n if (redirectType === RedirectType.push) {\n router.push(redirect, {})\n } else {\n router.replace(redirect, {})\n }\n reset()\n })\n }, [redirect, redirectType, reset, router])\n\n return null\n}\n\nexport class RedirectErrorBoundary extends React.Component<\n RedirectBoundaryProps,\n { redirect: string | null; redirectType: RedirectType | null }\n> {\n constructor(props: RedirectBoundaryProps) {\n super(props)\n this.state = { redirect: null, redirectType: null }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isRedirectError(error)) {\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n return { redirect: url, redirectType }\n }\n // Re-throw if error is not for redirect\n throw error\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n const { redirect, redirectType } = this.state\n if (redirect !== null && redirectType !== null) {\n return (\n this.setState({ redirect: null })}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport function RedirectBoundary({ children }: { children: React.ReactNode }) {\n const router = useRouter()\n return (\n {children}\n )\n}\n","import { addBasePath } from './add-base-path'\n\n/**\n * Function to correctly assign location to URL\n *\n * The method will add basePath, and will also correctly add location (including if it is a relative path)\n * @param location Location that should be added to the url\n * @param url Base URL to which the location should be assigned\n */\nexport function assignLocation(location: string, url: URL): URL {\n if (location.startsWith('.')) {\n const urlBase = url.origin + url.pathname\n return new URL(\n // In order for a relative path to be added to the current url correctly, the current url must end with a slash\n // new URL('./relative', 'https://example.com/subdir').href -> 'https://example.com/relative'\n // new URL('./relative', 'https://example.com/subdir/').href -> 'https://example.com/subdir/relative'\n (urlBase.endsWith('/') ? urlBase : urlBase + '/') + location\n )\n }\n\n return new URL(addBasePath(location), url.href)\n}\n","export const reportGlobalError =\n typeof reportError === 'function'\n ? // In modern browsers, reportError will dispatch an error event,\n // emulating an uncaught JavaScript error.\n reportError\n : (error: unknown) => {\n // TODO: Dispatch error event\n globalThis.console.error(error)\n }\n","export const shouldRenderRootLevelErrorOverlay = () => {\n return !!window.__next_root_layout_missing_tags?.length\n}\n","import type {\n CacheNodeSeedData,\n FlightData,\n FlightDataPath,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../server/app-render/types'\nimport type { HeadData } from '../shared/lib/app-router-context.shared-runtime'\n\nexport type NormalizedFlightData = {\n /**\n * The full `FlightSegmentPath` inclusive of the final `Segment`\n */\n segmentPath: FlightSegmentPath\n /**\n * The `FlightSegmentPath` exclusive of the final `Segment`\n */\n pathToSegment: FlightSegmentPath\n segment: Segment\n tree: FlightRouterState\n seedData: CacheNodeSeedData | null\n head: HeadData\n isHeadPartial: boolean\n isRootRender: boolean\n}\n\n// TODO: We should only have to export `normalizeFlightData`, however because the initial flight data\n// that gets passed to `createInitialRouterState` doesn't conform to the `FlightDataPath` type (it's missing the root segment)\n// we're currently exporting it so we can use it directly. This should be fixed as part of the unification of\n// the different ways we express `FlightSegmentPath`.\nexport function getFlightDataPartsFromPath(\n flightDataPath: FlightDataPath\n): NormalizedFlightData {\n // Pick the last 4 items from the `FlightDataPath` to get the [tree, seedData, viewport, isHeadPartial].\n const flightDataPathLength = 4\n // tree, seedData, and head are *always* the last three items in the `FlightDataPath`.\n const [tree, seedData, head, isHeadPartial] =\n flightDataPath.slice(-flightDataPathLength)\n // The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.\n const segmentPath = flightDataPath.slice(0, -flightDataPathLength)\n\n return {\n // TODO: Unify these two segment path helpers. We are inconsistently pushing an empty segment (\"\")\n // to the start of the segment path in some places which makes it hard to use solely the segment path.\n // Look for \"// TODO-APP: remove ''\" in the codebase.\n pathToSegment: segmentPath.slice(0, -1),\n segmentPath,\n // if the `FlightDataPath` corresponds with the root, there'll be no segment path,\n // in which case we default to ''.\n segment: segmentPath[segmentPath.length - 1] ?? '',\n tree,\n seedData,\n head,\n isHeadPartial,\n isRootRender: flightDataPath.length === flightDataPathLength,\n }\n}\n\nexport function getNextFlightSegmentPath(\n flightSegmentPath: FlightSegmentPath\n): FlightSegmentPath {\n // Since `FlightSegmentPath` is a repeated tuple of `Segment` and `ParallelRouteKey`, we slice off two items\n // to get the next segment path.\n return flightSegmentPath.slice(2)\n}\n\nexport function normalizeFlightData(\n flightData: FlightData\n): NormalizedFlightData[] | string {\n // FlightData can be a string when the server didn't respond with a proper flight response,\n // or when a redirect happens, to signal to the client that it needs to perform an MPA navigation.\n if (typeof flightData === 'string') {\n return flightData\n }\n\n return flightData.map(getFlightDataPartsFromPath)\n}\n","import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n","/**\n * Run function with `scroll-behavior: auto` applied to ``.\n * This css change will be reverted after the function finishes.\n */\nexport function handleSmoothScroll(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n const htmlElement = document.documentElement\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","import type { FlightRouterState } from '../../server/app-render/types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { getCurrentAppRouterState } from '../../shared/lib/router/action-queue'\nimport { createPrefetchURL } from './app-router'\nimport { PrefetchKind } from './router-reducer/router-reducer-types'\nimport { getCurrentCacheVersion } from './segment-cache'\nimport { createCacheKey } from './segment-cache'\nimport {\n type PrefetchTask,\n PrefetchPriority,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n bumpPrefetchTask,\n} from './segment-cache'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement | HTMLFormElement\n\ntype LinkInstance = {\n router: AppRouterInstance\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n prefetchHref: string\n\n isVisible: boolean\n wasHoveredOrTouched: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n\n // The cache version at the time the task was initiated. This is used to\n // determine if the cache was invalidated since the task was initiated.\n cacheVersion: number\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst links: WeakMap | Map =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst visibleLinks: Set = new Set()\n\n// A single IntersectionObserver instance shared by all components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n) {\n let prefetchUrl: URL | null = null\n try {\n prefetchUrl = createPrefetchURL(href)\n if (prefetchUrl === null) {\n // We only track the link if it's prefetchable. For example, this excludes\n // links to external URLs.\n return\n }\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return\n }\n\n const instance: LinkInstance = {\n prefetchHref: prefetchUrl.href,\n router,\n kind,\n isVisible: false,\n wasHoveredOrTouched: false,\n prefetchTask: null,\n cacheVersion: -1,\n }\n const existingInstance = links.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountLinkInstance(element)\n }\n links.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nexport function unmountLinkInstance(element: LinkElement) {\n const instance = links.get(element)\n if (instance !== undefined) {\n links.delete(element)\n visibleLinks.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(\n element: LinkElement,\n isVisible: boolean\n) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n visibleLinks.add(instance)\n } else {\n visibleLinks.delete(instance)\n }\n rescheduleLinkPrefetch(instance)\n}\n\nexport function onNavigationIntent(element: HTMLAnchorElement | SVGAElement) {\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n instance.wasHoveredOrTouched = true\n rescheduleLinkPrefetch(instance)\n }\n}\n\nfunction rescheduleLinkPrefetch(instance: LinkInstance) {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with bumpPrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n if (!process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // The old prefetch implementation does not have different priority levels.\n // Just schedule a new prefetch task.\n prefetchWithOldCacheImplementation(instance)\n return\n }\n\n // In the Segment Cache implementation, we assign a higher priority level to\n // links that were at one point hovered or touched. Since the queue is last-\n // in-first-out, the highest priority Link is whichever one was hovered last.\n //\n // We also increase the relative priority of links whenever they re-enter the\n // viewport, as if they were being scheduled for the first time.\n const priority = instance.wasHoveredOrTouched\n ? PrefetchPriority.Intent\n : PrefetchPriority.Default\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const nextUrl = appRouterState.nextUrl\n const treeAtTimeOfPrefetch = appRouterState.tree\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.kind === PrefetchKind.FULL,\n priority\n )\n instance.cacheVersion = getCurrentCacheVersion()\n }\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n bumpPrefetchTask(existingPrefetchTask, priority)\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n const currentCacheVersion = getCurrentCacheVersion()\n for (const instance of visibleLinks) {\n const task = instance.prefetchTask\n if (\n task !== null &&\n instance.cacheVersion === currentCacheVersion &&\n task.key.nextUrl === nextUrl &&\n task.treeAtTimeOfPrefetch === tree\n ) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n const priority = instance.wasHoveredOrTouched\n ? PrefetchPriority.Intent\n : PrefetchPriority.Default\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.kind === PrefetchKind.FULL,\n priority\n )\n instance.cacheVersion = getCurrentCacheVersion()\n }\n}\n\nfunction prefetchWithOldCacheImplementation(instance: LinkInstance) {\n // This is the path used when the Segment Cache is not enabled.\n if (typeof window === 'undefined') {\n return\n }\n\n const doPrefetch = async () => {\n // note that `appRouter.prefetch()` is currently sync,\n // so we have to wrap this call in an async function to be able to catch() errors below.\n return instance.router.prefetch(instance.prefetchHref, {\n kind: instance.kind,\n })\n }\n\n // Prefetch the page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n doPrefetch().catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err\n }\n })\n}\n","// To distinguish from React error.digest, we use a different symbol here to determine if the error is from console.error or unhandled promise rejection.\nconst digestSym = Symbol.for('next.console.error.digest')\nconst consoleTypeSym = Symbol.for('next.console.error.type')\n\n// Represent non Error shape unhandled promise rejections or console.error errors.\n// Those errors will be captured and displayed in Error Overlay.\ntype UnhandledError = Error & {\n [digestSym]: 'NEXT_UNHANDLED_ERROR'\n [consoleTypeSym]: 'string' | 'error'\n environmentName: string\n}\n\nexport function createUnhandledError(\n message: string | Error,\n environmentName?: string | null\n): UnhandledError {\n const error = (\n typeof message === 'string' ? new Error(message) : message\n ) as UnhandledError\n error[digestSym] = 'NEXT_UNHANDLED_ERROR'\n error[consoleTypeSym] = typeof message === 'string' ? 'string' : 'error'\n\n if (environmentName && !error.environmentName) {\n error.environmentName = environmentName\n }\n\n return error\n}\n\nexport const isUnhandledConsoleOrRejection = (\n error: any\n): error is UnhandledError => {\n return error && error[digestSym] === 'NEXT_UNHANDLED_ERROR'\n}\n\nexport const getUnhandledErrorType = (error: UnhandledError) => {\n return error[consoleTypeSym]\n}\n","import isError from '../../lib/is-error'\n\nconst hydrationErrorRegex =\n /hydration failed|while hydrating|content does not match|did not match|HTML didn't match/i\n\nconst reactUnifiedMismatchWarning = `Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:`\n\nconst reactHydrationStartMessages = [\n reactUnifiedMismatchWarning,\n `A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:`,\n]\n\nexport const REACT_HYDRATION_ERROR_LINK =\n 'https://react.dev/link/hydration-mismatch'\nexport const NEXTJS_HYDRATION_ERROR_LINK =\n 'https://nextjs.org/docs/messages/react-hydration-error'\n\nexport const getDefaultHydrationErrorMessage = () => {\n return reactUnifiedMismatchWarning\n}\n\nexport function isHydrationError(error: unknown): boolean {\n return isError(error) && hydrationErrorRegex.test(error.message)\n}\n\nexport function isReactHydrationErrorMessage(msg: string): boolean {\n return reactHydrationStartMessages.some((prefix) => msg.startsWith(prefix))\n}\n\nconst hydrationWarningRegexes = [\n /^In HTML, (.+?) cannot be a child of <(.+?)>\\.(.*)\\nThis will cause a hydration error\\.(.*)/,\n /^In HTML, (.+?) cannot be a descendant of <(.+?)>\\.\\nThis will cause a hydration error\\.(.*)/,\n /^In HTML, text nodes cannot be a child of <(.+?)>\\.\\nThis will cause a hydration error\\./,\n /^In HTML, whitespace text nodes cannot be a child of <(.+?)>\\. Make sure you don't have any extra whitespace between tags on each line of your source code\\.\\nThis will cause a hydration error\\./,\n /^Expected server HTML to contain a matching <(.+?)> in <(.+?)>\\.(.*)/,\n /^Did not expect server HTML to contain a <(.+?)> in <(.+?)>\\.(.*)/,\n /^Expected server HTML to contain a matching text node for \"(.+?)\" in <(.+?)>\\.(.*)/,\n /^Did not expect server HTML to contain the text node \"(.+?)\" in <(.+?)>\\.(.*)/,\n /^Text content did not match\\. Server: \"(.+?)\" Client: \"(.+?)\"(.*)/,\n]\n\nexport function testReactHydrationWarning(msg: string): boolean {\n if (typeof msg !== 'string' || !msg) return false\n // React 18 has the `Warning: ` prefix.\n // React 19 does not.\n if (msg.startsWith('Warning: ')) {\n msg = msg.slice('Warning: '.length)\n }\n return hydrationWarningRegexes.some((regex) => regex.test(msg))\n}\n\nexport function getHydrationErrorStackInfo(rawMessage: string): {\n message: string | null\n stack?: string\n diff?: string\n} {\n rawMessage = rawMessage.replace(/^Error: /, '')\n rawMessage = rawMessage.replace('Warning: ', '')\n const isReactHydrationWarning = testReactHydrationWarning(rawMessage)\n\n if (!isReactHydrationErrorMessage(rawMessage) && !isReactHydrationWarning) {\n return {\n message: null,\n stack: rawMessage,\n diff: '',\n }\n }\n\n if (isReactHydrationWarning) {\n const [message, diffLog] = rawMessage.split('\\n\\n')\n return {\n message: message.trim(),\n stack: '',\n diff: (diffLog || '').trim(),\n }\n }\n\n const firstLineBreak = rawMessage.indexOf('\\n')\n rawMessage = rawMessage.slice(firstLineBreak + 1).trim()\n\n const [message, trailing] = rawMessage.split(`${REACT_HYDRATION_ERROR_LINK}`)\n const trimmedMessage = message.trim()\n // React built-in hydration diff starts with a newline, checking if length is > 1\n if (trailing && trailing.length > 1) {\n const stacks: string[] = []\n const diffs: string[] = []\n trailing.split('\\n').forEach((line) => {\n if (line.trim() === '') return\n if (line.trim().startsWith('at ')) {\n stacks.push(line)\n } else {\n diffs.push(line)\n }\n })\n\n return {\n message: trimmedMessage,\n diff: diffs.join('\\n'),\n stack: stacks.join('\\n'),\n }\n } else {\n return {\n message: trimmedMessage,\n stack: trailing, // without hydration diff\n }\n }\n}\n","'use client'\n\nimport React, { type JSX } from 'react'\nimport { useUntrackedPathname } from './navigation-untracked'\nimport { isNextRouterError } from './is-next-router-error'\nimport { handleHardNavError } from './nav-failure-handler'\n\nconst workAsyncStorage =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n ).workAsyncStorage\n : undefined\n\nconst styles = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily:\n 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '28px',\n margin: '0 8px',\n },\n} as const\n\nexport type ErrorComponent = React.ComponentType<{\n error: Error\n // global-error, there's no `reset` function;\n // regular error boundary, there's a `reset` function.\n reset?: () => void\n}>\n\nexport interface ErrorBoundaryProps {\n children?: React.ReactNode\n errorComponent: ErrorComponent | undefined\n errorStyles?: React.ReactNode | undefined\n errorScripts?: React.ReactNode | undefined\n}\n\ninterface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {\n pathname: string | null\n errorComponent: ErrorComponent\n}\n\ninterface ErrorBoundaryHandlerState {\n error: Error | null\n previousPathname: string | null\n}\n\n// if we are revalidating we want to re-throw the error so the\n// function crashes so we can maintain our previous cache\n// instead of caching the error page\nfunction HandleISRError({ error }: { error: any }) {\n if (workAsyncStorage) {\n const store = workAsyncStorage.getStore()\n if (store?.isRevalidate || store?.isStaticGeneration) {\n console.error(error)\n throw error\n }\n }\n\n return null\n}\n\nexport class ErrorBoundaryHandler extends React.Component<\n ErrorBoundaryHandlerProps,\n ErrorBoundaryHandlerState\n> {\n constructor(props: ErrorBoundaryHandlerProps) {\n super(props)\n this.state = { error: null, previousPathname: this.props.pathname }\n }\n\n static getDerivedStateFromError(error: Error) {\n if (isNextRouterError(error)) {\n // Re-throw if an expected internal Next.js router error occurs\n // this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)\n throw error\n }\n\n return { error }\n }\n\n static getDerivedStateFromProps(\n props: ErrorBoundaryHandlerProps,\n state: ErrorBoundaryHandlerState\n ): ErrorBoundaryHandlerState | null {\n const { error } = state\n\n // if we encounter an error while\n // a navigation is pending we shouldn't render\n // the error boundary and instead should fallback\n // to a hard navigation to attempt recovering\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n if (error && handleHardNavError(error)) {\n // clear error so we don't render anything\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n }\n\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.error) {\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n return {\n error: state.error,\n previousPathname: props.pathname,\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n if (this.state.error) {\n return (\n <>\n \n {this.props.errorStyles}\n {this.props.errorScripts}\n \n \n )\n }\n\n return this.props.children\n }\n}\n\nexport type GlobalErrorComponent = React.ComponentType<{\n error: any\n}>\nexport function GlobalError({ error }: { error: any }) {\n const digest: string | undefined = error?.digest\n return (\n \n \n \n \n
\n
\n

\n Application error: a {digest ? 'server' : 'client'}-side exception\n has occurred while loading {window.location.hostname} (see the{' '}\n {digest ? 'server logs' : 'browser console'} for more\n information).\n

\n {digest ?

{`Digest: ${digest}`}

: null}\n
\n
\n \n \n )\n}\n\n// Exported so that the import signature in the loaders can be identical to user\n// supplied custom global error signatures.\nexport default GlobalError\n\n/**\n * Handles errors through `getDerivedStateFromError`.\n * Renders the provided error component and provides a way to `reset` the error boundary state.\n */\n\n/**\n * Renders error boundary with the provided \"errorComponent\" property as the fallback.\n * If no \"errorComponent\" property is provided it renders the children without an error boundary.\n */\nexport function ErrorBoundary({\n errorComponent,\n errorStyles,\n errorScripts,\n children,\n}: ErrorBoundaryProps & {\n children: React.ReactNode\n}): JSX.Element {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these errors can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n if (errorComponent) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","import type { Params } from '../../server/request/params'\nimport { wellKnownProperties } from '../../shared/lib/utils/reflect-utils'\n\ninterface CacheLifetime {}\nconst CachedParams = new WeakMap>()\n\nexport function makeUntrackedExoticParams(\n underlyingParams: Params\n): Promise {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const promise = Promise.resolve(underlyingParams)\n CachedParams.set(underlyingParams, promise)\n\n Object.keys(underlyingParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n ;(promise as any)[prop] = underlyingParams[prop]\n }\n })\n\n return promise\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n copyNextErrorCode: null,\n createDigestWithErrorCode: null,\n extractNextErrorCode: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n copyNextErrorCode: function() {\n return copyNextErrorCode;\n },\n createDigestWithErrorCode: function() {\n return createDigestWithErrorCode;\n },\n extractNextErrorCode: function() {\n return extractNextErrorCode;\n }\n});\nconst ERROR_CODE_DELIMITER = '@';\nconst createDigestWithErrorCode = (thrownValue, originalDigest)=>{\n if (typeof thrownValue === 'object' && thrownValue !== null && '__NEXT_ERROR_CODE' in thrownValue) {\n return `${originalDigest}${ERROR_CODE_DELIMITER}${thrownValue.__NEXT_ERROR_CODE}`;\n }\n return originalDigest;\n};\nconst copyNextErrorCode = (source, target)=>{\n const errorCode = extractNextErrorCode(source);\n if (errorCode && typeof target === 'object' && target !== null) {\n Object.defineProperty(target, '__NEXT_ERROR_CODE', {\n value: errorCode,\n enumerable: false,\n configurable: true\n });\n }\n};\nconst extractNextErrorCode = (error)=>{\n if (typeof error === 'object' && error !== null && '__NEXT_ERROR_CODE' in error && typeof error.__NEXT_ERROR_CODE === 'string') {\n return error.__NEXT_ERROR_CODE;\n }\n if (typeof error === 'object' && error !== null && 'digest' in error && typeof error.digest === 'string') {\n const segments = error.digest.split(ERROR_CODE_DELIMITER);\n const errorCode = segments.find((segment)=>segment.startsWith('E'));\n return errorCode;\n }\n return undefined;\n};\n\n//# sourceMappingURL=error-telemetry-utils.js.map","import {\n ACTION_NAVIGATE,\n ACTION_SERVER_PATCH,\n ACTION_RESTORE,\n ACTION_REFRESH,\n ACTION_PREFETCH,\n ACTION_HMR_REFRESH,\n ACTION_SERVER_ACTION,\n} from './router-reducer-types'\nimport type {\n ReducerActions,\n ReducerState,\n ReadonlyReducerState,\n} from './router-reducer-types'\nimport { navigateReducer } from './reducers/navigate-reducer'\nimport { serverPatchReducer } from './reducers/server-patch-reducer'\nimport { restoreReducer } from './reducers/restore-reducer'\nimport { refreshReducer } from './reducers/refresh-reducer'\nimport { prefetchReducer } from './reducers/prefetch-reducer'\nimport { hmrRefreshReducer } from './reducers/hmr-refresh-reducer'\nimport { serverActionReducer } from './reducers/server-action-reducer'\n\n/**\n * Reducer that handles the app-router state updates.\n */\nfunction clientReducer(\n state: ReadonlyReducerState,\n action: ReducerActions\n): ReducerState {\n switch (action.type) {\n case ACTION_NAVIGATE: {\n return navigateReducer(state, action)\n }\n case ACTION_SERVER_PATCH: {\n return serverPatchReducer(state, action)\n }\n case ACTION_RESTORE: {\n return restoreReducer(state, action)\n }\n case ACTION_REFRESH: {\n return refreshReducer(state, action)\n }\n case ACTION_HMR_REFRESH: {\n return hmrRefreshReducer(state, action)\n }\n case ACTION_PREFETCH: {\n return prefetchReducer(state, action)\n }\n case ACTION_SERVER_ACTION: {\n return serverActionReducer(state, action)\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error('Unknown action')\n }\n}\n\nfunction serverReducer(\n state: ReadonlyReducerState,\n _action: ReducerActions\n): ReducerState {\n return state\n}\n\n// we don't run the client reducer on the server, so we use a noop function for better tree shaking\nexport const reducer =\n typeof window === 'undefined' ? serverReducer : clientReducer\n","import type { Segment } from '../../server/app-render/types'\n\nexport const matchSegment = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n // segment is either Array or string\n if (typeof existingSegment === 'string') {\n if (typeof segment === 'string') {\n // Common case: segment is just a string\n return existingSegment === segment\n }\n return false\n }\n\n if (typeof segment === 'string') {\n return false\n }\n return existingSegment[0] === segment[0] && existingSegment[1] === segment[1]\n}\n","'use client'\n\nimport React, { useContext, type JSX } from 'react'\nimport { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime'\n\nexport default function RenderFromTemplateContext(): JSX.Element {\n const children = useContext(TemplateContext)\n return <>{children}\n}\n","import {\n fetchServerResponse,\n type FetchServerResponseResult,\n} from './fetch-server-response'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n PrefetchKind,\n type ReadonlyReducerState,\n} from './router-reducer-types'\nimport { prefetchQueue } from './reducers/prefetch-reducer'\n\nconst INTERCEPTION_CACHE_KEY_MARKER = '%'\n\nexport type AliasedPrefetchCacheEntry = PrefetchCacheEntry & {\n /** This is a special property that indicates a prefetch entry associated with a different URL\n * was returned rather than the requested URL. This signals to the router that it should only\n * apply the part that doesn't depend on searchParams (specifically the loading state).\n */\n aliased?: boolean\n}\n\n/**\n * Creates a cache key for the router prefetch cache\n *\n * @param url - The URL being navigated to\n * @param nextUrl - an internal URL, primarily used for handling rewrites. Defaults to '/'.\n * @return The generated prefetch cache key.\n */\nfunction createPrefetchCacheKeyImpl(\n url: URL,\n includeSearchParams: boolean,\n prefix?: string | null\n) {\n // Initially we only use the pathname as the cache key. We don't want to include\n // search params so that multiple URLs with the same search parameter can re-use\n // loading states.\n let pathnameFromUrl = url.pathname\n\n // RSC responses can differ based on search params, specifically in the case where we aren't\n // returning a partial response (ie with `PrefetchKind.AUTO`).\n // In the auto case, since loading.js & layout.js won't have access to search params,\n // we can safely re-use that cache entry. But for full prefetches, we should not\n // re-use the cache entry as the response may differ.\n if (includeSearchParams) {\n // if we have a full prefetch, we can include the search param in the key,\n // as we'll be getting back a full response. The server might have read the search\n // params when generating the full response.\n pathnameFromUrl += url.search\n }\n\n if (prefix) {\n return `${prefix}${INTERCEPTION_CACHE_KEY_MARKER}${pathnameFromUrl}`\n }\n\n return pathnameFromUrl\n}\n\nfunction createPrefetchCacheKey(\n url: URL,\n kind: PrefetchKind | undefined,\n nextUrl?: string | null\n) {\n return createPrefetchCacheKeyImpl(url, kind === PrefetchKind.FULL, nextUrl)\n}\n\nfunction getExistingCacheEntry(\n url: URL,\n kind: PrefetchKind = PrefetchKind.TEMPORARY,\n nextUrl: string | null,\n prefetchCache: Map,\n allowAliasing: boolean\n): AliasedPrefetchCacheEntry | undefined {\n // We first check if there's a more specific interception route prefetch entry\n // This is because when we detect a prefetch that corresponds with an interception route, we prefix it with nextUrl (see `createPrefetchCacheKey`)\n // to avoid conflicts with other pages that may have the same URL but render different things depending on the `Next-URL` header.\n for (const maybeNextUrl of [nextUrl, null]) {\n const cacheKeyWithParams = createPrefetchCacheKeyImpl(\n url,\n true,\n maybeNextUrl\n )\n const cacheKeyWithoutParams = createPrefetchCacheKeyImpl(\n url,\n false,\n maybeNextUrl\n )\n\n // First, we check if we have a cache entry that exactly matches the URL\n const cacheKeyToUse = url.search\n ? cacheKeyWithParams\n : cacheKeyWithoutParams\n\n const existingEntry = prefetchCache.get(cacheKeyToUse)\n if (existingEntry && allowAliasing) {\n // We know we're returning an aliased entry when the pathname matches but the search params don't,\n const isAliased =\n existingEntry.url.pathname === url.pathname &&\n existingEntry.url.search !== url.search\n\n if (isAliased) {\n return {\n ...existingEntry,\n aliased: true,\n }\n }\n\n return existingEntry\n }\n\n // If the request contains search params, and we're not doing a full prefetch, we can return the\n // param-less entry if it exists.\n // This is technically covered by the check at the bottom of this function, which iterates over cache entries,\n // but lets us arrive there quicker in the param-full case.\n const entryWithoutParams = prefetchCache.get(cacheKeyWithoutParams)\n if (\n process.env.NODE_ENV !== 'development' &&\n allowAliasing &&\n url.search &&\n kind !== PrefetchKind.FULL &&\n entryWithoutParams &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !entryWithoutParams.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...entryWithoutParams, aliased: true }\n }\n }\n\n // If we've gotten to this point, we didn't find a specific cache entry that matched\n // the request URL.\n // We attempt a partial match by checking if there's a cache entry with the same pathname.\n // Regardless of what we find, since it doesn't correspond with the requested URL, we'll mark it \"aliased\".\n // This will signal to the router that it should only apply the loading state on the prefetched data.\n if (\n process.env.NODE_ENV !== 'development' &&\n kind !== PrefetchKind.FULL &&\n allowAliasing\n ) {\n for (const cacheEntry of prefetchCache.values()) {\n if (\n cacheEntry.url.pathname === url.pathname &&\n // We shouldn't return the aliased entry if it was relocated to a new cache key.\n // Since it's rewritten, it could respond with a completely different loading state.\n !cacheEntry.key.includes(INTERCEPTION_CACHE_KEY_MARKER)\n ) {\n return { ...cacheEntry, aliased: true }\n }\n }\n }\n\n return undefined\n}\n\n/**\n * Returns a prefetch cache entry if one exists. Otherwise creates a new one and enqueues a fetch request\n * to retrieve the prefetch data from the server.\n */\nexport function getOrCreatePrefetchCacheEntry({\n url,\n nextUrl,\n tree,\n prefetchCache,\n kind,\n allowAliasing = true,\n}: Pick & {\n url: URL\n kind?: PrefetchKind\n allowAliasing: boolean\n}): AliasedPrefetchCacheEntry {\n const existingCacheEntry = getExistingCacheEntry(\n url,\n kind,\n nextUrl,\n prefetchCache,\n allowAliasing\n )\n\n if (existingCacheEntry) {\n // Grab the latest status of the cache entry and update it\n existingCacheEntry.status = getPrefetchEntryCacheStatus(existingCacheEntry)\n\n // when `kind` is provided, an explicit prefetch was requested.\n // if the requested prefetch is \"full\" and the current cache entry wasn't, we want to re-prefetch with the new intent\n const switchedToFullPrefetch =\n existingCacheEntry.kind !== PrefetchKind.FULL &&\n kind === PrefetchKind.FULL\n\n if (switchedToFullPrefetch) {\n // If we switched to a full prefetch, validate that the existing cache entry contained partial data.\n // It's possible that the cache entry was seeded with full data but has a cache type of \"auto\" (ie when cache entries\n // are seeded but without a prefetch intent)\n existingCacheEntry.data.then((prefetchResponse) => {\n const isFullPrefetch =\n Array.isArray(prefetchResponse.flightData) &&\n prefetchResponse.flightData.some((flightData) => {\n // If we started rendering from the root and we returned RSC data (seedData), we already had a full prefetch.\n return flightData.isRootRender && flightData.seedData !== null\n })\n\n if (!isFullPrefetch) {\n return createLazyPrefetchEntry({\n tree,\n url,\n nextUrl,\n prefetchCache,\n // If we didn't get an explicit prefetch kind, we want to set a temporary kind\n // rather than assuming the same intent as the previous entry, to be consistent with how we\n // lazily create prefetch entries when intent is left unspecified.\n kind: kind ?? PrefetchKind.TEMPORARY,\n })\n }\n })\n }\n\n // If the existing cache entry was marked as temporary, it means it was lazily created when attempting to get an entry,\n // where we didn't have the prefetch intent. Now that we have the intent (in `kind`), we want to update the entry to the more accurate kind.\n if (kind && existingCacheEntry.kind === PrefetchKind.TEMPORARY) {\n existingCacheEntry.kind = kind\n }\n\n // We've determined that the existing entry we found is still valid, so we return it.\n return existingCacheEntry\n }\n\n // If we didn't return an entry, create a new one.\n return createLazyPrefetchEntry({\n tree,\n url,\n nextUrl,\n prefetchCache,\n kind: kind || PrefetchKind.TEMPORARY,\n })\n}\n\n/*\n * Used to take an existing cache entry and prefix it with the nextUrl, if it exists.\n * This ensures that we don't have conflicting cache entries for the same URL (as is the case with route interception).\n */\nfunction prefixExistingPrefetchCacheEntry({\n url,\n nextUrl,\n prefetchCache,\n existingCacheKey,\n}: Pick & {\n url: URL\n existingCacheKey: string\n}) {\n const existingCacheEntry = prefetchCache.get(existingCacheKey)\n if (!existingCacheEntry) {\n // no-op -- there wasn't an entry to move\n return\n }\n\n const newCacheKey = createPrefetchCacheKey(\n url,\n existingCacheEntry.kind,\n nextUrl\n )\n prefetchCache.set(newCacheKey, { ...existingCacheEntry, key: newCacheKey })\n prefetchCache.delete(existingCacheKey)\n\n return newCacheKey\n}\n\n/**\n * Use to seed the prefetch cache with data that has already been fetched.\n */\nexport function createSeededPrefetchCacheEntry({\n nextUrl,\n tree,\n prefetchCache,\n url,\n data,\n kind,\n}: Pick & {\n url: URL\n data: FetchServerResponseResult\n kind: PrefetchKind\n}) {\n // The initial cache entry technically includes full data, but it isn't explicitly prefetched -- we just seed the\n // prefetch cache so that we can skip an extra prefetch request later, since we already have the data.\n // if the prefetch corresponds with an interception route, we use the nextUrl to prefix the cache key\n const prefetchCacheKey = data.couldBeIntercepted\n ? createPrefetchCacheKey(url, kind, nextUrl)\n : createPrefetchCacheKey(url, kind)\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data: Promise.resolve(data),\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: Date.now(),\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n } satisfies PrefetchCacheEntry\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\n/**\n * Creates a prefetch entry entry and enqueues a fetch request to retrieve the data.\n */\nfunction createLazyPrefetchEntry({\n url,\n kind,\n tree,\n nextUrl,\n prefetchCache,\n}: Pick & {\n url: URL\n kind: PrefetchKind\n}): PrefetchCacheEntry {\n const prefetchCacheKey = createPrefetchCacheKey(url, kind)\n\n // initiates the fetch request for the prefetch and attaches a listener\n // to the promise to update the prefetch cache entry when the promise resolves (if necessary)\n const data = prefetchQueue.enqueue(() =>\n fetchServerResponse(url, {\n flightRouterState: tree,\n nextUrl,\n prefetchKind: kind,\n }).then((prefetchResponse) => {\n // TODO: `fetchServerResponse` should be more tighly coupled to these prefetch cache operations\n // to avoid drift between this cache key prefixing logic\n // (which is currently directly influenced by the server response)\n let newCacheKey\n\n if (prefetchResponse.couldBeIntercepted) {\n // Determine if we need to prefix the cache key with the nextUrl\n newCacheKey = prefixExistingPrefetchCacheEntry({\n url,\n existingCacheKey: prefetchCacheKey,\n nextUrl,\n prefetchCache,\n })\n }\n\n // If the prefetch was a cache hit, we want to update the existing cache entry to reflect that it was a full prefetch.\n // This is because we know that a static response will contain the full RSC payload, and can be updated to respect the `static`\n // staleTime.\n if (prefetchResponse.prerendered) {\n const existingCacheEntry = prefetchCache.get(\n // if we prefixed the cache key due to route interception, we want to use the new key. Otherwise we use the original key\n newCacheKey ?? prefetchCacheKey\n )\n if (existingCacheEntry) {\n existingCacheEntry.kind = PrefetchKind.FULL\n if (prefetchResponse.staleTime !== -1) {\n // This is the stale time that was collected by the server during\n // static generation. Use this in place of the default stale time.\n existingCacheEntry.staleTime = prefetchResponse.staleTime\n }\n }\n }\n\n return prefetchResponse\n })\n )\n\n const prefetchEntry = {\n treeAtTimeOfPrefetch: tree,\n data,\n kind,\n prefetchTime: Date.now(),\n lastUsedTime: null,\n staleTime: -1,\n key: prefetchCacheKey,\n status: PrefetchCacheEntryStatus.fresh,\n url,\n }\n\n prefetchCache.set(prefetchCacheKey, prefetchEntry)\n\n return prefetchEntry\n}\n\nexport function prunePrefetchCache(\n prefetchCache: ReadonlyReducerState['prefetchCache']\n) {\n for (const [href, prefetchCacheEntry] of prefetchCache) {\n if (\n getPrefetchEntryCacheStatus(prefetchCacheEntry) ===\n PrefetchCacheEntryStatus.expired\n ) {\n prefetchCache.delete(href)\n }\n }\n}\n\n// These values are set by `define-env-plugin` (based on `nextConfig.experimental.staleTimes`)\n// and default to 5 minutes (static) / 0 seconds (dynamic)\nconst DYNAMIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000\n\nexport const STATIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME) * 1000\n\nfunction getPrefetchEntryCacheStatus({\n kind,\n prefetchTime,\n lastUsedTime,\n staleTime,\n}: PrefetchCacheEntry): PrefetchCacheEntryStatus {\n if (staleTime !== -1) {\n // `staleTime` is the value sent by the server during static generation.\n // When this is available, it takes precedence over any of the heuristics\n // that follow.\n //\n // TODO: When PPR is enabled, the server will *always* return a stale time\n // when prefetching. We should never use a prefetch entry that hasn't yet\n // received data from the server. So the only two cases should be 1) we use\n // the server-generated stale time 2) the unresolved entry is discarded.\n return Date.now() < prefetchTime + staleTime\n ? PrefetchCacheEntryStatus.fresh\n : PrefetchCacheEntryStatus.stale\n }\n\n // We will re-use the cache entry data for up to the `dynamic` staletime window.\n if (Date.now() < (lastUsedTime ?? prefetchTime) + DYNAMIC_STALETIME_MS) {\n return lastUsedTime\n ? PrefetchCacheEntryStatus.reusable\n : PrefetchCacheEntryStatus.fresh\n }\n\n // For \"auto\" prefetching, we'll re-use only the loading boundary for up to `static` staletime window.\n // A stale entry will only re-use the `loading` boundary, not the full data.\n // This will trigger a \"lazy fetch\" for the full data.\n if (kind === PrefetchKind.AUTO) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.stale\n }\n }\n\n // for \"full\" prefetching, we'll re-use the cache entry data for up to `static` staletime window.\n if (kind === PrefetchKind.FULL) {\n if (Date.now() < prefetchTime + STATIC_STALETIME_MS) {\n return PrefetchCacheEntryStatus.reusable\n }\n }\n\n return PrefetchCacheEntryStatus.expired\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n","export const createRenderParamsFromClient =\n process.env.NODE_ENV === 'development'\n ? (require('./params.browser.dev') as typeof import('./params.browser.dev'))\n .makeDynamicallyTrackedExoticParamsWithDevWarnings\n : (\n require('./params.browser.prod') as typeof import('./params.browser.prod')\n ).makeUntrackedExoticParams\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n CacheNodeSeedData,\n} from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport {\n PrefetchCacheEntryStatus,\n type PrefetchCacheEntry,\n} from './router-reducer-types'\n\nexport function fillLazyItemsTillLeafWithHead(\n newCache: CacheNode,\n existingCache: CacheNode | undefined,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null,\n head: React.ReactNode,\n prefetchEntry: PrefetchCacheEntry | undefined\n): void {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n newCache.head = head\n return\n }\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n // TODO: We should traverse the cacheNodeSeedData tree instead of the router\n // state tree. Ideally, they would always be the same shape, but because of\n // the loading.js pattern, cacheNodeSeedData sometimes only represents a\n // partial tree. That's why this node is sometimes null. Once PPR lands,\n // loading.js will no longer have special behavior and we can traverse the\n // data tree instead.\n //\n // We should also consider merging the router state tree and the data tree\n // in the response format, so that we don't have to send the keys twice.\n // Then the client can convert them into separate representations.\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n if (existingCache) {\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n const hasReusablePrefetch =\n prefetchEntry?.kind === 'auto' &&\n prefetchEntry.status === PrefetchCacheEntryStatus.reusable\n\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n const existingCacheNode = parallelRouteCacheNode.get(cacheKey)\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n }\n } else if (hasReusablePrefetch && existingCacheNode) {\n // No new data was sent from the server, but the existing cache node\n // was prefetched, so we should reuse that.\n newCacheNode = {\n lazyData: existingCacheNode.lazyData,\n rsc: existingCacheNode.rsc,\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n prefetchRsc: existingCacheNode.prefetchRsc,\n head: existingCacheNode.head,\n prefetchHead: existingCacheNode.prefetchHead,\n parallelRoutes: new Map(existingCacheNode.parallelRoutes),\n loading: existingCacheNode.loading,\n } as CacheNode\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n loading: null,\n }\n }\n\n // Overrides the cache key with the new cache node.\n parallelRouteCacheNode.set(cacheKey, newCacheNode)\n // Traverse deeper to apply the head / fill lazy items till the head.\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n existingCacheNode,\n parallelRouteState,\n parallelSeedData ? parallelSeedData : null,\n head,\n prefetchEntry\n )\n\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n continue\n }\n }\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillLazyItemsTillLeafWithHead(\n newCacheNode,\n undefined,\n parallelRouteState,\n parallelSeedData,\n head,\n prefetchEntry\n )\n }\n}\n","'use strict';\n\nmodule.exports = require('./client.browser');\n","// This import must go first because it needs to patch webpack chunk loading\n// before React patches chunk loading.\nimport './app-webpack'\nimport { appBootstrap } from './app-bootstrap'\n\nappBootstrap(() => {\n const { hydrate } = require('./app-index')\n // Include app-router and layout-router in the main chunk\n require('next/dist/client/components/app-router')\n require('next/dist/client/components/layout-router')\n hydrate()\n})\n","import type {\n FlightRouterState,\n FlightDataPath,\n Segment,\n} from '../../../server/app-render/types'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\n\n// TODO-APP: flightSegmentPath will be empty in case of static response, needs to be handled.\nexport function shouldHardNavigate(\n flightSegmentPath: FlightDataPath,\n flightRouterState: FlightRouterState\n): boolean {\n const [segment, parallelRoutes] = flightRouterState\n // TODO-APP: Check if `as` can be replaced.\n const [currentSegment, parallelRouteKey] = flightSegmentPath as [\n Segment,\n string,\n ]\n\n // Check if current segment matches the existing segment.\n if (!matchSegment(currentSegment, segment)) {\n // If dynamic parameter in tree doesn't match up with segment path a hard navigation is triggered.\n if (Array.isArray(currentSegment)) {\n return true\n }\n\n // If the existing segment did not match soft navigation is triggered.\n return false\n }\n const lastSegment = flightSegmentPath.length <= 2\n\n if (lastSegment) {\n return false\n }\n\n return shouldHardNavigate(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey]\n )\n}\n","function _class_private_field_loose_base(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n\n return receiver;\n}\nexport { _class_private_field_loose_base as _ };\n","/**\n * Before starting the Next.js runtime and requiring any module, we need to make\n * sure the following scripts are executed in the correct order:\n * - Polyfills\n * - next/script with `beforeInteractive` strategy\n */\n\nconst version = process.env.__NEXT_VERSION\n\nwindow.next = {\n version,\n appDir: true,\n}\n\nfunction loadScriptsInSequence(\n scripts: [src: string, props: { [prop: string]: any }][],\n hydrate: () => void\n) {\n if (!scripts || !scripts.length) {\n return hydrate()\n }\n\n return scripts\n .reduce((promise, [src, props]) => {\n return promise.then(() => {\n return new Promise((resolve, reject) => {\n const el = document.createElement('script')\n\n if (props) {\n for (const key in props) {\n if (key !== 'children') {\n el.setAttribute(key, props[key])\n }\n }\n }\n\n if (src) {\n el.src = src\n el.onload = () => resolve()\n el.onerror = reject\n } else if (props) {\n el.innerHTML = props.children\n setTimeout(resolve)\n }\n\n document.head.appendChild(el)\n })\n })\n }, Promise.resolve())\n .catch((err: Error) => {\n console.error(err)\n // Still try to hydrate even if there's an error.\n })\n .then(() => {\n hydrate()\n })\n}\n\nexport function appBootstrap(hydrate: () => void) {\n loadScriptsInSequence((self as any).__next_s, () => {\n // If the static shell is being debugged, skip hydration if the\n // `__nextppronly` query is present. This is only enabled when the\n // environment variable `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` is\n // set to `1`. Otherwise the following is optimized out.\n if (process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1') {\n const search = new URLSearchParams(window.location.search)\n if (\n search.get('__nextppronly') === 'fallback' ||\n search.get('__nextppronly') === '1'\n ) {\n console.warn(\n `Skipping hydration due to __nextppronly=${search.get('__nextppronly')}`\n )\n return\n }\n }\n\n hydrate()\n })\n}\n","export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n","import { RedirectStatusCode } from './redirect-status-code'\nimport {\n RedirectType,\n type RedirectError,\n isRedirectError,\n REDIRECT_ERROR_CODE,\n} from './redirect-error'\n\nconst actionAsyncStorage =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/action-async-storage.external') as typeof import('../../server/app-render/action-async-storage.external')\n ).actionAsyncStorage\n : undefined\n\nexport function getRedirectError(\n url: string,\n type: RedirectType,\n statusCode: RedirectStatusCode = RedirectStatusCode.TemporaryRedirect\n): RedirectError {\n const error = new Error(REDIRECT_ERROR_CODE) as RedirectError\n error.digest = `${REDIRECT_ERROR_CODE};${type};${url};${statusCode};`\n return error\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 307/303 to the caller.\n * - In a Server Action, type defaults to 'push' and 'replace' elsewhere.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function redirect(\n /** The URL to redirect to */\n url: string,\n type?: RedirectType\n): never {\n type ??= actionAsyncStorage?.getStore()?.isAction\n ? RedirectType.push\n : RedirectType.replace\n\n throw getRedirectError(url, type, RedirectStatusCode.TemporaryRedirect)\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 308/303 to the caller.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function permanentRedirect(\n /** The URL to redirect to */\n url: string,\n type: RedirectType = RedirectType.replace\n): never {\n throw getRedirectError(url, type, RedirectStatusCode.PermanentRedirect)\n}\n\n/**\n * Returns the encoded URL from the error if it's a RedirectError, null\n * otherwise. Note that this does not validate the URL returned.\n *\n * @param error the error that may be a redirect error\n * @return the url if the error was a redirect error\n */\nexport function getURLFromRedirectError(error: RedirectError): string\nexport function getURLFromRedirectError(error: unknown): string | null {\n if (!isRedirectError(error)) return null\n\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(';').slice(2, -2).join(';')\n}\n\nexport function getRedirectTypeFromError(error: RedirectError): RedirectType {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return error.digest.split(';', 2)[1] as RedirectType\n}\n\nexport function getRedirectStatusCodeFromError(error: RedirectError): number {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return Number(error.digest.split(';').at(-2))\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n METADATA_BOUNDARY_NAME: null,\n OUTLET_BOUNDARY_NAME: null,\n VIEWPORT_BOUNDARY_NAME: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n METADATA_BOUNDARY_NAME: function() {\n return METADATA_BOUNDARY_NAME;\n },\n OUTLET_BOUNDARY_NAME: function() {\n return OUTLET_BOUNDARY_NAME;\n },\n VIEWPORT_BOUNDARY_NAME: function() {\n return VIEWPORT_BOUNDARY_NAME;\n }\n});\nconst METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';\nconst VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';\nconst OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';\n\n//# sourceMappingURL=metadata-constants.js.map","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n/**\n * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)\n * within a route segment as well as inject a tag.\n *\n * `notFound()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a `` meta tag and set the status code to 404.\n * - In a Route Handler or Server Action, it will serve a 404 to the caller.\n *\n * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};404`\n\nexport function notFound(): never {\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n\n throw error\n}\n","import { useEffect } from 'react'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\n\nexport function handleHardNavError(error: unknown): boolean {\n if (\n error &&\n typeof window !== 'undefined' &&\n window.next.__pendingUrl &&\n createHrefFromUrl(new URL(window.location.href)) !==\n createHrefFromUrl(window.next.__pendingUrl)\n ) {\n console.error(\n `Error occurred during navigation, falling back to hard navigation`,\n error\n )\n window.location.href = window.next.__pendingUrl.toString()\n return true\n }\n return false\n}\n\nexport function useNavFailureHandler() {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // this if is only for DCE of the feature flag not conditional\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n const uncaughtExceptionHandler = (\n evt: ErrorEvent | PromiseRejectionEvent\n ) => {\n const error = 'reason' in evt ? evt.reason : evt.error\n // if we have an unhandled exception/rejection during\n // a navigation we fall back to a hard navigation to\n // attempt recovering to a good state\n handleHardNavError(error)\n }\n window.addEventListener('unhandledrejection', uncaughtExceptionHandler)\n window.addEventListener('error', uncaughtExceptionHandler)\n return () => {\n window.removeEventListener('error', uncaughtExceptionHandler)\n window.removeEventListener(\n 'unhandledrejection',\n uncaughtExceptionHandler\n )\n }\n }, [])\n }\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\n\nexport function isNavigatingToNewRootLayout(\n currentTree: FlightRouterState,\n nextTree: FlightRouterState\n): boolean {\n // Compare segments\n const currentTreeSegment = currentTree[0]\n const nextTreeSegment = nextTree[0]\n\n // If any segment is different before we find the root layout, the root layout has changed.\n // E.g. /same/(group1)/layout.js -> /same/(group2)/layout.js\n // First segment is 'same' for both, keep looking. (group1) changed to (group2) before the root layout was found, it must have changed.\n if (Array.isArray(currentTreeSegment) && Array.isArray(nextTreeSegment)) {\n // Compare dynamic param name and type but ignore the value, different values would not affect the current root layout\n // /[name] - /slug1 and /slug2, both values (slug1 & slug2) still has the same layout /[name]/layout.js\n if (\n currentTreeSegment[0] !== nextTreeSegment[0] ||\n currentTreeSegment[2] !== nextTreeSegment[2]\n ) {\n return true\n }\n } else if (currentTreeSegment !== nextTreeSegment) {\n return true\n }\n\n // Current tree root layout found\n if (currentTree[4]) {\n // If the next tree doesn't have the root layout flag, it must have changed.\n return !nextTree[4]\n }\n // Current tree didn't have its root layout here, must have changed.\n if (nextTree[4]) {\n return true\n }\n // We can't assume it's `parallelRoutes.children` here in case the root layout is `app/@something/layout.js`\n // But it's not possible to be more than one parallelRoutes before the root layout is found\n // TODO-APP: change to traverse all parallel routes\n const currentTreeChild = Object.values(currentTree[1])[0]\n const nextTreeChild = Object.values(nextTree[1])[0]\n if (!currentTreeChild || !nextTreeChild) return true\n return isNavigatingToNewRootLayout(currentTreeChild, nextTreeChild)\n}\n","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightRouterState } from '../../../server/app-render/types'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\n/**\n * Invalidate cache one level down from the router state.\n */\nexport function invalidateCacheByRouterState(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState\n): void {\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const segmentForParallelRoute = routerState[1][key][0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n parallelRouteCacheNode.delete(cacheKey)\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n }\n }\n}\n","/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n needsPaint = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return needsPaint\n ? !0\n : exports.unstable_now() - startTime < frameInterval\n ? !1\n : !0;\n}\nfunction performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_requestPaint = function () {\n needsPaint = !0;\n};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline())));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../../server/app-render/types'\nimport { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { invalidateCacheBelowFlightSegmentPath } from '../invalidate-cache-below-flight-segmentpath'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { shouldHardNavigate } from '../should-hard-navigate'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport {\n PrefetchCacheEntryStatus,\n type Mutable,\n type NavigateAction,\n type ReadonlyReducerState,\n type ReducerState,\n} from '../router-reducer-types'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport { prefetchQueue } from './prefetch-reducer'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { DEFAULT_SEGMENT_KEY } from '../../../../shared/lib/segment'\nimport { listenForDynamicRequest, startPPRNavigation } from '../ppr-navigations'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\nimport { clearCacheNodeDataForSegmentPath } from '../clear-cache-node-data-for-segment-path'\nimport { handleAliasedPrefetchEntry } from '../aliased-prefetch-navigations'\nimport {\n navigate as navigateUsingSegmentCache,\n NavigationResultTag,\n type NavigationResult,\n} from '../../segment-cache'\n\nexport function handleExternalUrl(\n state: ReadonlyReducerState,\n mutable: Mutable,\n url: string,\n pendingPush: boolean\n) {\n mutable.mpaNavigation = true\n mutable.canonicalUrl = url\n mutable.pendingPush = pendingPush\n mutable.scrollableSegments = undefined\n\n return handleMutable(state, mutable)\n}\n\nfunction generateSegmentsFromPatch(\n flightRouterPatch: FlightRouterState\n): FlightSegmentPath[] {\n const segments: FlightSegmentPath[] = []\n const [segment, parallelRoutes] = flightRouterPatch\n\n if (Object.keys(parallelRoutes).length === 0) {\n return [[segment]]\n }\n\n for (const [parallelRouteKey, parallelRoute] of Object.entries(\n parallelRoutes\n )) {\n for (const childSegment of generateSegmentsFromPatch(parallelRoute)) {\n // If the segment is empty, it means we are at the root of the tree\n if (segment === '') {\n segments.push([parallelRouteKey, ...childSegment])\n } else {\n segments.push([segment, parallelRouteKey, ...childSegment])\n }\n }\n }\n\n return segments\n}\n\nfunction triggerLazyFetchForLeafSegments(\n newCache: CacheNode,\n currentCache: CacheNode,\n flightSegmentPath: FlightSegmentPath,\n treePatch: FlightRouterState\n) {\n let appliedPatch = false\n\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n const segmentPathsToFill = generateSegmentsFromPatch(treePatch).map(\n (segment) => [...flightSegmentPath, ...segment]\n )\n\n for (const segmentPaths of segmentPathsToFill) {\n clearCacheNodeDataForSegmentPath(newCache, currentCache, segmentPaths)\n\n appliedPatch = true\n }\n\n return appliedPatch\n}\n\nfunction handleNavigationResult(\n url: URL,\n state: ReadonlyReducerState,\n mutable: Mutable,\n pendingPush: boolean,\n result: NavigationResult\n): ReducerState {\n switch (result.tag) {\n case NavigationResultTag.MPA: {\n // Perform an MPA navigation.\n const newUrl = result.data\n return handleExternalUrl(state, mutable, newUrl, pendingPush)\n }\n case NavigationResultTag.NoOp: {\n // The server responded with no change to the current page. However, if\n // the URL changed, we still need to update that.\n const newCanonicalUrl = result.data.canonicalUrl\n mutable.canonicalUrl = newCanonicalUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(state.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n if (onlyHashChange) {\n // The only updated part of the URL is the hash.\n mutable.onlyHashChange = true\n mutable.shouldScroll = result.data.shouldScroll\n mutable.hashFragment = url.hash\n // Setting this to an empty array triggers a scroll for all new and\n // updated segments. See `ScrollAndFocusHandler` for more details.\n mutable.scrollableSegments = []\n }\n\n return handleMutable(state, mutable)\n }\n case NavigationResultTag.Success: {\n // Received a new result.\n mutable.cache = result.data.cacheNode\n mutable.patchedTree = result.data.flightRouterState\n mutable.canonicalUrl = result.data.canonicalUrl\n mutable.scrollableSegments = result.data.scrollableSegments\n mutable.shouldScroll = result.data.shouldScroll\n mutable.hashFragment = result.data.hash\n return handleMutable(state, mutable)\n }\n case NavigationResultTag.Async: {\n return result.data.then(\n (asyncResult) =>\n handleNavigationResult(url, state, mutable, pendingPush, asyncResult),\n // If the navigation failed, return the current state.\n // TODO: This matches the current behavior but we need to do something\n // better here if the network fails.\n () => {\n return state\n }\n )\n }\n default: {\n result satisfies never\n return state\n }\n }\n}\n\nexport function navigateReducer(\n state: ReadonlyReducerState,\n action: NavigateAction\n): ReducerState {\n const { url, isExternalUrl, navigateType, shouldScroll, allowAliasing } =\n action\n const mutable: Mutable = {}\n const { hash } = url\n const href = createHrefFromUrl(url)\n const pendingPush = navigateType === 'push'\n // we want to prune the prefetch cache on every navigation to avoid it growing too large\n prunePrefetchCache(state.prefetchCache)\n\n mutable.preserveCustomHistoryState = false\n mutable.pendingPush = pendingPush\n\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush)\n }\n\n // Handles case where `` tag is present,\n // which will trigger an MPA navigation.\n if (document.getElementById('__next-page-redirect')) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // (Very Early Experimental Feature) Segment Cache\n //\n // Bypass the normal prefetch cache and use the new per-segment cache\n // implementation instead. This is only supported if PPR is enabled, too.\n //\n // Temporary glue code between the router reducer and the new navigation\n // implementation. Eventually we'll rewrite the router reducer to a\n // state machine.\n const result = navigateUsingSegmentCache(\n url,\n state.cache,\n state.tree,\n state.nextUrl,\n shouldScroll\n )\n return handleNavigationResult(url, state, mutable, pendingPush, result)\n }\n\n const prefetchValues = getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n tree: state.tree,\n prefetchCache: state.prefetchCache,\n allowAliasing,\n })\n const { treeAtTimeOfPrefetch, data } = prefetchValues\n\n prefetchQueue.bump(data)\n\n return data.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride, postponed }) => {\n let isFirstRead = false\n // we only want to mark this once\n if (!prefetchValues.lastUsedTime) {\n // important: we should only mark the cache node as dirty after we unsuspend from the call above\n prefetchValues.lastUsedTime = Date.now()\n isFirstRead = true\n }\n\n if (prefetchValues.aliased) {\n const result = handleAliasedPrefetchEntry(\n state,\n flightData,\n url,\n mutable\n )\n\n // We didn't return new router state because we didn't apply the aliased entry for some reason.\n // We'll re-invoke the navigation handler but ensure that we don't attempt to use the aliased entry. This\n // will create an on-demand prefetch entry.\n if (result === false) {\n return navigateReducer(state, { ...action, allowAliasing: false })\n }\n\n return result\n }\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(state, mutable, flightData, pendingPush)\n }\n\n const updatedCanonicalUrl = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : href\n\n const onlyHashChange =\n !!hash &&\n state.canonicalUrl.split('#', 1)[0] ===\n updatedCanonicalUrl.split('#', 1)[0]\n\n // If only the hash has changed, the server hasn't sent us any new data. We can just update\n // the mutable properties responsible for URL and scroll handling and return early.\n if (onlyHashChange) {\n mutable.onlyHashChange = true\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.shouldScroll = shouldScroll\n mutable.hashFragment = hash\n mutable.scrollableSegments = []\n return handleMutable(state, mutable)\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n let scrollableSegments: FlightSegmentPath[] = []\n for (const normalizedFlightData of flightData) {\n const {\n pathToSegment: flightSegmentPath,\n seedData,\n head,\n isHeadPartial,\n isRootRender,\n } = normalizedFlightData\n let treePatch = normalizedFlightData.tree\n\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...flightSegmentPath]\n\n // Create new tree based on the flightSegmentPath and router state patch\n let newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n // If the tree patch can't be applied to the current tree then we use the tree at time of prefetch\n // TODO-APP: This should instead fill in the missing pieces in `currentTree` with the data from `treeAtTimeOfPrefetch`, then apply the patch.\n if (newTree === null) {\n newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n treeAtTimeOfPrefetch,\n treePatch,\n href\n )\n }\n\n if (newTree !== null) {\n if (\n // This is just a paranoid check. When a route is PPRed, the server\n // will send back a static response that's rendered from\n // the root. If for some reason it doesn't, we fall back to the\n // non-PPR implementation.\n // TODO: We should get rid of the else branch and do all navigations\n // via startPPRNavigation. The current structure is just\n // an incremental step.\n seedData &&\n isRootRender &&\n postponed\n ) {\n const task = startPPRNavigation(\n currentCache,\n currentTree,\n treePatch,\n seedData,\n head,\n isHeadPartial,\n false,\n scrollableSegments\n )\n\n if (task !== null) {\n if (task.route === null) {\n // Detected a change to the root layout. Perform an full-\n // page navigation.\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n // Use the tree computed by startPPRNavigation instead\n // of the one computed by applyRouterStatePatchToTree.\n // TODO: We should remove applyRouterStatePatchToTree\n // from the PPR path entirely.\n const patchedRouterState: FlightRouterState = task.route\n newTree = patchedRouterState\n\n const newCache = task.node\n if (newCache !== null) {\n // We've created a new Cache Node tree that contains a prefetched\n // version of the next page. This can be rendered instantly.\n mutable.cache = newCache\n }\n const dynamicRequestTree = task.dynamicRequestTree\n if (dynamicRequestTree !== null) {\n // The prefetched tree has dynamic holes in it. We initiate a\n // dynamic request to fill them in.\n //\n // Do not block on the result. We'll immediately render the Cache\n // Node tree and suspend on the dynamic parts. When the request\n // comes in, we'll fill in missing data and ping React to\n // re-render. Unlike the lazy fetching model in the non-PPR\n // implementation, this is modeled as a single React update +\n // streaming, rather than multiple top-level updates. (However,\n // even in the new model, we'll still need to sometimes update the\n // root multiple times per navigation, like if the server sends us\n // a different response than we expected. For now, we revert back\n // to the lazy fetching mechanism in that case.)\n const dynamicRequest = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl: state.nextUrl,\n })\n\n listenForDynamicRequest(task, dynamicRequest)\n // We store the dynamic request on the `lazyData` property of the CacheNode\n // because we're not going to await the dynamic request here. Since we're not blocking\n // on the dynamic request, `layout-router` will\n // task.node.lazyData = dynamicRequest\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n } else {\n // Nothing changed, so reuse the old cache.\n // TODO: What if the head changed but not any of the segment data?\n // Is that possible? If so, we should clone the whole tree and\n // update the head.\n newTree = treePatch\n }\n } else {\n // The static response does not include any dynamic holes, so\n // there's no need to do a second request.\n // TODO: As an incremental step this just reverts back to the\n // non-PPR implementation. We can simplify this branch further,\n // given that PPR prefetches are always static and return the whole\n // tree. Or in the meantime we could factor it out into a\n // separate function.\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n const cache: CacheNode = createEmptyCacheNode()\n let applied = false\n\n if (\n prefetchValues.status === PrefetchCacheEntryStatus.stale &&\n !isFirstRead\n ) {\n // When we have a stale prefetch entry, we only want to re-use the loading state of the route we're navigating to, to support instant loading navigations\n // this will trigger a lazy fetch for the actual page data by nulling the `rsc` and `prefetchRsc` values for page data,\n // while copying over the `loading` for the segment that contains the page data.\n // We only do this on subsequent reads, as otherwise there'd be no loading data to re-use.\n\n // We skip this branch if only the hash fragment has changed, as we don't want to trigger a lazy fetch in that case\n applied = triggerLazyFetchForLeafSegments(\n cache,\n currentCache,\n flightSegmentPath,\n treePatch\n )\n // since we re-used the stale cache's loading state & refreshed the data,\n // update the `lastUsedTime` so that it can continue to be re-used for the next 30s\n prefetchValues.lastUsedTime = Date.now()\n } else {\n applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData,\n prefetchValues\n )\n }\n\n const hardNavigate = shouldHardNavigate(\n // TODO-APP: remove ''\n flightSegmentPathWithLeadingEmpty,\n currentTree\n )\n\n if (hardNavigate) {\n // Copy rsc for the root node of the cache.\n cache.rsc = currentCache.rsc\n cache.prefetchRsc = currentCache.prefetchRsc\n\n invalidateCacheBelowFlightSegmentPath(\n cache,\n currentCache,\n flightSegmentPath\n )\n // Ensure the existing cache value is used when the cache was not invalidated.\n mutable.cache = cache\n } else if (applied) {\n mutable.cache = cache\n // If we applied the cache, we update the \"current cache\" value so any other\n // segments in the FlightDataPath will be able to reference the updated cache.\n currentCache = cache\n }\n\n for (const subSegment of generateSegmentsFromPatch(treePatch)) {\n const scrollableSegmentPath = [\n ...flightSegmentPath,\n ...subSegment,\n ]\n // Filter out the __DEFAULT__ paths as they shouldn't be scrolled to in this case.\n if (\n scrollableSegmentPath[scrollableSegmentPath.length - 1] !==\n DEFAULT_SEGMENT_KEY\n ) {\n scrollableSegments.push(scrollableSegmentPath)\n }\n }\n }\n\n currentTree = newTree\n }\n }\n\n mutable.patchedTree = currentTree\n mutable.canonicalUrl = updatedCanonicalUrl\n mutable.scrollableSegments = scrollableSegments\n mutable.hashFragment = hash\n mutable.shouldScroll = shouldScroll\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","import { handleGlobalErrors } from '../errors/use-error-handler'\n\nhandleGlobalErrors()\n","import { hasBasePath } from './has-base-path'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function removeBasePath(path: string): string {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!hasBasePath(path)) {\n return path\n }\n }\n\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path\n\n path = path.slice(basePath.length)\n if (!path.startsWith('/')) path = `/${path}`\n return path\n}\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { AppRouterState } from './router-reducer-types'\nimport { applyFlightData } from './apply-flight-data'\nimport { fetchServerResponse } from './fetch-server-response'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\ninterface RefreshInactiveParallelSegments {\n state: AppRouterState\n updatedTree: FlightRouterState\n updatedCache: CacheNode\n includeNextUrl: boolean\n canonicalUrl: string\n}\n\n/**\n * Refreshes inactive segments that are still in the current FlightRouterState.\n * A segment is considered \"inactive\" when the server response indicates it didn't match to a page component.\n * This happens during a soft-navigation, where the server will want to patch in the segment\n * with the \"default\" component, but we explicitly ignore the server in this case\n * and keep the existing state for that segment. New data for inactive segments are inherently\n * not part of the server response when we patch the tree, because they were associated with a response\n * from an earlier navigation/request. For each segment, once it becomes \"active\", we encode the URL that provided\n * the data for it. This function traverses parallel routes looking for these markers so that it can re-fetch\n * and patch the new data into the tree.\n */\nexport async function refreshInactiveParallelSegments(\n options: RefreshInactiveParallelSegments\n) {\n const fetchedSegments = new Set()\n await refreshInactiveParallelSegmentsImpl({\n ...options,\n rootTree: options.updatedTree,\n fetchedSegments,\n })\n}\n\nasync function refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree,\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree = updatedTree,\n canonicalUrl,\n}: RefreshInactiveParallelSegments & {\n fetchedSegments: Set\n rootTree: FlightRouterState\n}) {\n const [, parallelRoutes, refetchPath, refetchMarker] = updatedTree\n const fetchPromises = []\n\n if (\n refetchPath &&\n refetchPath !== canonicalUrl &&\n refetchMarker === 'refresh' &&\n // it's possible for the tree to contain multiple segments that contain data at the same URL\n // we keep track of them so we can dedupe the requests\n !fetchedSegments.has(refetchPath)\n ) {\n fetchedSegments.add(refetchPath) // Mark this URL as fetched\n\n // Eagerly kick off the fetch for the refetch path & the parallel routes. This should be fine to do as they each operate\n // independently on their own cache nodes, and `applyFlightData` will copy anything it doesn't care about from the existing cache.\n const fetchPromise = fetchServerResponse(\n new URL(refetchPath, location.origin),\n {\n // refetch from the root of the updated tree, otherwise it will be scoped to the current segment\n // and might not contain the data we need to patch in interception route data (such as dynamic params from a previous segment)\n flightRouterState: [rootTree[0], rootTree[1], rootTree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n }\n ).then(({ flightData }) => {\n if (typeof flightData !== 'string') {\n for (const flightDataPath of flightData) {\n // we only pass the new cache as this function is called after clearing the router cache\n // and filling in the new page data from the server. Meaning the existing cache is actually the cache that's\n // just been created & has been written to, but hasn't been \"committed\" yet.\n applyFlightData(updatedCache, updatedCache, flightDataPath)\n }\n } else {\n // When flightData is a string, it suggests that the server response should have triggered an MPA navigation\n // I'm not 100% sure of this decision, but it seems unlikely that we'd want to introduce a redirect side effect\n // when refreshing on-screen data, so handling this has been ommitted.\n }\n })\n\n fetchPromises.push(fetchPromise)\n }\n\n for (const key in parallelRoutes) {\n const parallelFetchPromise = refreshInactiveParallelSegmentsImpl({\n state,\n updatedTree: parallelRoutes[key],\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree,\n canonicalUrl,\n })\n\n fetchPromises.push(parallelFetchPromise)\n }\n\n await Promise.all(fetchPromises)\n}\n\n/**\n * Walks the current parallel segments to determine if they are \"active\".\n * An active parallel route will have a `__PAGE__` segment in the FlightRouterState.\n * As opposed to a `__DEFAULT__` segment, which means there was no match for that parallel route.\n * We add a special marker here so that we know how to refresh its data when the router is revalidated.\n */\nexport function addRefreshMarkerToActiveParallelSegments(\n tree: FlightRouterState,\n path: string\n) {\n const [segment, parallelRoutes, , refetchMarker] = tree\n // a page segment might also contain concatenated search params, so we do a partial match on the key\n if (segment.includes(PAGE_SEGMENT_KEY) && refetchMarker !== 'refresh') {\n tree[2] = path\n tree[3] = 'refresh'\n }\n\n for (const key in parallelRoutes) {\n addRefreshMarkerToActiveParallelSegments(parallelRoutes[key], path)\n }\n}\n","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","'use client'\n\n/**\n * HTTPAccessFallbackBoundary is a boundary that catches errors and renders a\n * fallback component for HTTP errors.\n *\n * It receives the status code, and determine if it should render fallbacks for few HTTP 4xx errors.\n *\n * e.g. 404\n * 404 represents not found, and the fallback component pair contains the component and its styles.\n *\n */\n\nimport React, { useContext } from 'react'\nimport { useUntrackedPathname } from '../navigation-untracked'\nimport {\n HTTPAccessErrorStatus,\n getAccessFallbackHTTPStatus,\n getAccessFallbackErrorTypeByStatus,\n isHTTPAccessFallbackError,\n} from './http-access-fallback'\nimport { warnOnce } from '../../../shared/lib/utils/warn-once'\nimport { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'\n\ninterface HTTPAccessFallbackBoundaryProps {\n notFound?: React.ReactNode\n forbidden?: React.ReactNode\n unauthorized?: React.ReactNode\n children: React.ReactNode\n missingSlots?: Set\n}\n\ninterface HTTPAccessFallbackErrorBoundaryProps\n extends HTTPAccessFallbackBoundaryProps {\n pathname: string | null\n missingSlots?: Set\n}\n\ninterface HTTPAccessBoundaryState {\n triggeredStatus: number | undefined\n previousPathname: string | null\n}\n\nclass HTTPAccessFallbackErrorBoundary extends React.Component<\n HTTPAccessFallbackErrorBoundaryProps,\n HTTPAccessBoundaryState\n> {\n constructor(props: HTTPAccessFallbackErrorBoundaryProps) {\n super(props)\n this.state = {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n\n componentDidCatch(): void {\n if (\n process.env.NODE_ENV === 'development' &&\n this.props.missingSlots &&\n this.props.missingSlots.size > 0 &&\n // A missing children slot is the typical not-found case, so no need to warn\n !this.props.missingSlots.has('children')\n ) {\n let warningMessage =\n 'No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs\\n\\n'\n\n const formattedSlots = Array.from(this.props.missingSlots)\n .sort((a, b) => a.localeCompare(b))\n .map((slot) => `@${slot}`)\n .join(', ')\n\n warningMessage += 'Missing slots: ' + formattedSlots\n\n warnOnce(warningMessage)\n }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isHTTPAccessFallbackError(error)) {\n const httpStatus = getAccessFallbackHTTPStatus(error)\n return {\n triggeredStatus: httpStatus,\n }\n }\n // Re-throw if error is not for 404\n throw error\n }\n\n static getDerivedStateFromProps(\n props: HTTPAccessFallbackErrorBoundaryProps,\n state: HTTPAccessBoundaryState\n ): HTTPAccessBoundaryState | null {\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.triggeredStatus) {\n return {\n triggeredStatus: undefined,\n previousPathname: props.pathname,\n }\n }\n return {\n triggeredStatus: state.triggeredStatus,\n previousPathname: props.pathname,\n }\n }\n\n render() {\n const { notFound, forbidden, unauthorized, children } = this.props\n const { triggeredStatus } = this.state\n const errorComponents = {\n [HTTPAccessErrorStatus.NOT_FOUND]: notFound,\n [HTTPAccessErrorStatus.FORBIDDEN]: forbidden,\n [HTTPAccessErrorStatus.UNAUTHORIZED]: unauthorized,\n }\n\n if (triggeredStatus) {\n const isNotFound =\n triggeredStatus === HTTPAccessErrorStatus.NOT_FOUND && notFound\n const isForbidden =\n triggeredStatus === HTTPAccessErrorStatus.FORBIDDEN && forbidden\n const isUnauthorized =\n triggeredStatus === HTTPAccessErrorStatus.UNAUTHORIZED && unauthorized\n\n // If there's no matched boundary in this layer, keep throwing the error by rendering the children\n if (!(isNotFound || isForbidden || isUnauthorized)) {\n return children\n }\n\n return (\n <>\n \n {process.env.NODE_ENV === 'development' && (\n \n )}\n {errorComponents[triggeredStatus]}\n \n )\n }\n\n return children\n }\n}\n\nexport function HTTPAccessFallbackBoundary({\n notFound,\n forbidden,\n unauthorized,\n children,\n}: HTTPAccessFallbackBoundaryProps) {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these error can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n const missingSlots = useContext(MissingSlotContext)\n const hasErrorFallback = !!(notFound || forbidden || unauthorized)\n\n if (hasErrorFallback) {\n return (\n \n {children}\n \n )\n }\n\n return <>{children}\n}\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","import { normalizeAppPath } from './app-paths'\n\n// order matters here, the first match will be used\nexport const INTERCEPTION_ROUTE_MARKERS = [\n '(..)(..)',\n '(.)',\n '(..)',\n '(...)',\n] as const\n\nexport function isInterceptionRouteAppPath(path: string): boolean {\n // TODO-APP: add more serious validation\n return (\n path\n .split('/')\n .find((segment) =>\n INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m))\n ) !== undefined\n )\n}\n\nexport function extractInterceptionRouteInformation(path: string) {\n let interceptingRoute: string | undefined,\n marker: (typeof INTERCEPTION_ROUTE_MARKERS)[number] | undefined,\n interceptedRoute: string | undefined\n\n for (const segment of path.split('/')) {\n marker = INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m))\n if (marker) {\n ;[interceptingRoute, interceptedRoute] = path.split(marker, 2)\n break\n }\n }\n\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(\n `Invalid interception route: ${path}. Must be in the format //(..|...|..)(..)/`\n )\n }\n\n interceptingRoute = normalizeAppPath(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed\n\n switch (marker) {\n case '(.)':\n // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route\n if (interceptingRoute === '/') {\n interceptedRoute = `/${interceptedRoute}`\n } else {\n interceptedRoute = interceptingRoute + '/' + interceptedRoute\n }\n break\n case '(..)':\n // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route\n if (interceptingRoute === '/') {\n throw new Error(\n `Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`\n )\n }\n interceptedRoute = interceptingRoute\n .split('/')\n .slice(0, -1)\n .concat(interceptedRoute)\n .join('/')\n break\n case '(...)':\n // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route\n interceptedRoute = '/' + interceptedRoute\n break\n case '(..)(..)':\n // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route\n\n const splitInterceptingRoute = interceptingRoute.split('/')\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(\n `Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`\n )\n }\n\n interceptedRoute = splitInterceptingRoute\n .slice(0, -2)\n .concat(interceptedRoute)\n .join('/')\n break\n default:\n throw new Error('Invariant: unexpected marker')\n }\n\n return { interceptingRoute, interceptedRoute }\n}\n","import type {\n ActionFlightResponse,\n ActionResult,\n} from '../../../../server/app-render/types'\nimport { callServer } from '../../../app-call-server'\nimport { findSourceMapURL } from '../../../app-find-source-map-url'\nimport {\n ACTION_HEADER,\n NEXT_IS_PRERENDER_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n RSC_CONTENT_TYPE_HEADER,\n} from '../../app-router-headers'\n\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromFetch } from 'react-server-dom-webpack/client'\n// // eslint-disable-next-line import/no-extraneous-dependencies\n// import { encodeReply } from 'react-server-dom-webpack/client'\nconst { createFromFetch, createTemporaryReferenceSet, encodeReply } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport {\n PrefetchKind,\n type ReadonlyReducerState,\n type ReducerState,\n type ServerActionAction,\n type ServerActionMutable,\n} from '../router-reducer-types'\nimport { assignLocation } from '../../../assign-location'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { handleMutable } from '../handle-mutable'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../../flight-data-helpers'\nimport { getRedirectError } from '../../redirect'\nimport { RedirectType } from '../../redirect-error'\nimport { createSeededPrefetchCacheEntry } from '../prefetch-cache-utils'\nimport { removeBasePath } from '../../../remove-base-path'\nimport { hasBasePath } from '../../../has-base-path'\nimport {\n extractInfoFromServerReferenceId,\n omitUnusedArgs,\n} from '../../../../shared/lib/server-reference-info'\nimport { revalidateEntireCache } from '../../segment-cache'\n\ntype FetchServerActionResult = {\n redirectLocation: URL | undefined\n redirectType: RedirectType | undefined\n actionResult?: ActionResult\n actionFlightData?: NormalizedFlightData[] | string\n isPrerender: boolean\n revalidatedParts: {\n tag: boolean\n cookie: boolean\n paths: string[]\n }\n}\n\nasync function fetchServerAction(\n state: ReadonlyReducerState,\n nextUrl: ReadonlyReducerState['nextUrl'],\n { actionId, actionArgs }: ServerActionAction\n): Promise {\n const temporaryReferences = createTemporaryReferenceSet()\n const info = extractInfoFromServerReferenceId(actionId)\n\n // TODO: Currently, we're only omitting unused args for the experimental \"use\n // cache\" functions. Once the server reference info byte feature is stable, we\n // should apply this to server actions as well.\n const usedArgs =\n info.type === 'use-cache' ? omitUnusedArgs(actionArgs, info) : actionArgs\n\n const body = await encodeReply(usedArgs, { temporaryReferences })\n\n const res = await fetch('', {\n method: 'POST',\n headers: {\n Accept: RSC_CONTENT_TYPE_HEADER,\n [ACTION_HEADER]: actionId,\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(state.tree)\n ),\n ...(process.env.NEXT_DEPLOYMENT_ID\n ? {\n 'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID,\n }\n : {}),\n ...(nextUrl\n ? {\n [NEXT_URL]: nextUrl,\n }\n : {}),\n },\n body,\n })\n\n const redirectHeader = res.headers.get('x-action-redirect')\n const [location, _redirectType] = redirectHeader?.split(';') || []\n let redirectType: RedirectType | undefined\n switch (_redirectType) {\n case 'push':\n redirectType = RedirectType.push\n break\n case 'replace':\n redirectType = RedirectType.replace\n break\n default:\n redirectType = undefined\n }\n\n const isPrerender = !!res.headers.get(NEXT_IS_PRERENDER_HEADER)\n let revalidatedParts: FetchServerActionResult['revalidatedParts']\n try {\n const revalidatedHeader = JSON.parse(\n res.headers.get('x-action-revalidated') || '[[],0,0]'\n )\n revalidatedParts = {\n paths: revalidatedHeader[0] || [],\n tag: !!revalidatedHeader[1],\n cookie: revalidatedHeader[2],\n }\n } catch (e) {\n revalidatedParts = {\n paths: [],\n tag: false,\n cookie: false,\n }\n }\n\n const redirectLocation = location\n ? assignLocation(\n location,\n new URL(state.canonicalUrl, window.location.href)\n )\n : undefined\n\n const contentType = res.headers.get('content-type')\n\n if (contentType?.startsWith(RSC_CONTENT_TYPE_HEADER)) {\n const response: ActionFlightResponse = await createFromFetch(\n Promise.resolve(res),\n { callServer, findSourceMapURL, temporaryReferences }\n )\n\n if (location) {\n // if it was a redirection, then result is just a regular RSC payload\n return {\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n return {\n actionResult: response.a,\n actionFlightData: normalizeFlightData(response.f),\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n }\n\n // Handle invalid server action responses\n if (res.status >= 400) {\n // The server can respond with a text/plain error message, but we'll fallback to something generic\n // if there isn't one.\n const error =\n contentType === 'text/plain'\n ? await res.text()\n : 'An unexpected response was received from the server.'\n\n throw new Error(error)\n }\n\n return {\n redirectLocation,\n redirectType,\n revalidatedParts,\n isPrerender,\n }\n}\n\n/*\n * This reducer is responsible for calling the server action and processing any side-effects from the server action.\n * It does not mutate the state by itself but rather delegates to other reducers to do the actual mutation.\n */\nexport function serverActionReducer(\n state: ReadonlyReducerState,\n action: ServerActionAction\n): ReducerState {\n const { resolve, reject } = action\n const mutable: ServerActionMutable = {}\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n // only pass along the `nextUrl` param (used for interception routes) if the current route was intercepted.\n // If the route has been intercepted, the action should be as well.\n // Otherwise the server action might be intercepted with the wrong action id\n // (ie, one that corresponds with the intercepted route)\n const nextUrl =\n state.nextUrl && hasInterceptionRouteInCurrentTree(state.tree)\n ? state.nextUrl\n : null\n\n return fetchServerAction(state, nextUrl, action).then(\n async ({\n actionResult,\n actionFlightData: flightData,\n redirectLocation,\n redirectType,\n isPrerender,\n revalidatedParts,\n }) => {\n let redirectHref: string | undefined\n\n // honor the redirect type instead of defaulting to push in case of server actions.\n if (redirectLocation) {\n if (redirectType === RedirectType.replace) {\n state.pushRef.pendingPush = false\n mutable.pendingPush = false\n } else {\n state.pushRef.pendingPush = true\n mutable.pendingPush = true\n }\n\n redirectHref = createHrefFromUrl(redirectLocation, false)\n mutable.canonicalUrl = redirectHref\n }\n\n if (!flightData) {\n resolve(actionResult)\n\n // If there is a redirect but no flight data we need to do a mpaNavigation.\n if (redirectLocation) {\n return handleExternalUrl(\n state,\n mutable,\n redirectLocation.href,\n state.pushRef.pendingPush\n )\n }\n return state\n }\n\n if (typeof flightData === 'string') {\n // Handle case when navigating to page in `pages` from `app`\n resolve(actionResult)\n\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n const actionRevalidated =\n revalidatedParts.paths.length > 0 ||\n revalidatedParts.tag ||\n revalidatedParts.cookie\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('SERVER ACTION APPLY FAILED')\n resolve(actionResult)\n\n return state\n }\n\n // Given the path can only have two items the items are only the router state and rsc for the root.\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n redirectHref ? redirectHref : state.canonicalUrl\n )\n\n if (newTree === null) {\n resolve(actionResult)\n\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n resolve(actionResult)\n\n return handleExternalUrl(\n state,\n mutable,\n redirectHref || state.canonicalUrl,\n state.pushRef.pendingPush\n )\n }\n\n // The server sent back RSC data for the server action, so we need to apply it to the cache.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const cache: CacheNode = createEmptyCacheNode()\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = cacheNodeSeedData[3]\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as server actions have to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head,\n undefined\n )\n\n mutable.cache = cache\n if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n revalidateEntireCache(state.nextUrl, newTree)\n } else {\n mutable.prefetchCache = new Map()\n }\n if (actionRevalidated) {\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl: Boolean(nextUrl),\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n }\n }\n\n mutable.patchedTree = newTree\n currentTree = newTree\n }\n\n if (redirectLocation && redirectHref) {\n if (!process.env.__NEXT_CLIENT_SEGMENT_CACHE && !actionRevalidated) {\n // Because the RedirectBoundary will trigger a navigation, we need to seed the prefetch cache\n // with the FlightData that we got from the server action for the target page, so that it's\n // available when the page is navigated to and doesn't need to be re-fetched.\n // We only do this if the server action didn't revalidate any data, as in that case the\n // client cache will be cleared and the data will be re-fetched anyway.\n // NOTE: We don't do this in the Segment Cache implementation.\n // Dynamic data should never be placed into the cache, unless it's\n // \"converted\" to static data using . What we\n // do instead is re-prefetch links and forms whenever the cache is\n // invalidated.\n createSeededPrefetchCacheEntry({\n url: redirectLocation,\n data: {\n flightData,\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n // TODO: We should be able to set this if the server action\n // returned a fully static response.\n staleTime: -1,\n },\n tree: state.tree,\n prefetchCache: state.prefetchCache,\n nextUrl: state.nextUrl,\n kind: isPrerender ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n mutable.prefetchCache = state.prefetchCache\n }\n\n // If the action triggered a redirect, the action promise will be rejected with\n // a redirect so that it's handled by RedirectBoundary as we won't have a valid\n // action result to resolve the promise with. This will effectively reset the state of\n // the component that called the action as the error boundary will remount the tree.\n // The status code doesn't matter here as the action handler will have already sent\n // a response with the correct status code.\n reject(\n getRedirectError(\n hasBasePath(redirectHref)\n ? removeBasePath(redirectHref)\n : redirectHref,\n redirectType || RedirectType.push\n )\n )\n } else {\n resolve(actionResult)\n }\n\n return handleMutable(state, mutable)\n },\n (e: any) => {\n // When the server action is rejected we don't update the state and instead call the reject handler of the promise.\n reject(e)\n\n return state\n }\n )\n}\n","import {\n getDefaultHydrationErrorMessage,\n isHydrationError,\n testReactHydrationWarning,\n} from '../is-hydration-error'\nimport {\n hydrationErrorState,\n getReactHydrationDiffSegments,\n} from './hydration-error-info'\n\nexport function attachHydrationErrorState(error: Error) {\n let parsedHydrationErrorState: typeof hydrationErrorState = {}\n const isHydrationWarning = testReactHydrationWarning(error.message)\n const isHydrationRuntimeError = isHydrationError(error)\n\n // If it's not hydration warnings or errors, skip\n if (!(isHydrationRuntimeError || isHydrationWarning)) {\n return\n }\n\n const reactHydrationDiffSegments = getReactHydrationDiffSegments(\n error.message\n )\n // If the reactHydrationDiffSegments exists\n // and the diff (reactHydrationDiffSegments[1]) exists\n // e.g. the hydration diff log error.\n if (reactHydrationDiffSegments) {\n const diff = reactHydrationDiffSegments[1]\n parsedHydrationErrorState = {\n ...(error as any).details,\n ...hydrationErrorState,\n // If diff is present in error, we don't need to pick up the console logged warning.\n // - if hydration error has diff, and is not hydration diff log, then it's a normal hydration error.\n // - if hydration error no diff, then leverage the one from the hydration diff log.\n\n warning: (diff && !isHydrationWarning\n ? null\n : hydrationErrorState.warning) || [getDefaultHydrationErrorMessage()],\n // When it's hydration diff log, do not show notes section.\n // This condition is only for the 1st squashed error.\n notes: isHydrationWarning ? '' : reactHydrationDiffSegments[0],\n reactOutputComponentDiff: diff,\n }\n // Cache the `reactOutputComponentDiff` into hydrationErrorState.\n // This is only required for now when we still squashed the hydration diff log into hydration error.\n // Once the all error is logged to dev overlay in order, this will go away.\n if (!hydrationErrorState.reactOutputComponentDiff && diff) {\n hydrationErrorState.reactOutputComponentDiff = diff\n }\n // If it's hydration runtime error that doesn't contain the diff, combine the diff from the cached hydration diff.\n if (\n !diff &&\n isHydrationRuntimeError &&\n hydrationErrorState.reactOutputComponentDiff\n ) {\n parsedHydrationErrorState.reactOutputComponentDiff =\n hydrationErrorState.reactOutputComponentDiff\n }\n } else {\n // Normal runtime error, where it doesn't contain the hydration diff.\n\n // If there's any extra information in the error message to display,\n // append it to the error message details property\n if (hydrationErrorState.warning) {\n // The patched console.error found hydration errors logged by React\n // Append the logged warning to the error message\n parsedHydrationErrorState = {\n ...(error as any).details,\n // It contains the warning, component stack, server and client tag names\n ...hydrationErrorState,\n }\n }\n // Consume the cached hydration diff.\n // This is only required for now when we still squashed the hydration diff log into hydration error.\n // Once the all error is logged to dev overlay in order, this will go away.\n if (hydrationErrorState.reactOutputComponentDiff) {\n parsedHydrationErrorState.reactOutputComponentDiff =\n hydrationErrorState.reactOutputComponentDiff\n }\n }\n // If it's a hydration error, store the hydration error state into the error object\n ;(error as any).details = parsedHydrationErrorState\n}\n","import { startTransition, useCallback } from 'react'\nimport {\n ACTION_SERVER_ACTION,\n type ReducerActions,\n type ServerActionDispatcher,\n} from './components/router-reducer/router-reducer-types'\n\nlet globalServerActionDispatcher = null as ServerActionDispatcher | null\n\nexport function useServerActionDispatcher(\n dispatch: React.Dispatch\n) {\n const serverActionDispatcher: ServerActionDispatcher = useCallback(\n (actionPayload) => {\n startTransition(() => {\n dispatch({\n ...actionPayload,\n type: ACTION_SERVER_ACTION,\n })\n })\n },\n [dispatch]\n )\n globalServerActionDispatcher = serverActionDispatcher\n}\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n const actionDispatcher = globalServerActionDispatcher\n\n if (!actionDispatcher) {\n throw new Error('Invariant: missing action dispatcher.')\n }\n\n return new Promise((resolve, reject) => {\n actionDispatcher({\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n ChildSegmentMap,\n HeadData,\n ReadyCacheNode,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { FetchServerResponseResult } from './fetch-server-response'\nimport { isNavigatingToNewRootLayout } from './is-navigating-to-new-root-layout'\n\n// This is yet another tree type that is used to track pending promises that\n// need to be fulfilled once the dynamic data is received. The terminal nodes of\n// this tree represent the new Cache Node trees that were created during this\n// request. We can't use the Cache Node tree or Route State tree directly\n// because those include reused nodes, too. This tree is discarded as soon as\n// the navigation response is received.\ntype SPANavigationTask = {\n // The router state that corresponds to the tree that this Task represents.\n route: FlightRouterState\n // The CacheNode that corresponds to the tree that this Task represents. If\n // `children` is null (i.e. if this is a terminal task node), then `node`\n // represents a brand new Cache Node tree, which way or may not need to be\n // filled with dynamic data from the server.\n node: CacheNode | null\n // The tree sent to the server during the dynamic request. This is the\n // same as `route`, except with the `refetch` marker set on dynamic segments.\n // If all the segments are static, then this will be null, and no server\n // request is required.\n dynamicRequestTree: FlightRouterState | null\n children: Map | null\n}\n\n// A special type used to bail out and trigger a full-page navigation.\ntype MPANavigationTask = {\n // MPA tasks are distinguised from SPA tasks by having a null `route`.\n route: null\n node: null\n dynamicRequestTree: null\n children: null\n}\n\nconst MPA_NAVIGATION_TASK: MPANavigationTask = {\n route: null,\n node: null,\n dynamicRequestTree: null,\n children: null,\n}\n\nexport type Task = SPANavigationTask | MPANavigationTask\n\n// Creates a new Cache Node tree (i.e. copy-on-write) that represents the\n// optimistic result of a navigation, using both the current Cache Node tree and\n// data that was prefetched prior to navigation.\n//\n// At the moment we call this function, we haven't yet received the navigation\n// response from the server. It could send back something completely different\n// from the tree that was prefetched — due to rewrites, default routes, parallel\n// routes, etc.\n//\n// But in most cases, it will return the same tree that we prefetched, just with\n// the dynamic holes filled in. So we optimistically assume this will happen,\n// and accept that the real result could be arbitrarily different.\n//\n// We'll reuse anything that was already in the previous tree, since that's what\n// the server does.\n//\n// New segments (ones that don't appear in the old tree) are assigned an\n// unresolved promise. The data for these promises will be fulfilled later, when\n// the navigation response is received.\n//\n// The tree can be rendered immediately after it is created (that's why this is\n// a synchronous function). Any new trees that do not have prefetch data will\n// suspend during rendering, until the dynamic data streams in.\n//\n// Returns a Task object, which contains both the updated Cache Node and a path\n// to the pending subtrees that need to be resolved by the navigation response.\n//\n// A return value of `null` means there were no changes, and the previous tree\n// can be reused without initiating a server request.\nexport function startPPRNavigation(\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n isSamePageNavigation: boolean,\n scrollableSegmentsResult: Array\n): Task | null {\n const segmentPath: Array = []\n return updateCacheNodeOnNavigation(\n oldCacheNode,\n oldRouterState,\n newRouterState,\n false,\n prefetchData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n segmentPath,\n scrollableSegmentsResult\n )\n}\n\nfunction updateCacheNodeOnNavigation(\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n didFindRootLayout: boolean,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n isSamePageNavigation: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array\n): Task | null {\n // Diff the old and new trees to reuse the shared layouts.\n const oldRouterStateChildren = oldRouterState[1]\n const newRouterStateChildren = newRouterState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[2] : null\n\n if (!didFindRootLayout) {\n // We're currently traversing the part of the tree that was also part of\n // the previous route. If we discover a root layout, then we don't need to\n // trigger an MPA navigation. See beginRenderingNewRouteTree for context.\n const isRootLayout = newRouterState[4] === true\n if (isRootLayout) {\n // Found a matching root layout.\n didFindRootLayout = true\n }\n }\n\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n\n // Clone the current set of segment children, even if they aren't active in\n // the new tree.\n // TODO: We currently retain all the inactive segments indefinitely, until\n // there's an explicit refresh, or a parent layout is lazily refreshed. We\n // rely on this for popstate navigations, which update the Router State Tree\n // but do not eagerly perform a data fetch, because they expect the segment\n // data to already be in the Cache Node tree. For highly static sites that\n // are mostly read-only, this may happen only rarely, causing memory to\n // leak. We should figure out a better model for the lifetime of inactive\n // segments, so we can maintain instant back/forward navigations without\n // leaking memory indefinitely.\n const prefetchParallelRoutes = new Map(oldParallelRoutes)\n\n // As we diff the trees, we may sometimes modify (copy-on-write, not mutate)\n // the Route Tree that was returned by the server — for example, in the case\n // of default parallel routes, we preserve the currently active segment. To\n // avoid mutating the original tree, we clone the router state children along\n // the return path.\n let patchedRouterStateChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let taskChildren = null\n\n // Most navigations require a request to fetch additional data from the\n // server, either because the data was not already prefetched, or because the\n // target route contains dynamic data that cannot be prefetched.\n //\n // However, if the target route is fully static, and it's already completely\n // loaded into the segment cache, then we can skip the server request.\n //\n // This starts off as `false`, and is set to `true` if any of the child\n // routes requires a dynamic request.\n let needsDynamicRequest = false\n // As we traverse the children, we'll construct a FlightRouterState that can\n // be sent to the server to request the dynamic data. If it turns out that\n // nothing in the subtree is dynamic (i.e. needsDynamicRequest is false at the\n // end), then this will be discarded.\n // TODO: We can probably optimize the format of this data structure to only\n // include paths that are dynamic. Instead of reusing the\n // FlightRouterState type.\n let dynamicRequestTreeChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n\n for (let parallelRouteKey in newRouterStateChildren) {\n const newRouterStateChild: FlightRouterState =\n newRouterStateChildren[parallelRouteKey]\n const oldRouterStateChild: FlightRouterState | void =\n oldRouterStateChildren[parallelRouteKey]\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const newSegmentChild = newRouterStateChild[0]\n const newSegmentPathChild = segmentPath.concat([\n parallelRouteKey,\n newSegmentChild,\n ])\n const newSegmentKeyChild = createRouterCacheKey(newSegmentChild)\n\n const oldSegmentChild =\n oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined\n\n const oldCacheNodeChild =\n oldSegmentMapChild !== undefined\n ? oldSegmentMapChild.get(newSegmentKeyChild)\n : undefined\n\n let taskChild: Task | null\n if (newSegmentChild === DEFAULT_SEGMENT_KEY) {\n // This is another kind of leaf segment — a default route.\n //\n // Default routes have special behavior. When there's no matching segment\n // for a parallel route, Next.js preserves the currently active segment\n // during a client navigation — but not for initial render. The server\n // leaves it to the client to account for this. So we need to handle\n // it here.\n if (oldRouterStateChild !== undefined) {\n // Reuse the existing Router State for this segment. We spawn a \"task\"\n // just to keep track of the updated router state; unlike most, it's\n // already fulfilled and won't be affected by the dynamic response.\n taskChild = spawnReusedTask(oldRouterStateChild)\n } else {\n // There's no currently active segment. Switch to the \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n } else if (\n isSamePageNavigation &&\n // Check if this is a page segment.\n // TODO: We're not consistent about how we do this check. Some places\n // check if the segment starts with PAGE_SEGMENT_KEY, but most seem to\n // check if there any any children, which is why I'm doing it here. We\n // should probably encode an empty children set as `null` though. Either\n // way, we should update all the checks to be consistent.\n Object.keys(newRouterStateChild[1]).length === 0\n ) {\n // We special case navigations to the exact same URL as the current\n // location. It's a common UI pattern for apps to refresh when you click a\n // link to the current page. So when this happens, we refresh the dynamic\n // data in the page segments.\n //\n // Note that this does not apply if the any part of the hash or search\n // query has changed. This might feel a bit weird but it makes more sense\n // when you consider that the way to trigger this behavior is to click\n // the same link multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case\n // occurs, not just the page segments. Essentially treating it the same as\n // a refresh() triggered by an action, which is the more explicit way of\n // modeling the UI pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/\n // cached data. If the page segment is fully static and prefetched, the\n // request is skipped. (This is also how refresh() works.)\n taskChild = beginRenderingNewRouteTree(\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n } else if (\n oldRouterStateChild !== undefined &&\n oldSegmentChild !== undefined &&\n matchSegment(newSegmentChild, oldSegmentChild)\n ) {\n if (\n oldCacheNodeChild !== undefined &&\n oldRouterStateChild !== undefined\n ) {\n // This segment exists in both the old and new trees. Recursively update\n // the children.\n taskChild = updateCacheNodeOnNavigation(\n oldCacheNodeChild,\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n } else {\n // There's no existing Cache Node for this segment. Switch to the\n // \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n } else {\n // This is a new tree. Switch to the \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n\n if (taskChild !== null) {\n // Recursively propagate up the child tasks.\n\n if (taskChild.route === null) {\n // One of the child tasks discovered a change to the root layout.\n // Immediately unwind from this recursive traversal.\n return MPA_NAVIGATION_TASK\n }\n\n if (taskChildren === null) {\n taskChildren = new Map()\n }\n taskChildren.set(parallelRouteKey, taskChild)\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild)\n prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The child tree's route state may be different from the prefetched\n // route sent by the server. We need to clone it as we traverse back up\n // the tree.\n const taskChildRoute = taskChild.route\n patchedRouterStateChildren[parallelRouteKey] = taskChildRoute\n\n const dynamicRequestTreeChild = taskChild.dynamicRequestTree\n if (dynamicRequestTreeChild !== null) {\n // Something in the child tree is dynamic.\n needsDynamicRequest = true\n dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild\n } else {\n dynamicRequestTreeChildren[parallelRouteKey] = taskChildRoute\n }\n } else {\n // The child didn't change. We can use the prefetched router state.\n patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild\n dynamicRequestTreeChildren[parallelRouteKey] = newRouterStateChild\n }\n }\n\n if (taskChildren === null) {\n // No new tasks were spawned.\n return null\n }\n\n const newCacheNode: ReadyCacheNode = {\n lazyData: null,\n rsc: oldCacheNode.rsc,\n // We intentionally aren't updating the prefetchRsc field, since this node\n // is already part of the current tree, because it would be weird for\n // prefetch data to be newer than the final data. It probably won't ever be\n // observable anyway, but it could happen if the segment is unmounted then\n // mounted again, because LayoutRouter will momentarily switch to rendering\n // prefetchRsc, via useDeferredValue.\n prefetchRsc: oldCacheNode.prefetchRsc,\n head: oldCacheNode.head,\n prefetchHead: oldCacheNode.prefetchHead,\n loading: oldCacheNode.loading,\n\n // Everything is cloned except for the children, which we computed above.\n parallelRoutes: prefetchParallelRoutes,\n }\n\n return {\n // Return a cloned copy of the router state with updated children.\n route: patchRouterStateWithNewChildren(\n newRouterState,\n patchedRouterStateChildren\n ),\n node: newCacheNode,\n dynamicRequestTree: needsDynamicRequest\n ? patchRouterStateWithNewChildren(\n newRouterState,\n dynamicRequestTreeChildren\n )\n : null,\n children: taskChildren,\n }\n}\n\nfunction beginRenderingNewRouteTree(\n oldRouterState: FlightRouterState | void,\n newRouterState: FlightRouterState,\n didFindRootLayout: boolean,\n prefetchData: CacheNodeSeedData | null,\n possiblyPartialPrefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array\n): Task {\n if (!didFindRootLayout) {\n // The route tree changed before we reached a layout. (The highest-level\n // layout in a route tree is referred to as the \"root\" layout.) This could\n // mean that we're navigating between two different root layouts. When this\n // happens, we perform a full-page (MPA-style) navigation.\n //\n // However, the algorithm for deciding where to start rendering a route\n // (i.e. the one performed in order to reach this function) is stricter\n // than the one used to detect a change in the root layout. So just because\n // we're re-rendering a segment outside of the root layout does not mean we\n // should trigger a full-page navigation.\n //\n // Specifically, we handle dynamic parameters differently: two segments are\n // considered the same even if their parameter values are different.\n //\n // Refer to isNavigatingToNewRootLayout for details.\n //\n // Note that we only have to perform this extra traversal if we didn't\n // already discover a root layout in the part of the tree that is unchanged.\n // In the common case, this branch is skipped completely.\n if (\n oldRouterState === undefined ||\n isNavigatingToNewRootLayout(oldRouterState, newRouterState)\n ) {\n // The root layout changed. Perform a full-page navigation.\n return MPA_NAVIGATION_TASK\n }\n }\n return createCacheNodeOnNavigation(\n newRouterState,\n prefetchData,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n}\n\nfunction createCacheNodeOnNavigation(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n possiblyPartialPrefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array\n): SPANavigationTask {\n // Same traversal as updateCacheNodeNavigation, but we switch to this path\n // once we reach the part of the tree that was not in the previous route. We\n // don't need to diff against the old tree, we just need to create a new one.\n if (prefetchData === null) {\n // There's no prefetch for this segment. Everything from this point will be\n // requested from the server, even if there are static children below it.\n // Create a terminal task node that will later be fulfilled by\n // server response.\n return spawnPendingTask(\n routerState,\n null,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n }\n\n const routerStateChildren = routerState[1]\n const isPrefetchRscPartial = prefetchData[4]\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = Object.keys(routerStateChildren).length === 0\n\n // If prefetch data is available for a segment, and it's fully static (i.e.\n // does not contain any dynamic holes), we don't need to request it from\n // the server.\n if (\n // Check if the segment data is partial\n isPrefetchRscPartial ||\n // Check if the head is partial (only relevant if this is a leaf segment)\n (isPrefetchHeadPartial && isLeafSegment)\n ) {\n // We only have partial data from this segment. Like missing segments, we\n // must request the full data from the server.\n return spawnPendingTask(\n routerState,\n prefetchData,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n }\n\n // The prefetched segment is fully static, so we don't need to request a new\n // one from the server. Keep traversing down the tree until we reach something\n // that requires a dynamic request.\n const prefetchDataChildren = prefetchData[2]\n const taskChildren = new Map()\n const cacheNodeChildren = new Map()\n let dynamicRequestTreeChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let needsDynamicRequest = false\n if (isLeafSegment) {\n // The segment path of every leaf segment (i.e. page) is collected into\n // a result array. This is used by the LayoutRouter to scroll to ensure that\n // new pages are visible after a navigation.\n // TODO: We should use a string to represent the segment path instead of\n // an array. We already use a string representation for the path when\n // accessing the Segment Cache, so we can use the same one.\n scrollableSegmentsResult.push(segmentPath)\n } else {\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n const segmentChild = routerStateChild[0]\n const segmentPathChild = segmentPath.concat([\n parallelRouteKey,\n segmentChild,\n ])\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const taskChild = createCacheNodeOnNavigation(\n routerStateChild,\n prefetchDataChild,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPathChild,\n scrollableSegmentsResult\n )\n taskChildren.set(parallelRouteKey, taskChild)\n const dynamicRequestTreeChild = taskChild.dynamicRequestTree\n if (dynamicRequestTreeChild !== null) {\n // Something in the child tree is dynamic.\n needsDynamicRequest = true\n dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild\n } else {\n dynamicRequestTreeChildren[parallelRouteKey] = routerStateChild\n }\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n cacheNodeChildren.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n const rsc = prefetchData[1]\n const loading = prefetchData[3]\n return {\n // Since we're inside a new route tree, unlike the\n // `updateCacheNodeOnNavigation` path, the router state on the children\n // tasks is always the same as the router state we pass in. So we don't need\n // to clone/modify it.\n route: routerState,\n node: {\n lazyData: null,\n // Since this is a fully static segment, we don't need to use the\n // `prefetchRsc` field.\n rsc,\n prefetchRsc: null,\n head: isLeafSegment ? possiblyPartialPrefetchHead : null,\n prefetchHead: null,\n loading,\n parallelRoutes: cacheNodeChildren,\n },\n dynamicRequestTree: needsDynamicRequest\n ? patchRouterStateWithNewChildren(routerState, dynamicRequestTreeChildren)\n : null,\n children: taskChildren,\n }\n}\n\nfunction patchRouterStateWithNewChildren(\n baseRouterState: FlightRouterState,\n newChildren: { [parallelRouteKey: string]: FlightRouterState }\n): FlightRouterState {\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n\nfunction spawnPendingTask(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array\n): SPANavigationTask {\n // Create a task that will later be fulfilled by data from the server.\n\n // Clone the prefetched route tree and the `refetch` marker to it. We'll send\n // this to the server so it knows where to start rendering.\n const dynamicRequestTree = patchRouterStateWithNewChildren(\n routerState,\n routerState[1]\n )\n dynamicRequestTree[3] = 'refetch'\n\n const newTask: Task = {\n route: routerState,\n\n // Corresponds to the part of the route that will be rendered on the server.\n node: createPendingCacheNode(\n routerState,\n prefetchData,\n prefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n ),\n // Because this is non-null, and it gets propagated up through the parent\n // tasks, the root task will know that it needs to perform a server request.\n dynamicRequestTree,\n children: null,\n }\n return newTask\n}\n\nfunction spawnReusedTask(reusedRouterState: FlightRouterState): Task {\n // Create a task that reuses an existing segment, e.g. when reusing\n // the current active segment in place of a default route.\n return {\n route: reusedRouterState,\n node: null,\n dynamicRequestTree: null,\n children: null,\n }\n}\n\n// Writes a dynamic server response into the tree created by\n// updateCacheNodeOnNavigation. All pending promises that were spawned by the\n// navigation will be resolved, either with dynamic data from the server, or\n// `null` to indicate that the data is missing.\n//\n// A `null` value will trigger a lazy fetch during render, which will then patch\n// up the tree using the same mechanism as the non-PPR implementation\n// (serverPatchReducer).\n//\n// Usually, the server will respond with exactly the subset of data that we're\n// waiting for — everything below the nearest shared layout. But technically,\n// the server can return anything it wants.\n//\n// This does _not_ create a new tree; it modifies the existing one in place.\n// Which means it must follow the Suspense rules of cache safety.\nexport function listenForDynamicRequest(\n task: SPANavigationTask,\n responsePromise: Promise\n) {\n responsePromise.then(\n ({ flightData }: FetchServerResponseResult) => {\n if (typeof flightData === 'string') {\n // Happens when navigating to page in `pages` from `app`. We shouldn't\n // get here because should have already handled this during\n // the prefetch.\n return\n }\n for (const normalizedFlightData of flightData) {\n const {\n segmentPath,\n tree: serverRouterState,\n seedData: dynamicData,\n head: dynamicHead,\n } = normalizedFlightData\n\n if (!dynamicData) {\n // This shouldn't happen. PPR should always send back a response.\n // However, `FlightDataPath` is a shared type and the pre-PPR handling of\n // this might return null.\n continue\n }\n\n writeDynamicDataIntoPendingTask(\n task,\n segmentPath,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n }\n\n // Now that we've exhausted all the data we received from the server, if\n // there are any remaining pending tasks in the tree, abort them now.\n // If there's any missing data, it will trigger a lazy fetch.\n abortTask(task, null)\n },\n (error: any) => {\n // This will trigger an error during render\n abortTask(task, error)\n }\n )\n}\n\nfunction writeDynamicDataIntoPendingTask(\n rootTask: SPANavigationTask,\n segmentPath: FlightSegmentPath,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData\n) {\n // The data sent by the server represents only a subtree of the app. We need\n // to find the part of the task tree that matches the server response, and\n // fulfill it using the dynamic data.\n //\n // segmentPath represents the parent path of subtree. It's a repeating pattern\n // of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // Iterate through the path and finish any tasks that match this payload.\n let task = rootTask\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n const taskChildren = task.children\n if (taskChildren !== null) {\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (matchSegment(segment, taskSegment)) {\n // Found a match for this task. Keep traversing down the task tree.\n task = taskChild\n continue\n }\n }\n }\n // We didn't find a child task that matches the server data. Exit. We won't\n // abort the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n return\n }\n\n finishTaskUsingDynamicDataPayload(\n task,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n}\n\nfunction finishTaskUsingDynamicDataPayload(\n task: SPANavigationTask,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData\n) {\n if (task.dynamicRequestTree === null) {\n // Everything in this subtree is already complete. Bail out.\n return\n }\n\n // dynamicData may represent a larger subtree than the task. Before we can\n // finish the task, we need to line them up.\n const taskChildren = task.children\n const taskNode = task.node\n if (taskChildren === null) {\n // We've reached the leaf node of the pending task. The server data tree\n // lines up the pending Cache Node tree. We can now switch to the\n // normal algorithm.\n if (taskNode !== null) {\n finishPendingCacheNode(\n taskNode,\n task.route,\n serverRouterState,\n dynamicData,\n dynamicHead\n )\n // Set this to null to indicate that this task is now complete.\n task.dynamicRequestTree = null\n }\n return\n }\n // The server returned more data than we need to finish the task. Skip over\n // the extra segments until we reach the leaf task node.\n const serverChildren = serverRouterState[1]\n const dynamicDataChildren = dynamicData[2]\n\n for (const parallelRouteKey in serverRouterState) {\n const serverRouterStateChild: FlightRouterState =\n serverChildren[parallelRouteKey]\n const dynamicDataChild: CacheNodeSeedData | null | void =\n dynamicDataChildren[parallelRouteKey]\n\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (\n matchSegment(serverRouterStateChild[0], taskSegment) &&\n dynamicDataChild !== null &&\n dynamicDataChild !== undefined\n ) {\n // Found a match for this task. Keep traversing down the task tree.\n return finishTaskUsingDynamicDataPayload(\n taskChild,\n serverRouterStateChild,\n dynamicDataChild,\n dynamicHead\n )\n }\n }\n // We didn't find a child task that matches the server data. We won't abort\n // the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n }\n}\n\nfunction createPendingCacheNode(\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array\n): ReadyCacheNode {\n const routerStateChildren = routerState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[2] : null\n\n const parallelRoutes = new Map()\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | null | void =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const segmentChild = routerStateChild[0]\n const segmentPathChild = segmentPath.concat([\n parallelRouteKey,\n segmentChild,\n ])\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n\n const newCacheNodeChild = createPendingCacheNode(\n routerStateChild,\n prefetchDataChild === undefined ? null : prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial,\n segmentPathChild,\n scrollableSegmentsResult\n )\n\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n parallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = parallelRoutes.size === 0\n\n if (isLeafSegment) {\n // The segment path of every leaf segment (i.e. page) is collected into\n // a result array. This is used by the LayoutRouter to scroll to ensure that\n // new pages are visible after a navigation.\n // TODO: We should use a string to represent the segment path instead of\n // an array. We already use a string representation for the path when\n // accessing the Segment Cache, so we can use the same one.\n scrollableSegmentsResult.push(segmentPath)\n }\n\n const maybePrefetchRsc = prefetchData !== null ? prefetchData[1] : null\n const maybePrefetchLoading = prefetchData !== null ? prefetchData[3] : null\n return {\n lazyData: null,\n parallelRoutes: parallelRoutes,\n\n prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,\n prefetchHead: isLeafSegment ? prefetchHead : [null, null],\n\n // TODO: Technically, a loading boundary could contain dynamic data. We must\n // have separate `loading` and `prefetchLoading` fields to handle this, like\n // we do for the segment data and head.\n loading: maybePrefetchLoading !== undefined ? maybePrefetchLoading : null,\n\n // Create a deferred promise. This will be fulfilled once the dynamic\n // response is received from the server.\n rsc: createDeferredRsc() as React.ReactNode,\n head: isLeafSegment ? (createDeferredRsc() as React.ReactNode) : null,\n }\n}\n\nfunction finishPendingCacheNode(\n cacheNode: CacheNode,\n taskState: FlightRouterState,\n serverState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData\n): void {\n // Writes a dynamic response into an existing Cache Node tree. This does _not_\n // create a new tree, it updates the existing tree in-place. So it must follow\n // the Suspense rules of cache safety — it can resolve pending promises, but\n // it cannot overwrite existing data. It can add segments to the tree (because\n // a missing segment will cause the layout router to suspend).\n // but it cannot delete them.\n //\n // We must resolve every promise in the tree, or else it will suspend\n // indefinitely. If we did not receive data for a segment, we will resolve its\n // data promise to `null` to trigger a lazy fetch during render.\n const taskStateChildren = taskState[1]\n const serverStateChildren = serverState[1]\n const dataChildren = dynamicData[2]\n\n // The router state that we traverse the tree with (taskState) is the same one\n // that we used to construct the pending Cache Node tree. That way we're sure\n // to resolve all the pending promises.\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in taskStateChildren) {\n const taskStateChild: FlightRouterState =\n taskStateChildren[parallelRouteKey]\n const serverStateChild: FlightRouterState | void =\n serverStateChildren[parallelRouteKey]\n const dataChild: CacheNodeSeedData | null | void =\n dataChildren[parallelRouteKey]\n\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n const taskSegmentChild = taskStateChild[0]\n const taskSegmentKeyChild = createRouterCacheKey(taskSegmentChild)\n\n const cacheNodeChild =\n segmentMapChild !== undefined\n ? segmentMapChild.get(taskSegmentKeyChild)\n : undefined\n\n if (cacheNodeChild !== undefined) {\n if (\n serverStateChild !== undefined &&\n matchSegment(taskSegmentChild, serverStateChild[0])\n ) {\n if (dataChild !== undefined && dataChild !== null) {\n // This is the happy path. Recursively update all the children.\n finishPendingCacheNode(\n cacheNodeChild,\n taskStateChild,\n serverStateChild,\n dataChild,\n dynamicHead\n )\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render. This shouldn't happen because the Route Tree\n // and the Seed Data tree sent by the server should always be the same\n // shape when part of the same server response.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null)\n }\n } else {\n // The server response matches what was expected to receive, but there's\n // no matching Cache Node in the task tree. This is a bug in the\n // implementation because we should have created a node for every\n // segment in the tree that's associated with this task.\n }\n }\n\n // Use the dynamic data from the server to fulfill the deferred RSC promise\n // on the Cache Node.\n const rsc = cacheNode.rsc\n const dynamicSegmentData = dynamicData[1]\n if (rsc === null) {\n // This is a lazy cache node. We can overwrite it. This is only safe\n // because we know that the LayoutRouter suspends if `rsc` is `null`.\n cacheNode.rsc = dynamicSegmentData\n } else if (isDeferredRsc(rsc)) {\n // This is a deferred RSC promise. We can fulfill it with the data we just\n // received from the server. If it was already resolved by a different\n // navigation, then this does nothing because we can't overwrite data.\n rsc.resolve(dynamicSegmentData)\n } else {\n // This is not a deferred RSC promise, nor is it empty, so it must have\n // been populated by a different navigation. We must not overwrite it.\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved with the dynamic head from\n // the server.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(dynamicHead)\n }\n}\n\nexport function abortTask(task: SPANavigationTask, error: any): void {\n const cacheNode = task.node\n if (cacheNode === null) {\n // This indicates the task is already complete.\n return\n }\n\n const taskChildren = task.children\n if (taskChildren === null) {\n // Reached the leaf task node. This is the root of a pending cache\n // node tree.\n abortPendingCacheNode(task.route, cacheNode, error)\n } else {\n // This is an intermediate task node. Keep traversing until we reach a\n // task node with no children. That will be the root of the cache node tree\n // that needs to be resolved.\n for (const taskChild of taskChildren.values()) {\n abortTask(taskChild, error)\n }\n }\n\n // Set this to null to indicate that this task is now complete.\n task.dynamicRequestTree = null\n}\n\nfunction abortPendingCacheNode(\n routerState: FlightRouterState,\n cacheNode: CacheNode,\n error: any\n): void {\n // For every pending segment in the tree, resolve its `rsc` promise to `null`\n // to trigger a lazy fetch during render.\n //\n // Or, if an error object is provided, it will error instead.\n const routerStateChildren = routerState[1]\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n if (segmentMapChild === undefined) {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n continue\n }\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const cacheNodeChild = segmentMapChild.get(segmentKeyChild)\n if (cacheNodeChild !== undefined) {\n abortPendingCacheNode(routerStateChild, cacheNodeChild, error)\n } else {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n }\n }\n const rsc = cacheNode.rsc\n if (isDeferredRsc(rsc)) {\n if (error === null) {\n // This will trigger a lazy fetch during render.\n rsc.resolve(null)\n } else {\n // This will trigger an error during rendering.\n rsc.reject(error)\n }\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved. If an error was provided, we\n // will not resolve it with an error, since this is rendered at the root of\n // the app. We want the segment to error, not the entire app.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(null)\n }\n}\n\nexport function updateCacheNodeOnPopstateRestoration(\n oldCacheNode: CacheNode,\n routerState: FlightRouterState\n): ReadyCacheNode {\n // A popstate navigation reads data from the local cache. It does not issue\n // new network requests (unless the cache entries have been evicted). So, we\n // update the cache to drop the prefetch data for any segment whose dynamic\n // data was already received. This prevents an unnecessary flash back to PPR\n // state during a back/forward navigation.\n //\n // This function clones the entire cache node tree and sets the `prefetchRsc`\n // field to `null` to prevent it from being rendered. We can't mutate the node\n // in place because this is a concurrent data structure.\n\n const routerStateChildren = routerState[1]\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n const newParallelRoutes = new Map(oldParallelRoutes)\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n if (oldSegmentMapChild !== undefined) {\n const oldCacheNodeChild = oldSegmentMapChild.get(segmentKeyChild)\n if (oldCacheNodeChild !== undefined) {\n const newCacheNodeChild = updateCacheNodeOnPopstateRestoration(\n oldCacheNodeChild,\n routerStateChild\n )\n const newSegmentMapChild = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n newParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n // Only show prefetched data if the dynamic data is still pending.\n //\n // Tehnically, what we're actually checking is whether the dynamic network\n // response was received. But since it's a streaming response, this does not\n // mean that all the dynamic data has fully streamed in. It just means that\n // _some_ of the dynamic data was received. But as a heuristic, we assume that\n // the rest dynamic data will stream in quickly, so it's still better to skip\n // the prefetch state.\n const rsc = oldCacheNode.rsc\n const shouldUsePrefetch = isDeferredRsc(rsc) && rsc.status === 'pending'\n\n return {\n lazyData: null,\n rsc,\n head: oldCacheNode.head,\n\n prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : [null, null],\n prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,\n loading: oldCacheNode.loading,\n\n // These are the cloned children we computed above\n parallelRoutes: newParallelRoutes,\n }\n}\n\nconst DEFERRED = Symbol()\n\ntype PendingDeferredRsc = Promise & {\n status: 'pending'\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype FulfilledDeferredRsc = Promise & {\n status: 'fulfilled'\n value: React.ReactNode\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype RejectedDeferredRsc = Promise & {\n status: 'rejected'\n reason: any\n resolve: (value: React.ReactNode) => void\n reject: (error: any) => void\n tag: Symbol\n}\n\ntype DeferredRsc =\n | PendingDeferredRsc\n | FulfilledDeferredRsc\n | RejectedDeferredRsc\n\n// This type exists to distinguish a DeferredRsc from a Flight promise. It's a\n// compromise to avoid adding an extra field on every Cache Node, which would be\n// awkward because the pre-PPR parts of codebase would need to account for it,\n// too. We can remove it once type Cache Node type is more settled.\nfunction isDeferredRsc(value: any): value is DeferredRsc {\n return value && value.tag === DEFERRED\n}\n\nfunction createDeferredRsc(): PendingDeferredRsc {\n let resolve: any\n let reject: any\n const pendingRsc = new Promise((res, rej) => {\n resolve = res\n reject = rej\n }) as PendingDeferredRsc\n pendingRsc.status = 'pending'\n pendingRsc.resolve = (value: React.ReactNode) => {\n if (pendingRsc.status === 'pending') {\n const fulfilledRsc: FulfilledDeferredRsc = pendingRsc as any\n fulfilledRsc.status = 'fulfilled'\n fulfilledRsc.value = value\n resolve(value)\n }\n }\n pendingRsc.reject = (error: any) => {\n if (pendingRsc.status === 'pending') {\n const rejectedRsc: RejectedDeferredRsc = pendingRsc as any\n rejectedRsc.status = 'rejected'\n rejectedRsc.reason = error\n reject(error)\n }\n }\n pendingRsc.tag = DEFERRED\n return pendingRsc\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n Mutable,\n ReadonlyReducerState,\n ReducerState,\n RefreshAction,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\nimport { refreshInactiveParallelSegments } from '../refetch-inactive-parallel-segments'\nimport { revalidateEntireCache } from '../../segment-cache'\n\nexport function refreshReducer(\n state: ReadonlyReducerState,\n action: RefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n let currentTree = state.tree\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [\n currentTree[0],\n currentTree[1],\n currentTree[2],\n 'refetch',\n ],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n })\n\n return cache.lazyData.then(\n async ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n for (const normalizedFlightData of flightData) {\n const {\n tree: treePatch,\n seedData: cacheNodeSeedData,\n head,\n isRootRender,\n } = normalizedFlightData\n\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (cacheNodeSeedData !== null) {\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n cache.rsc = rsc\n cache.prefetchRsc = null\n cache.loading = loading\n fillLazyItemsTillLeafWithHead(\n cache,\n // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.\n undefined,\n treePatch,\n cacheNodeSeedData,\n head,\n undefined\n )\n if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n revalidateEntireCache(state.nextUrl, newTree)\n } else {\n mutable.prefetchCache = new Map()\n }\n }\n\n await refreshInactiveParallelSegments({\n state,\n updatedTree: newTree,\n updatedCache: cache,\n includeNextUrl,\n canonicalUrl: mutable.canonicalUrl || state.canonicalUrl,\n })\n\n mutable.cache = cache\n mutable.patchedTree = newTree\n\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n","'use client'\n\nimport React, {\n use,\n useEffect,\n useMemo,\n useCallback,\n startTransition,\n useInsertionEffect,\n useDeferredValue,\n} from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n CacheNode,\n AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n ACTION_HMR_REFRESH,\n ACTION_NAVIGATE,\n ACTION_PREFETCH,\n ACTION_REFRESH,\n ACTION_RESTORE,\n ACTION_SERVER_PATCH,\n PrefetchKind,\n} from './router-reducer/router-reducer-types'\nimport type {\n AppRouterState,\n ReducerActions,\n RouterChangeByServerResponse,\n RouterNavigate,\n} from './router-reducer/router-reducer-types'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { useReducer, useUnwrapState } from './use-reducer'\nimport {\n default as DefaultGlobalError,\n ErrorBoundary,\n type GlobalErrorComponent,\n} from './error-boundary'\nimport { isBot } from '../../shared/lib/router/utils/is-bot'\nimport { addBasePath } from '../add-base-path'\nimport { AppRouterAnnouncer } from './app-router-announcer'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { findHeadInCache } from './router-reducer/reducers/find-head-in-cache'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { removeBasePath } from '../remove-base-path'\nimport { hasBasePath } from '../has-base-path'\nimport { getSelectedParams } from './router-reducer/compute-changed-path'\nimport type { FlightRouterState } from '../../server/app-render/types'\nimport { useNavFailureHandler } from './nav-failure-handler'\nimport { useServerActionDispatcher } from '../app-call-server'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport { prefetch as prefetchWithSegmentCache } from './segment-cache'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { isRedirectError, RedirectType } from './redirect-error'\nimport { prefetchReducer } from './router-reducer/reducers/prefetch-reducer'\nimport { pingVisibleLinks } from './links'\n\nconst globalMutable: {\n pendingMpaPath?: string\n} = {}\n\nfunction isExternalURL(url: URL) {\n return url.origin !== window.location.origin\n}\n\n/**\n * Given a link href, constructs the URL that should be prefetched. Returns null\n * in cases where prefetching should be disabled, like external URLs, or\n * during development.\n * @param href The href passed to , router.prefetch(), or similar\n * @returns A URL object to prefetch, or null if prefetching should be disabled\n */\nexport function createPrefetchURL(href: string): URL | null {\n // Don't prefetch for bots as they don't navigate.\n if (isBot(window.navigator.userAgent)) {\n return null\n }\n\n let url: URL\n try {\n url = new URL(addBasePath(href), window.location.href)\n } catch (_) {\n // TODO: Does this need to throw or can we just console.error instead? Does\n // anyone rely on this throwing? (Seems unlikely.)\n throw new Error(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n }\n\n // Don't prefetch during development (improves compilation performance)\n if (process.env.NODE_ENV === 'development') {\n return null\n }\n\n // External urls can't be prefetched in the same way.\n if (isExternalURL(url)) {\n return null\n }\n\n return url\n}\n\nfunction HistoryUpdater({\n appRouterState,\n}: {\n appRouterState: AppRouterState\n}) {\n useInsertionEffect(() => {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // clear pending URL as navigation is no longer\n // in flight\n window.next.__pendingUrl = undefined\n }\n\n const { tree, pushRef, canonicalUrl } = appRouterState\n const historyState = {\n ...(pushRef.preserveCustomHistoryState ? window.history.state : {}),\n // Identifier is shortened intentionally.\n // __NA is used to identify if the history entry can be handled by the app-router.\n // __N is used to identify if the history entry can be handled by the old router.\n __NA: true,\n __PRIVATE_NEXTJS_INTERNALS_TREE: tree,\n }\n if (\n pushRef.pendingPush &&\n // Skip pushing an additional history entry if the canonicalUrl is the same as the current url.\n // This mirrors the browser behavior for normal navigation.\n createHrefFromUrl(new URL(window.location.href)) !== canonicalUrl\n ) {\n // This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.\n pushRef.pendingPush = false\n window.history.pushState(historyState, '', canonicalUrl)\n } else {\n window.history.replaceState(historyState, '', canonicalUrl)\n }\n }, [appRouterState])\n\n useEffect(() => {\n // The Next-Url and the base tree may affect the result of a prefetch\n // task. Re-prefetch all visible links with the updated values. In most\n // cases, this will not result in any new network requests, only if\n // the prefetch result actually varies on one of these inputs.\n if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n pingVisibleLinks(appRouterState.nextUrl, appRouterState.tree)\n }\n }, [appRouterState.nextUrl, appRouterState.tree])\n\n return null\n}\n\nexport function createEmptyCacheNode(): CacheNode {\n return {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n}\n\n/**\n * Server response that only patches the cache and tree.\n */\nfunction useChangeByServerResponse(\n dispatch: React.Dispatch\n): RouterChangeByServerResponse {\n return useCallback(\n ({ previousTree, serverResponse }) => {\n startTransition(() => {\n dispatch({\n type: ACTION_SERVER_PATCH,\n previousTree,\n serverResponse,\n })\n })\n },\n [dispatch]\n )\n}\n\nfunction useNavigate(dispatch: React.Dispatch): RouterNavigate {\n return useCallback(\n (href, navigateType, shouldScroll) => {\n const url = new URL(addBasePath(href), location.href)\n\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n return dispatch({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n shouldScroll: shouldScroll ?? true,\n navigateType,\n allowAliasing: true,\n })\n },\n [dispatch]\n )\n}\n\nfunction copyNextJsInternalHistoryState(data: any) {\n if (data == null) data = {}\n const currentState = window.history.state\n const __NA = currentState?.__NA\n if (__NA) {\n data.__NA = __NA\n }\n const __PRIVATE_NEXTJS_INTERNALS_TREE =\n currentState?.__PRIVATE_NEXTJS_INTERNALS_TREE\n if (__PRIVATE_NEXTJS_INTERNALS_TREE) {\n data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE\n }\n\n return data\n}\n\nfunction Head({\n headCacheNode,\n}: {\n headCacheNode: CacheNode | null\n}): React.ReactNode {\n // If this segment has a `prefetchHead`, it's the statically prefetched data.\n // We should use that on initial render instead of `head`. Then we'll switch\n // to `head` when the dynamic response streams in.\n const head = headCacheNode !== null ? headCacheNode.head : null\n const prefetchHead =\n headCacheNode !== null ? headCacheNode.prefetchHead : null\n\n // If no prefetch data is available, then we go straight to rendering `head`.\n const resolvedPrefetchRsc = prefetchHead !== null ? prefetchHead : head\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n return useDeferredValue(head, resolvedPrefetchRsc)\n}\n\n/**\n * The global router that wraps the application components.\n */\nfunction Router({\n actionQueue,\n assetPrefix,\n globalError,\n}: {\n actionQueue: AppRouterActionQueue\n assetPrefix: string\n globalError: [GlobalErrorComponent, React.ReactNode]\n}) {\n const [state, dispatch] = useReducer(actionQueue)\n const { canonicalUrl } = useUnwrapState(state)\n // Add memoized pathname/query for useSearchParams and usePathname.\n const { searchParams, pathname } = useMemo(() => {\n const url = new URL(\n canonicalUrl,\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n\n return {\n // This is turned into a readonly class in `useSearchParams`\n searchParams: url.searchParams,\n pathname: hasBasePath(url.pathname)\n ? removeBasePath(url.pathname)\n : url.pathname,\n }\n }, [canonicalUrl])\n\n const changeByServerResponse = useChangeByServerResponse(dispatch)\n const navigate = useNavigate(dispatch)\n useServerActionDispatcher(dispatch)\n\n /**\n * The app router that is exposed through `useRouter`. It's only concerned with dispatching actions to the reducer, does not hold state.\n */\n const appRouter = useMemo(() => {\n const routerInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch: process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href, options) =>\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n options?.kind === PrefetchKind.FULL\n )\n : (href, options) => {\n // Use the old prefetch implementation.\n const url = createPrefetchURL(href)\n if (url !== null) {\n // The prefetch reducer doesn't actually update any state or\n // trigger a rerender. It just writes to a mutable cache. So we\n // shouldn't bother calling setState/dispatch; we can just re-run\n // the reducer directly using the current state.\n // TODO: Refactor this away from a \"reducer\" so it's\n // less confusing.\n prefetchReducer(actionQueue.state, {\n type: ACTION_PREFETCH,\n url,\n kind: options?.kind ?? PrefetchKind.FULL,\n })\n }\n },\n replace: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'replace', options.scroll ?? true)\n })\n },\n push: (href, options = {}) => {\n startTransition(() => {\n navigate(href, 'push', options.scroll ?? true)\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatch({\n type: ACTION_REFRESH,\n origin: window.location.origin,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n startTransition(() => {\n dispatch({\n type: ACTION_HMR_REFRESH,\n origin: window.location.origin,\n })\n })\n }\n },\n }\n\n return routerInstance\n }, [actionQueue, dispatch, navigate])\n\n useEffect(() => {\n // Exists for debugging purposes. Don't use in application code.\n if (window.next) {\n window.next.router = appRouter\n }\n }, [appRouter])\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { cache, prefetchCache, tree } = useUnwrapState(state)\n\n // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n // Add `window.nd` for debugging purposes.\n // This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.\n // @ts-ignore this is for debugging\n window.nd = {\n router: appRouter,\n cache,\n prefetchCache,\n tree,\n }\n }, [appRouter, cache, prefetchCache, tree])\n }\n\n useEffect(() => {\n // If the app is restored from bfcache, it's possible that\n // pushRef.mpaNavigation is true, which would mean that any re-render of this component\n // would trigger the mpa navigation logic again from the lines below.\n // This will restore the router to the initial state in the event that the app is restored from bfcache.\n function handlePageShow(event: PageTransitionEvent) {\n if (\n !event.persisted ||\n !window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n ) {\n return\n }\n\n // Clear the pendingMpaPath value so that a subsequent MPA navigation to the same URL can be triggered.\n // This is necessary because if the browser restored from bfcache, the pendingMpaPath would still be set to the value\n // of the last MPA navigation.\n globalMutable.pendingMpaPath = undefined\n\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n }\n\n window.addEventListener('pageshow', handlePageShow)\n\n return () => {\n window.removeEventListener('pageshow', handlePageShow)\n }\n }, [dispatch])\n\n useEffect(() => {\n // Ensure that any redirect errors that bubble up outside of the RedirectBoundary\n // are caught and handled by the router.\n function handleUnhandledRedirect(\n event: ErrorEvent | PromiseRejectionEvent\n ) {\n const error = 'reason' in event ? event.reason : event.error\n if (isRedirectError(error)) {\n event.preventDefault()\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n if (redirectType === RedirectType.push) {\n appRouter.push(url, {})\n } else {\n appRouter.replace(url, {})\n }\n }\n }\n window.addEventListener('error', handleUnhandledRedirect)\n window.addEventListener('unhandledrejection', handleUnhandledRedirect)\n\n return () => {\n window.removeEventListener('error', handleUnhandledRedirect)\n window.removeEventListener('unhandledrejection', handleUnhandledRedirect)\n }\n }, [appRouter])\n\n // When mpaNavigation flag is set do a hard navigation to the new url.\n // Infinitely suspend because we don't actually want to rerender any child\n // components with the new URL and any entangled state updates shouldn't\n // commit either (eg: useTransition isPending should stay true until the page\n // unloads).\n //\n // This is a side effect in render. Don't try this at home, kids. It's\n // probably safe because we know this is a singleton component and it's never\n // in . At least I hope so. (It will run twice in dev strict mode,\n // but that's... fine?)\n const { pushRef } = useUnwrapState(state)\n if (pushRef.mpaNavigation) {\n // if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL\n if (globalMutable.pendingMpaPath !== canonicalUrl) {\n const location = window.location\n if (pushRef.pendingPush) {\n location.assign(canonicalUrl)\n } else {\n location.replace(canonicalUrl)\n }\n\n globalMutable.pendingMpaPath = canonicalUrl\n }\n // TODO-APP: Should we listen to navigateerror here to catch failed\n // navigations somehow? And should we call window.stop() if a SPA navigation\n // should interrupt an MPA one?\n use(unresolvedThenable)\n }\n\n useEffect(() => {\n const originalPushState = window.history.pushState.bind(window.history)\n const originalReplaceState = window.history.replaceState.bind(\n window.history\n )\n\n // Ensure the canonical URL in the Next.js Router is updated when the URL is changed so that `usePathname` and `useSearchParams` hold the pushed values.\n const applyUrlFromHistoryPushReplace = (\n url: string | URL | null | undefined\n ) => {\n const href = window.location.href\n const tree: FlightRouterState | undefined =\n window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(url ?? href, href),\n tree,\n })\n })\n }\n\n /**\n * Patch pushState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.pushState = function pushState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalPushState(data, _unused, url)\n }\n\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n\n return originalPushState(data, _unused, url)\n }\n\n /**\n * Patch replaceState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.replaceState = function replaceState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalReplaceState(data, _unused, url)\n }\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n return originalReplaceState(data, _unused, url)\n }\n\n /**\n * Handle popstate event, this is used to handle back/forward in the browser.\n * By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.\n * That case can happen when the old router injected the history entry.\n */\n const onPopState = (event: PopStateEvent) => {\n if (!event.state) {\n // TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.\n return\n }\n\n // This case happens when the history entry was pushed by the `pages` router.\n if (!event.state.__NA) {\n window.location.reload()\n return\n }\n\n // TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously\n // Without startTransition works if the cache is there for this path\n startTransition(() => {\n dispatch({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n tree: event.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n })\n }\n\n // Register popstate event to call onPopstate.\n window.addEventListener('popstate', onPopState)\n return () => {\n window.history.pushState = originalPushState\n window.history.replaceState = originalReplaceState\n window.removeEventListener('popstate', onPopState)\n }\n }, [dispatch])\n\n const { cache, tree, nextUrl, focusAndScrollRef } = useUnwrapState(state)\n\n const matchingHead = useMemo(() => {\n return findHeadInCache(cache, tree[1])\n }, [cache, tree])\n\n // Add memoized pathParams for useParams.\n const pathParams = useMemo(() => {\n return getSelectedParams(tree)\n }, [tree])\n\n const layoutRouterContext = useMemo(() => {\n return {\n parentTree: tree,\n parentCacheNode: cache,\n parentSegmentPath: null,\n // Root node always has `url`\n // Provided in AppTreeContext to ensure it can be overwritten in layout-router\n url: canonicalUrl,\n }\n }, [tree, cache, canonicalUrl])\n\n const globalLayoutRouterContext = useMemo(() => {\n return {\n changeByServerResponse,\n tree,\n focusAndScrollRef,\n nextUrl,\n }\n }, [changeByServerResponse, tree, focusAndScrollRef, nextUrl])\n\n let head\n if (matchingHead !== null) {\n // The head is wrapped in an extra component so we can use\n // `useDeferredValue` to swap between the prefetched and final versions of\n // the head. (This is what LayoutRouter does for segment data, too.)\n //\n // The `key` is used to remount the component whenever the head moves to\n // a different segment.\n const [headCacheNode, headKey] = matchingHead\n head = \n } else {\n head = null\n }\n\n let content = (\n \n {head}\n {cache.rsc}\n \n \n )\n\n if (process.env.NODE_ENV !== 'production') {\n // In development, we apply few error boundaries and hot-reloader:\n // - DevRootHTTPAccessFallbackBoundary: avoid using navigation API like notFound() in root layout\n // - HotReloader:\n // - hot-reload the app when the code changes\n // - render dev overlay\n // - catch runtime errors and display global-error when necessary\n if (typeof window !== 'undefined') {\n const { DevRootHTTPAccessFallbackBoundary } =\n require('./dev-root-http-access-fallback-boundary') as typeof import('./dev-root-http-access-fallback-boundary')\n content = (\n \n {content}\n \n )\n }\n const HotReloader: typeof import('./react-dev-overlay/app/hot-reloader-client').default =\n require('./react-dev-overlay/app/hot-reloader-client').default\n\n content = (\n \n {content}\n \n )\n } else {\n // In production, we only apply the user-customized global error boundary.\n content = (\n \n {content}\n \n )\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n {content}\n \n \n \n \n \n \n \n )\n}\n\nexport default function AppRouter({\n actionQueue,\n globalErrorComponentAndStyles: [globalErrorComponent, globalErrorStyles],\n assetPrefix,\n}: {\n actionQueue: AppRouterActionQueue\n globalErrorComponentAndStyles: [GlobalErrorComponent, React.ReactNode]\n assetPrefix: string\n}) {\n useNavFailureHandler()\n\n return (\n \n \n \n )\n}\n\nconst runtimeStyles = new Set()\nlet runtimeStyleChanged = new Set<() => void>()\n\nglobalThis._N_E_STYLE_LOAD = function (href: string) {\n let len = runtimeStyles.size\n runtimeStyles.add(href)\n if (runtimeStyles.size !== len) {\n runtimeStyleChanged.forEach((cb) => cb())\n }\n // TODO figure out how to get a promise here\n // But maybe it's not necessary as react would block rendering until it's loaded\n return Promise.resolve()\n}\n\nfunction RuntimeStyles() {\n const [, forceUpdate] = React.useState(0)\n const renderedStylesSize = runtimeStyles.size\n useEffect(() => {\n const changed = () => forceUpdate((c) => c + 1)\n runtimeStyleChanged.add(changed)\n if (renderedStylesSize !== runtimeStyles.size) {\n changed()\n }\n return () => {\n runtimeStyleChanged.delete(changed)\n }\n }, [renderedStylesSize, forceUpdate])\n\n const dplId = process.env.NEXT_DEPLOYMENT_ID\n ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n return [...runtimeStyles].map((href, i) => (\n \n ))\n}\n","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash'\nimport { isGroupSegment } from '../../segment'\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport function normalizeAppPath(route: string) {\n return ensureLeadingSlash(\n route.split('/').reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname\n }\n\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === 'page' || segment === 'route') &&\n index === segments.length - 1\n ) {\n return pathname\n }\n\n return `${pathname}/${segment}`\n }, '')\n )\n}\n\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */\nexport function normalizeRscURL(url: string) {\n return url.replace(\n /\\.rsc($|\\?)/,\n // $1 ensures `?` is preserved\n '$1'\n )\n}\n","import type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { getNextFlightSegmentPath } from '../../flight-data-helpers'\nimport { matchSegment } from '../match-segments'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\n\n/**\n * Deep merge of the two router states. Parallel route keys are preserved if the patch doesn't have them.\n */\nfunction applyPatch(\n initialTree: FlightRouterState,\n patchTree: FlightRouterState\n): FlightRouterState {\n const [initialSegment, initialParallelRoutes] = initialTree\n const [patchSegment, patchParallelRoutes] = patchTree\n\n // if the applied patch segment is __DEFAULT__ then it can be ignored in favor of the initial tree\n // this is because the __DEFAULT__ segment is used as a placeholder on navigation\n if (\n patchSegment === DEFAULT_SEGMENT_KEY &&\n initialSegment !== DEFAULT_SEGMENT_KEY\n ) {\n return initialTree\n }\n\n if (matchSegment(initialSegment, patchSegment)) {\n const newParallelRoutes: FlightRouterState[1] = {}\n for (const key in initialParallelRoutes) {\n const isInPatchTreeParallelRoutes =\n typeof patchParallelRoutes[key] !== 'undefined'\n if (isInPatchTreeParallelRoutes) {\n newParallelRoutes[key] = applyPatch(\n initialParallelRoutes[key],\n patchParallelRoutes[key]\n )\n } else {\n newParallelRoutes[key] = initialParallelRoutes[key]\n }\n }\n\n for (const key in patchParallelRoutes) {\n if (newParallelRoutes[key]) {\n continue\n }\n\n newParallelRoutes[key] = patchParallelRoutes[key]\n }\n\n const tree: FlightRouterState = [initialSegment, newParallelRoutes]\n\n // Copy over the existing tree\n if (initialTree[2]) {\n tree[2] = initialTree[2]\n }\n\n if (initialTree[3]) {\n tree[3] = initialTree[3]\n }\n\n if (initialTree[4]) {\n tree[4] = initialTree[4]\n }\n\n return tree\n }\n\n return patchTree\n}\n\n/**\n * Apply the router state from the Flight response, but skip patching default segments.\n * Useful for patching the router cache when navigating, where we persist the existing default segment if there isn't a new one.\n * Creates a new router state tree.\n */\nexport function applyRouterStatePatchToTree(\n flightSegmentPath: FlightSegmentPath,\n flightRouterState: FlightRouterState,\n treePatch: FlightRouterState,\n path: string\n): FlightRouterState | null {\n const [segment, parallelRoutes, url, refetch, isRootLayout] =\n flightRouterState\n\n // Root refresh\n if (flightSegmentPath.length === 1) {\n const tree: FlightRouterState = applyPatch(flightRouterState, treePatch)\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n }\n\n const [currentSegment, parallelRouteKey] = flightSegmentPath\n\n // Tree path returned from the server should always match up with the current tree in the browser\n if (!matchSegment(currentSegment, segment)) {\n return null\n }\n\n const lastSegment = flightSegmentPath.length === 2\n\n let parallelRoutePatch\n if (lastSegment) {\n parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch)\n } else {\n parallelRoutePatch = applyRouterStatePatchToTree(\n getNextFlightSegmentPath(flightSegmentPath),\n parallelRoutes[parallelRouteKey],\n treePatch,\n path\n )\n\n if (parallelRoutePatch === null) {\n return null\n }\n }\n\n const tree: FlightRouterState = [\n flightSegmentPath[0],\n {\n ...parallelRoutes,\n [parallelRouteKey]: parallelRoutePatch,\n },\n url,\n refetch,\n ]\n\n // Current segment is the root layout\n if (isRootLayout) {\n tree[4] = true\n }\n\n addRefreshMarkerToActiveParallelSegments(tree, path)\n\n return tree\n}\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.1.0-canary-029e8bd6-20250306\";\n","'use client'\nimport { hexHash } from '../../../shared/lib/hash'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n NEXT_RSC_UNION_QUERY,\n} from '../app-router-headers'\nimport type { RequestHeaders } from './fetch-server-response'\n\n/**\n * Mutates the provided URL by adding a cache-busting search parameter for CDNs that don't\n * support custom headers. This helps avoid caching conflicts by making each request unique.\n *\n * Rather than relying on the Vary header which some CDNs ignore, we append a search param\n * to create a unique URL that forces a fresh request.\n *\n * Example:\n * URL before: https://example.com/path?query=1\n * URL after: https://example.com/path?query=1&_rsc=abc123\n *\n * Note: This function mutates the input URL directly and does not return anything.\n *\n * TODO: Since we need to use a search param anyway, we could simplify by removing the custom\n * headers approach entirely and just use search params.\n */\nexport const setCacheBustingSearchParam = (\n url: URL,\n headers: RequestHeaders\n): void => {\n const uniqueCacheKey = hexHash(\n [\n headers[NEXT_ROUTER_PREFETCH_HEADER] || '0',\n headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] || '0',\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL],\n ].join(',')\n )\n\n /**\n * Note that we intentionally do not use `url.searchParams.set` here:\n *\n * const url = new URL('https://example.com/search?q=custom%20spacing');\n * url.searchParams.set('_rsc', 'abc123');\n * console.log(url.toString()); // Outputs: https://example.com/search?q=custom+spacing&_rsc=abc123\n * ^ <--- this is causing confusion\n * This is in fact intended based on https://url.spec.whatwg.org/#interface-urlsearchparams, but\n * we want to preserve the %20 as %20 if that's what the user passed in, hence the custom\n * logic below.\n */\n const existingSearch = url.search\n const rawQuery = existingSearch.startsWith('?')\n ? existingSearch.slice(1)\n : existingSearch\n const pairs = rawQuery.split('&').filter(Boolean)\n pairs.push(`${NEXT_RSC_UNION_QUERY}=${uniqueCacheKey}`)\n url.search = pairs.length ? `?${pairs.join('&')}` : ''\n}\n","'use client'\n\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n} from '../../../lib/metadata/metadata-constants'\n\n// We use a namespace object to allow us to recover the name of the function\n// at runtime even when production bundling/minification is used.\nconst NameSpace = {\n [METADATA_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [VIEWPORT_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n [OUTLET_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: React.ReactNode\n }) {\n return children\n },\n}\n\nexport const MetadataBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[METADATA_BOUNDARY_NAME.slice(0) as typeof METADATA_BOUNDARY_NAME]\n\nexport const ViewportBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[VIEWPORT_BOUNDARY_NAME.slice(0) as typeof VIEWPORT_BOUNDARY_NAME]\n\nexport const OutletBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[OUTLET_BOUNDARY_NAME.slice(0) as typeof OUTLET_BOUNDARY_NAME]\n","/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray,\n ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, self, source, owner, props) {\n self = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== self ? self : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(\n oldElement.type,\n newKey,\n void 0,\n void 0,\n void 0,\n oldElement.props\n );\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction noop$1() {}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop$1, noop$1)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n };\nfunction noop() {}\nexports.Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n};\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = void 0;\n if (null != config)\n for (propName in (void 0 !== config.ref && (owner = void 0),\n void 0 !== config.key && (key = \"\" + config.key),\n config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, void 0, void 0, owner, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, void 0, void 0, null, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n ReactSharedInternals.T = prevTransition;\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, createDeps, update) {\n var dispatcher = ReactSharedInternals.H;\n if (\"function\" === typeof update)\n throw Error(\n \"useEffect CRUD overload is not enabled in this build of React.\"\n );\n return dispatcher.useEffect(create, createDeps);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.1.0-canary-029e8bd6-20250306\";\n","import { RedirectStatusCode } from './redirect-status-code'\n\nexport const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport enum RedirectType {\n push = 'push',\n replace = 'replace',\n}\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `forbidden` docs\n/**\n * @experimental\n * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)\n * within a route segment as well as inject a tag.\n *\n * `forbidden()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`\n\nexport function forbidden(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`forbidden()\\` is experimental and only allowed to be enabled when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\n\nimport './components/globals/patch-console'\nimport './components/globals/handle-global-errors'\n\nimport ReactDOMClient from 'react-dom/client'\nimport React, { use } from 'react'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromReadableStream } from 'react-server-dom-webpack/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport {\n onCaughtError,\n onUncaughtError,\n} from './react-client-callbacks/error-boundary-callbacks'\nimport { callServer } from './app-call-server'\nimport { findSourceMapURL } from './app-find-source-map-url'\nimport {\n type AppRouterActionQueue,\n createMutableActionQueue,\n} from '../shared/lib/router/action-queue'\nimport AppRouter from './components/app-router'\nimport type { InitialRSCPayload } from '../server/app-render/types'\nimport { createInitialRouterState } from './components/router-reducer/create-initial-router-state'\nimport { MissingSlotContext } from '../shared/lib/app-router-context.shared-runtime'\nimport { setAppBuildId } from './app-build-id'\nimport { shouldRenderRootLevelErrorOverlay } from './lib/is-error-thrown-while-rendering-rsc'\n\n/// \n\nconst appElement: HTMLElement | Document = document\n\nconst encoder = new TextEncoder()\n\nlet initialServerDataBuffer: (string | Uint8Array)[] | undefined = undefined\nlet initialServerDataWriter: ReadableStreamDefaultController | undefined =\n undefined\nlet initialServerDataLoaded = false\nlet initialServerDataFlushed = false\n\nlet initialFormStateData: null | any = null\n\ntype FlightSegment =\n | [isBootStrap: 0]\n | [isNotBootstrap: 1, responsePartial: string]\n | [isFormState: 2, formState: any]\n | [isBinary: 3, responseBase64Partial: string]\n\ntype NextFlight = Omit, 'push'> & {\n push: (seg: FlightSegment) => void\n}\n\ndeclare global {\n // If you're working in a browser environment\n interface Window {\n __next_f: NextFlight\n }\n}\n\nfunction nextServerDataCallback(seg: FlightSegment): void {\n if (seg[0] === 0) {\n initialServerDataBuffer = []\n } else if (seg[0] === 1) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(encoder.encode(seg[1]))\n } else {\n initialServerDataBuffer.push(seg[1])\n }\n } else if (seg[0] === 2) {\n initialFormStateData = seg[1]\n } else if (seg[0] === 3) {\n if (!initialServerDataBuffer)\n throw new Error('Unexpected server data: missing bootstrap script.')\n\n // Decode the base64 string back to binary data.\n const binaryString = atob(seg[1])\n const decodedChunk = new Uint8Array(binaryString.length)\n for (var i = 0; i < binaryString.length; i++) {\n decodedChunk[i] = binaryString.charCodeAt(i)\n }\n\n if (initialServerDataWriter) {\n initialServerDataWriter.enqueue(decodedChunk)\n } else {\n initialServerDataBuffer.push(decodedChunk)\n }\n }\n}\n\nfunction isStreamErrorOrUnfinished(ctr: ReadableStreamDefaultController) {\n // If `desiredSize` is null, it means the stream is closed or errored. If it is lower than 0, the stream is still unfinished.\n return ctr.desiredSize === null || ctr.desiredSize < 0\n}\n\n// There might be race conditions between `nextServerDataRegisterWriter` and\n// `DOMContentLoaded`. The former will be called when React starts to hydrate\n// the root, the latter will be called when the DOM is fully loaded.\n// For streaming, the former is called first due to partial hydration.\n// For non-streaming, the latter can be called first.\n// Hence, we use two variables `initialServerDataLoaded` and\n// `initialServerDataFlushed` to make sure the writer will be closed and\n// `initialServerDataBuffer` will be cleared in the right time.\nfunction nextServerDataRegisterWriter(ctr: ReadableStreamDefaultController) {\n if (initialServerDataBuffer) {\n initialServerDataBuffer.forEach((val) => {\n ctr.enqueue(typeof val === 'string' ? encoder.encode(val) : val)\n })\n if (initialServerDataLoaded && !initialServerDataFlushed) {\n if (isStreamErrorOrUnfinished(ctr)) {\n ctr.error(\n new Error(\n 'The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.'\n )\n )\n } else {\n ctr.close()\n }\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n }\n\n initialServerDataWriter = ctr\n}\n\n// When `DOMContentLoaded`, we can close all pending writers to finish hydration.\nconst DOMContentLoaded = function () {\n if (initialServerDataWriter && !initialServerDataFlushed) {\n initialServerDataWriter.close()\n initialServerDataFlushed = true\n initialServerDataBuffer = undefined\n }\n initialServerDataLoaded = true\n}\n\n// It's possible that the DOM is already loaded.\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', DOMContentLoaded, false)\n} else {\n // Delayed in marco task to ensure it's executed later than hydration\n setTimeout(DOMContentLoaded)\n}\n\nconst nextServerDataLoadingGlobal = (self.__next_f = self.__next_f || [])\nnextServerDataLoadingGlobal.forEach(nextServerDataCallback)\nnextServerDataLoadingGlobal.push = nextServerDataCallback\n\nconst readable = new ReadableStream({\n start(controller) {\n nextServerDataRegisterWriter(controller)\n },\n})\n\nconst initialServerResponse = createFromReadableStream(\n readable,\n { callServer, findSourceMapURL }\n)\n\n// React overrides `.then` and doesn't return a new promise chain,\n// so we wrap the action queue in a promise to ensure that its value\n// is defined when the promise resolves.\n// https://github.com/facebook/react/blob/163365a07872337e04826c4f501565d43dbd2fd4/packages/react-client/src/ReactFlightClient.js#L189-L190\nconst pendingActionQueue: Promise = new Promise(\n (resolve, reject) => {\n initialServerResponse.then(\n (initialRSCPayload) => {\n // setAppBuildId should be called only once, during JS initialization\n // and before any components have hydrated.\n setAppBuildId(initialRSCPayload.b)\n\n resolve(\n createMutableActionQueue(\n createInitialRouterState({\n initialFlightData: initialRSCPayload.f,\n initialCanonicalUrlParts: initialRSCPayload.c,\n initialParallelRoutes: new Map(),\n location: window.location,\n couldBeIntercepted: initialRSCPayload.i,\n postponed: initialRSCPayload.s,\n prerendered: initialRSCPayload.S,\n })\n )\n )\n },\n (err: Error) => reject(err)\n )\n }\n)\n\nfunction ServerRoot(): React.ReactNode {\n const initialRSCPayload = use(initialServerResponse)\n const actionQueue = use(pendingActionQueue)\n\n const router = (\n \n )\n\n if (process.env.NODE_ENV === 'development' && initialRSCPayload.m) {\n // We provide missing slot information in a context provider only during development\n // as we log some additional information about the missing slots in the console.\n return (\n \n {router}\n \n )\n }\n\n return router\n}\n\nconst StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP\n ? React.StrictMode\n : React.Fragment\n\nfunction Root({ children }: React.PropsWithChildren<{}>) {\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n window.__NEXT_HYDRATED_CB?.()\n }, [])\n }\n\n return children\n}\n\nconst reactRootOptions: ReactDOMClient.RootOptions = {\n onRecoverableError,\n onCaughtError,\n onUncaughtError,\n}\n\nexport function hydrate() {\n const reactEl = (\n \n \n \n \n \n \n \n )\n\n if (\n document.documentElement.id === '__next_error__' ||\n !!window.__next_root_layout_missing_tags?.length\n ) {\n let element = reactEl\n // Server rendering failed, fall back to client-side rendering\n if (\n process.env.NODE_ENV !== 'production' &&\n shouldRenderRootLevelErrorOverlay()\n ) {\n const { createRootLevelDevOverlayElement } =\n require('./components/react-dev-overlay/app/client-entry') as typeof import('./components/react-dev-overlay/app/client-entry')\n\n // Note this won't cause hydration mismatch because we are doing CSR w/o hydration\n element = createRootLevelDevOverlayElement(element)\n }\n\n ReactDOMClient.createRoot(appElement, reactRootOptions).render(element)\n } else {\n React.startTransition(() => {\n ReactDOMClient.hydrateRoot(appElement, reactEl, {\n ...reactRootOptions,\n formState: initialFormStateData,\n })\n })\n }\n\n // TODO-APP: Remove this logic when Float has GC built-in in development.\n if (process.env.NODE_ENV !== 'production') {\n const { linkGc } =\n require('./app-link-gc') as typeof import('./app-link-gc')\n linkGc()\n }\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n RestoreAction,\n} from '../router-reducer-types'\nimport { extractPathFromFlightRouterState } from '../compute-changed-path'\nimport { updateCacheNodeOnPopstateRestoration } from '../ppr-navigations'\n\nexport function restoreReducer(\n state: ReadonlyReducerState,\n action: RestoreAction\n): ReducerState {\n const { url, tree } = action\n const href = createHrefFromUrl(url)\n // This action is used to restore the router state from the history state.\n // However, it's possible that the history state no longer contains the `FlightRouterState`.\n // We will copy over the internal state on pushState/replaceState events, but if a history entry\n // occurred before hydration, or if the user navigated to a hash using a regular anchor link,\n // the history state will not contain the `FlightRouterState`.\n // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.\n const treeToRestore = tree || state.tree\n\n const oldCache = state.cache\n const newCache = process.env.__NEXT_PPR\n ? // When PPR is enabled, we update the cache to drop the prefetch\n // data for any segment whose dynamic data was already received. This\n // prevents an unnecessary flash back to PPR state during a\n // back/forward navigation.\n updateCacheNodeOnPopstateRestoration(oldCache, treeToRestore)\n : oldCache\n\n return {\n // Set canonical url\n canonicalUrl: href,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache: newCache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: treeToRestore,\n nextUrl: extractPathFromFlightRouterState(treeToRestore) ?? url.pathname,\n }\n}\n","import { useEffect } from 'react'\nimport { attachHydrationErrorState } from './attach-hydration-error-state'\nimport { isNextRouterError } from '../is-next-router-error'\nimport { storeHydrationErrorStateFromConsoleArgs } from './hydration-error-info'\nimport { formatConsoleArgs, parseConsoleArgs } from '../../lib/console'\nimport isError from '../../../lib/is-error'\nimport { createUnhandledError } from './console-error'\nimport { enqueueConsecutiveDedupedError } from './enqueue-client-error'\nimport { getReactStitchedError } from '../errors/stitched-error'\n\nconst queueMicroTask =\n globalThis.queueMicrotask || ((cb: () => void) => Promise.resolve().then(cb))\n\nexport type ErrorHandler = (error: Error) => void\n\nconst errorQueue: Array = []\nconst errorHandlers: Array = []\nconst rejectionQueue: Array = []\nconst rejectionHandlers: Array = []\n\nexport function handleClientError(\n originError: unknown,\n consoleErrorArgs: any[],\n capturedFromConsole: boolean = false\n) {\n let error: Error\n if (!originError || !isError(originError)) {\n // If it's not an error, format the args into an error\n const formattedErrorMessage = formatConsoleArgs(consoleErrorArgs)\n const { environmentName } = parseConsoleArgs(consoleErrorArgs)\n error = createUnhandledError(formattedErrorMessage, environmentName)\n } else {\n error = capturedFromConsole\n ? createUnhandledError(originError)\n : originError\n }\n error = getReactStitchedError(error)\n\n storeHydrationErrorStateFromConsoleArgs(...consoleErrorArgs)\n attachHydrationErrorState(error)\n\n enqueueConsecutiveDedupedError(errorQueue, error)\n for (const handler of errorHandlers) {\n // Delayed the error being passed to React Dev Overlay,\n // avoid the state being synchronously updated in the component.\n queueMicroTask(() => {\n handler(error)\n })\n }\n}\n\nexport function useErrorHandler(\n handleOnUnhandledError: ErrorHandler,\n handleOnUnhandledRejection: ErrorHandler\n) {\n useEffect(() => {\n // Handle queued errors.\n errorQueue.forEach(handleOnUnhandledError)\n rejectionQueue.forEach(handleOnUnhandledRejection)\n\n // Listen to new errors.\n errorHandlers.push(handleOnUnhandledError)\n rejectionHandlers.push(handleOnUnhandledRejection)\n\n return () => {\n // Remove listeners.\n errorHandlers.splice(errorHandlers.indexOf(handleOnUnhandledError), 1)\n rejectionHandlers.splice(\n rejectionHandlers.indexOf(handleOnUnhandledRejection),\n 1\n )\n\n // Reset error queues.\n errorQueue.splice(0, errorQueue.length)\n rejectionQueue.splice(0, rejectionQueue.length)\n }\n }, [handleOnUnhandledError, handleOnUnhandledRejection])\n}\n\nfunction onUnhandledError(event: WindowEventMap['error']): void | boolean {\n if (isNextRouterError(event.error)) {\n event.preventDefault()\n return false\n }\n // When there's an error property present, we log the error to error overlay.\n // Otherwise we don't do anything as it's not logging in the console either.\n if (event.error) {\n handleClientError(event.error, [])\n }\n}\n\nfunction onUnhandledRejection(ev: WindowEventMap['unhandledrejection']): void {\n const reason = ev?.reason\n if (isNextRouterError(reason)) {\n ev.preventDefault()\n return\n }\n\n let error = reason\n if (error && !isError(error)) {\n error = createUnhandledError(error + '')\n }\n\n rejectionQueue.push(error)\n for (const handler of rejectionHandlers) {\n handler(error)\n }\n}\n\nexport function handleGlobalErrors() {\n if (typeof window !== 'undefined') {\n try {\n // Increase the number of stack frames on the client\n Error.stackTraceLimit = 50\n } catch {}\n\n window.addEventListener('error', onUnhandledError)\n window.addEventListener('unhandledrejection', onUnhandledRejection)\n }\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */\nexport function removeTrailingSlash(route: string) {\n return route.replace(/\\/$/, '') || '/'\n}\n","\"trimStart\"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),\"trimEnd\"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),\"description\"in Symbol.prototype||Object.defineProperty(Symbol.prototype,\"description\",{configurable:!0,get:function(){var t=/\\((.*)\\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if(\"function\"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(n){return r.resolve(t()).then(function(){return n})},function(n){return r.resolve(t()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})}),Array.prototype.at||(Array.prototype.at=function(t){var r=Math.trunc(t)||0;if(r<0&&(r+=this.length),!(r<0||r>=this.length))return this[r]}),Object.hasOwn||(Object.hasOwn=function(t,r){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");return Object.prototype.hasOwnProperty.call(Object(t),r)}),\"canParse\"in URL||(URL.canParse=function(t,r){try{return!!new URL(t,r)}catch(t){return!1}});\n","import isError from '../../../lib/is-error'\nimport { isNextRouterError } from '../is-next-router-error'\nimport { handleClientError } from '../errors/use-error-handler'\nimport { parseConsoleArgs } from '../../lib/console'\n\nexport const originConsoleError = globalThis.console.error\n\n// Patch console.error to collect information about hydration errors\nexport function patchConsoleError() {\n // Ensure it's only patched once\n if (typeof window === 'undefined') {\n return\n }\n window.console.error = function error(...args: any[]) {\n let maybeError: unknown\n if (process.env.NODE_ENV !== 'production') {\n const { error: replayedError } = parseConsoleArgs(args)\n if (replayedError) {\n maybeError = replayedError\n } else if (isError(args[0])) {\n maybeError = args[0]\n } else {\n // See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78\n maybeError = args[1]\n }\n } else {\n maybeError = args[0]\n }\n\n if (!isNextRouterError(maybeError)) {\n if (process.env.NODE_ENV !== 'production') {\n handleClientError(\n // replayed errors have their own complex format string that should be used,\n // but if we pass the error directly, `handleClientError` will ignore it\n maybeError,\n args,\n true\n )\n }\n\n originConsoleError.apply(window.console, args)\n }\n }\n}\n","export const createRenderSearchParamsFromClient =\n process.env.NODE_ENV === 'development'\n ? (\n require('./search-params.browser.dev') as typeof import('./search-params.browser.dev')\n ).makeUntrackedExoticSearchParamsWithDevWarnings\n : (\n require('./search-params.browser.prod') as typeof import('./search-params.browser.prod')\n ).makeUntrackedExoticSearchParams\n","/**\n * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.\n * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.\n * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.\n *\n * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)\n */\nexport const unstable_rethrow =\n typeof window === 'undefined'\n ? (\n require('./unstable-rethrow.server') as typeof import('./unstable-rethrow.server')\n ).unstable_rethrow\n : (\n require('./unstable-rethrow.browser') as typeof import('./unstable-rethrow.browser')\n ).unstable_rethrow\n","import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { FlightRouterState } from '../../server/app-render/types'\n\nconst ANNOUNCER_TYPE = 'next-route-announcer'\nconst ANNOUNCER_ID = '__next-route-announcer__'\n\nfunction getAnnouncerNode() {\n const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0]\n if (existingAnnouncer?.shadowRoot?.childNodes[0]) {\n return existingAnnouncer.shadowRoot.childNodes[0] as HTMLElement\n } else {\n const container = document.createElement(ANNOUNCER_TYPE)\n container.style.cssText = 'position:absolute'\n const announcer = document.createElement('div')\n announcer.ariaLive = 'assertive'\n announcer.id = ANNOUNCER_ID\n announcer.role = 'alert'\n announcer.style.cssText =\n 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal'\n\n // Use shadow DOM here to avoid any potential CSS bleed\n const shadow = container.attachShadow({ mode: 'open' })\n shadow.appendChild(announcer)\n document.body.appendChild(container)\n return announcer\n }\n}\n\nexport function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {\n const [portalNode, setPortalNode] = useState(null)\n\n useEffect(() => {\n const announcer = getAnnouncerNode()\n setPortalNode(announcer)\n return () => {\n const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0]\n if (container?.isConnected) {\n document.body.removeChild(container)\n }\n }\n }, [])\n\n const [routeAnnouncement, setRouteAnnouncement] = useState('')\n const previousTitle = useRef(undefined)\n\n useEffect(() => {\n let currentTitle = ''\n if (document.title) {\n currentTitle = document.title\n } else {\n const pageHeader = document.querySelector('h1')\n if (pageHeader) {\n currentTitle = pageHeader.innerText || pageHeader.textContent || ''\n }\n }\n\n // Only announce the title change, but not for the first load because screen\n // readers do that automatically.\n if (\n previousTitle.current !== undefined &&\n previousTitle.current !== currentTitle\n ) {\n setRouteAnnouncement(currentTitle)\n }\n previousTitle.current = currentTitle\n }, [tree])\n\n return portalNode ? createPortal(routeAnnouncement, portalNode) : null\n}\n","import { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ServerPatchAction,\n ReducerState,\n ReadonlyReducerState,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { applyFlightData } from '../apply-flight-data'\nimport { handleMutable } from '../handle-mutable'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\n\nexport function serverPatchReducer(\n state: ReadonlyReducerState,\n action: ServerPatchAction\n): ReducerState {\n const {\n serverResponse: { flightData, canonicalUrl: canonicalUrlOverride },\n } = action\n\n const mutable: Mutable = {}\n\n mutable.preserveCustomHistoryState = false\n\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { segmentPath: flightSegmentPath, tree: treePatch } =\n normalizedFlightData\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n ['', ...flightSegmentPath],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n // `applyRouterStatePatchToTree` returns `null` when it determined that the server response is not applicable to the current tree.\n // In other words, the server responded with a tree that doesn't match what the client is currently rendering.\n // This can happen if the server patch action took longer to resolve than a subsequent navigation which would have changed the tree.\n // Previously this case triggered an MPA navigation but it should be safe to simply discard the server response rather than forcing\n // the entire page to reload.\n if (newTree === null) {\n return state\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n state.canonicalUrl,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n\n const cache: CacheNode = createEmptyCacheNode()\n applyFlightData(currentCache, cache, normalizedFlightData)\n\n mutable.patchedTree = newTree\n mutable.cache = cache\n\n currentCache = cache\n currentTree = newTree\n }\n\n return handleMutable(state, mutable)\n}\n","import type {\n FlightRouterState,\n Segment,\n} from '../../../server/app-render/types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n","// This file is only used in app router due to the specific error state handling.\n\nimport type { ErrorInfo } from 'react'\nimport { getReactStitchedError } from '../components/errors/stitched-error'\nimport { handleClientError } from '../components/errors/use-error-handler'\nimport { isNextRouterError } from '../components/is-next-router-error'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { reportGlobalError } from './report-global-error'\nimport { originConsoleError } from '../components/globals/intercept-console-error'\nimport {\n ErrorBoundaryHandler,\n GlobalError as DefaultErrorBoundary,\n} from '../components/error-boundary'\n\nexport function onCaughtError(\n err: unknown,\n errorInfo: ErrorInfo & { errorBoundary?: React.Component }\n) {\n const errorBoundaryComponent = errorInfo.errorBoundary?.constructor\n\n let isImplicitErrorBoundary\n\n if (process.env.NODE_ENV !== 'production') {\n const { AppDevOverlayErrorBoundary } =\n require('../components/react-dev-overlay/app/app-dev-overlay-error-boundary') as typeof import('../components/react-dev-overlay/app/app-dev-overlay-error-boundary')\n\n isImplicitErrorBoundary =\n errorBoundaryComponent === AppDevOverlayErrorBoundary\n }\n\n isImplicitErrorBoundary =\n isImplicitErrorBoundary ||\n (errorBoundaryComponent === ErrorBoundaryHandler &&\n (errorInfo.errorBoundary! as InstanceType)\n .props.errorComponent === DefaultErrorBoundary)\n\n if (isImplicitErrorBoundary) {\n // We don't consider errors caught unless they're caught by an explicit error\n // boundary. The built-in ones are considered implicit.\n // This mimics how the same app would behave without Next.js.\n return onUncaughtError(err, errorInfo)\n }\n\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const errorBoundaryName =\n // read react component displayName\n (errorBoundaryComponent as any)?.displayName ||\n errorBoundaryComponent?.name ||\n 'Unknown'\n\n const componentThatErroredFrame = errorInfo?.componentStack?.split('\\n')[1]\n\n // Match chrome or safari stack trace\n const matches =\n // regex to match the function name in the stack trace\n // example 1: at Page (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1)\n // example 2: Page@http://localhost:3000/_next/static/chunks/pages/index.js?ts=1631600000000:2:1\n componentThatErroredFrame?.match(/\\s+at (\\w+)\\s+|(\\w+)@/) ?? []\n const componentThatErroredName = matches[1] || matches[2] || 'Unknown'\n\n // Create error location with errored component and error boundary, to match the behavior of default React onCaughtError handler.\n const errorBoundaryMessage = `It was handled by the <${errorBoundaryName}> error boundary.`\n const componentErrorMessage = componentThatErroredName\n ? `The above error occurred in the <${componentThatErroredName}> component.`\n : `The above error occurred in one of your components.`\n\n const errorLocation = `${componentErrorMessage} ${errorBoundaryMessage}`\n\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // Log and report the error with location but without modifying the error stack\n originConsoleError('%o\\n\\n%s', err, errorLocation)\n\n handleClientError(stitchedError, [])\n } else {\n originConsoleError(err)\n }\n}\n\nexport function onUncaughtError(err: unknown, errorInfo: React.ErrorInfo) {\n // Skip certain custom errors which are not expected to be reported on client\n if (isBailoutToCSRError(err) || isNextRouterError(err)) return\n\n if (process.env.NODE_ENV !== 'production') {\n const stitchedError = getReactStitchedError(err)\n // TODO: change to passing down errorInfo later\n // In development mode, pass along the component stack to the error\n if (errorInfo.componentStack) {\n ;(stitchedError as any)._componentStack = errorInfo.componentStack\n }\n\n // TODO: Add an adendum to the overlay telling people about custom error boundaries.\n reportGlobalError(stitchedError)\n } else {\n reportGlobalError(err)\n }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_PREFETCH = 'prefetch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n previousTree,\n serverResponse,\n}: {\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport type RouterNavigate = (\n href: string,\n navigateType: 'push' | 'replace',\n shouldScroll: boolean\n) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n prefetchCache?: AppRouterState['prefetchCache']\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n origin: Location['origin']\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n origin: Location['origin']\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n allowAliasing: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n tree: FlightRouterState | undefined\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n * - Only triggered in layout-router.\n * - Creates a new cache and router state with the Flight data applied.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n serverResponse: FetchServerResponseResult\n previousTree: FlightRouterState\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n * - `temporary` - a temporary prefetch entry is added to the cache, this is used when prefetch={false} is used in next/link or when you push a route programmatically.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n TEMPORARY = 'temporary',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\nexport interface PrefetchAction {\n type: typeof ACTION_PREFETCH\n url: URL\n kind: PrefetchKind\n}\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\nexport type PrefetchCacheEntry = {\n treeAtTimeOfPrefetch: FlightRouterState\n data: Promise\n kind: PrefetchKind\n prefetchTime: number\n staleTime: number\n lastUsedTime: number | null\n key: string\n status: PrefetchCacheEntryStatus\n url: URL\n}\n\nexport enum PrefetchCacheEntryStatus {\n fresh = 'fresh',\n reusable = 'reusable',\n expired = 'expired',\n stale = 'stale',\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n * Prefetched data is stored separately in `prefetchCache`, that is applied during ACTION_NAVIGATE.\n */\n cache: CacheNode\n /**\n * Cache that holds prefetched Flight responses keyed by url.\n */\n prefetchCache: Map\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n}\n\nexport type ReadonlyReducerState = Readonly\nexport type ReducerState = Promise | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | PrefetchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */\nexport function parsePath(path: string) {\n const hashIndex = path.indexOf('#')\n const queryIndex = path.indexOf('?')\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex)\n\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery\n ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined)\n : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : '',\n }\n }\n\n return { pathname: path, query: '', hash: '' }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\nexport function applyFlightData(\n existingCache: CacheNode,\n cache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): boolean {\n // The one before last item is the router state tree patch\n const { tree: treePatch, seedData, head, isRootRender } = flightData\n\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (seedData === null) {\n return false\n }\n\n if (isRootRender) {\n const rsc = seedData[1]\n const loading = seedData[3]\n cache.loading = loading\n cache.rsc = rsc\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n cache.prefetchRsc = null\n fillLazyItemsTillLeafWithHead(\n cache,\n existingCache,\n treePatch,\n seedData,\n head,\n prefetchEntry\n )\n } else {\n // Copy rsc for the root node of the cache.\n cache.rsc = existingCache.rsc\n // This is a PPR-only field. Unlike the previous branch, since we're\n // just cloning the existing cache node, we might as well keep the\n // PPR value, if it exists.\n cache.prefetchRsc = existingCache.prefetchRsc\n cache.parallelRoutes = new Map(existingCache.parallelRoutes)\n cache.loading = existingCache.loading\n // Create a copy of the existing cache with the rsc applied.\n fillCacheWithNewSubTreeData(cache, existingCache, flightData, prefetchEntry)\n }\n\n return true\n}\n","import { use } from 'react'\nimport type { StreamingMetadataResolvedState } from './types'\n\nexport function BrowserResolvedMetadata({\n promise,\n}: {\n promise: Promise\n}) {\n const { metadata, error } = use(promise)\n // If there's metadata error on client, discard the browser metadata\n // and let metadata outlet deal with the error. This will avoid the duplication metadata.\n if (error) return null\n return metadata\n}\n","/**\n * Create a \"Thenable\" that does not resolve. This is used to suspend indefinitely when data is not available yet.\n */\nexport const unresolvedThenable = {\n then: () => {},\n} as PromiseLike\n","import type { FlightRouterState } from '../../../../server/app-render/types'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createRouterCacheKey } from '../create-router-cache-key'\n\nexport function findHeadInCache(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1]\n): [CacheNode, string] | null {\n return findHeadInCacheImpl(cache, parallelRoutes, '')\n}\n\nfunction findHeadInCacheImpl(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1],\n keyPrefix: string\n): [CacheNode, string] | null {\n const isLastItem = Object.keys(parallelRoutes).length === 0\n if (isLastItem) {\n // Returns the entire Cache Node of the segment whose head we will render.\n return [cache, keyPrefix]\n }\n\n // First try the 'children' parallel route if it exists\n // when starting from the \"root\", this corresponds with the main page component\n if (parallelRoutes.children) {\n const [segment, childParallelRoutes] = parallelRoutes.children\n const childSegmentMap = cache.parallelRoutes.get('children')\n if (childSegmentMap) {\n const cacheKey = createRouterCacheKey(segment)\n const cacheNode = childSegmentMap.get(cacheKey)\n if (cacheNode) {\n const item = findHeadInCacheImpl(\n cacheNode,\n childParallelRoutes,\n keyPrefix + '/' + cacheKey\n )\n if (item) return item\n }\n }\n }\n\n // if we didn't find metadata in the page slot, check the other parallel routes\n for (const key in parallelRoutes) {\n if (key === 'children') continue // already checked above\n\n const [segment, childParallelRoutes] = parallelRoutes[key]\n const childSegmentMap = cache.parallelRoutes.get(key)\n if (!childSegmentMap) {\n continue\n }\n\n const cacheKey = createRouterCacheKey(segment)\n\n const cacheNode = childSegmentMap.get(cacheKey)\n if (!cacheNode) {\n continue\n }\n\n const item = findHeadInCacheImpl(\n cacheNode,\n childParallelRoutes,\n keyPrefix + '/' + cacheKey\n )\n if (item) {\n return item\n }\n }\n\n return null\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { Segment } from '../../../server/app-render/types'\nimport { invalidateCacheByRouterState } from './invalidate-cache-by-router-state'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { PrefetchCacheEntry } from './router-reducer-types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\n\n/**\n * Common logic for filling cache with new sub tree data.\n */\nfunction fillCacheHelper(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry: PrefetchCacheEntry | undefined,\n fillLazyItems: boolean\n): void {\n const {\n segmentPath,\n seedData: cacheNodeSeedData,\n tree: treePatch,\n head,\n } = flightData\n let newCacheNode = newCache\n let existingCacheNode = existingCache\n\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n\n // segmentPath is a repeating tuple of parallelRouteKey and segment\n // we know we've hit the last entry we've reached our final pair\n const isLastEntry = i === segmentPath.length - 2\n const cacheKey = createRouterCacheKey(segment)\n\n const existingChildSegmentMap =\n existingCacheNode.parallelRoutes.get(parallelRouteKey)\n\n if (!existingChildSegmentMap) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n let childSegmentMap = newCacheNode.parallelRoutes.get(parallelRouteKey)\n if (!childSegmentMap || childSegmentMap === existingChildSegmentMap) {\n childSegmentMap = new Map(existingChildSegmentMap)\n newCacheNode.parallelRoutes.set(parallelRouteKey, childSegmentMap)\n }\n\n const existingChildCacheNode = existingChildSegmentMap.get(cacheKey)\n let childCacheNode = childSegmentMap.get(cacheKey)\n\n if (isLastEntry) {\n if (\n cacheNodeSeedData &&\n (!childCacheNode ||\n !childCacheNode.lazyData ||\n childCacheNode === existingChildCacheNode)\n ) {\n const incomingSegment = cacheNodeSeedData[0]\n const rsc = cacheNodeSeedData[1]\n const loading = cacheNodeSeedData[3]\n\n childCacheNode = {\n lazyData: null,\n // When `fillLazyItems` is false, we only want to fill the RSC data for the layout,\n // not the page segment.\n rsc:\n fillLazyItems || incomingSegment !== PAGE_SEGMENT_KEY ? rsc : null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes:\n fillLazyItems && existingChildCacheNode\n ? new Map(existingChildCacheNode.parallelRoutes)\n : new Map(),\n }\n\n if (existingChildCacheNode && fillLazyItems) {\n invalidateCacheByRouterState(\n childCacheNode,\n existingChildCacheNode,\n treePatch\n )\n }\n if (fillLazyItems) {\n fillLazyItemsTillLeafWithHead(\n childCacheNode,\n existingChildCacheNode,\n treePatch,\n cacheNodeSeedData,\n head,\n prefetchEntry\n )\n }\n\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n continue\n }\n\n if (!childCacheNode || !existingChildCacheNode) {\n // Bailout because the existing cache does not have the path to the leaf node\n // Will trigger lazy fetch in layout-router because of missing segment\n continue\n }\n\n if (childCacheNode === existingChildCacheNode) {\n childCacheNode = {\n lazyData: childCacheNode.lazyData,\n rsc: childCacheNode.rsc,\n prefetchRsc: childCacheNode.prefetchRsc,\n head: childCacheNode.head,\n prefetchHead: childCacheNode.prefetchHead,\n parallelRoutes: new Map(childCacheNode.parallelRoutes),\n loading: childCacheNode.loading,\n } as CacheNode\n childSegmentMap.set(cacheKey, childCacheNode)\n }\n\n // Move deeper into the cache nodes\n newCacheNode = childCacheNode\n existingCacheNode = existingChildCacheNode\n }\n}\n\n/**\n * Fill cache with rsc based on flightDataPath\n */\nexport function fillCacheWithNewSubTreeData(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, true)\n}\n\nexport function fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache: CacheNode,\n existingCache: CacheNode,\n flightData: NormalizedFlightData,\n prefetchEntry?: PrefetchCacheEntry\n): void {\n fillCacheHelper(newCache, existingCache, flightData, prefetchEntry, false)\n}\n","import { fetchServerResponse } from '../fetch-server-response'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree'\nimport { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'\nimport type {\n ReadonlyReducerState,\n ReducerState,\n HmrRefreshAction,\n Mutable,\n} from '../router-reducer-types'\nimport { handleExternalUrl } from './navigate-reducer'\nimport { handleMutable } from '../handle-mutable'\nimport { applyFlightData } from '../apply-flight-data'\nimport type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime'\nimport { createEmptyCacheNode } from '../../app-router'\nimport { handleSegmentMismatch } from '../handle-segment-mismatch'\nimport { hasInterceptionRouteInCurrentTree } from './has-interception-route-in-current-tree'\n\n// A version of refresh reducer that keeps the cache around instead of wiping all of it.\nfunction hmrRefreshReducerImpl(\n state: ReadonlyReducerState,\n action: HmrRefreshAction\n): ReducerState {\n const { origin } = action\n const mutable: Mutable = {}\n const href = state.canonicalUrl\n\n mutable.preserveCustomHistoryState = false\n\n const cache: CacheNode = createEmptyCacheNode()\n // If the current tree was intercepted, the nextUrl should be included in the request.\n // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.\n const includeNextUrl = hasInterceptionRouteInCurrentTree(state.tree)\n\n // TODO-APP: verify that `href` is not an external url.\n // Fetch data from the root of the tree.\n cache.lazyData = fetchServerResponse(new URL(href, origin), {\n flightRouterState: [state.tree[0], state.tree[1], state.tree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n isHmrRefresh: true,\n })\n\n return cache.lazyData.then(\n ({ flightData, canonicalUrl: canonicalUrlOverride }) => {\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return handleExternalUrl(\n state,\n mutable,\n flightData,\n state.pushRef.pendingPush\n )\n }\n\n // Remove cache.lazyData as it has been resolved at this point.\n cache.lazyData = null\n\n let currentTree = state.tree\n let currentCache = state.cache\n\n for (const normalizedFlightData of flightData) {\n const { tree: treePatch, isRootRender } = normalizedFlightData\n if (!isRootRender) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED')\n return state\n }\n\n const newTree = applyRouterStatePatchToTree(\n // TODO-APP: remove ''\n [''],\n currentTree,\n treePatch,\n state.canonicalUrl\n )\n\n if (newTree === null) {\n return handleSegmentMismatch(state, action, treePatch)\n }\n\n if (isNavigatingToNewRootLayout(currentTree, newTree)) {\n return handleExternalUrl(\n state,\n mutable,\n href,\n state.pushRef.pendingPush\n )\n }\n\n const canonicalUrlOverrideHref = canonicalUrlOverride\n ? createHrefFromUrl(canonicalUrlOverride)\n : undefined\n\n if (canonicalUrlOverride) {\n mutable.canonicalUrl = canonicalUrlOverrideHref\n }\n const applied = applyFlightData(\n currentCache,\n cache,\n normalizedFlightData\n )\n\n if (applied) {\n mutable.cache = cache\n currentCache = cache\n }\n\n mutable.patchedTree = newTree\n mutable.canonicalUrl = href\n\n currentTree = newTree\n }\n return handleMutable(state, mutable)\n },\n () => state\n )\n}\n\nfunction hmrRefreshReducerNoop(\n state: ReadonlyReducerState,\n _action: HmrRefreshAction\n): ReducerState {\n return state\n}\n\nexport const hmrRefreshReducer =\n process.env.NODE_ENV === 'production'\n ? hmrRefreshReducerNoop\n : hmrRefreshReducerImpl\n","'use client'\n\nimport { Suspense, use } from 'react'\nimport type { StreamingMetadataResolvedState } from './types'\n\nexport const AsyncMetadata =\n typeof window === 'undefined'\n ? (\n require('./server-inserted-metadata') as typeof import('./server-inserted-metadata')\n ).ServerInsertMetadata\n : (\n require('./browser-resolved-metadata') as typeof import('./browser-resolved-metadata')\n ).BrowserResolvedMetadata\n\nfunction MetadataOutlet({\n promise,\n}: {\n promise: Promise\n}) {\n const { error, digest } = use(promise)\n if (error) {\n if (digest) {\n // The error will lose its original digest after passing from server layer to client layer;\n // We recover the digest property here to override the React created one if original digest exists.\n ;(error as any).digest = digest\n }\n throw error\n }\n return null\n}\n\nexport function AsyncMetadataOutlet({\n promise,\n}: {\n promise: Promise\n}) {\n return (\n \n \n \n )\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.js');\n} else {\n module.exports = require('./cjs/react-server-dom-webpack-client.browser.development.js');\n}\n","import { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isNextRouterError } from './is-next-router-error'\n\nexport function unstable_rethrow(error: unknown): void {\n if (isNextRouterError(error) || isBailoutToCSRError(error)) {\n throw error\n }\n\n if (error instanceof Error && 'cause' in error) {\n unstable_rethrow(error.cause)\n }\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `unauthorized` docs\n/**\n * @experimental\n * This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)\n * within a route segment as well as inject a tag.\n *\n * `unauthorized()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n *\n * Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};401`\n\nexport function unauthorized(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`unauthorized()\\` is experimental and only allowed to be used when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n // eslint-disable-next-line no-throw-literal\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","import type { Segment } from '../../../../server/app-render/types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n","import type { Dispatch } from 'react'\nimport React, { use, useCallback } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport type { AppRouterActionQueue } from '../../shared/lib/router/action-queue'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\nimport { useSyncDevRenderIndicator } from './react-dev-overlay/utils/dev-indicator/use-sync-dev-render-indicator'\n\nexport function useUnwrapState(state: ReducerState): AppRouterState {\n // reducer actions can be async, so sometimes we need to suspend until the state is resolved\n if (isThenable(state)) {\n const result = use(state)\n return result\n }\n\n return state\n}\n\nexport function useReducer(\n actionQueue: AppRouterActionQueue\n): [ReducerState, Dispatch] {\n const [state, setState] = React.useState(actionQueue.state)\n const syncDevRenderIndicator = useSyncDevRenderIndicator()\n\n const dispatch = useCallback(\n (action: ReducerActions) => {\n syncDevRenderIndicator(() => {\n actionQueue.dispatch(action, setState)\n })\n },\n [actionQueue, syncDevRenderIndicator]\n )\n\n return [state, dispatch]\n}\n","/*\n This is a simple promise queue that allows you to limit the number of concurrent promises\n that are running at any given time. It's used to limit the number of concurrent\n prefetch requests that are being made to the server but could be used for other\n things as well.\n*/\nexport class PromiseQueue {\n #maxConcurrency: number\n #runningCount: number\n #queue: Array<{\n promiseFn: Promise\n task: () => void\n }>\n\n constructor(maxConcurrency = 5) {\n this.#maxConcurrency = maxConcurrency\n this.#runningCount = 0\n this.#queue = []\n }\n\n enqueue(promiseFn: () => Promise): Promise {\n let taskResolve: (value: T | PromiseLike) => void\n let taskReject: (reason?: any) => void\n\n const taskPromise = new Promise((resolve, reject) => {\n taskResolve = resolve\n taskReject = reject\n }) as Promise\n\n const task = async () => {\n try {\n this.#runningCount++\n const result = await promiseFn()\n taskResolve(result)\n } catch (error) {\n taskReject(error)\n } finally {\n this.#runningCount--\n this.#processNext()\n }\n }\n\n const enqueueResult = { promiseFn: taskPromise, task }\n // wonder if we should take a LIFO approach here\n this.#queue.push(enqueueResult)\n this.#processNext()\n\n return taskPromise\n }\n\n bump(promiseFn: Promise) {\n const index = this.#queue.findIndex((item) => item.promiseFn === promiseFn)\n\n if (index > -1) {\n const bumpedItem = this.#queue.splice(index, 1)[0]\n this.#queue.unshift(bumpedItem)\n this.#processNext(true)\n }\n }\n\n #processNext(forced = false) {\n if (\n (this.#runningCount < this.#maxConcurrency || forced) &&\n this.#queue.length > 0\n ) {\n this.#queue.shift()?.task()\n }\n }\n}\n","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */\nexport function addPathPrefix(path: string, prefix?: string) {\n if (!path.startsWith('/') || !prefix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${prefix}${pathname}${query}${hash}`\n}\n","import isError from '../../lib/is-error'\n\nfunction formatObject(arg: unknown, depth: number) {\n switch (typeof arg) {\n case 'object':\n if (arg === null) {\n return 'null'\n } else if (Array.isArray(arg)) {\n let result = '['\n if (depth < 1) {\n for (let i = 0; i < arg.length; i++) {\n if (result !== '[') {\n result += ','\n }\n if (Object.prototype.hasOwnProperty.call(arg, i)) {\n result += formatObject(arg[i], depth + 1)\n }\n }\n } else {\n result += arg.length > 0 ? '...' : ''\n }\n result += ']'\n return result\n } else if (arg instanceof Error) {\n return arg + ''\n } else {\n const keys = Object.keys(arg)\n let result = '{'\n if (depth < 1) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n const desc = Object.getOwnPropertyDescriptor(arg, 'key')\n if (desc && !desc.get && !desc.set) {\n const jsonKey = JSON.stringify(key)\n if (jsonKey !== '\"' + key + '\"') {\n result += jsonKey + ': '\n } else {\n result += key + ': '\n }\n result += formatObject(desc.value, depth + 1)\n }\n }\n } else {\n result += keys.length > 0 ? '...' : ''\n }\n result += '}'\n return result\n }\n case 'string':\n return JSON.stringify(arg)\n default:\n return String(arg)\n }\n}\n\nexport function formatConsoleArgs(args: unknown[]): string {\n let message: string\n let idx: number\n if (typeof args[0] === 'string') {\n message = args[0]\n idx = 1\n } else {\n message = ''\n idx = 0\n }\n let result = ''\n let startQuote = false\n for (let i = 0; i < message.length; ++i) {\n const char = message[i]\n if (char !== '%' || i === message.length - 1 || idx >= args.length) {\n result += char\n continue\n }\n\n const code = message[++i]\n switch (code) {\n case 'c': {\n // TODO: We should colorize with HTML instead of turning into a string.\n // Ignore for now.\n result = startQuote ? `${result}]` : `[${result}`\n startQuote = !startQuote\n idx++\n break\n }\n case 'O':\n case 'o': {\n result += formatObject(args[idx++], 0)\n break\n }\n case 'd':\n case 'i': {\n result += parseInt(args[idx++] as any, 10)\n break\n }\n case 'f': {\n result += parseFloat(args[idx++] as any)\n break\n }\n case 's': {\n result += String(args[idx++])\n break\n }\n default:\n result += '%' + code\n }\n }\n\n for (; idx < args.length; idx++) {\n result += (idx > 0 ? ' ' : '') + formatObject(args[idx], 0)\n }\n\n return result\n}\n\nexport function parseConsoleArgs(args: unknown[]): {\n environmentName: string | null\n error: Error | null\n} {\n // See\n // https://github.com/facebook/react/blob/65a56d0e99261481c721334a3ec4561d173594cd/packages/react-devtools-shared/src/backend/flight/renderer.js#L88-L93\n //\n // Logs replayed from the server look like this:\n // [\n // \"%c%s%c %o\\n\\n%s\\n\\n%s\\n\",\n // \"background: #e6e6e6; ...\",\n // \" Server \", // can also be e.g. \" Prerender \"\n // \"\",\n // Error,\n // \"The above error occurred in the component.\",\n // ...\n // ]\n if (\n args.length > 3 &&\n typeof args[0] === 'string' &&\n args[0].startsWith('%c%s%c ') &&\n typeof args[1] === 'string' &&\n typeof args[2] === 'string' &&\n typeof args[3] === 'string'\n ) {\n const environmentName = args[2]\n const maybeError = args[4]\n\n return {\n environmentName: environmentName.trim(),\n error: isError(maybeError) ? maybeError : null,\n }\n }\n\n return {\n environmentName: null,\n error: null,\n }\n}\n","// This gets assigned as a side-effect during app initialization. Because it\n// represents the build used to create the JS bundle, it should never change\n// after being set, so we store it in a global variable.\n//\n// When performing RSC requests, if the incoming data has a different build ID,\n// we perform an MPA navigation/refresh to load the updated build and ensure\n// that the client and server in sync.\n\n// Starts as an empty string. In practice, because setAppBuildId is called\n// during initialization before hydration starts, this will always get\n// reassigned to the actual build ID before it's ever needed by a navigation.\n// If for some reasons it didn't, due to a bug or race condition, then on\n// navigation the build comparision would fail and trigger an MPA navigation.\nlet globalBuildId: string = ''\n\nexport function setAppBuildId(buildId: string) {\n globalBuildId = buildId\n}\n\nexport function getAppBuildId(): string {\n return globalBuildId\n}\n","import type { Segment } from '../../../server/app-render/types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\nexport function createRouterCacheKey(\n segment: Segment,\n withoutSearchParameters: boolean = false\n) {\n // if the segment is an array, it means it's a dynamic segment\n // for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.\n if (Array.isArray(segment)) {\n return `${segment[0]}|${segment[1]}|${segment[2]}`\n }\n\n // Page segments might have search parameters, ie __PAGE__?foo=bar\n // When `withoutSearchParameters` is true, we only want to return the page segment\n if (withoutSearchParameters && segment.startsWith(PAGE_SEGMENT_KEY)) {\n return PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n","import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function addBasePath(path: string, required?: boolean): string {\n return normalizePathTrailingSlash(\n process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required\n ? path\n : addPathPrefix(path, basePath)\n )\n}\n","/**\n * Entry point to the Segment Cache implementation.\n *\n * All code related to the Segment Cache lives `segment-cache-impl` directory.\n * Callers access it through this indirection.\n *\n * This is to ensure the code is dead code eliminated from the bundle if the\n * flag is disabled.\n *\n * TODO: This is super tedious. Since experimental flags are an essential part\n * of our workflow, we should establish a better pattern for dead code\n * elimination. Ideally it would be done at the bundler level, like how React's\n * build process works. In the React repo, you don't even need to add any extra\n * configuration per experiment — if the code is not reachable, it gets stripped\n * from the build automatically by Rollup. Or, shorter term, we could stub out\n * experimental modules at build time by updating the build config, i.e. a more\n * automated version of what I'm doing manually in this file.\n */\n\nexport type { NavigationResult } from './segment-cache-impl/navigation'\nexport type { PrefetchTask } from './segment-cache-impl/scheduler'\n\nconst notEnabled: any = () => {\n throw new Error(\n 'Segment Cache experiment is not enabled. This is a bug in Next.js.'\n )\n}\n\nexport const prefetch: typeof import('./segment-cache-impl/prefetch').prefetch =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/prefetch').prefetch(...args)\n }\n : notEnabled\n\nexport const navigate: typeof import('./segment-cache-impl/navigation').navigate =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/navigation').navigate(...args)\n }\n : notEnabled\n\nexport const revalidateEntireCache: typeof import('./segment-cache-impl/cache').revalidateEntireCache =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/cache').revalidateEntireCache(\n ...args\n )\n }\n : notEnabled\n\nexport const getCurrentCacheVersion: typeof import('./segment-cache-impl/cache').getCurrentCacheVersion =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/cache').getCurrentCacheVersion(\n ...args\n )\n }\n : notEnabled\n\nexport const schedulePrefetchTask: typeof import('./segment-cache-impl/scheduler').schedulePrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/scheduler').schedulePrefetchTask(\n ...args\n )\n }\n : notEnabled\n\nexport const cancelPrefetchTask: typeof import('./segment-cache-impl/scheduler').cancelPrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/scheduler').cancelPrefetchTask(\n ...args\n )\n }\n : notEnabled\n\nexport const bumpPrefetchTask: typeof import('./segment-cache-impl/scheduler').bumpPrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/scheduler').bumpPrefetchTask(\n ...args\n )\n }\n : notEnabled\n\nexport const createCacheKey: typeof import('./segment-cache-impl/cache-key').createCacheKey =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return require('./segment-cache-impl/cache-key').createCacheKey(...args)\n }\n : notEnabled\n\n/**\n * Below are public constants. They're small enough that we don't need to\n * DCE them.\n */\n\nexport const enum NavigationResultTag {\n MPA,\n Success,\n NoOp,\n Async,\n}\n\n/**\n * The priority of the prefetch task. Higher numbers are higher priority.\n */\nexport const enum PrefetchPriority {\n /**\n * Assigned to any visible link that was hovered/touched at some point. This\n * is not removed on mouse exit, because a link that was momentarily\n * hovered is more likely to to be interacted with than one that was not.\n */\n Intent = 2,\n /**\n * The default priority for prefetch tasks.\n */\n Default = 1,\n /**\n * Assigned to tasks when they spawn non-blocking background work, like\n * revalidating a partially cached entry to see if more data is available.\n */\n Background = 0,\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","import { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function hasBasePath(path: string): boolean {\n return pathHasPrefix(path, basePath)\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use client'\n\nimport type {\n CacheNode,\n LazyCacheNode,\n LoadingModuleData,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../server/app-render/types'\nimport type { ErrorComponent } from './error-boundary'\nimport type { FocusAndScrollRef } from './router-reducer/router-reducer-types'\n\nimport React, {\n useContext,\n use,\n startTransition,\n Suspense,\n useDeferredValue,\n type JSX,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { fetchServerResponse } from './router-reducer/fetch-server-response'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { matchSegment } from './match-segments'\nimport { handleSmoothScroll } from '../../shared/lib/router/utils/handle-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has-interception-route-in-current-tree'\n\n/**\n * Add refetch marker to router state at the point of the current layout segment.\n * This ensures the response returned is not further down than the current layout segment.\n */\nfunction walkAddRefetch(\n segmentPathToWalk: FlightSegmentPath | undefined,\n treeToRecreate: FlightRouterState\n): FlightRouterState {\n if (segmentPathToWalk) {\n const [segment, parallelRouteKey] = segmentPathToWalk\n const isLast = segmentPathToWalk.length === 2\n\n if (matchSegment(treeToRecreate[0], segment)) {\n if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {\n if (isLast) {\n const subTree = walkAddRefetch(\n undefined,\n treeToRecreate[1][parallelRouteKey]\n )\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: [\n subTree[0],\n subTree[1],\n subTree[2],\n 'refetch',\n ],\n },\n ]\n }\n\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: walkAddRefetch(\n segmentPathToWalk.slice(2),\n treeToRecreate[1][parallelRouteKey]\n ),\n },\n ]\n }\n }\n }\n\n return treeToRecreate\n}\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',\n element\n )\n }\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(element: HTMLElement, viewportHeight: number) {\n const rect = element.getBoundingClientRect()\n return rect.top >= 0 && rect.top <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n segmentPath: FlightSegmentPath\n}\nclass InnerScrollAndFocusHandler extends React.Component {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.\n const { focusAndScrollRef, segmentPath } = this.props\n\n if (focusAndScrollRef.apply) {\n // segmentPaths is an array of segment paths that should be scrolled to\n // if the current segment path is not in the array, the scroll is not applied\n // unless the array is empty, in which case the scroll is always applied\n if (\n focusAndScrollRef.segmentPaths.length !== 0 &&\n !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath) =>\n segmentPath.every((segment, index) =>\n matchSegment(segment, scrollRefSegmentPath[index])\n )\n )\n ) {\n return\n }\n\n let domNode:\n | ReturnType\n | ReturnType = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n if (process.env.NODE_ENV !== 'production') {\n if (domNode.parentElement?.localName === 'head') {\n // TODO: We enter this state when metadata was rendered as part of the page or via Next.js.\n // This is always a bug in Next.js and caused by React hoisting metadata.\n // We need to replace `findDOMNode` in favor of Fragment Refs (when available) so that we can skip over metadata.\n }\n }\n\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // State is mutated to ensure that the focus and scroll is applied only once.\n focusAndScrollRef.apply = false\n focusAndScrollRef.hashFragment = null\n focusAndScrollRef.segmentPaths = []\n\n handleSmoothScroll(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n ;(domNode as HTMLElement).scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n ;(domNode as HTMLElement).scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `handleSmoothScroll`\n focusAndScrollRef.onlyHashChange = false\n\n // Set focus on the element\n domNode.focus()\n }\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n // Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.\n if (this.props.focusAndScrollRef.apply) {\n this.handlePotentialScroll()\n }\n }\n\n render() {\n return this.props.children\n }\n}\n\nfunction ScrollAndFocusHandler({\n segmentPath,\n children,\n}: {\n segmentPath: FlightSegmentPath\n children: React.ReactNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n \n {children}\n \n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n tree,\n segmentPath,\n cacheNode,\n url,\n}: {\n tree: FlightRouterState\n segmentPath: FlightSegmentPath\n cacheNode: CacheNode\n url: string\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const { changeByServerResponse, tree: fullTree } = context\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n cacheNode.prefetchRsc !== null ? cacheNode.prefetchRsc : cacheNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n const rsc: any = useDeferredValue(cacheNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n const resolvedRsc: React.ReactNode =\n typeof rsc === 'object' && rsc !== null && typeof rsc.then === 'function'\n ? use(rsc)\n : rsc\n\n if (!resolvedRsc) {\n // The data for this segment is not available, and there's no pending\n // navigation that will be able to fulfill it. We need to fetch more from\n // the server and patch the cache.\n\n // Check if there's already a pending request.\n let lazyData = cacheNode.lazyData\n if (lazyData === null) {\n /**\n * Router state with refetch marker added\n */\n // TODO-APP: remove ''\n const refetchTree = walkAddRefetch(['', ...segmentPath], fullTree)\n const includeNextUrl = hasInterceptionRouteInCurrentTree(fullTree)\n cacheNode.lazyData = lazyData = fetchServerResponse(\n new URL(url, location.origin),\n {\n flightRouterState: refetchTree,\n nextUrl: includeNextUrl ? context.nextUrl : null,\n }\n ).then((serverResponse) => {\n startTransition(() => {\n changeByServerResponse({\n previousTree: fullTree,\n serverResponse,\n })\n })\n\n return serverResponse\n })\n\n // Suspend while waiting for lazyData to resolve\n use(lazyData)\n }\n // Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.\n // A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.\n use(unresolvedThenable) as never\n }\n\n // If we get to this point, then we know we have something we can render.\n const subtree = (\n // The layout router context narrows down tree and childNodes at each level.\n \n {resolvedRsc}\n \n )\n // Ensure root layout is not wrapped in a div as the root layout renders ``\n return subtree\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n loading,\n children,\n}: {\n loading: LoadingModuleData | Promise\n children: React.ReactNode\n}): JSX.Element {\n // If loading is a promise, unwrap it. This happens in cases where we haven't\n // yet received the loading data from the server — which includes whether or\n // not this layout has a loading component at all.\n //\n // It's OK to suspend here instead of inside the fallback because this\n // promise will resolve simultaneously with the data for the segment itself.\n // So it will never suspend for longer than it would have if we didn't use\n // a Suspense fallback at all.\n let loadingModuleData\n if (\n typeof loading === 'object' &&\n loading !== null &&\n typeof (loading as any).then === 'function'\n ) {\n const promiseForLoading = loading as Promise\n loadingModuleData = use(promiseForLoading)\n } else {\n loadingModuleData = loading as LoadingModuleData\n }\n\n if (loadingModuleData) {\n const loadingRsc = loadingModuleData[0]\n const loadingStyles = loadingModuleData[1]\n const loadingScripts = loadingModuleData[2]\n return (\n \n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n \n }\n >\n {children}\n \n )\n }\n\n return <>{children}\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n forbidden,\n unauthorized,\n}: {\n parallelRouterKey: string\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n forbidden: React.ReactNode | undefined\n unauthorized: React.ReactNode | undefined\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const { parentTree, parentCacheNode, parentSegmentPath, url } = context\n\n // Get the CacheNode for this segment by reading it from the parent segment's\n // child map.\n const parentParallelRoutes = parentCacheNode.parallelRoutes\n let segmentMap = parentParallelRoutes.get(parallelRouterKey)\n // If the parallel router cache node does not exist yet, create it.\n // This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.\n if (!segmentMap) {\n segmentMap = new Map()\n parentParallelRoutes.set(parallelRouterKey, segmentMap)\n }\n\n // Get the active segment in the tree\n // The reason arrays are used in the data format is that these are transferred from the server to the browser so it's optimized to save bytes.\n const parentTreeSegment = parentTree[0]\n const tree = parentTree[1][parallelRouterKey]\n const treeSegment = tree[0]\n\n const segmentPath =\n parentSegmentPath === null\n ? // TODO: The root segment value is currently omitted from the segment\n // path. This has led to a bunch of special cases scattered throughout\n // the code. We should clean this up.\n [parallelRouterKey]\n : parentSegmentPath.concat([parentTreeSegment, parallelRouterKey])\n\n // The \"state\" key of a segment is the one passed to React — it represents the\n // identity of the UI tree. Whenever the state key changes, the tree is\n // recreated and the state is reset. In the App Router model, search params do\n // not cause state to be lost, so two segments with the same segment path but\n // different search params should have the same state key.\n //\n // The \"cache\" key of a segment, however, *does* include the search params, if\n // it's possible that the segment accessed the search params on the server.\n // (This only applies to page segments; layout segments cannot access search\n // params on the server.)\n const cacheKey = createRouterCacheKey(treeSegment)\n const stateKey = createRouterCacheKey(treeSegment, true) // no search params\n\n // Read segment path from the parallel router cache node.\n let cacheNode = segmentMap.get(cacheKey)\n if (cacheNode === undefined) {\n // When data is not available during rendering client-side we need to fetch\n // it from the server.\n const newLazyCacheNode: LazyCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n\n // Flight data fetch kicked off during render and put into the cache.\n cacheNode = newLazyCacheNode\n segmentMap.set(cacheKey, newLazyCacheNode)\n }\n\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n\n // TODO: The loading module data for a segment is stored on the parent, then\n // applied to each of that parent segment's parallel route slots. In the\n // simple case where there's only one parallel route (the `children` slot),\n // this is no different from if the loading module data where stored on the\n // child directly. But I'm not sure this actually makes sense when there are\n // multiple parallel routes. It's not a huge issue because you always have\n // the option to define a narrower loading boundary for a particular slot. But\n // this sort of smells like an implementation accident to me.\n const loadingModuleData = parentCacheNode.loading\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n \n )\n}\n","'use client'\n\nimport React, { useContext } from 'react'\n\nexport type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void\n\n// Use `React.createContext` to avoid errors from the RSC checks because\n// it can't be imported directly in Server Components:\n//\n// import { createContext } from 'react'\n//\n// More info: https://github.com/vercel/next.js/pull/40686\nexport const ServerInsertedHTMLContext =\n React.createContext(null as any)\n\nexport function useServerInsertedHTML(callback: () => React.ReactNode): void {\n const addInsertedServerHTMLCallback = useContext(ServerInsertedHTMLContext)\n // Should have no effects on client where there's no flush effects provider\n if (addInsertedServerHTMLCallback) {\n addInsertedServerHTMLCallback(callback)\n }\n}\n","function _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexport { _interop_require_default as _ };\n","import type { SearchParams } from '../../server/request/search-params'\n\nimport { wellKnownProperties } from '../../shared/lib/utils/reflect-utils'\n\ninterface CacheLifetime {}\nconst CachedSearchParams = new WeakMap>()\n\nexport function makeUntrackedExoticSearchParams(\n underlyingSearchParams: SearchParams\n): Promise {\n const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams)\n if (cachedSearchParams) {\n return cachedSearchParams\n }\n\n // We don't use makeResolvedReactPromise here because searchParams\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(underlyingSearchParams)\n CachedSearchParams.set(underlyingSearchParams, promise)\n\n Object.keys(underlyingSearchParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n ;(promise as any)[prop] = underlyingSearchParams[prop]\n }\n })\n\n return promise\n}\n","'use client'\n\n// @ts-ignore\n// eslint-disable-next-line import/no-extraneous-dependencies\n// import { createFromReadableStream } from 'react-server-dom-webpack/client'\nconst { createFromReadableStream } = (\n !!process.env.NEXT_RUNTIME\n ? // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client.edge')\n : // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client')\n) as typeof import('react-server-dom-webpack/client')\n\nimport type {\n FlightRouterState,\n NavigationFlightResponse,\n} from '../../../server/app-render/types'\n\nimport type { NEXT_ROUTER_SEGMENT_PREFETCH_HEADER } from '../app-router-headers'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_RSC_UNION_QUERY,\n NEXT_URL,\n RSC_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n} from '../app-router-headers'\nimport { callServer } from '../../app-call-server'\nimport { findSourceMapURL } from '../../app-find-source-map-url'\nimport { PrefetchKind } from './router-reducer-types'\nimport {\n normalizeFlightData,\n type NormalizedFlightData,\n} from '../../flight-data-helpers'\nimport { getAppBuildId } from '../../app-build-id'\nimport { setCacheBustingSearchParam } from './set-cache-busting-search-param'\n\nexport interface FetchServerResponseOptions {\n readonly flightRouterState: FlightRouterState\n readonly nextUrl: string | null\n readonly prefetchKind?: PrefetchKind\n readonly isHmrRefresh?: boolean\n}\n\nexport type FetchServerResponseResult = {\n flightData: NormalizedFlightData[] | string\n canonicalUrl: URL | undefined\n couldBeIntercepted: boolean\n prerendered: boolean\n postponed: boolean\n staleTime: number\n}\n\nexport type RequestHeaders = {\n [RSC_HEADER]?: '1'\n [NEXT_ROUTER_STATE_TREE_HEADER]?: string\n [NEXT_URL]?: string\n [NEXT_ROUTER_PREFETCH_HEADER]?: '1'\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]?: string\n 'x-deployment-id'?: string\n [NEXT_HMR_REFRESH_HEADER]?: '1'\n // A header that is only added in test mode to assert on fetch priority\n 'Next-Test-Fetch-Priority'?: RequestInit['priority']\n}\n\nexport function urlToUrlWithoutFlightMarker(url: string): URL {\n const urlWithoutFlightParameters = new URL(url, location.origin)\n urlWithoutFlightParameters.searchParams.delete(NEXT_RSC_UNION_QUERY)\n if (process.env.NODE_ENV === 'production') {\n if (\n process.env.__NEXT_CONFIG_OUTPUT === 'export' &&\n urlWithoutFlightParameters.pathname.endsWith('.txt')\n ) {\n const { pathname } = urlWithoutFlightParameters\n const length = pathname.endsWith('/index.txt') ? 10 : 4\n // Slice off `/index.txt` or `.txt` from the end of the pathname\n urlWithoutFlightParameters.pathname = pathname.slice(0, -length)\n }\n }\n return urlWithoutFlightParameters\n}\n\nfunction doMpaNavigation(url: string): FetchServerResponseResult {\n return {\n flightData: urlToUrlWithoutFlightMarker(url).toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n}\n\nlet abortController = new AbortController()\n\nif (typeof window !== 'undefined') {\n // Abort any in-flight requests when the page is unloaded, e.g. due to\n // reloading the page or performing hard navigations. This allows us to ignore\n // what would otherwise be a thrown TypeError when the browser cancels the\n // requests.\n window.addEventListener('pagehide', () => {\n abortController.abort()\n })\n\n // Use a fresh AbortController instance on pageshow, e.g. when navigating back\n // and the JavaScript execution context is restored by the browser.\n window.addEventListener('pageshow', () => {\n abortController = new AbortController()\n })\n}\n\n/**\n * Fetch the flight data for the provided url. Takes in the current router state\n * to decide what to render server-side.\n */\nexport async function fetchServerResponse(\n url: URL,\n options: FetchServerResponseOptions\n): Promise {\n const { flightRouterState, nextUrl, prefetchKind } = options\n\n const headers: RequestHeaders = {\n // Enable flight response\n [RSC_HEADER]: '1',\n // Provide the current router state\n [NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(\n JSON.stringify(flightRouterState)\n ),\n }\n\n /**\n * Three cases:\n * - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully\n * - `prefetchKind` is `full` - we want to prefetch the whole page so same as above\n * - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully\n */\n if (prefetchKind === PrefetchKind.AUTO) {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n }\n\n if (process.env.NODE_ENV === 'development' && options.isHmrRefresh) {\n headers[NEXT_HMR_REFRESH_HEADER] = '1'\n }\n\n if (nextUrl) {\n headers[NEXT_URL] = nextUrl\n }\n\n try {\n // When creating a \"temporary\" prefetch (the \"on-demand\" prefetch that gets created on navigation, if one doesn't exist)\n // we send the request with a \"high\" priority as it's in response to a user interaction that could be blocking a transition.\n // Otherwise, all other prefetches are sent with a \"low\" priority.\n // We use \"auto\" for in all other cases to match the existing default, as this function is shared outside of prefetching.\n const fetchPriority = prefetchKind\n ? prefetchKind === PrefetchKind.TEMPORARY\n ? 'high'\n : 'low'\n : 'auto'\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n // In \"output: export\" mode, we can't rely on headers to distinguish\n // between HTML and RSC requests. Instead, we append an extra prefix\n // to the request.\n url = new URL(url)\n if (url.pathname.endsWith('/')) {\n url.pathname += 'index.txt'\n } else {\n url.pathname += '.txt'\n }\n }\n }\n\n const res = await createFetch(\n url,\n headers,\n fetchPriority,\n abortController.signal\n )\n\n const responseUrl = urlToUrlWithoutFlightMarker(res.url)\n const canonicalUrl = res.redirected ? responseUrl : undefined\n\n const contentType = res.headers.get('content-type') || ''\n const interception = !!res.headers.get('vary')?.includes(NEXT_URL)\n const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER)\n const staleTimeHeader = res.headers.get(NEXT_ROUTER_STALE_TIME_HEADER)\n const staleTime =\n staleTimeHeader !== null ? parseInt(staleTimeHeader, 10) : -1\n let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (!isFlightResponse) {\n isFlightResponse = contentType.startsWith('text/plain')\n }\n }\n }\n\n // If fetch returns something different than flight response handle it like a mpa navigation\n // If the fetch was not 200, we also handle it like a mpa navigation\n if (!isFlightResponse || !res.ok || !res.body) {\n // in case the original URL came with a hash, preserve it before redirecting to the new URL\n if (url.hash) {\n responseUrl.hash = url.hash\n }\n\n return doMpaNavigation(responseUrl.toString())\n }\n\n // We may navigate to a page that requires a different Webpack runtime.\n // In prod, every page will have the same Webpack runtime.\n // In dev, the Webpack runtime is minimal for each page.\n // We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.\n if (process.env.NODE_ENV !== 'production' && !process.env.TURBOPACK) {\n await require('../react-dev-overlay/app/hot-reloader-client').waitForWebpackRuntimeHotUpdate()\n }\n\n // Handle the `fetch` readable stream that can be unwrapped by `React.use`.\n const flightStream = postponed\n ? createUnclosingPrefetchStream(res.body)\n : res.body\n const response = await (createFromNextReadableStream(\n flightStream\n ) as Promise)\n\n if (getAppBuildId() !== response.b) {\n return doMpaNavigation(res.url)\n }\n\n return {\n flightData: normalizeFlightData(response.f),\n canonicalUrl: canonicalUrl,\n couldBeIntercepted: interception,\n prerendered: response.S,\n postponed,\n staleTime,\n }\n } catch (err) {\n if (!abortController.signal.aborted) {\n console.error(\n `Failed to fetch RSC payload for ${url}. Falling back to browser navigation.`,\n err\n )\n }\n\n // If fetch fails handle it like a mpa navigation\n // TODO-APP: Add a test for the case where a CORS request fails, e.g. external url redirect coming from the response.\n // See https://github.com/vercel/next.js/issues/43605#issuecomment-1451617521 for a reproduction.\n return {\n flightData: url.toString(),\n canonicalUrl: undefined,\n couldBeIntercepted: false,\n prerendered: false,\n postponed: false,\n staleTime: -1,\n }\n }\n}\n\nexport function createFetch(\n url: URL,\n headers: RequestHeaders,\n fetchPriority: 'auto' | 'high' | 'low' | null,\n signal?: AbortSignal\n) {\n const fetchUrl = new URL(url)\n\n // TODO: In output: \"export\" mode, the headers do nothing. Omit them (and the\n // cache busting search param) from the request so they're\n // maximally cacheable.\n setCacheBustingSearchParam(fetchUrl, headers)\n\n if (process.env.__NEXT_TEST_MODE && fetchPriority !== null) {\n headers['Next-Test-Fetch-Priority'] = fetchPriority\n }\n\n if (process.env.NEXT_DEPLOYMENT_ID) {\n headers['x-deployment-id'] = process.env.NEXT_DEPLOYMENT_ID\n }\n\n return fetch(fetchUrl, {\n // Backwards compat for older browsers. `same-origin` is the default in modern browsers.\n credentials: 'same-origin',\n headers,\n priority: fetchPriority || undefined,\n signal,\n })\n}\n\nexport function createFromNextReadableStream(\n flightStream: ReadableStream\n): Promise {\n return createFromReadableStream(flightStream, {\n callServer,\n findSourceMapURL,\n })\n}\n\nfunction createUnclosingPrefetchStream(\n originalFlightStream: ReadableStream\n): ReadableStream {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream.\n return\n }\n },\n })\n}\n","import type {\n PrefetchAction,\n ReducerState,\n ReadonlyReducerState,\n} from '../router-reducer-types'\nimport { PromiseQueue } from '../../promise-queue'\nimport {\n getOrCreatePrefetchCacheEntry,\n prunePrefetchCache,\n} from '../prefetch-cache-utils'\nexport const prefetchQueue = new PromiseQueue(5)\n\nexport const prefetchReducer = process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? identityReducerWhenSegmentCacheIsEnabled\n : prefetchReducerImpl\n\nfunction identityReducerWhenSegmentCacheIsEnabled(state: T): T {\n // Unlike the old implementation, the Segment Cache doesn't store its data in\n // the router reducer state.\n //\n // This shouldn't be reachable because we wrap the prefetch API in a check,\n // too, which prevents the action from being dispatched. But it's here for\n // clarity + code elimination.\n return state\n}\n\nfunction prefetchReducerImpl(\n state: ReadonlyReducerState,\n action: PrefetchAction\n): ReducerState {\n // let's prune the prefetch cache before we do anything else\n prunePrefetchCache(state.prefetchCache)\n\n const { url } = action\n\n getOrCreatePrefetchCacheEntry({\n url,\n nextUrl: state.nextUrl,\n prefetchCache: state.prefetchCache,\n kind: action.kind,\n tree: state.tree,\n allowAliasing: true,\n })\n\n return state\n}\n","import {\n getHydrationErrorStackInfo,\n testReactHydrationWarning,\n} from '../is-hydration-error'\n\nexport type HydrationErrorState = {\n // Hydration warning template format: \n warning?: [string, string, string]\n componentStack?: string\n serverContent?: string\n clientContent?: string\n // React 19 hydration diff format: \n notes?: string\n reactOutputComponentDiff?: string\n}\n\ntype NullableText = string | null | undefined\n\nexport const hydrationErrorState: HydrationErrorState = {}\n\n// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference\nconst htmlTagsWarnings = new Set([\n 'Warning: In HTML, %s cannot be a child of <%s>.%s\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, %s cannot be a descendant of <%s>.\\nThis will cause a hydration error.%s',\n 'Warning: In HTML, text nodes cannot be a child of <%s>.\\nThis will cause a hydration error.',\n \"Warning: In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\\nThis will cause a hydration error.\",\n 'Warning: Expected server HTML to contain a matching <%s> in <%s>.%s',\n 'Warning: Did not expect server HTML to contain a <%s> in <%s>.%s',\n])\nconst textAndTagsMismatchWarnings = new Set([\n 'Warning: Expected server HTML to contain a matching text node for \"%s\" in <%s>.%s',\n 'Warning: Did not expect server HTML to contain the text node \"%s\" in <%s>.%s',\n])\n\nexport const getHydrationWarningType = (\n message: NullableText\n): 'tag' | 'text' | 'text-in-tag' => {\n if (typeof message !== 'string') {\n // TODO: Doesn't make sense to treat no message as a hydration error message.\n // We should bail out somewhere earlier.\n return 'text'\n }\n\n const normalizedMessage = message.startsWith('Warning: ')\n ? message\n : `Warning: ${message}`\n\n if (isHtmlTagsWarning(normalizedMessage)) return 'tag'\n if (isTextInTagsMismatchWarning(normalizedMessage)) return 'text-in-tag'\n\n return 'text'\n}\n\nconst isHtmlTagsWarning = (message: string) => htmlTagsWarnings.has(message)\n\nconst isTextInTagsMismatchWarning = (msg: string) =>\n textAndTagsMismatchWarnings.has(msg)\n\nexport const getReactHydrationDiffSegments = (msg: NullableText) => {\n if (msg) {\n const { message, diff } = getHydrationErrorStackInfo(msg)\n if (message) return [message, diff]\n }\n return undefined\n}\n\n/**\n * Patch console.error to capture hydration errors.\n * If any of the knownHydrationWarnings are logged, store the message and component stack.\n * When the hydration runtime error is thrown, the message and component stack are added to the error.\n * This results in a more helpful error message in the error overlay.\n */\n\nexport function storeHydrationErrorStateFromConsoleArgs(...args: any[]) {\n let [msg, firstContent, secondContent, ...rest] = args\n if (testReactHydrationWarning(msg)) {\n // Some hydration warnings has 4 arguments, some has 3, fallback to the last argument\n // when the 3rd argument is not the component stack but an empty string\n const isReact18 = msg.startsWith('Warning: ')\n\n // For some warnings, there's only 1 argument for template.\n // The second argument is the diff or component stack.\n if (args.length === 3) {\n secondContent = ''\n }\n\n const warning: [string, string, string] = [\n // remove the last %s from the message\n msg,\n firstContent,\n secondContent,\n ]\n\n const lastArg = (rest[rest.length - 1] || '').trim()\n if (!isReact18) {\n hydrationErrorState.reactOutputComponentDiff = lastArg\n } else {\n hydrationErrorState.reactOutputComponentDiff =\n generateHydrationDiffReact18(msg, firstContent, secondContent, lastArg)\n }\n\n hydrationErrorState.warning = warning\n hydrationErrorState.serverContent = firstContent\n hydrationErrorState.clientContent = secondContent\n }\n}\n\n/*\n * Some hydration errors in React 18 does not have the diff in the error message.\n * Instead it has the error stack trace which is component stack that we can leverage.\n * Will parse the diff from the error stack trace\n * e.g.\n * Warning: Expected server HTML to contain a matching
in

.\n * at div\n * at p\n * at div\n * at div\n * at Page\n * output:\n * \n *

\n *

\n * >

\n *\n */\nfunction generateHydrationDiffReact18(\n message: string,\n firstContent: string,\n secondContent: string,\n lastArg: string\n) {\n const componentStack = lastArg\n let firstIndex = -1\n let secondIndex = -1\n const hydrationWarningType = getHydrationWarningType(message)\n\n // at div\\n at Foo\\n at Bar (....)\\n -> [div, Foo]\n const components = componentStack\n .split('\\n')\n // .reverse()\n .map((line: string, index: number) => {\n // `at ()` -> `at ()`\n line = line.trim()\n // extract `at ` to `<>`\n // e.g. ` at Foo` -> ``\n const [, component, location] = /at (\\w+)( \\((.*)\\))?/.exec(line) || []\n // If there's no location then it's user-land stack frame\n if (!location) {\n if (component === firstContent && firstIndex === -1) {\n firstIndex = index\n } else if (component === secondContent && secondIndex === -1) {\n secondIndex = index\n }\n }\n return location ? '' : component\n })\n .filter(Boolean)\n .reverse()\n\n let diff = ''\n for (let i = 0; i < components.length; i++) {\n const component = components[i]\n const matchFirstContent =\n hydrationWarningType === 'tag' && i === components.length - firstIndex - 1\n const matchSecondContent =\n hydrationWarningType === 'tag' &&\n i === components.length - secondIndex - 1\n if (matchFirstContent || matchSecondContent) {\n const spaces = ' '.repeat(Math.max(i * 2 - 2, 0) + 2)\n diff += `> ${spaces}<${component}>\\n`\n } else {\n const spaces = ' '.repeat(i * 2 + 2)\n diff += `${spaces}<${component}>\\n`\n }\n }\n if (hydrationWarningType === 'text') {\n const spaces = ' '.repeat(components.length * 2)\n diff += `+ ${spaces}\"${firstContent}\"\\n`\n diff += `- ${spaces}\"${secondContent}\"\\n`\n } else if (hydrationWarningType === 'text-in-tag') {\n const spaces = ' '.repeat(components.length * 2)\n diff += `> ${spaces}<${secondContent}>\\n`\n diff += `> ${spaces}\"${firstContent}\"\\n`\n }\n return diff\n}\n","'use client'\n\nimport type { ParsedUrlQuery } from 'querystring'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params and searchParams to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Page component.\n *\n * additionally we may send promises representing the params and searchParams. We don't ever use these passed\n * values but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations.\n * It is up to the caller to decide if the promises are needed.\n */\nexport function ClientPageRoot({\n Component,\n searchParams,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promises,\n}: {\n Component: React.ComponentType\n searchParams: ParsedUrlQuery\n params: Params\n promises?: Array>\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientSearchParams: Promise\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling searchParams in a client Page.'\n )\n }\n\n const { createSearchParamsFromClient } =\n require('../../server/request/search-params') as typeof import('../../server/request/search-params')\n clientSearchParams = createSearchParamsFromClient(searchParams, store)\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderSearchParamsFromClient } =\n require('../request/search-params.browser') as typeof import('../request/search-params.browser')\n const clientSearchParams = createRenderSearchParamsFromClient(searchParams)\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n\n return \n }\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */\nexport function pathHasPrefix(path: string, prefix: string) {\n if (typeof path !== 'string') {\n return false\n }\n\n const { pathname } = parsePath(path)\n return pathname === prefix || pathname.startsWith(prefix + '/')\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { FlightDataPath } from '../../../server/app-render/types'\n\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { extractPathFromFlightRouterState } from './compute-changed-path'\nimport { createSeededPrefetchCacheEntry } from './prefetch-cache-utils'\nimport { PrefetchKind, type PrefetchCacheEntry } from './router-reducer-types'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\nimport { getFlightDataPartsFromPath } from '../../flight-data-helpers'\n\nexport interface InitialRouterStateParameters {\n initialCanonicalUrlParts: string[]\n initialParallelRoutes: CacheNode['parallelRoutes']\n initialFlightData: FlightDataPath[]\n location: Location | null\n couldBeIntercepted: boolean\n postponed: boolean\n prerendered: boolean\n}\n\nexport function createInitialRouterState({\n initialFlightData,\n initialCanonicalUrlParts,\n initialParallelRoutes,\n location,\n couldBeIntercepted,\n postponed,\n prerendered,\n}: InitialRouterStateParameters) {\n // When initialized on the server, the canonical URL is provided as an array of parts.\n // This is to ensure that when the RSC payload streamed to the client, crawlers don't interpret it\n // as a URL that should be crawled.\n const initialCanonicalUrl = initialCanonicalUrlParts.join('/')\n const normalizedFlightData = getFlightDataPartsFromPath(initialFlightData[0])\n const {\n tree: initialTree,\n seedData: initialSeedData,\n head: initialHead,\n } = normalizedFlightData\n // For the SSR render, seed data should always be available (we only send back a `null` response\n // in the case of a `loading` segment, pre-PPR.)\n const rsc = initialSeedData?.[1]\n const loading = initialSeedData?.[3] ?? null\n\n const cache: CacheNode = {\n lazyData: null,\n rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n // The cache gets seeded during the first render. `initialParallelRoutes` ensures the cache from the first render is there during the second render.\n parallelRoutes: initialParallelRoutes,\n loading,\n }\n\n const canonicalUrl =\n // location.href is read as the initial value for canonicalUrl in the browser\n // This is safe to do as canonicalUrl can't be rendered, it's only used to control the history updates in the useEffect further down in this file.\n location\n ? // window.location does not have the same type as URL but has all the fields createHrefFromUrl needs.\n createHrefFromUrl(location)\n : initialCanonicalUrl\n\n addRefreshMarkerToActiveParallelSegments(initialTree, canonicalUrl)\n\n const prefetchCache = new Map()\n\n // When the cache hasn't been seeded yet we fill the cache with the head.\n if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {\n fillLazyItemsTillLeafWithHead(\n cache,\n undefined,\n initialTree,\n initialSeedData,\n initialHead,\n undefined\n )\n }\n\n const initialState = {\n tree: initialTree,\n cache,\n prefetchCache,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // First render needs to preserve the previous window.history.state\n // to avoid it being overwritten on navigation back/forward with MPA Navigation.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: {\n apply: false,\n onlyHashChange: false,\n hashFragment: null,\n segmentPaths: [],\n },\n canonicalUrl,\n nextUrl:\n // the || operator is intentional, the pathname can be an empty string\n (extractPathFromFlightRouterState(initialTree) || location?.pathname) ??\n null,\n }\n\n if (process.env.NODE_ENV !== 'development' && location) {\n // Seed the prefetch cache with this page's data.\n // This is to prevent needlessly re-prefetching a page that is already reusable,\n // and will avoid triggering a loading state/data fetch stall when navigating back to the page.\n // We don't currently do this in development because links aren't prefetched in development\n // so having a mismatch between prefetch/no prefetch provides inconsistent behavior based on which page\n // was loaded first.\n const url = new URL(\n `${location.pathname}${location.search}`,\n location.origin\n )\n\n createSeededPrefetchCacheEntry({\n url,\n data: {\n flightData: [normalizedFlightData],\n canonicalUrl: undefined,\n couldBeIntercepted: !!couldBeIntercepted,\n prerendered,\n postponed,\n // TODO: The initial RSC payload includes both static and dynamic data\n // in the same response, even if PPR is enabled. So if there's any\n // dynamic data at all, we can't set a stale time. In the future we may\n // add a way to split a single Flight stream into static and dynamic\n // parts. But in the meantime we should at least make this work for\n // fully static pages.\n staleTime: -1,\n },\n tree: initialState.tree,\n prefetchCache: initialState.prefetchCache,\n nextUrl: initialState.nextUrl,\n kind: prerendered ? PrefetchKind.FULL : PrefetchKind.AUTO,\n })\n }\n\n return initialState\n}\n","'use client'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when dynamicIO is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promise,\n}: {\n Component: React.ComponentType\n slots: { [key: string]: React.ReactNode }\n params: Params\n promise?: Promise\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientParams: Promise\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling params in a client segment such as a Layout or Template.'\n )\n }\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return \n } else {\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return \n }\n}\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable(\n promise: Promise | T\n): promise is Promise {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","import React from 'react'\nimport isError from '../../../lib/is-error'\nimport { copyNextErrorCode } from '../../../lib/error-telemetry-utils'\n\nconst REACT_ERROR_STACK_BOTTOM_FRAME = 'react-stack-bottom-frame'\nconst REACT_ERROR_STACK_BOTTOM_FRAME_REGEX = new RegExp(\n `(at ${REACT_ERROR_STACK_BOTTOM_FRAME} )|(${REACT_ERROR_STACK_BOTTOM_FRAME}\\\\@)`\n)\n\nexport function getReactStitchedError(err: T): Error | T {\n const isErrorInstance = isError(err)\n const originStack = isErrorInstance ? err.stack || '' : ''\n const originMessage = isErrorInstance ? err.message : ''\n const stackLines = originStack.split('\\n')\n const indexOfSplit = stackLines.findIndex((line) =>\n REACT_ERROR_STACK_BOTTOM_FRAME_REGEX.test(line)\n )\n const isOriginalReactError = indexOfSplit >= 0 // has the react-stack-bottom-frame\n let newStack = isOriginalReactError\n ? stackLines.slice(0, indexOfSplit).join('\\n')\n : originStack\n\n const newError = new Error(originMessage)\n // Copy all enumerable properties, e.g. digest\n Object.assign(newError, err)\n copyNextErrorCode(err, newError)\n newError.stack = newStack\n\n // Avoid duplicate overriding stack frames\n appendOwnerStack(newError)\n\n return newError\n}\n\nfunction appendOwnerStack(error: Error) {\n if (!React.captureOwnerStack) {\n return\n }\n let stack = error.stack || ''\n // This module is only bundled in development mode so this is safe.\n const ownerStack = React.captureOwnerStack()\n // Avoid duplicate overriding stack frames\n if (ownerStack && stack.endsWith(ownerStack) === false) {\n stack += ownerStack\n // Override stack\n error.stack = stack\n }\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use client'\n\nimport type { FetchServerResponseResult } from '../../client/components/router-reducer/fetch-server-response'\nimport type {\n FocusAndScrollRef,\n PrefetchKind,\n RouterChangeByServerResponse,\n} from '../../client/components/router-reducer/router-reducer-types'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../server/app-render/types'\nimport React from 'react'\n\nexport type ChildSegmentMap = Map\n\n/**\n * Cache node used in app-router / layout-router.\n */\nexport type CacheNode = ReadyCacheNode | LazyCacheNode\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\nexport type LazyCacheNode = {\n /**\n * When rsc is null, this is a lazily-initialized cache node.\n *\n * If the app attempts to render it, it triggers a lazy data fetch,\n * postpones the render, and schedules an update to a new tree.\n *\n * TODO: This mechanism should not be used when PPR is enabled, though it\n * currently is in some cases until we've implemented partial\n * segment fetching.\n */\n rsc: null\n\n /**\n * A prefetched version of the segment data. See explanation in corresponding\n * field of ReadyCacheNode (below).\n *\n * Since LazyCacheNode mostly only exists in the non-PPR implementation, this\n * will usually be null, but it could have been cloned from a previous\n * CacheNode that was created by the PPR implementation. Eventually we want\n * to migrate everything away from LazyCacheNode entirely.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * A pending response for the lazy data fetch. If this is not present\n * during render, it is lazily created.\n */\n lazyData: Promise | null\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n loading: LoadingModuleData | Promise\n\n /**\n * Child parallel routes.\n */\n parallelRoutes: Map\n}\n\nexport type ReadyCacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * component, we can use `null` to represent empty.\n *\n * TODO: For additional type safety, update this type to\n * Exclude. Need to update createEmptyCacheNode to\n * accept rsc as an argument, or just inline the callers.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * There should never be a lazy data request in this case.\n */\n lazyData: null\n prefetchHead: HeadData | null\n\n head: HeadData\n\n loading: LoadingModuleData | Promise\n\n parallelRoutes: Map\n}\n\nexport interface NavigateOptions {\n scroll?: boolean\n}\n\nexport interface PrefetchOptions {\n kind: PrefetchKind\n}\n\nexport interface AppRouterInstance {\n /**\n * Navigate to the previous history entry.\n */\n back(): void\n /**\n * Navigate to the next history entry.\n */\n forward(): void\n /**\n * Refresh the current page.\n */\n refresh(): void\n /**\n * Refresh the current page. Use in development only.\n * @internal\n */\n hmrRefresh(): void\n /**\n * Navigate to the provided href.\n * Pushes a new history entry.\n */\n push(href: string, options?: NavigateOptions): void\n /**\n * Navigate to the provided href.\n * Replaces the current history entry.\n */\n replace(href: string, options?: NavigateOptions): void\n /**\n * Prefetch the provided href.\n */\n prefetch(href: string, options?: PrefetchOptions): void\n}\n\nexport const AppRouterContext = React.createContext(\n null\n)\nexport const LayoutRouterContext = React.createContext<{\n parentTree: FlightRouterState\n parentCacheNode: CacheNode\n parentSegmentPath: FlightSegmentPath | null\n url: string\n} | null>(null)\n\nexport const GlobalLayoutRouterContext = React.createContext<{\n tree: FlightRouterState\n changeByServerResponse: RouterChangeByServerResponse\n focusAndScrollRef: FocusAndScrollRef\n nextUrl: string | null\n}>(null as any)\n\nexport const TemplateContext = React.createContext(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n AppRouterContext.displayName = 'AppRouterContext'\n LayoutRouterContext.displayName = 'LayoutRouterContext'\n GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'\n TemplateContext.displayName = 'TemplateContext'\n}\n\nexport const MissingSlotContext = React.createContext>(new Set())\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n} from '../../../server/app-render/types'\nimport type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime'\nimport {\n addSearchParamsIfPageSegment,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { createEmptyCacheNode } from '../app-router'\nimport { applyRouterStatePatchToTree } from './apply-router-state-patch-to-tree'\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport { fillCacheWithNewSubTreeDataButOnlyLoading } from './fill-cache-with-new-subtree-data'\nimport { handleMutable } from './handle-mutable'\nimport type { Mutable, ReadonlyReducerState } from './router-reducer-types'\n\n/**\n * This is a stop-gap until per-segment caching is implemented. It leverages the `aliased` flag that is added\n * to prefetch entries when it's determined that the loading state from that entry should be used for this navigation.\n * This function takes the aliased entry and only applies the loading state to the updated cache node.\n * We should remove this once per-segment fetching is implemented as ideally the prefetch cache will contain a\n * more granular segment map and so the router will be able to simply re-use the loading segment for the new navigation.\n */\nexport function handleAliasedPrefetchEntry(\n state: ReadonlyReducerState,\n flightData: string | NormalizedFlightData[],\n url: URL,\n mutable: Mutable\n) {\n let currentTree = state.tree\n let currentCache = state.cache\n const href = createHrefFromUrl(url)\n let applied\n\n if (typeof flightData === 'string') {\n return false\n }\n\n for (const normalizedFlightData of flightData) {\n // If the segment doesn't have a loading component, we don't need to do anything.\n if (!hasLoadingComponentInSeedData(normalizedFlightData.seedData)) {\n continue\n }\n\n let treePatch = normalizedFlightData.tree\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n const { seedData, isRootRender, pathToSegment } = normalizedFlightData\n // TODO-APP: remove ''\n const flightSegmentPathWithLeadingEmpty = ['', ...pathToSegment]\n\n // Segments are keyed by searchParams (e.g. __PAGE__?{\"foo\":\"bar\"}). We might return a less specific, param-less entry,\n // so we ensure that the final tree contains the correct searchParams (reflected in the URL) are provided in the updated FlightRouterState tree.\n // We only do this on the first read, as otherwise we'd be overwriting the searchParams that may have already been set\n treePatch = addSearchParamsToPageSegments(\n treePatch,\n Object.fromEntries(url.searchParams)\n )\n\n let newTree = applyRouterStatePatchToTree(\n flightSegmentPathWithLeadingEmpty,\n currentTree,\n treePatch,\n href\n )\n\n const newCache = createEmptyCacheNode()\n\n // The prefetch cache entry was aliased -- this signals that we only fill in the cache with the\n // loading state and not the actual parallel route seed data.\n if (isRootRender && seedData) {\n // Fill in the cache with the new loading / rsc data\n const rsc = seedData[1]\n const loading = seedData[3]\n newCache.loading = loading\n newCache.rsc = rsc\n\n // Construct a new tree and apply the aliased loading state for each parallel route\n fillNewTreeWithOnlyLoadingSegments(\n newCache,\n currentCache,\n treePatch,\n seedData\n )\n } else {\n // Copy rsc for the root node of the cache.\n newCache.rsc = currentCache.rsc\n newCache.prefetchRsc = currentCache.prefetchRsc\n newCache.loading = currentCache.loading\n newCache.parallelRoutes = new Map(currentCache.parallelRoutes)\n\n // copy the loading state only into the leaf node (the part that changed)\n fillCacheWithNewSubTreeDataButOnlyLoading(\n newCache,\n currentCache,\n normalizedFlightData\n )\n }\n\n // If we don't have an updated tree, there's no reason to update the cache, as the tree\n // dictates what cache nodes to render.\n if (newTree) {\n currentTree = newTree\n currentCache = newCache\n applied = true\n }\n }\n\n if (!applied) {\n return false\n }\n\n mutable.patchedTree = currentTree\n mutable.cache = currentCache\n mutable.canonicalUrl = href\n mutable.hashFragment = url.hash\n\n return handleMutable(state, mutable)\n}\n\nfunction hasLoadingComponentInSeedData(seedData: CacheNodeSeedData | null) {\n if (!seedData) return false\n\n const parallelRoutes = seedData[2]\n const loading = seedData[3]\n\n if (loading) {\n return true\n }\n\n for (const key in parallelRoutes) {\n if (hasLoadingComponentInSeedData(parallelRoutes[key])) {\n return true\n }\n }\n\n return false\n}\n\nfunction fillNewTreeWithOnlyLoadingSegments(\n newCache: CacheNode,\n existingCache: CacheNode,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null\n) {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n return\n }\n\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[2][key] !== undefined\n ? cacheNodeSeedData[2][key]\n : null\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const rsc = parallelSeedData[1]\n const loading = parallelSeedData[3]\n newCacheNode = {\n lazyData: null,\n // copy the layout but null the page segment as that's not meant to be used\n rsc: segmentForParallelRoute.includes(PAGE_SEGMENT_KEY) ? null : rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillNewTreeWithOnlyLoadingSegments(\n newCacheNode,\n existingCache,\n parallelRouteState,\n parallelSeedData\n )\n }\n}\n\n/**\n * Add search params to the page segments in the flight router state\n * Page segments that are associated with search params have a page segment key\n * followed by a query string. This function will add those params to the page segment.\n * This is useful if we return an aliased prefetch entry (ie, won't have search params)\n * but the canonical router URL has search params.\n */\nexport function addSearchParamsToPageSegments(\n flightRouterState: FlightRouterState,\n searchParams: Record\n): FlightRouterState {\n const [segment, parallelRoutes, ...rest] = flightRouterState\n\n // If it's a page segment, modify the segment by adding search params\n if (segment.includes(PAGE_SEGMENT_KEY)) {\n const newSegment = addSearchParamsIfPageSegment(segment, searchParams)\n return [newSegment, parallelRoutes, ...rest]\n }\n\n // Otherwise, recurse through the parallel routes and return a new tree\n const updatedParallelRoutes: { [key: string]: FlightRouterState } = {}\n\n for (const [key, parallelRoute] of Object.entries(parallelRoutes)) {\n updatedParallelRoutes[key] = addSearchParamsToPageSegments(\n parallelRoute,\n searchParams\n )\n }\n\n return [segment, updatedParallelRoutes, ...rest]\n}\n","/** @internal */\nclass ReadonlyURLSearchParamsError extends Error {\n constructor() {\n super(\n 'Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams'\n )\n }\n}\n\nclass ReadonlyURLSearchParams extends URLSearchParams {\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n append() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n delete() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n set() {\n throw new ReadonlyURLSearchParamsError()\n }\n /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */\n sort() {\n throw new ReadonlyURLSearchParamsError()\n }\n}\n\nexport { redirect, permanentRedirect } from './redirect'\nexport { RedirectType } from './redirect-error'\nexport { notFound } from './not-found'\nexport { forbidden } from './forbidden'\nexport { unauthorized } from './unauthorized'\nexport { unstable_rethrow } from './unstable-rethrow'\nexport { ReadonlyURLSearchParams }\n","import type { FlightRouterState } from '../../../server/app-render/types'\nimport { handleExternalUrl } from './reducers/navigate-reducer'\nimport type {\n ReadonlyReducerState,\n ReducerActions,\n} from './router-reducer-types'\n\n/**\n * Handles the case where the client router attempted to patch the tree but, due to a mismatch, the patch failed.\n * This will perform an MPA navigation to return the router to a valid state.\n */\nexport function handleSegmentMismatch(\n state: ReadonlyReducerState,\n action: ReducerActions,\n treePatch: FlightRouterState\n) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Performing hard navigation because your application experienced an unrecoverable error. If this keeps occurring, please file a Next.js issue.\\n\\n' +\n 'Reason: Segment mismatch\\n' +\n `Last Action: ${action.type}\\n\\n` +\n `Current Tree: ${JSON.stringify(state.tree)}\\n\\n` +\n `Tree Patch Payload: ${JSON.stringify(treePatch)}`\n )\n }\n\n return handleExternalUrl(state, {}, state.canonicalUrl, true)\n}\n","/**\n * @license React\n * react-server-dom-webpack-client.browser.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactDOM = require(\"react-dom\"),\n decoderOptions = { stream: !0 };\nfunction resolveClientReference(bundlerConfig, metadata) {\n if (bundlerConfig) {\n var moduleExports = bundlerConfig[metadata[0]];\n if ((bundlerConfig = moduleExports && moduleExports[metadata[2]]))\n moduleExports = bundlerConfig.name;\n else {\n bundlerConfig = moduleExports && moduleExports[\"*\"];\n if (!bundlerConfig)\n throw Error(\n 'Could not find the module \"' +\n metadata[0] +\n '\" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.'\n );\n moduleExports = metadata[2];\n }\n return 4 === metadata.length\n ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1]\n : [bundlerConfig.id, bundlerConfig.chunks, moduleExports];\n }\n return metadata;\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = \"\",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf(\"#\");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n id +\n '\" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = __webpack_require__(id);\n if (\"function\" !== typeof promise.then || \"fulfilled\" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = \"fulfilled\";\n promise.value = value;\n },\n function (reason) {\n promise.status = \"rejected\";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++],\n chunkFilename = chunks[i++],\n entry = chunkCache.get(chunkId);\n void 0 === entry\n ? (chunkMap.set(chunkId, chunkFilename),\n (chunkFilename = __webpack_chunk_load__(chunkId)),\n promises.push(chunkFilename),\n (entry = chunkCache.set.bind(chunkCache, chunkId, null)),\n chunkFilename.then(entry, ignoreReject),\n chunkCache.set(chunkId, chunkFilename))\n : null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = __webpack_require__(metadata[0]);\n if (4 === metadata.length && \"function\" === typeof moduleExports.then)\n if (\"fulfilled\" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n return \"*\" === metadata[2]\n ? moduleExports\n : \"\" === metadata[2]\n ? moduleExports.__esModule\n ? moduleExports.default\n : moduleExports\n : moduleExports[metadata[2]];\n}\nvar chunkMap = new Map(),\n webpackGetChunkFilename = __webpack_require__.u;\n__webpack_require__.u = function (chunkId) {\n var flightChunk = chunkMap.get(chunkId);\n return void 0 !== flightChunk\n ? flightChunk\n : webpackGetChunkFilename(chunkId);\n};\nvar ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf,\n ObjectPrototype = Object.prototype,\n knownServerReferences = new WeakMap();\nfunction serializeNumber(number) {\n return Number.isFinite(number)\n ? 0 === number && -Infinity === 1 / number\n ? \"$-0\"\n : number\n : Infinity === number\n ? \"$Infinity\"\n : -Infinity === number\n ? \"$-Infinity\"\n : \"$NaN\";\n}\nfunction processReply(\n root,\n formFieldPrefix,\n temporaryReferences,\n resolve,\n reject\n) {\n function serializeTypedArray(tag, typedArray) {\n typedArray = new Blob([\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n ]);\n var blobId = nextPartId++;\n null === formData && (formData = new FormData());\n formData.append(formFieldPrefix + blobId, typedArray);\n return \"$\" + tag + blobId.toString(16);\n }\n function serializeBinaryReader(reader) {\n function progress(entry) {\n entry.done\n ? ((entry = nextPartId++),\n data.append(formFieldPrefix + entry, new Blob(buffer)),\n data.append(\n formFieldPrefix + streamId,\n '\"$o' + entry.toString(16) + '\"'\n ),\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data))\n : (buffer.push(entry.value),\n reader.read(new Uint8Array(1024)).then(progress, reject));\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++,\n buffer = [];\n reader.read(new Uint8Array(1024)).then(progress, reject);\n return \"$r\" + streamId.toString(16);\n }\n function serializeReader(reader) {\n function progress(entry) {\n if (entry.done)\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data);\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON);\n reader.read().then(progress, reject);\n } catch (x) {\n reject(x);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n reader.read().then(progress, reject);\n return \"$R\" + streamId.toString(16);\n }\n function serializeReadableStream(stream) {\n try {\n var binaryReader = stream.getReader({ mode: \"byob\" });\n } catch (x) {\n return serializeReader(stream.getReader());\n }\n return serializeBinaryReader(binaryReader);\n }\n function serializeAsyncIterable(iterable, iterator) {\n function progress(entry) {\n if (entry.done) {\n if (void 0 === entry.value)\n data.append(formFieldPrefix + streamId, \"C\");\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, \"C\" + partJSON);\n } catch (x) {\n reject(x);\n return;\n }\n pendingParts--;\n 0 === pendingParts && resolve(data);\n } else\n try {\n var partJSON$22 = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON$22);\n iterator.next().then(progress, reject);\n } catch (x$23) {\n reject(x$23);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n iterable = iterable === iterator;\n iterator.next().then(progress, reject);\n return \"$\" + (iterable ? \"x\" : \"X\") + streamId.toString(16);\n }\n function resolveToJSON(key, value) {\n if (null === value) return null;\n if (\"object\" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n if (void 0 !== temporaryReferences && -1 === key.indexOf(\":\")) {\n var parentReference = writtenObjects.get(this);\n if (void 0 !== parentReference)\n return (\n temporaryReferences.set(parentReference + \":\" + key, value),\n \"$T\"\n );\n }\n throw Error(\n \"React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n case REACT_LAZY_TYPE:\n parentReference = value._payload;\n var init = value._init;\n null === formData && (formData = new FormData());\n pendingParts++;\n try {\n var resolvedModel = init(parentReference),\n lazyId = nextPartId++,\n partJSON = serializeModel(resolvedModel, lazyId);\n formData.append(formFieldPrefix + lazyId, partJSON);\n return \"$\" + lazyId.toString(16);\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n pendingParts++;\n var lazyId$24 = nextPartId++;\n parentReference = function () {\n try {\n var partJSON$25 = serializeModel(value, lazyId$24),\n data$26 = formData;\n data$26.append(formFieldPrefix + lazyId$24, partJSON$25);\n pendingParts--;\n 0 === pendingParts && resolve(data$26);\n } catch (reason) {\n reject(reason);\n }\n };\n x.then(parentReference, parentReference);\n return \"$\" + lazyId$24.toString(16);\n }\n reject(x);\n return null;\n } finally {\n pendingParts--;\n }\n }\n if (\"function\" === typeof value.then) {\n null === formData && (formData = new FormData());\n pendingParts++;\n var promiseId = nextPartId++;\n value.then(function (partValue) {\n try {\n var partJSON$28 = serializeModel(partValue, promiseId);\n partValue = formData;\n partValue.append(formFieldPrefix + promiseId, partJSON$28);\n pendingParts--;\n 0 === pendingParts && resolve(partValue);\n } catch (reason) {\n reject(reason);\n }\n }, reject);\n return \"$@\" + promiseId.toString(16);\n }\n parentReference = writtenObjects.get(value);\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n else\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference &&\n ((key = parentReference + \":\" + key),\n writtenObjects.set(value, key),\n void 0 !== temporaryReferences &&\n temporaryReferences.set(key, value)));\n if (isArrayImpl(value)) return value;\n if (value instanceof FormData) {\n null === formData && (formData = new FormData());\n var data$32 = formData;\n key = nextPartId++;\n var prefix = formFieldPrefix + key + \"_\";\n value.forEach(function (originalValue, originalKey) {\n data$32.append(prefix + originalKey, originalValue);\n });\n return \"$K\" + key.toString(16);\n }\n if (value instanceof Map)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$Q\" + key.toString(16)\n );\n if (value instanceof Set)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$W\" + key.toString(16)\n );\n if (value instanceof ArrayBuffer)\n return (\n (key = new Blob([value])),\n (parentReference = nextPartId++),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + parentReference, key),\n \"$A\" + parentReference.toString(16)\n );\n if (value instanceof Int8Array) return serializeTypedArray(\"O\", value);\n if (value instanceof Uint8Array) return serializeTypedArray(\"o\", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray(\"U\", value);\n if (value instanceof Int16Array) return serializeTypedArray(\"S\", value);\n if (value instanceof Uint16Array) return serializeTypedArray(\"s\", value);\n if (value instanceof Int32Array) return serializeTypedArray(\"L\", value);\n if (value instanceof Uint32Array) return serializeTypedArray(\"l\", value);\n if (value instanceof Float32Array) return serializeTypedArray(\"G\", value);\n if (value instanceof Float64Array) return serializeTypedArray(\"g\", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray(\"M\", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray(\"m\", value);\n if (value instanceof DataView) return serializeTypedArray(\"V\", value);\n if (\"function\" === typeof Blob && value instanceof Blob)\n return (\n null === formData && (formData = new FormData()),\n (key = nextPartId++),\n formData.append(formFieldPrefix + key, value),\n \"$B\" + key.toString(16)\n );\n if ((key = getIteratorFn(value)))\n return (\n (parentReference = key.call(value)),\n parentReference === value\n ? ((key = nextPartId++),\n (parentReference = serializeModel(\n Array.from(parentReference),\n key\n )),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$i\" + key.toString(16))\n : Array.from(parentReference)\n );\n if (\n \"function\" === typeof ReadableStream &&\n value instanceof ReadableStream\n )\n return serializeReadableStream(value);\n key = value[ASYNC_ITERATOR];\n if (\"function\" === typeof key)\n return serializeAsyncIterable(value, key.call(value));\n key = getPrototypeOf(value);\n if (\n key !== ObjectPrototype &&\n (null === key || null !== getPrototypeOf(key))\n ) {\n if (void 0 === temporaryReferences)\n throw Error(\n \"Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported.\"\n );\n return \"$T\";\n }\n return value;\n }\n if (\"string\" === typeof value) {\n if (\"Z\" === value[value.length - 1] && this[key] instanceof Date)\n return \"$D\" + value;\n key = \"$\" === value[0] ? \"$\" + value : value;\n return key;\n }\n if (\"boolean\" === typeof value) return value;\n if (\"number\" === typeof value) return serializeNumber(value);\n if (\"undefined\" === typeof value) return \"$undefined\";\n if (\"function\" === typeof value) {\n parentReference = knownServerReferences.get(value);\n if (void 0 !== parentReference)\n return (\n (key = JSON.stringify(parentReference, resolveToJSON)),\n null === formData && (formData = new FormData()),\n (parentReference = nextPartId++),\n formData.set(formFieldPrefix + parentReference, key),\n \"$F\" + parentReference.toString(16)\n );\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.\"\n );\n }\n if (\"symbol\" === typeof value) {\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n }\n if (\"bigint\" === typeof value) return \"$n\" + value.toString(10);\n throw Error(\n \"Type \" +\n typeof value +\n \" is not supported as an argument to a Server Function.\"\n );\n }\n function serializeModel(model, id) {\n \"object\" === typeof model &&\n null !== model &&\n ((id = \"$\" + id.toString(16)),\n writtenObjects.set(model, id),\n void 0 !== temporaryReferences && temporaryReferences.set(id, model));\n modelRoot = model;\n return JSON.stringify(model, resolveToJSON);\n }\n var nextPartId = 1,\n pendingParts = 0,\n formData = null,\n writtenObjects = new WeakMap(),\n modelRoot = root,\n json = serializeModel(root, 0);\n null === formData\n ? resolve(json)\n : (formData.set(formFieldPrefix + \"0\", json),\n 0 === pendingParts && resolve(formData));\n return function () {\n 0 < pendingParts &&\n ((pendingParts = 0),\n null === formData ? resolve(json) : resolve(formData));\n };\n}\nfunction registerBoundServerReference(reference, id, bound) {\n knownServerReferences.set(reference, { id: id, bound: bound });\n}\nfunction createBoundServerReference(metaData, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return bound\n ? \"fulfilled\" === bound.status\n ? callServer(id, bound.value.concat(args))\n : Promise.resolve(bound).then(function (boundArgs) {\n return callServer(id, boundArgs.concat(args));\n })\n : callServer(id, args);\n }\n var id = metaData.id,\n bound = metaData.bound;\n registerBoundServerReference(action, id, bound);\n return action;\n}\nfunction ReactPromise(status, value, reason, response) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n this._response = response;\n}\nReactPromise.prototype = Object.create(Promise.prototype);\nReactPromise.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case \"resolved_model\":\n initializeModelChunk(this);\n break;\n case \"resolved_module\":\n initializeModuleChunk(this);\n }\n switch (this.status) {\n case \"fulfilled\":\n resolve(this.value);\n break;\n case \"pending\":\n case \"blocked\":\n resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n default:\n reject && reject(this.reason);\n }\n};\nfunction readChunk(chunk) {\n switch (chunk.status) {\n case \"resolved_model\":\n initializeModelChunk(chunk);\n break;\n case \"resolved_module\":\n initializeModuleChunk(chunk);\n }\n switch (chunk.status) {\n case \"fulfilled\":\n return chunk.value;\n case \"pending\":\n case \"blocked\":\n throw chunk;\n default:\n throw chunk.reason;\n }\n}\nfunction createPendingChunk(response) {\n return new ReactPromise(\"pending\", null, null, response);\n}\nfunction wakeChunk(listeners, value) {\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);\n}\nfunction wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {\n switch (chunk.status) {\n case \"fulfilled\":\n wakeChunk(resolveListeners, chunk.value);\n break;\n case \"pending\":\n case \"blocked\":\n if (chunk.value)\n for (var i = 0; i < resolveListeners.length; i++)\n chunk.value.push(resolveListeners[i]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (\n resolveListeners = 0;\n resolveListeners < rejectListeners.length;\n resolveListeners++\n )\n chunk.reason.push(rejectListeners[resolveListeners]);\n } else chunk.reason = rejectListeners;\n break;\n case \"rejected\":\n rejectListeners && wakeChunk(rejectListeners, chunk.reason);\n }\n}\nfunction triggerErrorOnChunk(chunk, error) {\n if (\"pending\" !== chunk.status && \"blocked\" !== chunk.status)\n chunk.reason.error(error);\n else {\n var listeners = chunk.reason;\n chunk.status = \"rejected\";\n chunk.reason = error;\n null !== listeners && wakeChunk(listeners, error);\n }\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new ReactPromise(\n \"resolved_model\",\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n null,\n response\n );\n}\nfunction resolveIteratorResultChunk(chunk, value, done) {\n resolveModelChunk(\n chunk,\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\"\n );\n}\nfunction resolveModelChunk(chunk, value) {\n if (\"pending\" !== chunk.status) chunk.reason.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_model\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModelChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nfunction resolveModuleChunk(chunk, value) {\n if (\"pending\" === chunk.status || \"blocked\" === chunk.status) {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_module\";\n chunk.value = value;\n null !== resolveListeners &&\n (initializeModuleChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nvar initializingHandler = null;\nfunction initializeModelChunk(chunk) {\n var prevHandler = initializingHandler;\n initializingHandler = null;\n var resolvedModel = chunk.value;\n chunk.status = \"blocked\";\n chunk.value = null;\n chunk.reason = null;\n try {\n var value = JSON.parse(resolvedModel, chunk._response._fromJSON),\n resolveListeners = chunk.value;\n null !== resolveListeners &&\n ((chunk.value = null),\n (chunk.reason = null),\n wakeChunk(resolveListeners, value));\n if (null !== initializingHandler) {\n if (initializingHandler.errored) throw initializingHandler.value;\n if (0 < initializingHandler.deps) {\n initializingHandler.value = value;\n initializingHandler.chunk = chunk;\n return;\n }\n }\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n } finally {\n initializingHandler = prevHandler;\n }\n}\nfunction initializeModuleChunk(chunk) {\n try {\n var value = requireModule(chunk.value);\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n }\n}\nfunction reportGlobalError(response, error) {\n response._closed = !0;\n response._closedReason = error;\n response._chunks.forEach(function (chunk) {\n \"pending\" === chunk.status && triggerErrorOnChunk(chunk, error);\n });\n}\nfunction createLazyChunkWrapper(chunk) {\n return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk ||\n ((chunk = response._closed\n ? new ReactPromise(\"rejected\", null, response._closedReason, response)\n : createPendingChunk(response)),\n chunks.set(id, chunk));\n return chunk;\n}\nfunction waitForReference(\n referencedChunk,\n parentObject,\n key,\n response,\n map,\n path\n) {\n function fulfill(value) {\n for (var i = 1; i < path.length; i++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), value === handler.chunk))\n value = handler.value;\n else if (\"fulfilled\" === value.status) value = value.value;\n else {\n path.splice(0, i - 1);\n value.then(fulfill, reject);\n return;\n }\n value = value[path[i]];\n }\n i = map(response, value, parentObject, key);\n parentObject[key] = i;\n \"\" === key && null === handler.value && (handler.value = i);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((value = handler.value), key)) {\n case \"3\":\n value.props = i;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((i = handler.chunk),\n null !== i &&\n \"blocked\" === i.status &&\n ((value = i.value),\n (i.status = \"fulfilled\"),\n (i.value = handler.value),\n null !== value && wakeChunk(value, handler.value)));\n }\n function reject(error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n referencedChunk.then(fulfill, reject);\n return null;\n}\nfunction loadServerReference(response, metaData, parentObject, key) {\n if (!response._serverReferenceConfig)\n return createBoundServerReference(metaData, response._callServer);\n var serverReference = resolveServerReference(\n response._serverReferenceConfig,\n metaData.id\n );\n if ((response = preloadModule(serverReference)))\n metaData.bound && (response = Promise.all([response, metaData.bound]));\n else if (metaData.bound) response = Promise.resolve(metaData.bound);\n else\n return (\n (response = requireModule(serverReference)),\n registerBoundServerReference(response, metaData.id, metaData.bound),\n response\n );\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n deps: 1,\n errored: !1\n };\n response.then(\n function () {\n var resolvedValue = requireModule(serverReference);\n if (metaData.bound) {\n var boundArgs = metaData.bound.value.slice(0);\n boundArgs.unshift(null);\n resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs);\n }\n registerBoundServerReference(resolvedValue, metaData.id, metaData.bound);\n parentObject[key] = resolvedValue;\n \"\" === key && null === handler.value && (handler.value = resolvedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((boundArgs = handler.value), key)) {\n case \"3\":\n boundArgs.props = resolvedValue;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((resolvedValue = handler.chunk),\n null !== resolvedValue &&\n \"blocked\" === resolvedValue.status &&\n ((boundArgs = resolvedValue.value),\n (resolvedValue.status = \"fulfilled\"),\n (resolvedValue.value = handler.value),\n null !== boundArgs && wakeChunk(boundArgs, handler.value)));\n },\n function (error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(chunk, error);\n }\n }\n );\n return null;\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(\":\");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n break;\n case \"resolved_module\":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n var value = id.value;\n for (id = 1; id < reference.length; id++) {\n for (; value.$$typeof === REACT_LAZY_TYPE; )\n if (((value = value._payload), \"fulfilled\" === value.status))\n value = value.value;\n else\n return waitForReference(\n value,\n parentObject,\n key,\n response,\n map,\n reference.slice(id - 1)\n );\n value = value[reference[id]];\n }\n return map(response, value, parentObject, key);\n case \"pending\":\n case \"blocked\":\n return waitForReference(id, parentObject, key, response, map, reference);\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction createBlob(response, model) {\n return new Blob(model.slice(1), { type: model[0] });\n}\nfunction createFormData(response, model) {\n response = new FormData();\n for (var i = 0; i < model.length; i++)\n response.append(model[i][0], model[i][1]);\n return response;\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseModelString(response, parentObject, key, value) {\n if (\"$\" === value[0]) {\n if (\"$\" === value)\n return (\n null !== initializingHandler &&\n \"0\" === key &&\n (initializingHandler = {\n parent: initializingHandler,\n chunk: null,\n value: null,\n deps: 0,\n errored: !1\n }),\n REACT_ELEMENT_TYPE\n );\n switch (value[1]) {\n case \"$\":\n return value.slice(1);\n case \"L\":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n (response = getChunk(response, parentObject)),\n createLazyChunkWrapper(response)\n );\n case \"@\":\n if (2 === value.length) return new Promise(function () {});\n parentObject = parseInt(value.slice(2), 16);\n return getChunk(response, parentObject);\n case \"S\":\n return Symbol.for(value.slice(2));\n case \"F\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(\n response,\n value,\n parentObject,\n key,\n loadServerReference\n )\n );\n case \"T\":\n parentObject = \"$\" + value.slice(2);\n response = response._tempRefs;\n if (null == response)\n throw Error(\n \"Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply.\"\n );\n return response.get(parentObject);\n case \"Q\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createMap)\n );\n case \"W\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createSet)\n );\n case \"B\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createBlob)\n );\n case \"K\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createFormData)\n );\n case \"Z\":\n return resolveErrorProd();\n case \"i\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, extractIterator)\n );\n case \"I\":\n return Infinity;\n case \"-\":\n return \"$-0\" === value ? -0 : -Infinity;\n case \"N\":\n return NaN;\n case \"u\":\n return;\n case \"D\":\n return new Date(Date.parse(value.slice(2)));\n case \"n\":\n return BigInt(value.slice(2));\n default:\n return (\n (value = value.slice(1)),\n getOutlinedModel(response, value, parentObject, key, createModel)\n );\n }\n }\n return value;\n}\nfunction missingCall() {\n throw Error(\n 'Trying to call a function from \"use server\" but the callServer option was not implemented in your router runtime.'\n );\n}\nfunction ResponseInstance(\n bundlerConfig,\n serverReferenceConfig,\n moduleLoading,\n callServer,\n encodeFormAction,\n nonce,\n temporaryReferences\n) {\n var chunks = new Map();\n this._bundlerConfig = bundlerConfig;\n this._serverReferenceConfig = serverReferenceConfig;\n this._moduleLoading = moduleLoading;\n this._callServer = void 0 !== callServer ? callServer : missingCall;\n this._encodeFormAction = encodeFormAction;\n this._nonce = nonce;\n this._chunks = chunks;\n this._stringDecoder = new TextDecoder();\n this._fromJSON = null;\n this._rowLength = this._rowTag = this._rowID = this._rowState = 0;\n this._buffer = [];\n this._closed = !1;\n this._closedReason = null;\n this._tempRefs = temporaryReferences;\n this._fromJSON = createFromJSONCallback(this);\n}\nfunction resolveBuffer(response, id, buffer) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : chunks.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n}\nfunction resolveModule(response, id, model) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n model = JSON.parse(model, response._fromJSON);\n var clientReference = resolveClientReference(response._bundlerConfig, model);\n if ((model = preloadModule(clientReference))) {\n if (chunk) {\n var blockedChunk = chunk;\n blockedChunk.status = \"blocked\";\n } else\n (blockedChunk = new ReactPromise(\"blocked\", null, null, response)),\n chunks.set(id, blockedChunk);\n model.then(\n function () {\n return resolveModuleChunk(blockedChunk, clientReference);\n },\n function (error) {\n return triggerErrorOnChunk(blockedChunk, error);\n }\n );\n } else\n chunk\n ? resolveModuleChunk(chunk, clientReference)\n : chunks.set(\n id,\n new ReactPromise(\"resolved_module\", clientReference, null, response)\n );\n}\nfunction resolveStream(response, id, stream, controller) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk\n ? \"pending\" === chunk.status &&\n ((response = chunk.value),\n (chunk.status = \"fulfilled\"),\n (chunk.value = stream),\n (chunk.reason = controller),\n null !== response && wakeChunk(response, chunk.value))\n : chunks.set(\n id,\n new ReactPromise(\"fulfilled\", stream, controller, response)\n );\n}\nfunction startReadableStream(response, id, type) {\n var controller = null;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, id, type, {\n enqueueValue: function (value) {\n null === previousBlockedChunk\n ? controller.enqueue(value)\n : previousBlockedChunk.then(function () {\n controller.enqueue(value);\n });\n },\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new ReactPromise(\"resolved_model\", json, null, response);\n initializeModelChunk(chunk);\n \"fulfilled\" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$52 = createPendingChunk(response);\n chunk$52.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$52;\n chunk.then(function () {\n previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);\n resolveModelChunk(chunk$52, json);\n });\n }\n },\n close: function () {\n if (null === previousBlockedChunk) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (null === previousBlockedChunk) controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction startAsyncIterable(response, id, iterator) {\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n $jscomp$compprop0 = {};\n $jscomp$compprop0 =\n (($jscomp$compprop0[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n \"Values cannot be passed to next() of AsyncIterables passed to Client Components.\"\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new ReactPromise(\n \"fulfilled\",\n { done: !0, value: void 0 },\n null,\n response\n );\n buffer[nextReadIndex] = createPendingChunk(response);\n }\n return buffer[nextReadIndex++];\n });\n }),\n $jscomp$compprop0);\n resolveStream(\n response,\n id,\n iterator ? $jscomp$compprop0[ASYNC_ITERATOR]() : $jscomp$compprop0,\n {\n enqueueValue: function (value) {\n if (nextWriteIndex === buffer.length)\n buffer[nextWriteIndex] = new ReactPromise(\n \"fulfilled\",\n { done: !1, value: value },\n null,\n response\n );\n else {\n var chunk = buffer[nextWriteIndex],\n resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"fulfilled\";\n chunk.value = { done: !1, value: value };\n null !== resolveListeners &&\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners);\n }\n nextWriteIndex++;\n },\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);\n nextWriteIndex++;\n },\n close: function (value) {\n closed = !0;\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);\n for (nextWriteIndex++; nextWriteIndex < buffer.length; )\n resolveIteratorResultChunk(\n buffer[nextWriteIndex++],\n '\"$undefined\"',\n !0\n );\n },\n error: function (error) {\n closed = !0;\n for (\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = createPendingChunk(response));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(buffer[nextWriteIndex++], error);\n }\n }\n );\n}\nfunction resolveErrorProd() {\n var error = Error(\n \"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.\"\n );\n error.stack = \"Error: \" + error.message;\n return error;\n}\nfunction mergeBuffer(buffer, lastChunk) {\n for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)\n byteLength += buffer[i].byteLength;\n byteLength = new Uint8Array(byteLength);\n for (var i$53 = (i = 0); i$53 < l; i$53++) {\n var chunk = buffer[i$53];\n byteLength.set(chunk, i);\n i += chunk.byteLength;\n }\n byteLength.set(lastChunk, i);\n return byteLength;\n}\nfunction resolveTypedArray(\n response,\n id,\n buffer,\n lastChunk,\n constructor,\n bytesPerElement\n) {\n buffer =\n 0 === buffer.length && 0 === lastChunk.byteOffset % bytesPerElement\n ? lastChunk\n : mergeBuffer(buffer, lastChunk);\n constructor = new constructor(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength / bytesPerElement\n );\n resolveBuffer(response, id, constructor);\n}\nfunction processFullBinaryRow(response, id, tag, buffer, chunk) {\n switch (tag) {\n case 65:\n resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);\n return;\n case 79:\n resolveTypedArray(response, id, buffer, chunk, Int8Array, 1);\n return;\n case 111:\n resolveBuffer(\n response,\n id,\n 0 === buffer.length ? chunk : mergeBuffer(buffer, chunk)\n );\n return;\n case 85:\n resolveTypedArray(response, id, buffer, chunk, Uint8ClampedArray, 1);\n return;\n case 83:\n resolveTypedArray(response, id, buffer, chunk, Int16Array, 2);\n return;\n case 115:\n resolveTypedArray(response, id, buffer, chunk, Uint16Array, 2);\n return;\n case 76:\n resolveTypedArray(response, id, buffer, chunk, Int32Array, 4);\n return;\n case 108:\n resolveTypedArray(response, id, buffer, chunk, Uint32Array, 4);\n return;\n case 71:\n resolveTypedArray(response, id, buffer, chunk, Float32Array, 4);\n return;\n case 103:\n resolveTypedArray(response, id, buffer, chunk, Float64Array, 8);\n return;\n case 77:\n resolveTypedArray(response, id, buffer, chunk, BigInt64Array, 8);\n return;\n case 109:\n resolveTypedArray(response, id, buffer, chunk, BigUint64Array, 8);\n return;\n case 86:\n resolveTypedArray(response, id, buffer, chunk, DataView, 1);\n return;\n }\n for (\n var stringDecoder = response._stringDecoder, row = \"\", i = 0;\n i < buffer.length;\n i++\n )\n row += stringDecoder.decode(buffer[i], decoderOptions);\n buffer = row += stringDecoder.decode(chunk);\n switch (tag) {\n case 73:\n resolveModule(response, id, buffer);\n break;\n case 72:\n id = buffer[0];\n buffer = buffer.slice(1);\n response = JSON.parse(buffer, response._fromJSON);\n buffer = ReactDOMSharedInternals.d;\n switch (id) {\n case \"D\":\n buffer.D(response);\n break;\n case \"C\":\n \"string\" === typeof response\n ? buffer.C(response)\n : buffer.C(response[0], response[1]);\n break;\n case \"L\":\n id = response[0];\n tag = response[1];\n 3 === response.length\n ? buffer.L(id, tag, response[2])\n : buffer.L(id, tag);\n break;\n case \"m\":\n \"string\" === typeof response\n ? buffer.m(response)\n : buffer.m(response[0], response[1]);\n break;\n case \"X\":\n \"string\" === typeof response\n ? buffer.X(response)\n : buffer.X(response[0], response[1]);\n break;\n case \"S\":\n \"string\" === typeof response\n ? buffer.S(response)\n : buffer.S(\n response[0],\n 0 === response[1] ? void 0 : response[1],\n 3 === response.length ? response[2] : void 0\n );\n break;\n case \"M\":\n \"string\" === typeof response\n ? buffer.M(response)\n : buffer.M(response[0], response[1]);\n }\n break;\n case 69:\n tag = JSON.parse(buffer);\n buffer = resolveErrorProd();\n buffer.digest = tag.digest;\n tag = response._chunks;\n (chunk = tag.get(id))\n ? triggerErrorOnChunk(chunk, buffer)\n : tag.set(id, new ReactPromise(\"rejected\", null, buffer, response));\n break;\n case 84:\n tag = response._chunks;\n (chunk = tag.get(id)) && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : tag.set(id, new ReactPromise(\"fulfilled\", buffer, null, response));\n break;\n case 78:\n case 68:\n case 87:\n throw Error(\n \"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.\"\n );\n case 82:\n startReadableStream(response, id, void 0);\n break;\n case 114:\n startReadableStream(response, id, \"bytes\");\n break;\n case 88:\n startAsyncIterable(response, id, !1);\n break;\n case 120:\n startAsyncIterable(response, id, !0);\n break;\n case 67:\n (response = response._chunks.get(id)) &&\n \"fulfilled\" === response.status &&\n response.reason.close(\"\" === buffer ? '\"$undefined\"' : buffer);\n break;\n default:\n (tag = response._chunks),\n (chunk = tag.get(id))\n ? resolveModelChunk(chunk, buffer)\n : tag.set(\n id,\n new ReactPromise(\"resolved_model\", buffer, null, response)\n );\n }\n}\nfunction createFromJSONCallback(response) {\n return function (key, value) {\n if (\"string\" === typeof value)\n return parseModelString(response, this, key, value);\n if (\"object\" === typeof value && null !== value) {\n if (value[0] === REACT_ELEMENT_TYPE) {\n if (\n ((key = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: value[1],\n key: value[2],\n ref: null,\n props: value[3]\n }),\n null !== initializingHandler)\n )\n if (\n ((value = initializingHandler),\n (initializingHandler = value.parent),\n value.errored)\n )\n (key = new ReactPromise(\"rejected\", null, value.value, response)),\n (key = createLazyChunkWrapper(key));\n else if (0 < value.deps) {\n var blockedChunk = new ReactPromise(\n \"blocked\",\n null,\n null,\n response\n );\n value.value = key;\n value.chunk = blockedChunk;\n key = createLazyChunkWrapper(blockedChunk);\n }\n } else key = value;\n return key;\n }\n return value;\n };\n}\nfunction createResponseFromOptions(options) {\n return new ResponseInstance(\n null,\n null,\n null,\n options && options.callServer ? options.callServer : void 0,\n void 0,\n void 0,\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0\n );\n}\nfunction startReadingFromStream(response, stream) {\n function progress(_ref) {\n var value = _ref.value;\n if (_ref.done) reportGlobalError(response, Error(\"Connection closed.\"));\n else {\n var i = 0,\n rowState = response._rowState;\n _ref = response._rowID;\n for (\n var rowTag = response._rowTag,\n rowLength = response._rowLength,\n buffer = response._buffer,\n chunkLength = value.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = value[i++];\n 58 === lastIdx\n ? (rowState = 1)\n : (_ref =\n (_ref << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = value[i];\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 35 === rowState ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = value[i++];\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) |\n (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = value.indexOf(10, i);\n break;\n case 4:\n (lastIdx = i + rowLength), lastIdx > value.length && (lastIdx = -1);\n }\n var offset = value.byteOffset + i;\n if (-1 < lastIdx)\n (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),\n processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),\n (i = lastIdx),\n 3 === rowState && i++,\n (rowLength = _ref = rowTag = rowState = 0),\n (buffer.length = 0);\n else {\n value = new Uint8Array(value.buffer, offset, value.byteLength - i);\n buffer.push(value);\n rowLength -= value.byteLength;\n break;\n }\n }\n response._rowState = rowState;\n response._rowID = _ref;\n response._rowTag = rowTag;\n response._rowLength = rowLength;\n return reader.read().then(progress).catch(error);\n }\n }\n function error(e) {\n reportGlobalError(response, e);\n }\n var reader = stream.getReader();\n reader.read().then(progress).catch(error);\n}\nexports.createFromFetch = function (promiseForResponse, options) {\n var response = createResponseFromOptions(options);\n promiseForResponse.then(\n function (r) {\n startReadingFromStream(response, r.body);\n },\n function (e) {\n reportGlobalError(response, e);\n }\n );\n return getChunk(response, 0);\n};\nexports.createFromReadableStream = function (stream, options) {\n options = createResponseFromOptions(options);\n startReadingFromStream(options, stream);\n return getChunk(options, 0);\n};\nexports.createServerReference = function (id, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return callServer(id, args);\n }\n registerBoundServerReference(action, id, null);\n return action;\n};\nexports.createTemporaryReferenceSet = function () {\n return new Map();\n};\nexports.encodeReply = function (value, options) {\n return new Promise(function (resolve, reject) {\n var abort = processReply(\n value,\n \"\",\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0,\n resolve,\n reject\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(signal.reason);\n else {\n var listener = function () {\n abort(signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n });\n};\nexports.registerServerReference = function (reference, id) {\n registerBoundServerReference(reference, id, null);\n return reference;\n};\n"],"names":["normalizePathTrailingSlash","path","startsWith","process","pathname","query","hash","parsePath","removeTrailingSlash","useSyncDevRenderIndicator","NOOP","fn","PathParamsContext","PathnameContext","SearchParamsContext","createContext","ACTION_HEADER","FLIGHT_HEADERS","NEXT_DID_POSTPONE_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_IS_PRERENDER_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_RSC_UNION_QUERY","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_HEADER","handleMutable","isNotUndefined","value","state","mutable","shouldScroll","nextUrl","patchedTree","changedPath","computeChangedPath","tree","canonicalUrl","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","apply","scrollableSegments","onlyHashChange","hashFragment","decodeURIComponent","slice","segmentPaths","cache","prefetchCache","hasInterceptionRouteInCurrentTree","segment","parallelRoutes","Array","isArray","isInterceptionRouteAppPath","key","invalidateCacheBelowFlightSegmentPath","newCache","existingCache","flightSegmentPath","isLastEntry","length","parallelRouteKey","cacheKey","createRouterCacheKey","existingChildSegmentMap","get","childSegmentMap","Map","set","delete","existingChildCacheNode","childCacheNode","lazyData","rsc","prefetchRsc","head","prefetchHead","getNextFlightSegmentPath","HTML_LIMITED_BOT_UA_RE","getObjectClassLabel","Object","prototype","toString","call","isPlainObject","getPrototypeOf","hasOwnProperty","getChunkScriptFilename","__webpack_require__","u","args","encodeURIPath","patchConsoleError","onRecoverableError","error","errorInfo","cause","isError","stitchedError","getReactStitchedError","isBailoutToCSRError","reportGlobalError","describeHasCheckingStringProperty","describeStringPropertyAccess","wellKnownProperties","isDefinitelyAValidIdentifier","target","prop","test","JSON","stringify","stringifiedProp","Set","isGroupSegment","endsWith","isParallelRouteSegment","addSearchParamsIfPageSegment","searchParams","isPageSegment","includes","PAGE_SEGMENT_KEY","stringifiedQuery","DEFAULT_SEGMENT_KEY","createMutableActionQueue","getCurrentAppRouterState","runRemainingActions","actionQueue","setState","pending","next","runAction","action","needsRefresh","dispatch","type","ACTION_REFRESH","origin","window","location","prevState","payload","actionResult","handleResult","nextState","discarded","resolve","isThenable","then","reject","err","globalActionQueue","initialState","dispatchAction","resolvers","ACTION_RESTORE","deferredPromise","Promise","startTransition","newAction","last","ACTION_NAVIGATE","ACTION_SERVER_ACTION","reducer","HTML_LIMITED_BOT_UA_RE_STRING","getBotType","isBot","HEADLESS_BROWSER_BOT_UA_RE","source","isHtmlLimitedBotUA","userAgent","isDomBotUA","createHrefFromUrl","url","includeHash","search","extractInfoFromServerReferenceId","id","infoByte","parseInt","argMask","usedArgs","index","bit","bitPosition","typeBit","hasRestArgs","restArgs","omitUnusedArgs","info","filteredArgs","djb2Hash","str","i","charCodeAt","char","hexHash","enqueueConsecutiveDedupedError","queue","previousError","stack","push","ReadonlyURLSearchParams","RedirectType","ServerInsertedHTMLContext","forbidden","notFound","permanentRedirect","redirect","unauthorized","unstable_rethrow","useParams","usePathname","useRouter","useSearchParams","useSelectedLayoutSegment","useSelectedLayoutSegments","useServerInsertedHTML","useDynamicRouteParams","undefined","useContext","require","useMemo","readonlySearchParams","router","AppRouterContext","context","LayoutRouterContext","getSelectedLayoutSegmentPath","first","segmentPath","node","children","values","segmentValue","getSegmentValue","parentTree","selectedLayoutSegments","selectedLayoutSegment","ensureLeadingSlash","clearCacheNodeDataForSegmentPath","loading","useUntrackedPathname","file","split","map","encodeURIComponent","p","join","RedirectBoundary","RedirectErrorBoundary","HandleRedirect","reset","redirectType","useEffect","React","replace","Component","getDerivedStateFromError","isRedirectError","getURLFromRedirectError","getRedirectTypeFromError","render","props","constructor","assignLocation","urlBase","URL","addBasePath","href","reportError","globalThis","console","shouldRenderRootLevelErrorOverlay","__next_root_layout_missing_tags","getFlightDataPartsFromPath","flightDataPath","seedData","isHeadPartial","flightDataPathLength","pathToSegment","isRootRender","normalizeFlightData","flightData","isNextRouterError","isHTTPAccessFallbackError","handleSmoothScroll","options","htmlElement","document","documentElement","existing","style","scrollBehavior","dontForceLayout","getClientRects","RedirectStatusCode","mountLinkInstance","onLinkVisibilityChanged","onNavigationIntent","pingVisibleLinks","unmountLinkInstance","links","WeakMap","visibleLinks","observer","IntersectionObserver","handleIntersect","entry","entries","isVisible","intersectionRatio","rootMargin","element","kind","prefetchUrl","createPrefetchURL","reportErrorFn","instance","prefetchHref","wasHoveredOrTouched","prefetchTask","cacheVersion","observe","cancelPrefetchTask","unobserve","add","rescheduleLinkPrefetch","existingPrefetchTask","prefetchWithOldCacheImplementation","prefetch","catch","currentCacheVersion","getCurrentCacheVersion","task","treeAtTimeOfPrefetch","createCacheKey","priority","PrefetchPriority","Intent","Default","scheduleSegmentPrefetchTask","PrefetchKind","FULL","createUnhandledError","getUnhandledErrorType","isUnhandledConsoleOrRejection","digestSym","Symbol","for","consoleTypeSym","message","environmentName","NEXTJS_HYDRATION_ERROR_LINK","REACT_HYDRATION_ERROR_LINK","getDefaultHydrationErrorMessage","getHydrationErrorStackInfo","isHydrationError","isReactHydrationErrorMessage","testReactHydrationWarning","hydrationErrorRegex","reactUnifiedMismatchWarning","reactHydrationStartMessages","msg","some","prefix","hydrationWarningRegexes","regex","rawMessage","isReactHydrationWarning","diff","diffLog","trim","firstLineBreak","indexOf","trailing","trimmedMessage","stacks","diffs","forEach","line","ErrorBoundary","ErrorBoundaryHandler","GlobalError","workAsyncStorage","styles","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","text","fontSize","fontWeight","lineHeight","margin","HandleISRError","store","getStore","isRevalidate","isStaticGeneration","getDerivedStateFromProps","previousPathname","errorStyles","errorScripts","this","errorComponent","digest","html","body","div","h2","hostname","makeUntrackedExoticParams","CachedParams","underlyingParams","cachedParams","promise","keys","has","clientReducer","serverReducer","navigateReducer","ACTION_SERVER_PATCH","serverPatchReducer","restoreReducer","refreshReducer","ACTION_HMR_REFRESH","hmrRefreshReducer","ACTION_PREFETCH","prefetchReducer","serverActionReducer","matchSegment","existingSegment","RenderFromTemplateContext","TemplateContext","STATIC_STALETIME_MS","createSeededPrefetchCacheEntry","getOrCreatePrefetchCacheEntry","prunePrefetchCache","createPrefetchCacheKeyImpl","includeSearchParams","pathnameFromUrl","INTERCEPTION_CACHE_KEY_MARKER","createPrefetchCacheKey","allowAliasing","existingCacheEntry","getExistingCacheEntry","maybeNextUrl","TEMPORARY","cacheKeyWithParams","cacheKeyWithoutParams","cacheKeyToUse","existingEntry","isAliased","aliased","entryWithoutParams","cacheEntry","status","getPrefetchEntryCacheStatus","data","isFullPrefetch","prefetchResponse","createLazyPrefetchEntry","prefetchCacheKey","couldBeIntercepted","prefetchEntry","prefetchTime","Date","now","lastUsedTime","staleTime","PrefetchCacheEntryStatus","fresh","prefetchQueue","enqueue","fetchServerResponse","flightRouterState","prefetchKind","newCacheKey","prefixExistingPrefetchCacheEntry","existingCacheKey","prerendered","prefetchCacheEntry","expired","DYNAMIC_STALETIME_MS","Number","stale","reusable","AUTO","findSourceMapURL","createRenderParamsFromClient","fillLazyItemsTillLeafWithHead","routerState","cacheNodeSeedData","isLastSegment","newCacheNode","parallelRouteState","segmentForParallelRoute","parallelSeedData","existingParallelRoutesCacheNode","hasReusablePrefetch","parallelRouteCacheNode","existingCacheNode","seedNode","existingParallelRoutes","appBootstrap","hydrate","shouldHardNavigate","currentSegment","scripts","self","__next_s","reduce","src","el","createElement","setAttribute","onload","onerror","innerHTML","setTimeout","appendChild","version","env","appDir","HTTPAccessErrorStatus","HTTP_ERROR_FALLBACK_ERROR_CODE","getAccessFallbackErrorTypeByStatus","getAccessFallbackHTTPStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","ALLOWED_CODES","httpStatus","getRedirectError","getRedirectStatusCodeFromError","actionAsyncStorage","statusCode","TemporaryRedirect","REDIRECT_ERROR_CODE","isAction","PermanentRedirect","at","DIGEST","handleHardNavError","useNavFailureHandler","__pendingUrl","isNavigatingToNewRootLayout","currentTree","nextTree","currentTreeSegment","nextTreeSegment","currentTreeChild","nextTreeChild","InvariantError","Error","name","invalidateCacheByRouterState","warnOnce","_","handleExternalUrl","isExternalUrl","navigateType","getElementById","prefetchValues","bump","canonicalUrlOverride","postponed","isFirstRead","result","handleAliasedPrefetchEntry","updatedCanonicalUrl","currentCache","normalizedFlightData","treePatch","flightSegmentPathWithLeadingEmpty","newTree","applyRouterStatePatchToTree","startPPRNavigation","route","patchedRouterState","dynamicRequestTree","dynamicRequest","listenForDynamicRequest","createEmptyCacheNode","applied","subSegment","applyFlightData","triggerLazyFetchForLeafSegments","appliedPatch","generateSegmentsFromPatch","scrollableSegmentPath","flightRouterPatch","segments","parallelRoute","childSegment","handleGlobalErrors","removeBasePath","addRefreshMarkerToActiveParallelSegments","refetchMarker","refreshInactiveParallelSegments","fetchedSegments","refreshInactiveParallelSegmentsImpl","rootTree","updatedTree","updatedCache","includeNextUrl","refetchPath","fetchPromises","fetchPromise","parallelFetchPromise","all","BailoutToCSRError","BAILOUT_TO_CSR","reason","HTTPAccessFallbackBoundary","HTTPAccessFallbackErrorBoundary","componentDidCatch","triggeredStatus","errorComponents","isNotFound","isForbidden","isUnauthorized","meta","content","missingSlots","MissingSlotContext","hasErrorFallback","INTERCEPTION_ROUTE_MARKERS","extractInterceptionRouteInformation","find","m","interceptingRoute","marker","interceptedRoute","normalizeAppPath","concat","splitInterceptingRoute","createFromFetch","createTemporaryReferenceSet","encodeReply","fetchServerAction","revalidatedParts","actionId","actionArgs","temporaryReferences","res","fetch","method","headers","Accept","redirectHeader","_redirectType","isPrerender","revalidatedHeader","parse","paths","tag","cookie","e","redirectLocation","contentType","response","callServer","actionFlightData","f","a","redirectHref","actionRevalidated","log","handleSegmentMismatch","Boolean","hasBasePath","attachHydrationErrorState","parsedHydrationErrorState","isHydrationWarning","isHydrationRuntimeError","reactHydrationDiffSegments","getReactHydrationDiffSegments","details","hydrationErrorState","warning","notes","reactOutputComponentDiff","useServerActionDispatcher","globalServerActionDispatcher","useCallback","actionPayload","serverActionDispatcher","actionDispatcher","abortTask","updateCacheNodeOnPopstateRestoration","oldCacheNode","routerStateChildren","oldParallelRoutes","newParallelRoutes","routerStateChild","segmentChild","segmentKeyChild","oldSegmentMapChild","oldCacheNodeChild","newCacheNodeChild","newSegmentMapChild","shouldUsePrefetch","isDeferredRsc","MPA_NAVIGATION_TASK","oldRouterState","newRouterState","prefetchData","isPrefetchHeadPartial","isSamePageNavigation","scrollableSegmentsResult","updateCacheNodeOnNavigation","didFindRootLayout","oldRouterStateChildren","newRouterStateChildren","prefetchDataChildren","prefetchParallelRoutes","patchedRouterStateChildren","taskChildren","needsDynamicRequest","dynamicRequestTreeChildren","taskChild","newRouterStateChild","oldRouterStateChild","prefetchDataChild","newSegmentChild","newSegmentPathChild","newSegmentKeyChild","oldSegmentChild","spawnReusedTask","reusedRouterState","beginRenderingNewRouteTree","taskChildRoute","dynamicRequestTreeChild","patchRouterStateWithNewChildren","possiblyPartialPrefetchHead","createCacheNodeOnNavigation","spawnPendingTask","isPrefetchRscPartial","isLeafSegment","cacheNodeChildren","segmentPathChild","baseRouterState","newChildren","clone","newTask","createPendingCacheNode","size","maybePrefetchRsc","maybePrefetchLoading","createDeferredRsc","responsePromise","serverRouterState","dynamicData","dynamicHead","writeDynamicDataIntoPendingTask","rootTask","taskSegment","finishTaskUsingDynamicDataPayload","taskNode","finishPendingCacheNode","cacheNode","taskState","serverState","taskStateChildren","serverStateChildren","dataChildren","taskStateChild","serverStateChild","dataChild","segmentMapChild","taskSegmentChild","taskSegmentKeyChild","cacheNodeChild","abortPendingCacheNode","dynamicSegmentData","serverChildren","dynamicDataChildren","serverRouterStateChild","dynamicDataChild","DEFERRED","pendingRsc","rej","fulfilledRsc","rejectedRsc","canonicalUrlOverrideHref","AppRouter","globalMutable","isExternalURL","navigator","HistoryUpdater","appRouterState","useInsertionEffect","historyState","history","__NA","__PRIVATE_NEXTJS_INTERNALS_TREE","pushState","replaceState","copyNextJsInternalHistoryState","currentState","Head","headCacheNode","resolvedPrefetchRsc","useDeferredValue","Router","assetPrefix","globalError","useReducer","useUnwrapState","changeByServerResponse","useChangeByServerResponse","previousTree","serverResponse","navigate","useNavigate","locationSearch","appRouter","back","forward","scroll","refresh","hmrRefresh","handlePageShow","event","persisted","pendingMpaPath","addEventListener","removeEventListener","handleUnhandledRedirect","preventDefault","assign","use","unresolvedThenable","originalPushState","bind","originalReplaceState","applyUrlFromHistoryPushReplace","_unused","_N","onPopState","reload","matchingHead","findHeadInCache","pathParams","getSelectedParams","layoutRouterContext","parentCacheNode","parentSegmentPath","globalLayoutRouterContext","headKey","AppRouterAnnouncer","RuntimeStyles","Provider","GlobalLayoutRouterContext","globalErrorComponentAndStyles","globalErrorComponent","globalErrorStyles","DefaultGlobalError","runtimeStyles","runtimeStyleChanged","forceUpdate","useState","renderedStylesSize","changed","c","link","rel","precedence","dplId","_N_E_STYLE_LOAD","len","cb","normalizeRscURL","parallelRoutePatch","refetch","isRootLayout","applyPatch","lastSegment","initialTree","patchTree","initialSegment","initialParallelRoutes","patchSegment","patchParallelRoutes","setCacheBustingSearchParam","uniqueCacheKey","existingSearch","pairs","rawQuery","filter","MetadataBoundary","OutletBoundary","ViewportBoundary","NameSpace","METADATA_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","errorCode","destination","isNaN","initialServerDataBuffer","initialServerDataWriter","appElement","encoder","TextEncoder","initialServerDataLoaded","initialServerDataFlushed","initialFormStateData","nextServerDataCallback","seg","encode","binaryString","atob","decodedChunk","Uint8Array","DOMContentLoaded","close","readyState","nextServerDataLoadingGlobal","__next_f","readable","ReadableStream","start","controller","nextServerDataRegisterWriter","ctr","val","desiredSize","initialServerResponse","createFromReadableStream","pendingActionQueue","setAppBuildId","initialRSCPayload","b","createInitialRouterState","initialFlightData","initialCanonicalUrlParts","s","S","ServerRoot","G","StrictModeIfEnabled","StrictMode","Root","reactRootOptions","onCaughtError","onUncaughtError","reactEl","HeadManagerContext","ReactDOMClient","createRoot","hydrateRoot","formState","extractPathFromFlightRouterState","treeToRestore","oldCache","handleClientError","useErrorHandler","queueMicroTask","queueMicrotask","errorHandlers","rejectionQueue","rejectionHandlers","originError","consoleErrorArgs","capturedFromConsole","formattedErrorMessage","formatConsoleArgs","parseConsoleArgs","handler","storeHydrationErrorStateFromConsoleArgs","errorQueue","handleOnUnhandledError","handleOnUnhandledRejection","splice","onUnhandledError","onUnhandledRejection","ev","stackTraceLimit","originConsoleError","maybeError","createRenderSearchParamsFromClient","ANNOUNCER_TYPE","portalNode","setPortalNode","getAnnouncerNode","announcer","existingAnnouncer","getElementsByName","shadowRoot","childNodes","container","cssText","ariaLive","ANNOUNCER_ID","role","shadow","attachShadow","mode","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","current","createPortal","params","isDynamicParameter","removeLeadingSlash","segmentToPathname","normalizeSegments","acc","childrenPath","childPath","treeA","treeB","computeChangedPathImpl","segmentA","parallelRoutesA","segmentB","parallelRoutesB","normalizedSegmentA","normalizedSegmentB","parallelRouterKey","isImplicitErrorBoundary","errorBoundaryComponent","errorBoundary","DefaultErrorBoundary","hashIndex","queryIndex","hasQuery","substring","fillCacheWithNewSubTreeData","BrowserResolvedMetadata","metadata","findHeadInCacheImpl","keyPrefix","isLastItem","childParallelRoutes","item","fillCacheWithNewSubTreeDataButOnlyLoading","fillCacheHelper","fillLazyItems","incomingSegment","hmrRefreshReducerNoop","_action","hmrRefreshReducerImpl","AsyncMetadata","AsyncMetadataOutlet","MetadataOutlet","Suspense","fallback","syncDevRenderIndicator","PromiseQueue","promiseFn","taskResolve","taskReject","taskPromise","enqueueResult","findIndex","bumpedItem","unshift","maxConcurrency","forced","shift","addPathPrefix","formatObject","arg","depth","desc","getOwnPropertyDescriptor","jsonKey","String","idx","startQuote","code","parseFloat","getAppBuildId","globalBuildId","buildId","withoutSearchParameters","required","basePath","NavigationResultTag","bumpPrefetchTask","revalidateEntireCache","schedulePrefetchTask","notEnabled","pathHasPrefix","OuterLayoutRouter","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","ReactDOM","rectProperties","topOfElementInViewport","viewportHeight","rect","getBoundingClientRect","top","InnerScrollAndFocusHandler","componentDidMount","handlePotentialScroll","componentDidUpdate","every","scrollRefSegmentPath","domNode","getHashFragmentDomNode","findDOMNode","Element","HTMLElement","shouldSkipElement","getComputedStyle","position","nextElementSibling","scrollIntoView","clientHeight","scrollTop","focus","ScrollAndFocusHandler","InnerLayoutRouter","fullTree","resolvedRsc","refetchTree","walkAddRefetch","segmentPathToWalk","treeToRecreate","isLast","subTree","LoadingBoundary","loadingModuleData","promiseForLoading","loadingRsc","loadingStyles","loadingScripts","templateStyles","templateScripts","template","parentParallelRoutes","segmentMap","parentTreeSegment","treeSegment","stateKey","newLazyCacheNode","callback","addInsertedServerHTMLCallback","makeUntrackedExoticSearchParams","CachedSearchParams","underlyingSearchParams","cachedSearchParams","createFetch","createFromNextReadableStream","urlToUrlWithoutFlightMarker","urlWithoutFlightParameters","doMpaNavigation","abortController","AbortController","fetchPriority","signal","responseUrl","redirected","interception","staleTimeHeader","isFlightResponse","ok","flightStream","createUnclosingPrefetchStream","reader","originalFlightStream","getReader","pull","done","read","aborted","fetchUrl","credentials","abort","prefetchReducerImpl","identityReducerWhenSegmentCacheIsEnabled","getHydrationWarningType","htmlTagsWarnings","textAndTagsMismatchWarnings","normalizedMessage","isTextInTagsMismatchWarning","isHtmlTagsWarning","firstContent","secondContent","rest","isReact18","lastArg","generateHydrationDiffReact18","firstIndex","secondIndex","hydrationWarningType","components","component","exec","reverse","matchFirstContent","matchSecondContent","spaces","repeat","Math","max","serverContent","clientContent","ClientPageRoot","clientSearchParams","clientParams","initialSeedData","initialCanonicalUrl","initialHead","ClientSegmentRoot","slots","REACT_ERROR_STACK_BOTTOM_FRAME","REACT_ERROR_STACK_BOTTOM_FRAME_REGEX","isErrorInstance","originStack","originMessage","stackLines","indexOfSplit","newStack","newError","copyNextErrorCode","appendOwnerStack","captureOwnerStack","ownerStack","addSearchParamsToPageSegments","hasLoadingComponentInSeedData","fromEntries","fillNewTreeWithOnlyLoadingSegments","updatedParallelRoutes","ReadonlyURLSearchParamsError","URLSearchParams","append","sort"],"sourceRoot":"","ignoreList":[12,18,19,21,24,25,44,52,55,59,65,73,83,86,92,94,111,124,126,129,140,145]}