@dxos/shell 0.5.1-main.bc05254 → 0.5.1-main.ff7d242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/{index-gdgcTUK8.mjs → index-Ba9TfOfV.mjs} +2 -2
- package/dist/bundle/{index-gdgcTUK8.mjs.map → index-Ba9TfOfV.mjs.map} +1 -1
- package/dist/bundle/{index-BkvYpJbE.mjs → index-DaiI_12x.mjs} +20 -17
- package/dist/bundle/{index-BkvYpJbE.mjs.map → index-DaiI_12x.mjs.map} +1 -1
- package/dist/bundle/shell.mjs +1 -1
- package/dist/bundle/shell.umd.js +4 -4
- package/dist/bundle/shell.umd.js.map +1 -1
- package/package.json +20 -20
package/dist/bundle/shell.mjs
CHANGED
package/dist/bundle/shell.umd.js
CHANGED
|
@@ -843,7 +843,7 @@ button {
|
|
|
843
843
|
background-color: #61493f;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
`;function $e5534fc185f7111e$export$2e2bcd8739ae039($){const I=React.useRef(null),U=React.useRef(null);return U.current&&U.current.update($),React.useEffect(()=>(U.current=new $efa000751917694d$export$2e2bcd8739ae039({...$,ref:I}),()=>{U.current=null}),[]),React.createElement("div",{ref:I})}const EmojiPickerToolbarButton=({disabled:$,defaultEmoji:I,emoji:U,onChangeEmoji:q,classNames:G})=>{const{t:K}=useTranslation("os"),[Y,J]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:U,onChange:q,defaultProp:I}),[X,Z]=React.useState(!1),Q=React.useRef(!1),[ee,te]=React.useState(!1);return React.createElement(Tooltip.Root,{open:ee,onOpenChange:ne=>{Q.current?(te(!1),Q.current=!1):te(ne)}},React.createElement(Popover.Root,{open:X,onOpenChange:ne=>{Z(ne),Q.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Popover.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:["gap-2 text-2xl plb-1",G],disabled:$},React.createElement("span",{className:"sr-only"},K("select emoji label")),React.createElement(react.ImageSquare,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},K("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),Z(!1),Q.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(J(ne),Z(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:$})=>{const{tx:I}=useThemeContext();return React.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12"},React.createElement("rect",{x:0,y:0,width:12,height:12,className:I("hue.fill","select--hue__preview",{hue:$})}))},HuePickerToolbarButton=({disabled:$,hue:I,onChangeHue:U,classNames:q,defaultHue:G})=>{const{t:K}=useTranslation("os"),[Y,J]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:U,defaultProp:G}),[X,Z]=React.useState(!1),Q=React.useRef(!1),[ee,te]=React.useState(!1);return React.createElement(Tooltip.Root,{open:ee,onOpenChange:ne=>{Q.current?(te(!1),Q.current=!1):te(ne)}},React.createElement(DropdownMenu2.Root,{modal:!1,open:X,onOpenChange:ne=>{Z(ne),Q.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",q),disabled:$},React.createElement("span",{className:"sr-only"},K("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},K("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu2.Content,{side:"bottom"},React.createElement(DropdownMenu2.Viewport,null,Object.keys(hueTokenThemes).map(ne=>React.createElement(DropdownMenu2.CheckboxItem,{key:ne,checked:ne===Y,onCheckedChange:()=>J(ne)},React.createElement(HuePreview,{hue:ne}),React.createElement("span",{className:"grow"},K(`${ne} label`)),React.createElement(DropdownMenu2.ItemIndicator,null,React.createElement(react.Check,null))))),React.createElement(DropdownMenu2.Arrow,null))))};var data={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},capitalize=$=>$.charAt(0).toUpperCase()+$.slice(1),generateName=$=>{const I=$.length*2/3,U=$.substring(0,I),q=$.substring(I),G=capitalize(data.adjectives[parseInt(U,16)%data.adjectives.length]),K=capitalize(data.animals[parseInt(q,16)%data.animals.length]);return`${G} ${K}`};const IdentityListItem=React.forwardRef(({identity:$,presence:I,onClick:U,classNames:q,...G},K)=>{var Z,Q,ee,te,ne;const Y=keyToFallback($.identityKey),J=useId("identityListItem__label"),X=((Z=$.profile)==null?void 0:Z.displayName)??generateName($.identityKey.toHex());return React.createElement(ListItem.Root,{...G,classNames:mx("flex gap-2 pis-3 pie-1 items-center",U&&"cursor-pointer",q),onClick:()=>U==null?void 0:U(),"data-testid":"identity-list-item",labelId:J,ref:K},React.createElement(Avatar.Root,{status:I===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:J,hue:((ee=(Q=$.profile)==null?void 0:Q.data)==null?void 0:ee.hue)||Y.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ne=(te=$.profile)==null?void 0:te.data)==null?void 0:ne.emoji)||Y.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},X)))}),SpaceMemberList=({spaceKey:$,includeSelf:I,onSelect:U})=>{const q=reactClient.useClient(),G=echo.useMembers($),K=React.useMemo(()=>I?G.sort(Y=>Y.identity.identityKey.equals(q.halo.identity.get().identityKey)?-1:1):G.filter(Y=>!Y.identity.identityKey.equals(q.halo.identity.get().identityKey)),[G]);return React.createElement(SpaceMemberListImpl,{members:K,onSelect:U})},SpaceMemberListImpl=({members:$,onSelect:I})=>{const{t:U}=useTranslation("os"),q=$.filter(G=>G.identity);return q.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},q.map(G=>React.createElement(IdentityListItem,{key:G.identity.identityKey.toHex(),identity:G.identity,presence:G.presence,onClick:I&&(()=>I(G))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},U("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:$,onClickAdd:I,onClickEdit:U,onClickReset:q,onClickJoinExisting:G,classNames:K,...Y},J)=>{var ne;const{t:X}=useTranslation("os"),Z=keyToFallback($.deviceKey),Q=useId("identityListItem__label"),ee=$.profile?X("device name placeholder",{os:$.profile.os,platform:$.profile.platform}):generateName($.deviceKey.toHex()),te=$.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...Y,classNames:["flex gap-2 items-center mlb-2",K],"data-testid":`device-list-item${te?"-current":""}`,labelId:Q,ref:J},React.createElement(Avatar.Root,{status:$.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:Q,hue:Z.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ne=$.profile)!=null&&ne.type?$.profile.type===halo.DeviceType.BROWSER?React.createElement(react.Compass,{...iconProps}):$.profile.type===halo.DeviceType.NATIVE?React.createElement(react.Desktop,{...iconProps}):[halo.DeviceType.AGENT,halo.DeviceType.AGENT_MANAGED].includes($.profile.type)?React.createElement(react.Robot,{...iconProps}):$.profile.type===halo.DeviceType.MOBILE?React.createElement(react.DeviceMobile,{...iconProps}):React.createElement(react.Devices,{...iconProps}):React.createElement(Avatar.Fallback,{text:Z.emoji})),te&&React.createElement(Tag,{color:"primary"},X("current device tag label")),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ee),$.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu2.Root,null,React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${te?"-current":""}.options`},React.createElement("span",{className:"sr-only"},X("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu2.Content,null,React.createElement(DropdownMenu2.Viewport,null,React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.join-existing",onClick:G},React.createElement(react.Intersect,{className:getSize(5)}),X("choose join new identity label")),React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.reset",onClick:q},React.createElement(react.Power,{className:getSize(5)}),X("reset device label")))))))}),DeviceList=({devices:$,onClickAdd:I,onClickEdit:U,onClickReset:q,onClickJoinExisting:G})=>{const{t:K}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},K("devices heading")),$.length>0&&React.createElement(List,null,$.map(Y=>React.createElement(DeviceListItem,{key:Y.deviceKey.toHex(),device:Y,onClickEdit:()=>U==null?void 0:U(Y),onClickReset:q,onClickJoinExisting:G}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm surface-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},K("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds($){const I=toDate($),U=new Date(Date.UTC(I.getFullYear(),I.getMonth(),I.getDate(),I.getHours(),I.getMinutes(),I.getSeconds(),I.getMilliseconds()));return U.setUTCFullYear(I.getFullYear()),+$-+U}function compareAsc($,I){const U=toDate($),q=toDate(I),G=U.getTime()-q.getTime();return G<0?-1:G>0?1:G}function differenceInCalendarMonths($,I){const U=toDate($),q=toDate(I),G=U.getFullYear()-q.getFullYear(),K=U.getMonth()-q.getMonth();return G*12+K}function getRoundingMethod($){return I=>{const q=($?Math[$]:Math.trunc)(I);return q===0?0:q}}function differenceInMilliseconds($,I){return+toDate($)-+toDate(I)}function endOfDay($){const I=toDate($);return I.setHours(23,59,59,999),I}function endOfMonth($){const I=toDate($),U=I.getMonth();return I.setFullYear(I.getFullYear(),U+1,0),I.setHours(23,59,59,999),I}function isLastDayOfMonth($){const I=toDate($);return+endOfDay(I)==+endOfMonth(I)}function differenceInMonths($,I){const U=toDate($),q=toDate(I),G=compareAsc(U,q),K=Math.abs(differenceInCalendarMonths(U,q));let Y;if(K<1)Y=0;else{U.getMonth()===1&&U.getDate()>27&&U.setDate(30),U.setMonth(U.getMonth()-G*K);let J=compareAsc(U,q)===-G;isLastDayOfMonth(toDate($))&&K===1&&compareAsc($,q)===1&&(J=!1),Y=G*(K-Number(J))}return Y===0?0:Y}function differenceInSeconds($,I,U){const q=differenceInMilliseconds($,I)/1e3;return getRoundingMethod(U==null?void 0:U.roundingMethod)(q)}function formatDistance($,I,U){const q=getDefaultOptions(),G=(U==null?void 0:U.locale)??q.locale??enUS$1,K=2520,Y=compareAsc($,I);if(isNaN(Y))throw new RangeError("Invalid time value");const J=Object.assign({},U,{addSuffix:U==null?void 0:U.addSuffix,comparison:Y});let X,Z;Y>0?(X=toDate(I),Z=toDate($)):(X=toDate($),Z=toDate(I));const Q=differenceInSeconds(Z,X),ee=(getTimezoneOffsetInMilliseconds(Z)-getTimezoneOffsetInMilliseconds(X))/1e3,te=Math.round((Q-ee)/60);let ne;if(te<2)return U!=null&&U.includeSeconds?Q<5?G.formatDistance("lessThanXSeconds",5,J):Q<10?G.formatDistance("lessThanXSeconds",10,J):Q<20?G.formatDistance("lessThanXSeconds",20,J):Q<40?G.formatDistance("halfAMinute",0,J):Q<60?G.formatDistance("lessThanXMinutes",1,J):G.formatDistance("xMinutes",1,J):te===0?G.formatDistance("lessThanXMinutes",1,J):G.formatDistance("xMinutes",te,J);if(te<45)return G.formatDistance("xMinutes",te,J);if(te<90)return G.formatDistance("aboutXHours",1,J);if(te<minutesInDay){const ie=Math.round(te/60);return G.formatDistance("aboutXHours",ie,J)}else{if(te<K)return G.formatDistance("xDays",1,J);if(te<minutesInMonth){const ie=Math.round(te/minutesInDay);return G.formatDistance("xDays",ie,J)}else if(te<minutesInMonth*2)return ne=Math.round(te/minutesInMonth),G.formatDistance("aboutXMonths",ne,J)}if(ne=differenceInMonths(Z,X),ne<12){const ie=Math.round(te/minutesInMonth);return G.formatDistance("xMonths",ie,J)}else{const ie=ne%12,oe=Math.trunc(ne/12);return ie<3?G.formatDistance("aboutXYears",oe,J):ie<9?G.formatDistance("overXYears",oe,J):G.formatDistance("almostXYears",oe+1,J)}}function formatDistanceToNow($,I){return formatDistance($,Date.now(),I)}var RPC_TIMEOUT=2e4,SystemStatus;(function($){$[$.ACTIVE=0]="ACTIVE",$[$.INACTIVE=1]="INACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function($){(function(I){I[I.NONE=0]="NONE",I[I.TRUNCATE=1]="TRUNCATE",I[I.HUMANIZE=2]="HUMANIZE"})($.KEY_OPTION||($.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function($){(function(I){I[I.BROWSER=0]="BROWSER",I[I.SHARED_WORKER=1]="SHARED_WORKER",I[I.NODE=2]="NODE"})($.PLATFORM_TYPE||($.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function($){$[$.CURRENT=0]="CURRENT",$[$.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function($){(function(I){I[I.OFFLINE=0]="OFFLINE",I[I.ONLINE=1]="ONLINE",I[I.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function($){(function(I){I[I.OFFLINE=0]="OFFLINE",I[I.ONLINE=1]="ONLINE",I[I.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(SpaceMember||(SpaceMember={}));var SpaceState;(function($){$[$.INACTIVE=2]="INACTIVE",$[$.ACTIVE=6]="ACTIVE",$[$.CLOSED=1]="CLOSED",$[$.CONTROL_ONLY=7]="CONTROL_ONLY",$[$.INITIALIZING=4]="INITIALIZING",$[$.READY=3]="READY",$[$.ERROR=5]="ERROR"})(SpaceState||(SpaceState={}));var CreateEpochRequest;(function($){(function(I){I[I.NONE=0]="NONE",I[I.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",I[I.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",I[I.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT"})($.Migration||($.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var Invitation;(function($){(function(I){I[I.INTERACTIVE=0]="INTERACTIVE",I[I.DELEGATED=1]="DELEGATED",I[I.MULTIUSE=2]="MULTIUSE"})($.Type||($.Type={})),function(I){I[I.DEVICE=0]="DEVICE",I[I.SPACE=1]="SPACE"}($.Kind||($.Kind={})),function(I){I[I.NONE=0]="NONE",I[I.SHARED_SECRET=1]="SHARED_SECRET",I[I.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}($.AuthMethod||($.AuthMethod={})),function(I){I[I.INIT=0]="INIT",I[I.CONNECTING=1]="CONNECTING",I[I.CONNECTED=2]="CONNECTED",I[I.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",I[I.AUTHENTICATING=4]="AUTHENTICATING",I[I.SUCCESS=5]="SUCCESS",I[I.CANCELLED=6]="CANCELLED",I[I.TIMEOUT=7]="TIMEOUT",I[I.ERROR=8]="ERROR",I[I.EXPIRED=9]="EXPIRED"}($.State||($.State={}))})(Invitation||(Invitation={}));var QueryInvitationsResponse;(function($){(function(I){I[I.ADDED=0]="ADDED",I[I.REMOVED=1]="REMOVED",I[I.SAVED=2]="SAVED",I[I.LOAD_COMPLETE=3]="LOAD_COMPLETE"})($.Action||($.Action={})),function(I){I[I.CREATED=0]="CREATED",I[I.ACCEPTED=1]="ACCEPTED"}($.Type||($.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState$2;(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(ConnectionState$2||(ConnectionState$2={}));var LogLevel;(function($){$[$.TRACE=5]="TRACE",$[$.DEBUG=10]="DEBUG",$[$.INFO=11]="INFO",$[$.WARN=12]="WARN",$[$.ERROR=13]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function($){(function(I){I[I.INCLUSIVE=1]="INCLUSIVE",I[I.EXPLICIT=2]="EXPLICIT"})($.MatchingOptions||($.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$7($,I,U,q){var G=arguments.length,K=G<3?I:q===null?q=Object.getOwnPropertyDescriptor(I,U):q,Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,I,U,q);else for(var J=$.length-1;J>=0;J--)(Y=$[J])&&(K=(G<3?Y(K):G>3?Y(I,U,K):Y(I,U))||K);return G>3&&K&&Object.defineProperty(I,U,K),K}var __dxlog_file$8="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,_a$1,_b,Context=(_n=class{constructor({onError:I=G=>{if(!(G instanceof ContextDisposedError))throw this.dispose(),G},attributes:U={},parent:q}={}){this._disposeCallbacks=[],this._isDisposed=!1,this._disposePromise=void 0,this._parent=null,this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_a$1]="Context",this[_b]=()=>this.toString(),this._onError=I,this._attributes=U,q!==void 0&&(this._parent=q)}static default(){return new _n}get disposed(){return this._isDisposed}get disposeCallbacksLength(){return this._disposeCallbacks.length}onDispose(I){return this._isDisposed&&(async()=>{try{await I()}catch(U){log$2.catch(U,void 0,{F:__dxlog_file$8,L:88,S:this,C:(q,G)=>q(...G)})}})(),this._disposeCallbacks.push(I),this._disposeCallbacks.length>this.maxSafeDisposeCallbacks&&log$2.warn("Context has a large number of dispose callbacks. This might be a memory leak.",{count:this._disposeCallbacks.length,safeThreshold:this.maxSafeDisposeCallbacks},{F:__dxlog_file$8,L:95,S:this,C:(U,q)=>U(...q)}),()=>{const U=this._disposeCallbacks.indexOf(I);U!==-1&&this._disposeCallbacks.splice(U,1)}}async dispose(){if(this._disposePromise)return this._disposePromise;this._isDisposed=!0;let I;this._disposePromise=new Promise(q=>{I=q});const U=Array.from(this._disposeCallbacks).reverse();this._disposeCallbacks.length=0;for(const q of U)try{await q()}catch(G){log$2.catch(G,void 0,{F:__dxlog_file$8,L:136,S:this,C:(K,Y)=>K(...Y)})}I()}raise(I){if(!this._isDisposed)try{this._onError(I)}catch(U){Promise.reject(U)}}derive({onError:I,attributes:U}={}){const q=new _n({onError:async K=>{if(!I)this.raise(K);else try{await I(K)}catch{this.raise(K)}},attributes:U}),G=this.onDispose(()=>q.dispose());return q.onDispose(G),q}getAttribute(I){if(I in this._attributes)return this._attributes[I];if(this._parent!==null)return this._parent.getAttribute(I)}toString(){return`Context(${this._isDisposed?"disposed":"active"})`}},_a$1=Symbol.toStringTag,_b=export_inspect.custom,_n);Context=_ts_decorate$7([safeInstanceof("Context")],Context);var cancelWithContext=($,I)=>{let U;return Promise.race([I,new Promise((q,G)=>{U=$.onDispose(()=>G(new ContextDisposedError))})]).finally(()=>U==null?void 0:U())},LifecycleState;(function($){$.CLOSED="CLOSED",$.OPEN="OPEN",$.ERROR="ERROR"})(LifecycleState||(LifecycleState={}));var Observable$2={};Object.defineProperty(Observable$2,"__esModule",{value:!0}),Observable$2.Observable=void 0;const hasSymbol=$=>!!Symbol[$],getSymbol=$=>hasSymbol($)?Symbol[$]:"@@"+$,SymbolIterator=getSymbol("iterator"),SymbolObservable=getSymbol("observable"),SymbolSpecies=getSymbol("species");function getMethod($,I){let U=$[I];if(U!=null){if(typeof U!="function")throw new TypeError(U+" is not a function");return U}}function getSpecies($){let I=$.constructor;return I!==void 0&&(I=I[SymbolSpecies],I===null&&(I=void 0)),I!==void 0?I:Observable$1}function isObservable$1($){return $ instanceof Observable$1}function hostReportError($){hostReportError.log?hostReportError.log($):setTimeout(()=>{throw $})}function enqueue($){Promise.resolve().then(()=>{try{$()}catch(I){hostReportError(I)}})}function cleanupSubscription($){let I=$._cleanup;if(I!==void 0&&($._cleanup=void 0,!!I))try{if(typeof I=="function")I();else{let U=getMethod(I,"unsubscribe");U&&U.call(I)}}catch(U){hostReportError(U)}}function closeSubscription($){$._observer=void 0,$._queue=void 0,$._state="closed"}function flushSubscription($){let I=$._queue;if(I){$._queue=void 0,$._state="ready";for(let U=0;U<I.length&&(notifySubscription($,I[U].type,I[U].value),$._state!=="closed");++U);}}function notifySubscription($,I,U){$._state="running";let q=$._observer;try{let G=getMethod(q,I);switch(I){case"next":G&&G.call(q,U);break;case"error":if(closeSubscription($),G)G.call(q,U);else throw U;break;case"complete":closeSubscription($),G&&G.call(q);break}}catch(G){hostReportError(G)}$._state==="closed"?cleanupSubscription($):$._state==="running"&&($._state="ready")}function onNotify($,I,U){if($._state!=="closed"){if($._state==="buffering"){$._queue.push({type:I,value:U});return}if($._state!=="ready"){$._state="buffering",$._queue=[{type:I,value:U}],enqueue(()=>flushSubscription($));return}notifySubscription($,I,U)}}class Subscription{constructor(I,U){this._cleanup=void 0,this._observer=I,this._queue=void 0,this._state="initializing";let q=this,G={get closed(){return q._state==="closed"},next(K){onNotify(q,"next",K)},error(K){onNotify(q,"error",K)},complete(){onNotify(q,"complete")}};try{this._cleanup=U.call(void 0,G)}catch(K){G.error(K)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class dr{constructor(I){if(!(this instanceof dr))throw new TypeError("Observable cannot be called as a function");if(typeof I!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=I}subscribe(I){return(typeof I!="object"||I===null)&&(I={next:I,error:arguments[1],complete:arguments[2]}),new Subscription(I,this._subscriber)}forEach(I){return new Promise((U,q)=>{if(typeof I!="function"){q(new TypeError(I+" is not a function"));return}function G(){K.unsubscribe(),U()}let K=this.subscribe({next(Y){try{I(Y,G)}catch(J){q(J),K.unsubscribe()}},error:q,complete:U})})}map(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>this.subscribe({next(G){try{G=I(G)}catch(K){return q.error(K)}q.next(G)},error(G){q.error(G)},complete(){q.complete()}}))}filter(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>this.subscribe({next(G){try{if(!I(G))return}catch(K){return q.error(K)}q.next(G)},error(G){q.error(G)},complete(){q.complete()}}))}reduce(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this),q=arguments.length>1,G=!1,Y=arguments[1];return new U(J=>this.subscribe({next(X){let Z=!G;if(G=!0,!Z||q)try{Y=I(Y,X)}catch(Q){return J.error(Q)}else Y=X},error(X){J.error(X)},complete(){if(!G&&!q)return J.error(new TypeError("Cannot reduce an empty sequence"));J.next(Y),J.complete()}}))}async all(){let I=[];return await this.forEach(U=>I.push(U)),I}concat(...I){let U=getSpecies(this);return new U(q=>{let G,K=0;function Y(J){G=J.subscribe({next(X){q.next(X)},error(X){q.error(X)},complete(){K===I.length?(G=void 0,q.complete()):Y(U.from(I[K++]))}})}return Y(this),()=>{G&&(G.unsubscribe(),G=void 0)}})}flatMap(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>{let G=[],K=this.subscribe({next(J){if(I)try{J=I(J)}catch(Z){return q.error(Z)}let X=U.from(J).subscribe({next(Z){q.next(Z)},error(Z){q.error(Z)},complete(){let Z=G.indexOf(X);Z>=0&&G.splice(Z,1),Y()}});G.push(X)},error(J){q.error(J)},complete(){Y()}});function Y(){K.closed&&G.length===0&&q.complete()}return()=>{G.forEach(J=>J.unsubscribe()),K.unsubscribe()}})}[SymbolObservable](){return this}static from(I){let U=typeof this=="function"?this:dr;if(I==null)throw new TypeError(I+" is not an object");let q=getMethod(I,SymbolObservable);if(q){let G=q.call(I);if(Object(G)!==G)throw new TypeError(G+" is not an object");return isObservable$1(G)&&G.constructor===U?G:new U(K=>G.subscribe(K))}if(hasSymbol("iterator")&&(q=getMethod(I,SymbolIterator),q))return new U(G=>{enqueue(()=>{if(!G.closed){for(let K of q.call(I))if(G.next(K),G.closed)return;G.complete()}})});if(Array.isArray(I))return new U(G=>{enqueue(()=>{if(!G.closed){for(let K=0;K<I.length;++K)if(G.next(I[K]),G.closed)return;G.complete()}})});throw new TypeError(I+" is not observable")}static of(...I){let U=typeof this=="function"?this:dr;return new U(q=>{enqueue(()=>{if(!q.closed){for(let G=0;G<I.length;++G)if(q.next(I[G]),q.closed)return;q.complete()}})})}static get[SymbolSpecies](){return this}};Observable$2.Observable=Observable$1,Object.defineProperty(Observable$1,Symbol("extensions"),{value:{symbol:SymbolObservable,hostReportError},configurable:!0});var zenObservable=Observable$2.Observable;const Observable=getDefaultExportFromCjs(zenObservable);var readableBrowser={exports:{}},events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function(I,U,q){return Function.prototype.apply.call(I,U,q)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:ReflectOwnKeys=function(I){return Object.getOwnPropertyNames(I)};function ProcessEmitWarning($){console&&console.warn&&console.warn($)}var NumberIsNaN=Number.isNaN||function(I){return I!==I};function EventEmitter$1(){EventEmitter$1.init.call(this)}events.exports=EventEmitter$1,events.exports.once=once$2,EventEmitter$1.EventEmitter=EventEmitter$1,EventEmitter$1.prototype._events=void 0,EventEmitter$1.prototype._eventsCount=0,EventEmitter$1.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener($){if(typeof $!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof $)}Object.defineProperty(EventEmitter$1,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function($){if(typeof $!="number"||$<0||NumberIsNaN($))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+$+".");defaultMaxListeners=$}}),EventEmitter$1.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter$1.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||NumberIsNaN(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function _getMaxListeners($){return $._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:$._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function(I){for(var U=[],q=1;q<arguments.length;q++)U.push(arguments[q]);var G=I==="error",K=this._events;if(K!==void 0)G=G&&K.error===void 0;else if(!G)return!1;if(G){var Y;if(U.length>0&&(Y=U[0]),Y instanceof Error)throw Y;var J=new Error("Unhandled error."+(Y?" ("+Y.message+")":""));throw J.context=Y,J}var X=K[I];if(X===void 0)return!1;if(typeof X=="function")ReflectApply(X,this,U);else for(var Z=X.length,Q=arrayClone(X,Z),q=0;q<Z;++q)ReflectApply(Q[q],this,U);return!0};function _addListener($,I,U,q){var G,K,Y;if(checkListener(U),K=$._events,K===void 0?(K=$._events=Object.create(null),$._eventsCount=0):(K.newListener!==void 0&&($.emit("newListener",I,U.listener?U.listener:U),K=$._events),Y=K[I]),Y===void 0)Y=K[I]=U,++$._eventsCount;else if(typeof Y=="function"?Y=K[I]=q?[U,Y]:[Y,U]:q?Y.unshift(U):Y.push(U),G=_getMaxListeners($),G>0&&Y.length>G&&!Y.warned){Y.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+Y.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=$,J.type=I,J.count=Y.length,ProcessEmitWarning(J)}return $}EventEmitter$1.prototype.addListener=function(I,U){return _addListener(this,I,U,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function(I,U){return _addListener(this,I,U,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap($,I,U){var q={fired:!1,wrapFn:void 0,target:$,type:I,listener:U},G=onceWrapper.bind(q);return G.listener=U,q.wrapFn=G,G}EventEmitter$1.prototype.once=function(I,U){return checkListener(U),this.on(I,_onceWrap(this,I,U)),this},EventEmitter$1.prototype.prependOnceListener=function(I,U){return checkListener(U),this.prependListener(I,_onceWrap(this,I,U)),this},EventEmitter$1.prototype.removeListener=function(I,U){var q,G,K,Y,J;if(checkListener(U),G=this._events,G===void 0)return this;if(q=G[I],q===void 0)return this;if(q===U||q.listener===U)--this._eventsCount===0?this._events=Object.create(null):(delete G[I],G.removeListener&&this.emit("removeListener",I,q.listener||U));else if(typeof q!="function"){for(K=-1,Y=q.length-1;Y>=0;Y--)if(q[Y]===U||q[Y].listener===U){J=q[Y].listener,K=Y;break}if(K<0)return this;K===0?q.shift():spliceOne(q,K),q.length===1&&(G[I]=q[0]),G.removeListener!==void 0&&this.emit("removeListener",I,J||U)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function(I){var U,q,G;if(q=this._events,q===void 0)return this;if(q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):q[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete q[I]),this;if(arguments.length===0){var K=Object.keys(q),Y;for(G=0;G<K.length;++G)Y=K[G],Y!=="removeListener"&&this.removeAllListeners(Y);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(U=q[I],typeof U=="function")this.removeListener(I,U);else if(U!==void 0)for(G=U.length-1;G>=0;G--)this.removeListener(I,U[G]);return this};function _listeners($,I,U){var q=$._events;if(q===void 0)return[];var G=q[I];return G===void 0?[]:typeof G=="function"?U?[G.listener||G]:[G]:U?unwrapListeners(G):arrayClone(G,G.length)}EventEmitter$1.prototype.listeners=function(I){return _listeners(this,I,!0)},EventEmitter$1.prototype.rawListeners=function(I){return _listeners(this,I,!1)},EventEmitter$1.listenerCount=function($,I){return typeof $.listenerCount=="function"?$.listenerCount(I):listenerCount.call($,I)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount($){var I=this._events;if(I!==void 0){var U=I[$];if(typeof U=="function")return 1;if(U!==void 0)return U.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone($,I){for(var U=new Array(I),q=0;q<I;++q)U[q]=$[q];return U}function spliceOne($,I){for(;I+1<$.length;I++)$[I]=$[I+1];$.pop()}function unwrapListeners($){for(var I=new Array($.length),U=0;U<I.length;++U)I[U]=$[U].listener||$[U];return I}function once$2($,I){return new Promise(function(U,q){function G(Y){$.removeListener(I,K),q(Y)}function K(){typeof $.removeListener=="function"&&$.removeListener("error",G),U([].slice.call(arguments))}eventTargetAgnosticAddListener($,I,K,{once:!0}),I!=="error"&&addErrorHandlerIfEventEmitter($,G,{once:!0})})}function addErrorHandlerIfEventEmitter($,I,U){typeof $.on=="function"&&eventTargetAgnosticAddListener($,"error",I,U)}function eventTargetAgnosticAddListener($,I,U,q){if(typeof $.on=="function")q.once?$.once(I,U):$.on(I,U);else if(typeof $.addEventListener=="function")$.addEventListener(I,function G(K){q.once&&$.removeEventListener(I,G),U(K)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof $)}var eventsExports=events.exports,streamBrowser=eventsExports.EventEmitter,buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$2=0,len=code.length;i$2<len;++i$2)lookup[i$2]=code[i$2],revLookup[code.charCodeAt(i$2)]=i$2;revLookup[45]=62,revLookup[95]=63;function getLens($){var I=$.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var U=$.indexOf("=");U===-1&&(U=I);var q=U===I?0:4-U%4;return[U,q]}function byteLength($){var I=getLens($),U=I[0],q=I[1];return(U+q)*3/4-q}function _byteLength($,I,U){return(I+U)*3/4-U}function toByteArray($){var I,U=getLens($),q=U[0],G=U[1],K=new Arr(_byteLength($,q,G)),Y=0,J=G>0?q-4:q,X;for(X=0;X<J;X+=4)I=revLookup[$.charCodeAt(X)]<<18|revLookup[$.charCodeAt(X+1)]<<12|revLookup[$.charCodeAt(X+2)]<<6|revLookup[$.charCodeAt(X+3)],K[Y++]=I>>16&255,K[Y++]=I>>8&255,K[Y++]=I&255;return G===2&&(I=revLookup[$.charCodeAt(X)]<<2|revLookup[$.charCodeAt(X+1)]>>4,K[Y++]=I&255),G===1&&(I=revLookup[$.charCodeAt(X)]<<10|revLookup[$.charCodeAt(X+1)]<<4|revLookup[$.charCodeAt(X+2)]>>2,K[Y++]=I>>8&255,K[Y++]=I&255),K}function tripletToBase64($){return lookup[$>>18&63]+lookup[$>>12&63]+lookup[$>>6&63]+lookup[$&63]}function encodeChunk$1($,I,U){for(var q,G=[],K=I;K<U;K+=3)q=($[K]<<16&16711680)+($[K+1]<<8&65280)+($[K+2]&255),G.push(tripletToBase64(q));return G.join("")}function fromByteArray($){for(var I,U=$.length,q=U%3,G=[],K=16383,Y=0,J=U-q;Y<J;Y+=K)G.push(encodeChunk$1($,Y,Y+K>J?J:Y+K));return q===1?(I=$[U-1],G.push(lookup[I>>2]+lookup[I<<4&63]+"==")):q===2&&(I=($[U-2]<<8)+$[U-1],G.push(lookup[I>>10]+lookup[I>>4&63]+lookup[I<<2&63]+"=")),G.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function($,I,U,q,G){var K,Y,J=G*8-q-1,X=(1<<J)-1,Z=X>>1,Q=-7,ee=U?G-1:0,te=U?-1:1,ne=$[I+ee];for(ee+=te,K=ne&(1<<-Q)-1,ne>>=-Q,Q+=J;Q>0;K=K*256+$[I+ee],ee+=te,Q-=8);for(Y=K&(1<<-Q)-1,K>>=-Q,Q+=q;Q>0;Y=Y*256+$[I+ee],ee+=te,Q-=8);if(K===0)K=1-Z;else{if(K===X)return Y?NaN:(ne?-1:1)*(1/0);Y=Y+Math.pow(2,q),K=K-Z}return(ne?-1:1)*Y*Math.pow(2,K-q)},ieee754.write=function($,I,U,q,G,K){var Y,J,X,Z=K*8-G-1,Q=(1<<Z)-1,ee=Q>>1,te=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,ne=q?0:K-1,ie=q?1:-1,oe=I<0||I===0&&1/I<0?1:0;for(I=Math.abs(I),isNaN(I)||I===1/0?(J=isNaN(I)?1:0,Y=Q):(Y=Math.floor(Math.log(I)/Math.LN2),I*(X=Math.pow(2,-Y))<1&&(Y--,X*=2),Y+ee>=1?I+=te/X:I+=te*Math.pow(2,1-ee),I*X>=2&&(Y++,X/=2),Y+ee>=Q?(J=0,Y=Q):Y+ee>=1?(J=(I*X-1)*Math.pow(2,G),Y=Y+ee):(J=I*Math.pow(2,ee-1)*Math.pow(2,G),Y=0));G>=8;$[U+ne]=J&255,ne+=ie,J/=256,G-=8);for(Y=Y<<G|J,Z+=G;Z>0;$[U+ne]=Y&255,ne+=ie,Y/=256,Z-=8);$[U+ne-ie]|=oe*128};/*!
|
|
846
|
+
`;function $e5534fc185f7111e$export$2e2bcd8739ae039($){const I=React.useRef(null),U=React.useRef(null);return U.current&&U.current.update($),React.useEffect(()=>(U.current=new $efa000751917694d$export$2e2bcd8739ae039({...$,ref:I}),()=>{U.current=null}),[]),React.createElement("div",{ref:I})}const EmojiPickerToolbarButton=({disabled:$,defaultEmoji:I,emoji:U,onChangeEmoji:q,classNames:G})=>{const{t:K}=useTranslation("os"),[Y,J]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:U,onChange:q,defaultProp:I}),[X,Z]=React.useState(!1),Q=React.useRef(!1),[ee,te]=React.useState(!1);return React.createElement(Tooltip.Root,{open:ee,onOpenChange:ne=>{Q.current?(te(!1),Q.current=!1):te(ne)}},React.createElement(Popover.Root,{open:X,onOpenChange:ne=>{Z(ne),Q.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Popover.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:["gap-2 text-2xl plb-1",G],disabled:$},React.createElement("span",{className:"sr-only"},K("select emoji label")),React.createElement(react.ImageSquare,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},K("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),Z(!1),Q.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(J(ne),Z(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:$})=>{const{tx:I}=useThemeContext();return React.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12"},React.createElement("rect",{x:0,y:0,width:12,height:12,className:I("hue.fill","select--hue__preview",{hue:$})}))},HuePickerToolbarButton=({disabled:$,hue:I,onChangeHue:U,classNames:q,defaultHue:G})=>{const{t:K}=useTranslation("os"),[Y,J]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:U,defaultProp:G}),[X,Z]=React.useState(!1),Q=React.useRef(!1),[ee,te]=React.useState(!1);return React.createElement(Tooltip.Root,{open:ee,onOpenChange:ne=>{Q.current?(te(!1),Q.current=!1):te(ne)}},React.createElement(DropdownMenu2.Root,{modal:!1,open:X,onOpenChange:ne=>{Z(ne),Q.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",q),disabled:$},React.createElement("span",{className:"sr-only"},K("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},K("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu2.Content,{side:"bottom"},React.createElement(DropdownMenu2.Viewport,null,Object.keys(hueTokenThemes).map(ne=>React.createElement(DropdownMenu2.CheckboxItem,{key:ne,checked:ne===Y,onCheckedChange:()=>J(ne)},React.createElement(HuePreview,{hue:ne}),React.createElement("span",{className:"grow"},K(`${ne} label`)),React.createElement(DropdownMenu2.ItemIndicator,null,React.createElement(react.Check,null))))),React.createElement(DropdownMenu2.Arrow,null))))};var data={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},capitalize=$=>$.charAt(0).toUpperCase()+$.slice(1),generateName=$=>{const I=$.length*2/3,U=$.substring(0,I),q=$.substring(I),G=capitalize(data.adjectives[parseInt(U,16)%data.adjectives.length]),K=capitalize(data.animals[parseInt(q,16)%data.animals.length]);return`${G} ${K}`};const IdentityListItem=React.forwardRef(({identity:$,presence:I,onClick:U,classNames:q,...G},K)=>{var Z,Q,ee,te,ne;const Y=keyToFallback($.identityKey),J=useId("identityListItem__label"),X=((Z=$.profile)==null?void 0:Z.displayName)??generateName($.identityKey.toHex());return React.createElement(ListItem.Root,{...G,classNames:mx("flex gap-2 pis-3 pie-1 items-center",U&&"cursor-pointer",q),onClick:()=>U==null?void 0:U(),"data-testid":"identity-list-item",labelId:J,ref:K},React.createElement(Avatar.Root,{status:I===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:J,hue:((ee=(Q=$.profile)==null?void 0:Q.data)==null?void 0:ee.hue)||Y.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ne=(te=$.profile)==null?void 0:te.data)==null?void 0:ne.emoji)||Y.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},X)))}),SpaceMemberList=({spaceKey:$,includeSelf:I,onSelect:U})=>{const q=reactClient.useClient(),G=echo.useMembers($),K=React.useMemo(()=>I?G.sort(Y=>Y.identity.identityKey.equals(q.halo.identity.get().identityKey)?-1:1):G.filter(Y=>!Y.identity.identityKey.equals(q.halo.identity.get().identityKey)),[G]);return React.createElement(SpaceMemberListImpl,{members:K,onSelect:U})},SpaceMemberListImpl=({members:$,onSelect:I})=>{const{t:U}=useTranslation("os"),q=$.filter(G=>G.identity);return q.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},q.map(G=>React.createElement(IdentityListItem,{key:G.identity.identityKey.toHex(),identity:G.identity,presence:G.presence,onClick:I&&(()=>I(G))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},U("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:$,onClickAdd:I,onClickEdit:U,onClickReset:q,onClickJoinExisting:G,classNames:K,...Y},J)=>{var ne;const{t:X}=useTranslation("os"),Z=keyToFallback($.deviceKey),Q=useId("identityListItem__label"),ee=$.profile?X("device name placeholder",{os:$.profile.os,platform:$.profile.platform}):generateName($.deviceKey.toHex()),te=$.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...Y,classNames:["flex gap-2 items-center mlb-2",K],"data-testid":`device-list-item${te?"-current":""}`,labelId:Q,ref:J},React.createElement(Avatar.Root,{status:$.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:Q,hue:Z.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ne=$.profile)!=null&&ne.type?$.profile.type===halo.DeviceType.BROWSER?React.createElement(react.Compass,{...iconProps}):$.profile.type===halo.DeviceType.NATIVE?React.createElement(react.Desktop,{...iconProps}):[halo.DeviceType.AGENT,halo.DeviceType.AGENT_MANAGED].includes($.profile.type)?React.createElement(react.Robot,{...iconProps}):$.profile.type===halo.DeviceType.MOBILE?React.createElement(react.DeviceMobile,{...iconProps}):React.createElement(react.Devices,{...iconProps}):React.createElement(Avatar.Fallback,{text:Z.emoji})),te&&React.createElement(Tag,{color:"primary"},X("current device tag label")),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ee),$.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu2.Root,null,React.createElement(DropdownMenu2.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${te?"-current":""}.options`},React.createElement("span",{className:"sr-only"},X("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu2.Content,null,React.createElement(DropdownMenu2.Viewport,null,React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.join-existing",onClick:G},React.createElement(react.Intersect,{className:getSize(5)}),X("choose join new identity label")),React.createElement(DropdownMenu2.Item,{"data-testid":"device-list-item-current.reset",onClick:q},React.createElement(react.Power,{className:getSize(5)}),X("reset device label")))))))}),DeviceList=({devices:$,onClickAdd:I,onClickEdit:U,onClickReset:q,onClickJoinExisting:G})=>{const{t:K}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},K("devices heading")),$.length>0&&React.createElement(List,null,$.map(Y=>React.createElement(DeviceListItem,{key:Y.deviceKey.toHex(),device:Y,onClickEdit:()=>U==null?void 0:U(Y),onClickReset:q,onClickJoinExisting:G}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm surface-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},K("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds($){const I=toDate($),U=new Date(Date.UTC(I.getFullYear(),I.getMonth(),I.getDate(),I.getHours(),I.getMinutes(),I.getSeconds(),I.getMilliseconds()));return U.setUTCFullYear(I.getFullYear()),+$-+U}function compareAsc($,I){const U=toDate($),q=toDate(I),G=U.getTime()-q.getTime();return G<0?-1:G>0?1:G}function differenceInCalendarMonths($,I){const U=toDate($),q=toDate(I),G=U.getFullYear()-q.getFullYear(),K=U.getMonth()-q.getMonth();return G*12+K}function getRoundingMethod($){return I=>{const q=($?Math[$]:Math.trunc)(I);return q===0?0:q}}function differenceInMilliseconds($,I){return+toDate($)-+toDate(I)}function endOfDay($){const I=toDate($);return I.setHours(23,59,59,999),I}function endOfMonth($){const I=toDate($),U=I.getMonth();return I.setFullYear(I.getFullYear(),U+1,0),I.setHours(23,59,59,999),I}function isLastDayOfMonth($){const I=toDate($);return+endOfDay(I)==+endOfMonth(I)}function differenceInMonths($,I){const U=toDate($),q=toDate(I),G=compareAsc(U,q),K=Math.abs(differenceInCalendarMonths(U,q));let Y;if(K<1)Y=0;else{U.getMonth()===1&&U.getDate()>27&&U.setDate(30),U.setMonth(U.getMonth()-G*K);let J=compareAsc(U,q)===-G;isLastDayOfMonth(toDate($))&&K===1&&compareAsc($,q)===1&&(J=!1),Y=G*(K-Number(J))}return Y===0?0:Y}function differenceInSeconds($,I,U){const q=differenceInMilliseconds($,I)/1e3;return getRoundingMethod(U==null?void 0:U.roundingMethod)(q)}function formatDistance($,I,U){const q=getDefaultOptions(),G=(U==null?void 0:U.locale)??q.locale??enUS$1,K=2520,Y=compareAsc($,I);if(isNaN(Y))throw new RangeError("Invalid time value");const J=Object.assign({},U,{addSuffix:U==null?void 0:U.addSuffix,comparison:Y});let X,Z;Y>0?(X=toDate(I),Z=toDate($)):(X=toDate($),Z=toDate(I));const Q=differenceInSeconds(Z,X),ee=(getTimezoneOffsetInMilliseconds(Z)-getTimezoneOffsetInMilliseconds(X))/1e3,te=Math.round((Q-ee)/60);let ne;if(te<2)return U!=null&&U.includeSeconds?Q<5?G.formatDistance("lessThanXSeconds",5,J):Q<10?G.formatDistance("lessThanXSeconds",10,J):Q<20?G.formatDistance("lessThanXSeconds",20,J):Q<40?G.formatDistance("halfAMinute",0,J):Q<60?G.formatDistance("lessThanXMinutes",1,J):G.formatDistance("xMinutes",1,J):te===0?G.formatDistance("lessThanXMinutes",1,J):G.formatDistance("xMinutes",te,J);if(te<45)return G.formatDistance("xMinutes",te,J);if(te<90)return G.formatDistance("aboutXHours",1,J);if(te<minutesInDay){const ie=Math.round(te/60);return G.formatDistance("aboutXHours",ie,J)}else{if(te<K)return G.formatDistance("xDays",1,J);if(te<minutesInMonth){const ie=Math.round(te/minutesInDay);return G.formatDistance("xDays",ie,J)}else if(te<minutesInMonth*2)return ne=Math.round(te/minutesInMonth),G.formatDistance("aboutXMonths",ne,J)}if(ne=differenceInMonths(Z,X),ne<12){const ie=Math.round(te/minutesInMonth);return G.formatDistance("xMonths",ie,J)}else{const ie=ne%12,oe=Math.trunc(ne/12);return ie<3?G.formatDistance("aboutXYears",oe,J):ie<9?G.formatDistance("overXYears",oe,J):G.formatDistance("almostXYears",oe+1,J)}}function formatDistanceToNow($,I){return formatDistance($,Date.now(),I)}var RPC_TIMEOUT=2e4,LogLevel;(function($){$[$.TRACE=5]="TRACE",$[$.DEBUG=10]="DEBUG",$[$.INFO=11]="INFO",$[$.WARN=12]="WARN",$[$.ERROR=13]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function($){(function(I){I[I.INCLUSIVE=1]="INCLUSIVE",I[I.EXPLICIT=2]="EXPLICIT"})($.MatchingOptions||($.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var SystemStatus;(function($){$[$.ACTIVE=0]="ACTIVE",$[$.INACTIVE=1]="INACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function($){(function(I){I[I.NONE=0]="NONE",I[I.TRUNCATE=1]="TRUNCATE",I[I.HUMANIZE=2]="HUMANIZE"})($.KEY_OPTION||($.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function($){(function(I){I[I.BROWSER=0]="BROWSER",I[I.SHARED_WORKER=1]="SHARED_WORKER",I[I.NODE=2]="NODE"})($.PLATFORM_TYPE||($.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function($){$[$.CURRENT=0]="CURRENT",$[$.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function($){(function(I){I[I.OFFLINE=0]="OFFLINE",I[I.ONLINE=1]="ONLINE",I[I.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function($){(function(I){I[I.OFFLINE=0]="OFFLINE",I[I.ONLINE=1]="ONLINE",I[I.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(SpaceMember||(SpaceMember={}));var SpaceState;(function($){$[$.INACTIVE=2]="INACTIVE",$[$.ACTIVE=6]="ACTIVE",$[$.CLOSED=1]="CLOSED",$[$.CONTROL_ONLY=7]="CONTROL_ONLY",$[$.INITIALIZING=4]="INITIALIZING",$[$.READY=3]="READY",$[$.ERROR=5]="ERROR"})(SpaceState||(SpaceState={}));var CreateEpochRequest;(function($){(function(I){I[I.NONE=0]="NONE",I[I.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",I[I.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",I[I.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT"})($.Migration||($.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var Invitation;(function($){(function(I){I[I.INTERACTIVE=0]="INTERACTIVE",I[I.DELEGATED=1]="DELEGATED",I[I.MULTIUSE=2]="MULTIUSE"})($.Type||($.Type={})),function(I){I[I.DEVICE=0]="DEVICE",I[I.SPACE=1]="SPACE"}($.Kind||($.Kind={})),function(I){I[I.NONE=0]="NONE",I[I.SHARED_SECRET=1]="SHARED_SECRET",I[I.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}($.AuthMethod||($.AuthMethod={})),function(I){I[I.INIT=0]="INIT",I[I.CONNECTING=1]="CONNECTING",I[I.CONNECTED=2]="CONNECTED",I[I.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",I[I.AUTHENTICATING=4]="AUTHENTICATING",I[I.SUCCESS=5]="SUCCESS",I[I.CANCELLED=6]="CANCELLED",I[I.TIMEOUT=7]="TIMEOUT",I[I.ERROR=8]="ERROR",I[I.EXPIRED=9]="EXPIRED"}($.State||($.State={}))})(Invitation||(Invitation={}));var QueryInvitationsResponse;(function($){(function(I){I[I.ADDED=0]="ADDED",I[I.REMOVED=1]="REMOVED",I[I.SAVED=2]="SAVED",I[I.LOAD_COMPLETE=3]="LOAD_COMPLETE"})($.Action||($.Action={})),function(I){I[I.CREATED=0]="CREATED",I[I.ACCEPTED=1]="ACCEPTED"}($.Type||($.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState$2;(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(ConnectionState$2||(ConnectionState$2={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$7($,I,U,q){var G=arguments.length,K=G<3?I:q===null?q=Object.getOwnPropertyDescriptor(I,U):q,Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,I,U,q);else for(var J=$.length-1;J>=0;J--)(Y=$[J])&&(K=(G<3?Y(K):G>3?Y(I,U,K):Y(I,U))||K);return G>3&&K&&Object.defineProperty(I,U,K),K}var __dxlog_file$8="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,_a$1,_b,Context=(_n=class{constructor({onError:I=G=>{if(!(G instanceof ContextDisposedError))throw this.dispose(),G},attributes:U={},parent:q}={}){this._disposeCallbacks=[],this._isDisposed=!1,this._disposePromise=void 0,this._parent=null,this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_a$1]="Context",this[_b]=()=>this.toString(),this._onError=I,this._attributes=U,q!==void 0&&(this._parent=q)}static default(){return new _n}get disposed(){return this._isDisposed}get disposeCallbacksLength(){return this._disposeCallbacks.length}onDispose(I){return this._isDisposed&&(async()=>{try{await I()}catch(U){log$2.catch(U,void 0,{F:__dxlog_file$8,L:88,S:this,C:(q,G)=>q(...G)})}})(),this._disposeCallbacks.push(I),this._disposeCallbacks.length>this.maxSafeDisposeCallbacks&&log$2.warn("Context has a large number of dispose callbacks. This might be a memory leak.",{count:this._disposeCallbacks.length,safeThreshold:this.maxSafeDisposeCallbacks},{F:__dxlog_file$8,L:95,S:this,C:(U,q)=>U(...q)}),()=>{const U=this._disposeCallbacks.indexOf(I);U!==-1&&this._disposeCallbacks.splice(U,1)}}async dispose(){if(this._disposePromise)return this._disposePromise;this._isDisposed=!0;let I;this._disposePromise=new Promise(q=>{I=q});const U=Array.from(this._disposeCallbacks).reverse();this._disposeCallbacks.length=0;for(const q of U)try{await q()}catch(G){log$2.catch(G,void 0,{F:__dxlog_file$8,L:136,S:this,C:(K,Y)=>K(...Y)})}I()}raise(I){if(!this._isDisposed)try{this._onError(I)}catch(U){Promise.reject(U)}}derive({onError:I,attributes:U}={}){const q=new _n({onError:async K=>{if(!I)this.raise(K);else try{await I(K)}catch{this.raise(K)}},attributes:U}),G=this.onDispose(()=>q.dispose());return q.onDispose(G),q}getAttribute(I){if(I in this._attributes)return this._attributes[I];if(this._parent!==null)return this._parent.getAttribute(I)}toString(){return`Context(${this._isDisposed?"disposed":"active"})`}},_a$1=Symbol.toStringTag,_b=export_inspect.custom,_n);Context=_ts_decorate$7([safeInstanceof("Context")],Context);var cancelWithContext=($,I)=>{let U;return Promise.race([I,new Promise((q,G)=>{U=$.onDispose(()=>G(new ContextDisposedError))})]).finally(()=>U==null?void 0:U())},LifecycleState;(function($){$.CLOSED="CLOSED",$.OPEN="OPEN",$.ERROR="ERROR"})(LifecycleState||(LifecycleState={}));var Observable$2={};Object.defineProperty(Observable$2,"__esModule",{value:!0}),Observable$2.Observable=void 0;const hasSymbol=$=>!!Symbol[$],getSymbol=$=>hasSymbol($)?Symbol[$]:"@@"+$,SymbolIterator=getSymbol("iterator"),SymbolObservable=getSymbol("observable"),SymbolSpecies=getSymbol("species");function getMethod($,I){let U=$[I];if(U!=null){if(typeof U!="function")throw new TypeError(U+" is not a function");return U}}function getSpecies($){let I=$.constructor;return I!==void 0&&(I=I[SymbolSpecies],I===null&&(I=void 0)),I!==void 0?I:Observable$1}function isObservable$1($){return $ instanceof Observable$1}function hostReportError($){hostReportError.log?hostReportError.log($):setTimeout(()=>{throw $})}function enqueue($){Promise.resolve().then(()=>{try{$()}catch(I){hostReportError(I)}})}function cleanupSubscription($){let I=$._cleanup;if(I!==void 0&&($._cleanup=void 0,!!I))try{if(typeof I=="function")I();else{let U=getMethod(I,"unsubscribe");U&&U.call(I)}}catch(U){hostReportError(U)}}function closeSubscription($){$._observer=void 0,$._queue=void 0,$._state="closed"}function flushSubscription($){let I=$._queue;if(I){$._queue=void 0,$._state="ready";for(let U=0;U<I.length&&(notifySubscription($,I[U].type,I[U].value),$._state!=="closed");++U);}}function notifySubscription($,I,U){$._state="running";let q=$._observer;try{let G=getMethod(q,I);switch(I){case"next":G&&G.call(q,U);break;case"error":if(closeSubscription($),G)G.call(q,U);else throw U;break;case"complete":closeSubscription($),G&&G.call(q);break}}catch(G){hostReportError(G)}$._state==="closed"?cleanupSubscription($):$._state==="running"&&($._state="ready")}function onNotify($,I,U){if($._state!=="closed"){if($._state==="buffering"){$._queue.push({type:I,value:U});return}if($._state!=="ready"){$._state="buffering",$._queue=[{type:I,value:U}],enqueue(()=>flushSubscription($));return}notifySubscription($,I,U)}}class Subscription{constructor(I,U){this._cleanup=void 0,this._observer=I,this._queue=void 0,this._state="initializing";let q=this,G={get closed(){return q._state==="closed"},next(K){onNotify(q,"next",K)},error(K){onNotify(q,"error",K)},complete(){onNotify(q,"complete")}};try{this._cleanup=U.call(void 0,G)}catch(K){G.error(K)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class dr{constructor(I){if(!(this instanceof dr))throw new TypeError("Observable cannot be called as a function");if(typeof I!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=I}subscribe(I){return(typeof I!="object"||I===null)&&(I={next:I,error:arguments[1],complete:arguments[2]}),new Subscription(I,this._subscriber)}forEach(I){return new Promise((U,q)=>{if(typeof I!="function"){q(new TypeError(I+" is not a function"));return}function G(){K.unsubscribe(),U()}let K=this.subscribe({next(Y){try{I(Y,G)}catch(J){q(J),K.unsubscribe()}},error:q,complete:U})})}map(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>this.subscribe({next(G){try{G=I(G)}catch(K){return q.error(K)}q.next(G)},error(G){q.error(G)},complete(){q.complete()}}))}filter(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>this.subscribe({next(G){try{if(!I(G))return}catch(K){return q.error(K)}q.next(G)},error(G){q.error(G)},complete(){q.complete()}}))}reduce(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this),q=arguments.length>1,G=!1,Y=arguments[1];return new U(J=>this.subscribe({next(X){let Z=!G;if(G=!0,!Z||q)try{Y=I(Y,X)}catch(Q){return J.error(Q)}else Y=X},error(X){J.error(X)},complete(){if(!G&&!q)return J.error(new TypeError("Cannot reduce an empty sequence"));J.next(Y),J.complete()}}))}async all(){let I=[];return await this.forEach(U=>I.push(U)),I}concat(...I){let U=getSpecies(this);return new U(q=>{let G,K=0;function Y(J){G=J.subscribe({next(X){q.next(X)},error(X){q.error(X)},complete(){K===I.length?(G=void 0,q.complete()):Y(U.from(I[K++]))}})}return Y(this),()=>{G&&(G.unsubscribe(),G=void 0)}})}flatMap(I){if(typeof I!="function")throw new TypeError(I+" is not a function");let U=getSpecies(this);return new U(q=>{let G=[],K=this.subscribe({next(J){if(I)try{J=I(J)}catch(Z){return q.error(Z)}let X=U.from(J).subscribe({next(Z){q.next(Z)},error(Z){q.error(Z)},complete(){let Z=G.indexOf(X);Z>=0&&G.splice(Z,1),Y()}});G.push(X)},error(J){q.error(J)},complete(){Y()}});function Y(){K.closed&&G.length===0&&q.complete()}return()=>{G.forEach(J=>J.unsubscribe()),K.unsubscribe()}})}[SymbolObservable](){return this}static from(I){let U=typeof this=="function"?this:dr;if(I==null)throw new TypeError(I+" is not an object");let q=getMethod(I,SymbolObservable);if(q){let G=q.call(I);if(Object(G)!==G)throw new TypeError(G+" is not an object");return isObservable$1(G)&&G.constructor===U?G:new U(K=>G.subscribe(K))}if(hasSymbol("iterator")&&(q=getMethod(I,SymbolIterator),q))return new U(G=>{enqueue(()=>{if(!G.closed){for(let K of q.call(I))if(G.next(K),G.closed)return;G.complete()}})});if(Array.isArray(I))return new U(G=>{enqueue(()=>{if(!G.closed){for(let K=0;K<I.length;++K)if(G.next(I[K]),G.closed)return;G.complete()}})});throw new TypeError(I+" is not observable")}static of(...I){let U=typeof this=="function"?this:dr;return new U(q=>{enqueue(()=>{if(!q.closed){for(let G=0;G<I.length;++G)if(q.next(I[G]),q.closed)return;q.complete()}})})}static get[SymbolSpecies](){return this}};Observable$2.Observable=Observable$1,Object.defineProperty(Observable$1,Symbol("extensions"),{value:{symbol:SymbolObservable,hostReportError},configurable:!0});var zenObservable=Observable$2.Observable;const Observable=getDefaultExportFromCjs(zenObservable);var readableBrowser={exports:{}},events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function(I,U,q){return Function.prototype.apply.call(I,U,q)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:ReflectOwnKeys=function(I){return Object.getOwnPropertyNames(I)};function ProcessEmitWarning($){console&&console.warn&&console.warn($)}var NumberIsNaN=Number.isNaN||function(I){return I!==I};function EventEmitter$1(){EventEmitter$1.init.call(this)}events.exports=EventEmitter$1,events.exports.once=once$2,EventEmitter$1.EventEmitter=EventEmitter$1,EventEmitter$1.prototype._events=void 0,EventEmitter$1.prototype._eventsCount=0,EventEmitter$1.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener($){if(typeof $!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof $)}Object.defineProperty(EventEmitter$1,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function($){if(typeof $!="number"||$<0||NumberIsNaN($))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+$+".");defaultMaxListeners=$}}),EventEmitter$1.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter$1.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||NumberIsNaN(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function _getMaxListeners($){return $._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:$._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function(I){for(var U=[],q=1;q<arguments.length;q++)U.push(arguments[q]);var G=I==="error",K=this._events;if(K!==void 0)G=G&&K.error===void 0;else if(!G)return!1;if(G){var Y;if(U.length>0&&(Y=U[0]),Y instanceof Error)throw Y;var J=new Error("Unhandled error."+(Y?" ("+Y.message+")":""));throw J.context=Y,J}var X=K[I];if(X===void 0)return!1;if(typeof X=="function")ReflectApply(X,this,U);else for(var Z=X.length,Q=arrayClone(X,Z),q=0;q<Z;++q)ReflectApply(Q[q],this,U);return!0};function _addListener($,I,U,q){var G,K,Y;if(checkListener(U),K=$._events,K===void 0?(K=$._events=Object.create(null),$._eventsCount=0):(K.newListener!==void 0&&($.emit("newListener",I,U.listener?U.listener:U),K=$._events),Y=K[I]),Y===void 0)Y=K[I]=U,++$._eventsCount;else if(typeof Y=="function"?Y=K[I]=q?[U,Y]:[Y,U]:q?Y.unshift(U):Y.push(U),G=_getMaxListeners($),G>0&&Y.length>G&&!Y.warned){Y.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+Y.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=$,J.type=I,J.count=Y.length,ProcessEmitWarning(J)}return $}EventEmitter$1.prototype.addListener=function(I,U){return _addListener(this,I,U,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function(I,U){return _addListener(this,I,U,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap($,I,U){var q={fired:!1,wrapFn:void 0,target:$,type:I,listener:U},G=onceWrapper.bind(q);return G.listener=U,q.wrapFn=G,G}EventEmitter$1.prototype.once=function(I,U){return checkListener(U),this.on(I,_onceWrap(this,I,U)),this},EventEmitter$1.prototype.prependOnceListener=function(I,U){return checkListener(U),this.prependListener(I,_onceWrap(this,I,U)),this},EventEmitter$1.prototype.removeListener=function(I,U){var q,G,K,Y,J;if(checkListener(U),G=this._events,G===void 0)return this;if(q=G[I],q===void 0)return this;if(q===U||q.listener===U)--this._eventsCount===0?this._events=Object.create(null):(delete G[I],G.removeListener&&this.emit("removeListener",I,q.listener||U));else if(typeof q!="function"){for(K=-1,Y=q.length-1;Y>=0;Y--)if(q[Y]===U||q[Y].listener===U){J=q[Y].listener,K=Y;break}if(K<0)return this;K===0?q.shift():spliceOne(q,K),q.length===1&&(G[I]=q[0]),G.removeListener!==void 0&&this.emit("removeListener",I,J||U)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function(I){var U,q,G;if(q=this._events,q===void 0)return this;if(q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):q[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete q[I]),this;if(arguments.length===0){var K=Object.keys(q),Y;for(G=0;G<K.length;++G)Y=K[G],Y!=="removeListener"&&this.removeAllListeners(Y);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(U=q[I],typeof U=="function")this.removeListener(I,U);else if(U!==void 0)for(G=U.length-1;G>=0;G--)this.removeListener(I,U[G]);return this};function _listeners($,I,U){var q=$._events;if(q===void 0)return[];var G=q[I];return G===void 0?[]:typeof G=="function"?U?[G.listener||G]:[G]:U?unwrapListeners(G):arrayClone(G,G.length)}EventEmitter$1.prototype.listeners=function(I){return _listeners(this,I,!0)},EventEmitter$1.prototype.rawListeners=function(I){return _listeners(this,I,!1)},EventEmitter$1.listenerCount=function($,I){return typeof $.listenerCount=="function"?$.listenerCount(I):listenerCount.call($,I)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount($){var I=this._events;if(I!==void 0){var U=I[$];if(typeof U=="function")return 1;if(U!==void 0)return U.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone($,I){for(var U=new Array(I),q=0;q<I;++q)U[q]=$[q];return U}function spliceOne($,I){for(;I+1<$.length;I++)$[I]=$[I+1];$.pop()}function unwrapListeners($){for(var I=new Array($.length),U=0;U<I.length;++U)I[U]=$[U].listener||$[U];return I}function once$2($,I){return new Promise(function(U,q){function G(Y){$.removeListener(I,K),q(Y)}function K(){typeof $.removeListener=="function"&&$.removeListener("error",G),U([].slice.call(arguments))}eventTargetAgnosticAddListener($,I,K,{once:!0}),I!=="error"&&addErrorHandlerIfEventEmitter($,G,{once:!0})})}function addErrorHandlerIfEventEmitter($,I,U){typeof $.on=="function"&&eventTargetAgnosticAddListener($,"error",I,U)}function eventTargetAgnosticAddListener($,I,U,q){if(typeof $.on=="function")q.once?$.once(I,U):$.on(I,U);else if(typeof $.addEventListener=="function")$.addEventListener(I,function G(K){q.once&&$.removeEventListener(I,G),U(K)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof $)}var eventsExports=events.exports,streamBrowser=eventsExports.EventEmitter,buffer={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$2=0,len=code.length;i$2<len;++i$2)lookup[i$2]=code[i$2],revLookup[code.charCodeAt(i$2)]=i$2;revLookup[45]=62,revLookup[95]=63;function getLens($){var I=$.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var U=$.indexOf("=");U===-1&&(U=I);var q=U===I?0:4-U%4;return[U,q]}function byteLength($){var I=getLens($),U=I[0],q=I[1];return(U+q)*3/4-q}function _byteLength($,I,U){return(I+U)*3/4-U}function toByteArray($){var I,U=getLens($),q=U[0],G=U[1],K=new Arr(_byteLength($,q,G)),Y=0,J=G>0?q-4:q,X;for(X=0;X<J;X+=4)I=revLookup[$.charCodeAt(X)]<<18|revLookup[$.charCodeAt(X+1)]<<12|revLookup[$.charCodeAt(X+2)]<<6|revLookup[$.charCodeAt(X+3)],K[Y++]=I>>16&255,K[Y++]=I>>8&255,K[Y++]=I&255;return G===2&&(I=revLookup[$.charCodeAt(X)]<<2|revLookup[$.charCodeAt(X+1)]>>4,K[Y++]=I&255),G===1&&(I=revLookup[$.charCodeAt(X)]<<10|revLookup[$.charCodeAt(X+1)]<<4|revLookup[$.charCodeAt(X+2)]>>2,K[Y++]=I>>8&255,K[Y++]=I&255),K}function tripletToBase64($){return lookup[$>>18&63]+lookup[$>>12&63]+lookup[$>>6&63]+lookup[$&63]}function encodeChunk$1($,I,U){for(var q,G=[],K=I;K<U;K+=3)q=($[K]<<16&16711680)+($[K+1]<<8&65280)+($[K+2]&255),G.push(tripletToBase64(q));return G.join("")}function fromByteArray($){for(var I,U=$.length,q=U%3,G=[],K=16383,Y=0,J=U-q;Y<J;Y+=K)G.push(encodeChunk$1($,Y,Y+K>J?J:Y+K));return q===1?(I=$[U-1],G.push(lookup[I>>2]+lookup[I<<4&63]+"==")):q===2&&(I=($[U-2]<<8)+$[U-1],G.push(lookup[I>>10]+lookup[I>>4&63]+lookup[I<<2&63]+"=")),G.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function($,I,U,q,G){var K,Y,J=G*8-q-1,X=(1<<J)-1,Z=X>>1,Q=-7,ee=U?G-1:0,te=U?-1:1,ne=$[I+ee];for(ee+=te,K=ne&(1<<-Q)-1,ne>>=-Q,Q+=J;Q>0;K=K*256+$[I+ee],ee+=te,Q-=8);for(Y=K&(1<<-Q)-1,K>>=-Q,Q+=q;Q>0;Y=Y*256+$[I+ee],ee+=te,Q-=8);if(K===0)K=1-Z;else{if(K===X)return Y?NaN:(ne?-1:1)*(1/0);Y=Y+Math.pow(2,q),K=K-Z}return(ne?-1:1)*Y*Math.pow(2,K-q)},ieee754.write=function($,I,U,q,G,K){var Y,J,X,Z=K*8-G-1,Q=(1<<Z)-1,ee=Q>>1,te=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,ne=q?0:K-1,ie=q?1:-1,oe=I<0||I===0&&1/I<0?1:0;for(I=Math.abs(I),isNaN(I)||I===1/0?(J=isNaN(I)?1:0,Y=Q):(Y=Math.floor(Math.log(I)/Math.LN2),I*(X=Math.pow(2,-Y))<1&&(Y--,X*=2),Y+ee>=1?I+=te/X:I+=te*Math.pow(2,1-ee),I*X>=2&&(Y++,X/=2),Y+ee>=Q?(J=0,Y=Q):Y+ee>=1?(J=(I*X-1)*Math.pow(2,G),Y=Y+ee):(J=I*Math.pow(2,ee-1)*Math.pow(2,G),Y=0));G>=8;$[U+ne]=J&255,ne+=ie,J/=256,G-=8);for(Y=Y<<G|J,Z+=G;Z>0;$[U+ne]=Y&255,ne+=ie,Y/=256,Z-=8);$[U+ne-ie]|=oe*128};/*!
|
|
847
847
|
* The buffer module from node.js, for the browser.
|
|
848
848
|
*
|
|
849
849
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -936,7 +936,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$2=requireSafeBuffer().B
|
|
|
936
936
|
*
|
|
937
937
|
* This source code is licensed under the MIT license found in the
|
|
938
938
|
* LICENSE file in the root directory of this source tree.
|
|
939
|
-
*/var hasRequiredUseSyncExternalStoreShim_development;function requireUseSyncExternalStoreShim_development(){return hasRequiredUseSyncExternalStoreShim_development||(hasRequiredUseSyncExternalStoreShim_development=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var $=React,I=$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function U(de){{for(var ue=arguments.length,pe=new Array(ue>1?ue-1:0),ve=1;ve<ue;ve++)pe[ve-1]=arguments[ve];q("error",de,pe)}}function q(de,ue,pe){{var ve=I.ReactDebugCurrentFrame,me=ve.getStackAddendum();me!==""&&(ue+="%s",pe=pe.concat([me]));var be=pe.map(function(ye){return String(ye)});be.unshift("Warning: "+ue),Function.prototype.apply.call(console[de],console,be)}}function G(de,ue){return de===ue&&(de!==0||1/de===1/ue)||de!==de&&ue!==ue}var K=typeof Object.is=="function"?Object.is:G,Y=$.useState,J=$.useEffect,X=$.useLayoutEffect,Z=$.useDebugValue,Q=!1,ee=!1;function te(de,ue,pe){Q||$.startTransition!==void 0&&(Q=!0,U("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var ve=ue();if(!ee){var me=ue();K(ve,me)||(U("The result of getSnapshot should be cached to avoid an infinite loop"),ee=!0)}var be=Y({inst:{value:ve,getSnapshot:ue}}),ye=be[0].inst,Se=be[1];return X(function(){ye.value=ve,ye.getSnapshot=ue,ne(ye)&&Se({inst:ye})},[de,ve,ue]),J(function(){ne(ye)&&Se({inst:ye});var xe=function(){ne(ye)&&Se({inst:ye})};return de(xe)},[de]),Z(ve),ve}function ne(de){var ue=de.getSnapshot,pe=de.value;try{var ve=ue();return!K(pe,ve)}catch{return!0}}function ie(de,ue,pe){return ue()}var oe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ce=!oe,fe=ce?ie:te,se=$.useSyncExternalStore!==void 0?$.useSyncExternalStore:fe;useSyncExternalStoreShim_development.useSyncExternalStore=se,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),useSyncExternalStoreShim_development}process.env.NODE_ENV==="production"?shim.exports=requireUseSyncExternalStoreShim_production_min():shim.exports=requireUseSyncExternalStoreShim_development()
|
|
939
|
+
*/var hasRequiredUseSyncExternalStoreShim_development;function requireUseSyncExternalStoreShim_development(){return hasRequiredUseSyncExternalStoreShim_development||(hasRequiredUseSyncExternalStoreShim_development=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var $=React,I=$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function U(de){{for(var ue=arguments.length,pe=new Array(ue>1?ue-1:0),ve=1;ve<ue;ve++)pe[ve-1]=arguments[ve];q("error",de,pe)}}function q(de,ue,pe){{var ve=I.ReactDebugCurrentFrame,me=ve.getStackAddendum();me!==""&&(ue+="%s",pe=pe.concat([me]));var be=pe.map(function(ye){return String(ye)});be.unshift("Warning: "+ue),Function.prototype.apply.call(console[de],console,be)}}function G(de,ue){return de===ue&&(de!==0||1/de===1/ue)||de!==de&&ue!==ue}var K=typeof Object.is=="function"?Object.is:G,Y=$.useState,J=$.useEffect,X=$.useLayoutEffect,Z=$.useDebugValue,Q=!1,ee=!1;function te(de,ue,pe){Q||$.startTransition!==void 0&&(Q=!0,U("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var ve=ue();if(!ee){var me=ue();K(ve,me)||(U("The result of getSnapshot should be cached to avoid an infinite loop"),ee=!0)}var be=Y({inst:{value:ve,getSnapshot:ue}}),ye=be[0].inst,Se=be[1];return X(function(){ye.value=ve,ye.getSnapshot=ue,ne(ye)&&Se({inst:ye})},[de,ve,ue]),J(function(){ne(ye)&&Se({inst:ye});var xe=function(){ne(ye)&&Se({inst:ye})};return de(xe)},[de]),Z(ve),ve}function ne(de){var ue=de.getSnapshot,pe=de.value;try{var ve=ue();return!K(pe,ve)}catch{return!0}}function ie(de,ue,pe){return ue()}var oe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ce=!oe,fe=ce?ie:te,se=$.useSyncExternalStore!==void 0?$.useSyncExternalStore:fe;useSyncExternalStoreShim_development.useSyncExternalStore=se,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),useSyncExternalStoreShim_development}var hasRequiredShim;function requireShim(){return hasRequiredShim||(hasRequiredShim=1,process.env.NODE_ENV==="production"?shim.exports=requireUseSyncExternalStoreShim_production_min():shim.exports=requireUseSyncExternalStoreShim_development()),shim.exports}var shimExports=requireShim(),jsxDevRuntime={exports:{}},reactJsxDevRuntime_production_min={};/**
|
|
940
940
|
* @license React
|
|
941
941
|
* react-jsx-dev-runtime.production.min.js
|
|
942
942
|
*
|
|
@@ -970,7 +970,7 @@ Check the top-level render call using <`+kt+">.")}return pt}}function Nn(He,pt){
|
|
|
970
970
|
*
|
|
971
971
|
* This source code is licensed under the MIT license found in the
|
|
972
972
|
* LICENSE file in the root directory of this source tree.
|
|
973
|
-
*/var hasRequiredWithSelector_production_min;function requireWithSelector_production_min(){if(hasRequiredWithSelector_production_min)return withSelector_production_min;hasRequiredWithSelector_production_min=1;var $=React,I=
|
|
973
|
+
*/var hasRequiredWithSelector_production_min;function requireWithSelector_production_min(){if(hasRequiredWithSelector_production_min)return withSelector_production_min;hasRequiredWithSelector_production_min=1;var $=React,I=requireShim();function U(Z,Q){return Z===Q&&(Z!==0||1/Z===1/Q)||Z!==Z&&Q!==Q}var q=typeof Object.is=="function"?Object.is:U,G=I.useSyncExternalStore,K=$.useRef,Y=$.useEffect,J=$.useMemo,X=$.useDebugValue;return withSelector_production_min.useSyncExternalStoreWithSelector=function(Z,Q,ee,te,ne){var ie=K(null);if(ie.current===null){var oe={hasValue:!1,value:null};ie.current=oe}else oe=ie.current;ie=J(function(){function fe(ve){if(!se){if(se=!0,de=ve,ve=te(ve),ne!==void 0&&oe.hasValue){var me=oe.value;if(ne(me,ve))return ue=me}return ue=ve}if(me=ue,q(de,ve))return me;var be=te(ve);return ne!==void 0&&ne(me,be)?me:(de=ve,ue=be)}var se=!1,de,ue,pe=ee===void 0?null:ee;return[function(){return fe(Q())},pe===null?void 0:function(){return fe(pe())}]},[Q,ee,te,ne]);var ce=G(Z,ie[0],ie[1]);return Y(function(){oe.hasValue=!0,oe.value=ce},[ce]),X(ce),ce},withSelector_production_min}var withSelector_development={};/**
|
|
974
974
|
* @license React
|
|
975
975
|
* use-sync-external-store-shim/with-selector.development.js
|
|
976
976
|
*
|
|
@@ -978,7 +978,7 @@ Check the top-level render call using <`+kt+">.")}return pt}}function Nn(He,pt){
|
|
|
978
978
|
*
|
|
979
979
|
* This source code is licensed under the MIT license found in the
|
|
980
980
|
* LICENSE file in the root directory of this source tree.
|
|
981
|
-
*/var hasRequiredWithSelector_development;function requireWithSelector_development(){return hasRequiredWithSelector_development||(hasRequiredWithSelector_development=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var $=React,I=
|
|
981
|
+
*/var hasRequiredWithSelector_development;function requireWithSelector_development(){return hasRequiredWithSelector_development||(hasRequiredWithSelector_development=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var $=React,I=requireShim();function U(Q,ee){return Q===ee&&(Q!==0||1/Q===1/ee)||Q!==Q&&ee!==ee}var q=typeof Object.is=="function"?Object.is:U,G=I.useSyncExternalStore,K=$.useRef,Y=$.useEffect,J=$.useMemo,X=$.useDebugValue;function Z(Q,ee,te,ne,ie){var oe=K(null),ce;oe.current===null?(ce={hasValue:!1,value:null},oe.current=ce):ce=oe.current;var fe=J(function(){var pe=!1,ve,me,be=function(ke){if(!pe){pe=!0,ve=ke;var De=ne(ke);if(ie!==void 0&&ce.hasValue){var Be=ce.value;if(ie(Be,De))return me=Be,Be}return me=De,De}var Ve=ve,nt=me;if(q(Ve,ke))return nt;var ot=ne(ke);return ie!==void 0&&ie(nt,ot)?nt:(ve=ke,me=ot,ot)},ye=te===void 0?null:te,Se=function(){return be(ee())},xe=ye===null?void 0:function(){return be(ye())};return[Se,xe]},[ee,te,ne,ie]),se=fe[0],de=fe[1],ue=G(Q,se,de);return Y(function(){ce.hasValue=!0,ce.value=ue},[ue]),X(ue),ue}withSelector_development.useSyncExternalStoreWithSelector=Z,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),withSelector_development}process.env.NODE_ENV==="production"?withSelector.exports=requireWithSelector_production_min():withSelector.exports=requireWithSelector_development();var withSelectorExports=withSelector.exports;/*! *****************************************************************************
|
|
982
982
|
Copyright (c) Microsoft Corporation.
|
|
983
983
|
|
|
984
984
|
Permission to use, copy, modify, and/or distribute this software for any
|