{"version":3,"file":"SuspenseValue.ChMuR4dk.mjs","names":[],"sources":["https:/framerusercontent.com/modules/wOI0XDWuPNeaYuatKp4b/ezOdeUpHBrE7fwL9evTL/browser.js","https:/framerusercontent.com/modules/HpmklHRFex5a5HMDftQo/5VVfjnRHGJM1T33zb1N5/SuspenseValue.js"],"sourcesContent":["export var Browser;(function(Browser){var isBrowser=Browser.isBrowser=()=>typeof window===\"object\";var isTouch=Browser.isTouch=()=>\"ontouchstart\"in window||navigator.maxTouchPoints>0;var isChrome=Browser.isChrome=()=>navigator.userAgent.toLowerCase().includes(\"chrome/\");var isWebKit=Browser.isWebKit=()=>navigator.userAgent.toLowerCase().includes(\"applewebkit/\");var isSafari=Browser.isSafari=()=>isWebKit()&&!isChrome();var isSafariDesktop=Browser.isSafariDesktop=()=>isSafari()&&!isTouch();var isWindows=Browser.isWindows=()=>/Win/.test(navigator.platform);var isMacOS=Browser.isMacOS=()=>/Mac/.test(navigator.platform);})(Browser||(Browser={}));\nexport const __FramerMetadata__ = {\"exports\":{\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./browser.map","export class SuspenseValue{read(){const status=this.status;// The component did rerender and we already set the status below.\nif(status){switch(status.type){// If the promise is still pending we need to suspend again.\ncase\"pending\":throw status.promise;// If the promise is fulfilled we can return the value\n// synchronously.\ncase\"fulfilled\":return status.value;// If the promise was rejected we can throw the error so we can\n// catch it with an ErrorBoundary in an ancestor.\ncase\"rejected\":throw status.reason;}}// Attach a callback to the promise to store the resolved value or the error\n// on the promise so we can synchronously read it later.\nconst promise=this.resolver().then(value=>{this.status={type:\"fulfilled\",value};},reason=>{this.status={type:\"rejected\",reason};});// This is the first time the promise is passed into the function. We set\n// the status field so we can early return above.\nthis.status={type:\"pending\",promise};// We throw the promise to suspend rendering. React will wait until the\n// promise is settled and rerender the component afterwards. When React\n// rerenders the component we can return the value in the code above.\nthrow promise;}constructor(resolver){this.resolver=resolver;}}\nexport const __FramerMetadata__ = {\"exports\":{\"SuspenseValue\":{\"type\":\"class\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SuspenseValue.map"],"mappings":"yKAAoB,SAAS,EAAQ,CAAe,EAAQ,cAAc,OAAO,GAAS,SAAS,IAAI,EAAQ,EAAQ,YAAY,iBAAiB,GAAQ,EAAU,eAAe,EAAM,EAAS,EAAQ,aAAa,EAAU,UAAU,cAAc,SAAS,WAAe,EAAS,EAAQ,aAAa,EAAU,UAAU,cAAc,SAAS,gBAAoB,EAAS,EAAQ,aAAa,KAAY,CAAC,IAA+B,EAAQ,oBAAoB,KAAY,CAAC,IAAwB,EAAQ,cAAc,MAAM,KAAK,EAAU,UAAsB,EAAQ,YAAY,MAAM,KAAK,EAAU,SAAW,GAAE,AAAU,IAAQ,EAAE,iBCAznB,EAAb,KAA0B,CAAC,MAAM,CAAC,IAAM,EAAO,KAAK,OACpD,GAAG,EAAQ,OAAO,EAAO,KAAd,CACX,IAAI,UAAU,MAAM,EAAO,QAE3B,IAAI,YAAY,OAAO,EAAO,MAE9B,IAAI,WAAW,MAAM,EAAO,MAAQ,CAEpC,IAAM,EAAQ,KAAK,WAAW,KAAK,GAAO,CAAC,KAAK,OAAO,CAAC,KAAK,YAAY,QAAM,AAAE,EAAC,GAAQ,CAAC,KAAK,OAAO,CAAC,KAAK,WAAW,SAAO,AAAE,GAKjI,KAHA,MAAK,OAAO,CAAC,KAAK,UAAU,UAAQ,CAG9B,CAAS,aAAY,EAAS,CAAC,KAAK,SAAS,CAAU,CAAC"}