@dxos/shell 0.6.14-main.f49f251 → 0.6.14-staging.e15392e
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/shell.mjs +10 -10
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +1 -1
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -39
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node/chunk-Q7SFCCGT.cjs +33 -0
- package/dist/lib/node/chunk-Q7SFCCGT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/react.cjs +4763 -0
- package/dist/lib/node/react.cjs.map +7 -0
- package/dist/lib/node/react.css +7 -0
- package/dist/lib/node/react.css.map +7 -0
- package/dist/lib/node/testing/index.cjs +181 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react.css +7 -0
- package/dist/lib/node-esm/react.css.map +7 -0
- package/dist/lib/node-esm/react.mjs +4809 -0
- package/dist/lib/node-esm/react.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +161 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +2 -2
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +10 -10
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +15 -15
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts +1 -2
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +2 -3
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +13 -9
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/index.js +1 -1
- package/dist/types/src/testing/index.js.map +1 -1
- package/package.json +38 -27
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +1 -1
- package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +1 -1
- package/src/playwright/invitations-manager.ts +2 -3
- package/src/playwright/invitations.spec.ts +14 -9
- package/src/testing/index.ts +2 -1
package/dist/bundle/shell.umd.js
CHANGED
|
@@ -958,7 +958,7 @@ button {
|
|
|
958
958
|
background-color: #61493f;
|
|
959
959
|
}
|
|
960
960
|
|
|
961
|
-
`;function $e5534fc185f7111e$export$2e2bcd8739ae039($){const _=React.useRef(null),I=React.useRef(null);return I.current&&I.current.update($),React.useEffect(()=>(I.current=new $efa000751917694d$export$2e2bcd8739ae039({...$,ref:_}),()=>{I.current=null}),[]),React.createElement("div",{ref:_})}const EmojiPickerToolbarButton=({disabled:$,defaultEmoji:_,emoji:I,onChangeEmoji:j,classNames:U})=>{const{t:G}=useTranslation("os"),{themeMode:q}=useThemeContext(),[K,Y]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:j,defaultProp:_}),[X,J]=React.useState(!1),Z=React.useRef(!1),[Q,ee]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Q,onOpenChange:ne=>{Z.current?(ee(!1),Z.current=!1):ee(ne)}},React.createElement(Popover.Root,{open:X,onOpenChange:ne=>{J(ne),Z.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",U],disabled:$},React.createElement("span",{className:"sr-only"},G("select emoji label")),React.createElement(react.UserCircle,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},G("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),J(!1),Z.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(Y(ne),J(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0,theme:q}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:$})=>{const{tx:_}=useThemeContext(),I=20;return React.createElement("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`},React.createElement("rect",{x:0,y:0,width:I,height:I,className:_("hue.fill","select--hue__preview",{hue:$})}))},hueTokens=Object.keys(hueTokenThemes).slice(0,16),HuePickerToolbarButton=({disabled:$,hue:_,onChangeHue:I,classNames:j,defaultHue:U})=>{const{t:G}=useTranslation("os"),[q,K]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:_,onChange:I,defaultProp:U}),[Y,X]=React.useState(!1),J=React.useRef(!1),[Z,Q]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Z,onOpenChange:ee=>{J.current?(Q(!1),J.current=!1):Q(ee)}},React.createElement(DropdownMenu.Root,{modal:!1,open:Y,onOpenChange:ee=>{X(ee),J.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",j),disabled:$},React.createElement("span",{className:"sr-only"},G("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},G("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu.Content,{side:"bottom",classNames:"!w-40"},React.createElement(DropdownMenu.Viewport,{classNames:"grid grid-cols-4"},hueTokens.map(ee=>React.createElement(DropdownMenu.CheckboxItem,{key:ee,checked:ee===q,onCheckedChange:()=>K(ee),classNames:"px-0 py-2 items-center justify-center"},React.createElement(HuePreview,{hue:ee})))))))};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 _=$.length*2/3,I=$.substring(0,_),j=$.substring(_),U=capitalize(data.adjectives[parseInt(I,16)%data.adjectives.length]),G=capitalize(data.animals[parseInt(j,16)%data.animals.length]);return`${U} ${G}`};const IdentityListItem=React.forwardRef(({identity:$,presence:_,onClick:I,classNames:j,...U},G)=>{var X,J,Z,Q,ee;const q=keyToFallback($.identityKey),K=useId$1("identityListItem__label"),Y=((X=$.profile)==null?void 0:X.displayName)??generateName($.identityKey.toHex());return React.createElement(ListItem.Root,{...U,classNames:mx("flex gap-2 pis-3 pie-1 items-center",I&&"cursor-pointer",j),onClick:()=>I==null?void 0:I(),"data-testid":"identity-list-item",labelId:K,ref:G},React.createElement(Avatar.Root,{status:_===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:K,hue:((Z=(J=$.profile)==null?void 0:J.data)==null?void 0:Z.hue)||q.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ee=(Q=$.profile)==null?void 0:Q.data)==null?void 0:ee.emoji)||q.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},Y)))}),SpaceMemberList=({spaceKey:$,includeSelf:_,onSelect:I})=>{const j=reactClient.useClient(),U=echo.useMembers($),G=React.useMemo(()=>_?U.sort(q=>q.identity.identityKey.equals(j.halo.identity.get().identityKey)?-1:1):U.filter(q=>!q.identity.identityKey.equals(j.halo.identity.get().identityKey)),[U]);return React.createElement(SpaceMemberListImpl,{members:G,onSelect:I})},SpaceMemberListImpl=({members:$,onSelect:_})=>{const{t:I}=useTranslation("os"),j=$.filter(U=>U.identity);return j.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},j.map(U=>React.createElement(IdentityListItem,{key:U.identity.identityKey.toHex(),identity:U.identity,presence:U.presence,onClick:_&&(()=>_(U))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},I("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:$,onClickAdd:_,onClickEdit:I,onClickReset:j,onClickRecover:U,onClickJoinExisting:G,classNames:q,connectionState:K,onAgentDestroy:Y,...X},J)=>{var ae,se;const{t:Z}=useTranslation("os"),Q=keyToFallback($.deviceKey),ee=useId$1("identityListItem__label"),ne=$.profile?Z("device name placeholder",{os:$.profile.os,platform:$.profile.platform}):generateName($.deviceKey.toHex()),re=$.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...X,classNames:["flex gap-2 items-center mlb-2",q],"data-testid":`device-list-item${re?"-current":""}`,labelId:ee,ref:J},React.createElement(Avatar.Root,{status:re&&K===mesh.ConnectionState.OFFLINE?"error":$.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:ee,hue:Q.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ae=$.profile)!=null&&ae.type?$.profile.type===halo.DeviceType.AGENT_MANAGED?React.createElement(react.Database,{...iconProps}):$.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:Q.emoji})),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ne),re&&React.createElement(Tag,{color:"primary"},Z("current device tag label")),((se=$.profile)==null?void 0:se.type)===halo.DeviceType.AGENT_MANAGED?React.createElement(Tooltip.Root,null,React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":"agent.destroy",onClick:Y},React.createElement("span",{className:"sr-only"},Z("destroy agent label")),React.createElement(react.Power,{className:getSize(5)}))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},Z("destroy agent label")))):$.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu.Root,null,React.createElement(DropdownMenu.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${re?"-current":""}.options`},React.createElement("span",{className:"sr-only"},Z("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu.Content,null,React.createElement(DropdownMenu.Viewport,null,React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.join-existing",onClick:G},React.createElement(react.ShareFat,{className:getSize(5)}),Z("choose join new identity label")),U&&React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.recover",onClick:U},React.createElement(react.FirstAidKit,{className:getSize(5)}),Z("choose recover identity label")),React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.reset",onClick:j},React.createElement(react.Power,{className:getSize(5)}),Z("reset device label")))))))}),DeviceList=({devices:$,connectionState:_,onClickAdd:I,onClickEdit:j,onClickReset:U,onClickRecover:G,onClickJoinExisting:q,onAgentDestroy:K})=>{const{t:Y}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},Y("devices heading")),$.length>0&&React.createElement(List,null,$.map(X=>React.createElement(DeviceListItem,{key:X.deviceKey.toHex(),device:X,onClickEdit:()=>j==null?void 0:j(X),onClickReset:U,onClickRecover:G,onClickJoinExisting:q,connectionState:_,onAgentDestroy:K}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3 is-full","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm bg-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},Y("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds($){const _=toDate($),I=new Date(Date.UTC(_.getFullYear(),_.getMonth(),_.getDate(),_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()));return I.setUTCFullYear(_.getFullYear()),+$-+I}function compareAsc($,_){const I=toDate($),j=toDate(_),U=I.getTime()-j.getTime();return U<0?-1:U>0?1:U}function differenceInCalendarMonths($,_){const I=toDate($),j=toDate(_),U=I.getFullYear()-j.getFullYear(),G=I.getMonth()-j.getMonth();return U*12+G}function getRoundingMethod($){return _=>{const j=($?Math[$]:Math.trunc)(_);return j===0?0:j}}function differenceInMilliseconds($,_){return+toDate($)-+toDate(_)}function endOfDay($){const _=toDate($);return _.setHours(23,59,59,999),_}function endOfMonth($){const _=toDate($),I=_.getMonth();return _.setFullYear(_.getFullYear(),I+1,0),_.setHours(23,59,59,999),_}function isLastDayOfMonth($){const _=toDate($);return+endOfDay(_)==+endOfMonth(_)}function differenceInMonths($,_){const I=toDate($),j=toDate(_),U=compareAsc(I,j),G=Math.abs(differenceInCalendarMonths(I,j));let q;if(G<1)q=0;else{I.getMonth()===1&&I.getDate()>27&&I.setDate(30),I.setMonth(I.getMonth()-U*G);let K=compareAsc(I,j)===-U;isLastDayOfMonth(toDate($))&&G===1&&compareAsc($,j)===1&&(K=!1),q=U*(G-Number(K))}return q===0?0:q}function differenceInSeconds($,_,I){const j=differenceInMilliseconds($,_)/1e3;return getRoundingMethod(I==null?void 0:I.roundingMethod)(j)}function formatDistance($,_,I){const j=getDefaultOptions(),U=(I==null?void 0:I.locale)??j.locale??enUS$1,G=2520,q=compareAsc($,_);if(isNaN(q))throw new RangeError("Invalid time value");const K=Object.assign({},I,{addSuffix:I==null?void 0:I.addSuffix,comparison:q});let Y,X;q>0?(Y=toDate(_),X=toDate($)):(Y=toDate($),X=toDate(_));const J=differenceInSeconds(X,Y),Z=(getTimezoneOffsetInMilliseconds(X)-getTimezoneOffsetInMilliseconds(Y))/1e3,Q=Math.round((J-Z)/60);let ee;if(Q<2)return I!=null&&I.includeSeconds?J<5?U.formatDistance("lessThanXSeconds",5,K):J<10?U.formatDistance("lessThanXSeconds",10,K):J<20?U.formatDistance("lessThanXSeconds",20,K):J<40?U.formatDistance("halfAMinute",0,K):J<60?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",1,K):Q===0?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",Q,K);if(Q<45)return U.formatDistance("xMinutes",Q,K);if(Q<90)return U.formatDistance("aboutXHours",1,K);if(Q<minutesInDay){const ne=Math.round(Q/60);return U.formatDistance("aboutXHours",ne,K)}else{if(Q<G)return U.formatDistance("xDays",1,K);if(Q<minutesInMonth){const ne=Math.round(Q/minutesInDay);return U.formatDistance("xDays",ne,K)}else if(Q<minutesInMonth*2)return ee=Math.round(Q/minutesInMonth),U.formatDistance("aboutXMonths",ee,K)}if(ee=differenceInMonths(X,Y),ee<12){const ne=Math.round(Q/minutesInMonth);return U.formatDistance("xMonths",ne,K)}else{const ne=ee%12,re=Math.trunc(ee/12);return ne<3?U.formatDistance("aboutXYears",re,K):ne<9?U.formatDistance("overXYears",re,K):U.formatDistance("almostXYears",re+1,K)}}function formatDistanceToNow($,_){return formatDistance($,Date.now(),_)}var SpaceState;(function($){$[$.INVALID=0]="INVALID",$[$.SPACE_INACTIVE=2]="SPACE_INACTIVE",$[$.SPACE_ACTIVE=6]="SPACE_ACTIVE",$[$.SPACE_CLOSED=1]="SPACE_CLOSED",$[$.SPACE_CONTROL_ONLY=7]="SPACE_CONTROL_ONLY",$[$.SPACE_INITIALIZING=4]="SPACE_INITIALIZING",$[$.SPACE_READY=3]="SPACE_READY",$[$.SPACE_ERROR=5]="SPACE_ERROR",$[$.SPACE_REQUIRES_MIGRATION=8]="SPACE_REQUIRES_MIGRATION"})(SpaceState||(SpaceState={}));var Invitation;(function($){(function(_){_[_.INTERACTIVE=0]="INTERACTIVE",_[_.DELEGATED=1]="DELEGATED",_[_.MULTIUSE=2]="MULTIUSE"})($.Type||($.Type={})),function(_){_[_.DEVICE=0]="DEVICE",_[_.SPACE=1]="SPACE"}($.Kind||($.Kind={})),function(_){_[_.NONE=0]="NONE",_[_.SHARED_SECRET=1]="SHARED_SECRET",_[_.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}($.AuthMethod||($.AuthMethod={})),function(_){_[_.INIT=0]="INIT",_[_.CONNECTING=1]="CONNECTING",_[_.CONNECTED=2]="CONNECTED",_[_.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",_[_.AUTHENTICATING=4]="AUTHENTICATING",_[_.SUCCESS=5]="SUCCESS",_[_.CANCELLED=6]="CANCELLED",_[_.TIMEOUT=7]="TIMEOUT",_[_.ERROR=8]="ERROR",_[_.EXPIRED=9]="EXPIRED"}($.State||($.State={}))})(Invitation||(Invitation={}));var LogLevel;(function($){$[$.NONE=0]="NONE",$[$.TRACE=5]="TRACE",$[$.DEBUG=10]="DEBUG",$[$.VERBOSE=11]="VERBOSE",$[$.INFO=12]="INFO",$[$.WARN=13]="WARN",$[$.ERROR=14]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.INCLUSIVE=1]="INCLUSIVE",_[_.EXPLICIT=2]="EXPLICIT"})($.MatchingOptions||($.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var SystemStatus;(function($){$[$.INACTIVE=0]="INACTIVE",$[$.ACTIVE=1]="ACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.TRUNCATE=1]="TRUNCATE",_[_.HUMANIZE=2]="HUMANIZE"})($.KEY_OPTION||($.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function($){(function(_){_[_.BROWSER=0]="BROWSER",_[_.SHARED_WORKER=1]="SHARED_WORKER",_[_.NODE=2]="NODE"})($.PLATFORM_TYPE||($.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function($){$[$.CURRENT=0]="CURRENT",$[$.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function($){(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE",_[_.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function($){(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE"})($.PresenceState||($.PresenceState={}))})(SpaceMember||(SpaceMember={}));var CreateEpochRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",_[_.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",_[_.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT",_[_.REPLACE_AUTOMERGE_ROOT=4]="REPLACE_AUTOMERGE_ROOT",_[_.MIGRATE_REFERENCES_TO_DXN=5]="MIGRATE_REFERENCES_TO_DXN"})($.Migration||($.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var QueryInvitationsResponse;(function($){(function(_){_[_.ADDED=0]="ADDED",_[_.REMOVED=1]="REMOVED",_[_.SAVED=2]="SAVED",_[_.LOAD_COMPLETE=3]="LOAD_COMPLETE"})($.Action||($.Action={})),function(_){_[_.CREATED=0]="CREATED",_[_.ACCEPTED=1]="ACCEPTED"}($.Type||($.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState;(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(ConnectionState||(ConnectionState={}));var QueryAgentStatusResponse;(function($){(function(_){_[_.UNKNOWN=0]="UNKNOWN",_[_.ACTIVE=1]="ACTIVE",_[_.INACTIVE=2]="INACTIVE",_[_.NOT_FOUND=3]="NOT_FOUND"})($.AgentStatus||($.AgentStatus={}))})(QueryAgentStatusResponse||(QueryAgentStatusResponse={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$1($,_,I,j){var U=arguments.length,G=U<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,I):j,q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate($,_,I,j);else for(var K=$.length-1;K>=0;K--)(q=$[K])&&(G=(U<3?q(G):U>3?q(_,I,G):q(_,I))||G);return U>3&&G&&Object.defineProperty(_,I,G),G}var __dxlog_file$6="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,DEFAULT_ERROR_HANDLER=($,_)=>{if(!($ instanceof ContextDisposedError))throw _.dispose(),$},CONTEXT_FLAG_IS_DISPOSED=1,CONTEXT_FLAG_LEAK_DETECTED=2,_a$1,_b,Context=(dn=class{constructor(_={},I){nn(this,qt);nn(this,Kt);nn(this,rn);nn(this,ln);nn(this,bn);nn(this,On);nn(this,Yt);nn(this,fn);Gt(this,Kt,[]),Gt(this,rn,void 0),Gt(this,ln,void 0),Gt(this,Yt,0),Gt(this,fn,void 0),this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_b]="Context",this[_a$1]=()=>this.toString(),Gt(this,rn,getContextName(_,I)),Gt(this,ln,_.parent),Gt(this,bn,_.attributes??{}),Gt(this,On,_.onError??DEFAULT_ERROR_HANDLER)}static default(){return new dn}get disposed(){return St(this,qt,Hn)}get disposeCallbacksLength(){return St(this,Kt).length}onDispose(_){if(St(this,qt,Hn)&&(async()=>{try{await _()}catch(I){log$2.catch(I,{context:St(this,rn)},{F:__dxlog_file$6,L:119,S:this,C:(j,U)=>j(...U)})}})(),St(this,Kt).push(_),St(this,Kt).length>this.maxSafeDisposeCallbacks&&!St(this,qt,Fr)){Gt(this,qt,!0,Lr);const I=new StackTrace().getStackArray(1)[0].trim();log$2.warn("Context has a large number of dispose callbacks (this might be a memory leak).",{context:St(this,rn),callSite:I,count:St(this,Kt).length},{F:__dxlog_file$6,L:128,S:this,C:(j,U)=>j(...U)})}return()=>{const I=St(this,Kt).indexOf(_);I!==-1&&St(this,Kt).splice(I,1)}}async dispose(_=!1){if(St(this,fn))return St(this,fn);Gt(this,qt,!0,Dr);let I;const j=new Promise(Y=>{I=Y});Gt(this,fn,j);const U=Array.from(St(this,Kt)).reverse();St(this,Kt).length=0;let G=0,q=!0;const K=[];for(const Y of U)try{await Y(),G++}catch(X){q=!1,_?K.push(X):log$2.catch(X,{context:St(this,rn),callback:G,count:U.length},{F:__dxlog_file$6,L:188,S:this,C:(J,Z)=>J(...Z)})}if(K.length>0)throw new AggregateError(K);return I(q),q}raise(_){if(!St(this,qt,Hn))try{St(this,On).call(this,_,this)}catch(I){Promise.reject(I)}}derive({onError:_,attributes:I}={}){const j=new dn({onError:async G=>{if(!_)this.raise(G);else try{await _(G,this)}catch{this.raise(G)}},attributes:I}),U=this.onDispose(()=>j.dispose());return j.onDispose(U),j}getAttribute(_){if(_ in St(this,bn))return St(this,bn)[_];if(St(this,ln))return St(this,ln).getAttribute(_)}toString(){return`Context(${St(this,qt,Hn)?"disposed":"active"})`}async[(_b=Symbol.toStringTag,_a$1=export_inspect.custom,Symbol.asyncDispose)](){await this.dispose()}},Kt=new WeakMap,rn=new WeakMap,ln=new WeakMap,bn=new WeakMap,On=new WeakMap,Yt=new WeakMap,fn=new WeakMap,qt=new WeakSet,Hn=function(){return!!(St(this,Yt)&CONTEXT_FLAG_IS_DISPOSED)},Dr=function(_){Gt(this,Yt,_?St(this,Yt)|CONTEXT_FLAG_IS_DISPOSED:St(this,Yt)&~CONTEXT_FLAG_IS_DISPOSED)},Fr=function(){return!!(St(this,Yt)&CONTEXT_FLAG_LEAK_DETECTED)},Lr=function(_){Gt(this,Yt,_?St(this,Yt)|CONTEXT_FLAG_LEAK_DETECTED:St(this,Yt)&~CONTEXT_FLAG_LEAK_DETECTED)},dn);Context=_ts_decorate$1([safeInstanceof("Context")],Context);var getContextName=($,_)=>{var I;if($.name)return $.name;if((I=_==null?void 0:_.F)!=null&&I.length){const j=_==null?void 0:_.F.split("/");return`${j[j.length-1]}#${(_==null?void 0:_.L)??0}`}},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($,_){let I=$[_];if(I!=null){if(typeof I!="function")throw new TypeError(I+" is not a function");return I}}function getSpecies($){let _=$.constructor;return _!==void 0&&(_=_[SymbolSpecies],_===null&&(_=void 0)),_!==void 0?_:Observable$1}function isObservable$1($){return $ instanceof Observable$1}function hostReportError($){hostReportError.log?hostReportError.log($):setTimeout(()=>{throw $})}function enqueue($){Promise.resolve().then(()=>{try{$()}catch(_){hostReportError(_)}})}function cleanupSubscription($){let _=$._cleanup;if(_!==void 0&&($._cleanup=void 0,!!_))try{if(typeof _=="function")_();else{let I=getMethod(_,"unsubscribe");I&&I.call(_)}}catch(I){hostReportError(I)}}function closeSubscription($){$._observer=void 0,$._queue=void 0,$._state="closed"}function flushSubscription($){let _=$._queue;if(_){$._queue=void 0,$._state="ready";for(let I=0;I<_.length&&(notifySubscription($,_[I].type,_[I].value),$._state!=="closed");++I);}}function notifySubscription($,_,I){$._state="running";let j=$._observer;try{let U=getMethod(j,_);switch(_){case"next":U&&U.call(j,I);break;case"error":if(closeSubscription($),U)U.call(j,I);else throw I;break;case"complete":closeSubscription($),U&&U.call(j);break}}catch(U){hostReportError(U)}$._state==="closed"?cleanupSubscription($):$._state==="running"&&($._state="ready")}function onNotify($,_,I){if($._state!=="closed"){if($._state==="buffering"){$._queue.push({type:_,value:I});return}if($._state!=="ready"){$._state="buffering",$._queue=[{type:_,value:I}],enqueue(()=>flushSubscription($));return}notifySubscription($,_,I)}}class Subscription{constructor(_,I){this._cleanup=void 0,this._observer=_,this._queue=void 0,this._state="initializing";let j=this,U={get closed(){return j._state==="closed"},next(G){onNotify(j,"next",G)},error(G){onNotify(j,"error",G)},complete(){onNotify(j,"complete")}};try{this._cleanup=I.call(void 0,U)}catch(G){U.error(G)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class nr{constructor(_){if(!(this instanceof nr))throw new TypeError("Observable cannot be called as a function");if(typeof _!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=_}subscribe(_){return(typeof _!="object"||_===null)&&(_={next:_,error:arguments[1],complete:arguments[2]}),new Subscription(_,this._subscriber)}forEach(_){return new Promise((I,j)=>{if(typeof _!="function"){j(new TypeError(_+" is not a function"));return}function U(){G.unsubscribe(),I()}let G=this.subscribe({next(q){try{_(q,U)}catch(K){j(K),G.unsubscribe()}},error:j,complete:I})})}map(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{U=_(U)}catch(G){return j.error(G)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}filter(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{if(!_(U))return}catch(G){return j.error(G)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}reduce(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this),j=arguments.length>1,U=!1,q=arguments[1];return new I(K=>this.subscribe({next(Y){let X=!U;if(U=!0,!X||j)try{q=_(q,Y)}catch(J){return K.error(J)}else q=Y},error(Y){K.error(Y)},complete(){if(!U&&!j)return K.error(new TypeError("Cannot reduce an empty sequence"));K.next(q),K.complete()}}))}async all(){let _=[];return await this.forEach(I=>_.push(I)),_}concat(..._){let I=getSpecies(this);return new I(j=>{let U,G=0;function q(K){U=K.subscribe({next(Y){j.next(Y)},error(Y){j.error(Y)},complete(){G===_.length?(U=void 0,j.complete()):q(I.from(_[G++]))}})}return q(this),()=>{U&&(U.unsubscribe(),U=void 0)}})}flatMap(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>{let U=[],G=this.subscribe({next(K){if(_)try{K=_(K)}catch(X){return j.error(X)}let Y=I.from(K).subscribe({next(X){j.next(X)},error(X){j.error(X)},complete(){let X=U.indexOf(Y);X>=0&&U.splice(X,1),q()}});U.push(Y)},error(K){j.error(K)},complete(){q()}});function q(){G.closed&&U.length===0&&j.complete()}return()=>{U.forEach(K=>K.unsubscribe()),G.unsubscribe()}})}[SymbolObservable](){return this}static from(_){let I=typeof this=="function"?this:nr;if(_==null)throw new TypeError(_+" is not an object");let j=getMethod(_,SymbolObservable);if(j){let U=j.call(_);if(Object(U)!==U)throw new TypeError(U+" is not an object");return isObservable$1(U)&&U.constructor===I?U:new I(G=>U.subscribe(G))}if(hasSymbol("iterator")&&(j=getMethod(_,SymbolIterator),j))return new I(U=>{enqueue(()=>{if(!U.closed){for(let G of j.call(_))if(U.next(G),U.closed)return;U.complete()}})});if(Array.isArray(_))return new I(U=>{enqueue(()=>{if(!U.closed){for(let G=0;G<_.length;++G)if(U.next(_[G]),U.closed)return;U.complete()}})});throw new TypeError(_+" is not observable")}static of(..._){let I=typeof this=="function"?this:nr;return new I(j=>{enqueue(()=>{if(!j.closed){for(let U=0;U<_.length;++U)if(j.next(_[U]),j.closed)return;j.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,j){return Function.prototype.apply.call(_,I,j)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:ReflectOwnKeys=function(_){return Object.getOwnPropertyNames(_)};function ProcessEmitWarning($){console&&console.warn&&console.warn($)}var NumberIsNaN=Number.isNaN||function(_){return _!==_};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(_){if(typeof _!="number"||_<0||NumberIsNaN(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function _getMaxListeners($){return $._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:$._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function(_){for(var I=[],j=1;j<arguments.length;j++)I.push(arguments[j]);var U=_==="error",G=this._events;if(G!==void 0)U=U&&G.error===void 0;else if(!U)return!1;if(U){var q;if(I.length>0&&(q=I[0]),q instanceof Error)throw q;var K=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw K.context=q,K}var Y=G[_];if(Y===void 0)return!1;if(typeof Y=="function")ReflectApply(Y,this,I);else for(var X=Y.length,J=arrayClone(Y,X),j=0;j<X;++j)ReflectApply(J[j],this,I);return!0};function _addListener($,_,I,j){var U,G,q;if(checkListener(I),G=$._events,G===void 0?(G=$._events=Object.create(null),$._eventsCount=0):(G.newListener!==void 0&&($.emit("newListener",_,I.listener?I.listener:I),G=$._events),q=G[_]),q===void 0)q=G[_]=I,++$._eventsCount;else if(typeof q=="function"?q=G[_]=j?[I,q]:[q,I]:j?q.unshift(I):q.push(I),U=_getMaxListeners($),U>0&&q.length>U&&!q.warned){q.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=$,K.type=_,K.count=q.length,ProcessEmitWarning(K)}return $}EventEmitter$1.prototype.addListener=function(_,I){return _addListener(this,_,I,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function(_,I){return _addListener(this,_,I,!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){var j={fired:!1,wrapFn:void 0,target:$,type:_,listener:I},U=onceWrapper.bind(j);return U.listener=I,j.wrapFn=U,U}EventEmitter$1.prototype.once=function(_,I){return checkListener(I),this.on(_,_onceWrap(this,_,I)),this},EventEmitter$1.prototype.prependOnceListener=function(_,I){return checkListener(I),this.prependListener(_,_onceWrap(this,_,I)),this},EventEmitter$1.prototype.removeListener=function(_,I){var j,U,G,q,K;if(checkListener(I),U=this._events,U===void 0)return this;if(j=U[_],j===void 0)return this;if(j===I||j.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete U[_],U.removeListener&&this.emit("removeListener",_,j.listener||I));else if(typeof j!="function"){for(G=-1,q=j.length-1;q>=0;q--)if(j[q]===I||j[q].listener===I){K=j[q].listener,G=q;break}if(G<0)return this;G===0?j.shift():spliceOne(j,G),j.length===1&&(U[_]=j[0]),U.removeListener!==void 0&&this.emit("removeListener",_,K||I)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function(_){var I,j,U;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[_]),this;if(arguments.length===0){var G=Object.keys(j),q;for(U=0;U<G.length;++U)q=G[U],q!=="removeListener"&&this.removeAllListeners(q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=j[_],typeof I=="function")this.removeListener(_,I);else if(I!==void 0)for(U=I.length-1;U>=0;U--)this.removeListener(_,I[U]);return this};function _listeners($,_,I){var j=$._events;if(j===void 0)return[];var U=j[_];return U===void 0?[]:typeof U=="function"?I?[U.listener||U]:[U]:I?unwrapListeners(U):arrayClone(U,U.length)}EventEmitter$1.prototype.listeners=function(_){return _listeners(this,_,!0)},EventEmitter$1.prototype.rawListeners=function(_){return _listeners(this,_,!1)},EventEmitter$1.listenerCount=function($,_){return typeof $.listenerCount=="function"?$.listenerCount(_):listenerCount.call($,_)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount($){var _=this._events;if(_!==void 0){var I=_[$];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone($,_){for(var I=new Array(_),j=0;j<_;++j)I[j]=$[j];return I}function spliceOne($,_){for(;_+1<$.length;_++)$[_]=$[_+1];$.pop()}function unwrapListeners($){for(var _=new Array($.length),I=0;I<_.length;++I)_[I]=$[I].listener||$[I];return _}function once$2($,_){return new Promise(function(I,j){function U(q){$.removeListener(_,G),j(q)}function G(){typeof $.removeListener=="function"&&$.removeListener("error",U),I([].slice.call(arguments))}eventTargetAgnosticAddListener($,_,G,{once:!0}),_!=="error"&&addErrorHandlerIfEventEmitter($,U,{once:!0})})}function addErrorHandlerIfEventEmitter($,_,I){typeof $.on=="function"&&eventTargetAgnosticAddListener($,"error",_,I)}function eventTargetAgnosticAddListener($,_,I,j){if(typeof $.on=="function")j.once?$.once(_,I):$.on(_,I);else if(typeof $.addEventListener=="function")$.addEventListener(_,function U(G){j.once&&$.removeEventListener(_,U),I(G)});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$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;revLookup[45]=62,revLookup[95]=63;function getLens($){var _=$.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=$.indexOf("=");I===-1&&(I=_);var j=I===_?0:4-I%4;return[I,j]}function byteLength($){var _=getLens($),I=_[0],j=_[1];return(I+j)*3/4-j}function _byteLength($,_,I){return(_+I)*3/4-I}function toByteArray($){var _,I=getLens($),j=I[0],U=I[1],G=new Arr(_byteLength($,j,U)),q=0,K=U>0?j-4:j,Y;for(Y=0;Y<K;Y+=4)_=revLookup[$.charCodeAt(Y)]<<18|revLookup[$.charCodeAt(Y+1)]<<12|revLookup[$.charCodeAt(Y+2)]<<6|revLookup[$.charCodeAt(Y+3)],G[q++]=_>>16&255,G[q++]=_>>8&255,G[q++]=_&255;return U===2&&(_=revLookup[$.charCodeAt(Y)]<<2|revLookup[$.charCodeAt(Y+1)]>>4,G[q++]=_&255),U===1&&(_=revLookup[$.charCodeAt(Y)]<<10|revLookup[$.charCodeAt(Y+1)]<<4|revLookup[$.charCodeAt(Y+2)]>>2,G[q++]=_>>8&255,G[q++]=_&255),G}function tripletToBase64($){return lookup[$>>18&63]+lookup[$>>12&63]+lookup[$>>6&63]+lookup[$&63]}function encodeChunk($,_,I){for(var j,U=[],G=_;G<I;G+=3)j=($[G]<<16&16711680)+($[G+1]<<8&65280)+($[G+2]&255),U.push(tripletToBase64(j));return U.join("")}function fromByteArray($){for(var _,I=$.length,j=I%3,U=[],G=16383,q=0,K=I-j;q<K;q+=G)U.push(encodeChunk($,q,q+G>K?K:q+G));return j===1?(_=$[I-1],U.push(lookup[_>>2]+lookup[_<<4&63]+"==")):j===2&&(_=($[I-2]<<8)+$[I-1],U.push(lookup[_>>10]+lookup[_>>4&63]+lookup[_<<2&63]+"=")),U.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function($,_,I,j,U){var G,q,K=U*8-j-1,Y=(1<<K)-1,X=Y>>1,J=-7,Z=I?U-1:0,Q=I?-1:1,ee=$[_+Z];for(Z+=Q,G=ee&(1<<-J)-1,ee>>=-J,J+=K;J>0;G=G*256+$[_+Z],Z+=Q,J-=8);for(q=G&(1<<-J)-1,G>>=-J,J+=j;J>0;q=q*256+$[_+Z],Z+=Q,J-=8);if(G===0)G=1-X;else{if(G===Y)return q?NaN:(ee?-1:1)*(1/0);q=q+Math.pow(2,j),G=G-X}return(ee?-1:1)*q*Math.pow(2,G-j)},ieee754.write=function($,_,I,j,U,G){var q,K,Y,X=G*8-U-1,J=(1<<X)-1,Z=J>>1,Q=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=j?0:G-1,ne=j?1:-1,re=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(K=isNaN(_)?1:0,q=J):(q=Math.floor(Math.log(_)/Math.LN2),_*(Y=Math.pow(2,-q))<1&&(q--,Y*=2),q+Z>=1?_+=Q/Y:_+=Q*Math.pow(2,1-Z),_*Y>=2&&(q++,Y/=2),q+Z>=J?(K=0,q=J):q+Z>=1?(K=(_*Y-1)*Math.pow(2,U),q=q+Z):(K=_*Math.pow(2,Z-1)*Math.pow(2,U),q=0));U>=8;$[I+ee]=K&255,ee+=ne,K/=256,U-=8);for(q=q<<U|K,X+=U;X>0;$[I+ee]=q&255,ee+=ne,q/=256,X-=8);$[I+ee-ne]|=re*128};/*!
|
|
961
|
+
`;function $e5534fc185f7111e$export$2e2bcd8739ae039($){const _=React.useRef(null),I=React.useRef(null);return I.current&&I.current.update($),React.useEffect(()=>(I.current=new $efa000751917694d$export$2e2bcd8739ae039({...$,ref:_}),()=>{I.current=null}),[]),React.createElement("div",{ref:_})}const EmojiPickerToolbarButton=({disabled:$,defaultEmoji:_,emoji:I,onChangeEmoji:j,classNames:U})=>{const{t:G}=useTranslation("os"),{themeMode:q}=useThemeContext(),[K,Y]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:I,onChange:j,defaultProp:_}),[X,J]=React.useState(!1),Z=React.useRef(!1),[Q,ee]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Q,onOpenChange:ne=>{Z.current?(ee(!1),Z.current=!1):ee(ne)}},React.createElement(Popover.Root,{open:X,onOpenChange:ne=>{J(ne),Z.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",U],disabled:$},React.createElement("span",{className:"sr-only"},G("select emoji label")),React.createElement(react.UserCircle,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},G("select emoji label"),React.createElement(Tooltip.Arrow,null))),React.createElement(Popover.Content,{side:"bottom",onKeyDownCapture:ne=>{ne.key==="Escape"&&(ne.stopPropagation(),J(!1),Z.current=!0)}},React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039,{data:emojiData,onEmojiSelect:({native:ne})=>{ne&&(Y(ne),J(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0,theme:q}),React.createElement(Popover.Arrow,null))))},HuePreview=({hue:$})=>{const{tx:_}=useThemeContext(),I=20;return React.createElement("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`},React.createElement("rect",{x:0,y:0,width:I,height:I,className:_("hue.fill","select--hue__preview",{hue:$})}))},hueTokens=Object.keys(hueTokenThemes).slice(0,16),HuePickerToolbarButton=({disabled:$,hue:_,onChangeHue:I,classNames:j,defaultHue:U})=>{const{t:G}=useTranslation("os"),[q,K]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:_,onChange:I,defaultProp:U}),[Y,X]=React.useState(!1),J=React.useRef(!1),[Z,Q]=React.useState(!1);return React.createElement(Tooltip.Root,{open:Z,onOpenChange:ee=>{J.current?(Q(!1),J.current=!1):Q(ee)}},React.createElement(DropdownMenu.Root,{modal:!1,open:Y,onOpenChange:ee=>{X(ee),J.current=!0}},React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(DropdownMenu.Trigger,{asChild:!0},React.createElement(Toolbar.Button,{classNames:mx("gap-2 plb-1",j),disabled:$},React.createElement("span",{className:"sr-only"},G("select hue label")),React.createElement(react.Palette,{className:getSize(5)})))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},G("select hue label"),React.createElement(Tooltip.Arrow,null))),React.createElement(DropdownMenu.Content,{side:"bottom",classNames:"!w-40"},React.createElement(DropdownMenu.Viewport,{classNames:"grid grid-cols-4"},hueTokens.map(ee=>React.createElement(DropdownMenu.CheckboxItem,{key:ee,checked:ee===q,onCheckedChange:()=>K(ee),classNames:"px-0 py-2 items-center justify-center"},React.createElement(HuePreview,{hue:ee})))))))};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 _=$.length*2/3,I=$.substring(0,_),j=$.substring(_),U=capitalize(data.adjectives[parseInt(I,16)%data.adjectives.length]),G=capitalize(data.animals[parseInt(j,16)%data.animals.length]);return`${U} ${G}`};const IdentityListItem=React.forwardRef(({identity:$,presence:_,onClick:I,classNames:j,...U},G)=>{var X,J,Z,Q,ee;const q=keyToFallback($.identityKey),K=useId$1("identityListItem__label"),Y=((X=$.profile)==null?void 0:X.displayName)??generateName($.identityKey.toHex());return React.createElement(ListItem.Root,{...U,classNames:mx("flex gap-2 pis-3 pie-1 items-center",I&&"cursor-pointer",j),onClick:()=>I==null?void 0:I(),"data-testid":"identity-list-item",labelId:K,ref:G},React.createElement(Avatar.Root,{status:_===echo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:K,hue:((Z=(J=$.profile)==null?void 0:J.data)==null?void 0:Z.hue)||q.hue},React.createElement(Avatar.Frame,{classNames:"place-self-center"},React.createElement(Avatar.Fallback,{text:((ee=(Q=$.profile)==null?void 0:Q.data)==null?void 0:ee.emoji)||q.emoji})),React.createElement(Avatar.Label,{classNames:"text-sm truncate pli-2"},Y)))}),SpaceMemberList=({spaceKey:$,includeSelf:_,onSelect:I})=>{const j=reactClient.useClient(),U=echo.useMembers($),G=React.useMemo(()=>_?U.sort(q=>q.identity.identityKey.equals(j.halo.identity.get().identityKey)?-1:1):U.filter(q=>!q.identity.identityKey.equals(j.halo.identity.get().identityKey)),[U]);return React.createElement(SpaceMemberListImpl,{members:G,onSelect:I})},SpaceMemberListImpl=({members:$,onSelect:_})=>{const{t:I}=useTranslation("os"),j=$.filter(U=>U.identity);return j.length>0?React.createElement(List,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},j.map(U=>React.createElement(IdentityListItem,{key:U.identity.identityKey.toHex(),identity:U.identity,presence:U.presence,onClick:_&&(()=>_(U))}))):React.createElement("div",{role:"none",className:"grow flex items-center p-2"},React.createElement("p",{className:mx(descriptionText,"text-center is-full mlb-2")},I("empty space members message")))},iconProps={weight:"duotone",width:24,height:24,x:8,y:8},DeviceListItem=React.forwardRef(({device:$,onClickAdd:_,onClickEdit:I,onClickReset:j,onClickRecover:U,onClickJoinExisting:G,classNames:q,connectionState:K,onAgentDestroy:Y,...X},J)=>{var ae,se;const{t:Z}=useTranslation("os"),Q=keyToFallback($.deviceKey),ee=useId$1("identityListItem__label"),ne=$.profile?Z("device name placeholder",{os:$.profile.os,platform:$.profile.platform}):generateName($.deviceKey.toHex()),re=$.kind===halo.DeviceKind.CURRENT;return React.createElement(ListItem.Root,{...X,classNames:["flex gap-2 items-center mlb-2",q],"data-testid":`device-list-item${re?"-current":""}`,labelId:ee,ref:J},React.createElement(Avatar.Root,{status:re&&K===mesh.ConnectionState.OFFLINE?"error":$.presence===halo.Device.PresenceState.ONLINE?"active":"inactive",labelId:ee,hue:Q.hue,variant:"square"},React.createElement(Avatar.Frame,{classNames:"place-self-center"},(ae=$.profile)!=null&&ae.type?$.profile.type===halo.DeviceType.AGENT_MANAGED?React.createElement(react.Database,{...iconProps}):$.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:Q.emoji})),React.createElement(Avatar.Label,{classNames:"flex-1 text-sm truncate"},ne),re&&React.createElement(Tag,{color:"primary"},Z("current device tag label")),((se=$.profile)==null?void 0:se.type)===halo.DeviceType.AGENT_MANAGED?React.createElement(Tooltip.Root,null,React.createElement(Tooltip.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":"agent.destroy",onClick:Y},React.createElement("span",{className:"sr-only"},Z("destroy agent label")),React.createElement(react.Power,{className:getSize(5)}))),React.createElement(Tooltip.Portal,null,React.createElement(Tooltip.Content,{side:"bottom",classNames:"z-50"},Z("destroy agent label")))):$.kind===halo.DeviceKind.CURRENT&&React.createElement(DropdownMenu.Root,null,React.createElement(DropdownMenu.Trigger,{asChild:!0},React.createElement(Button,{variant:"ghost",classNames:"pli-0 is-[--rail-action] bs-[--rail-action]","data-testid":`device-list-item${re?"-current":""}.options`},React.createElement("span",{className:"sr-only"},Z("more options label")),React.createElement(react.DotsThree,{className:getSize(5)}))),React.createElement(DropdownMenu.Content,null,React.createElement(DropdownMenu.Viewport,null,React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.join-existing",onClick:G},React.createElement(react.ShareFat,{className:getSize(5)}),Z("choose join new identity label")),U&&React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.recover",onClick:U},React.createElement(react.FirstAidKit,{className:getSize(5)}),Z("choose recover identity label")),React.createElement(DropdownMenu.Item,{"data-testid":"device-list-item-current.reset",onClick:j},React.createElement(react.Power,{className:getSize(5)}),Z("reset device label")))))))}),DeviceList=({devices:$,connectionState:_,onClickAdd:I,onClickEdit:j,onClickReset:U,onClickRecover:G,onClickJoinExisting:q,onAgentDestroy:K})=>{const{t:Y}=useTranslation("os");return React.createElement(React.Fragment,null,React.createElement("h2",{className:mx(descriptionText,"text-center mbs-4")},Y("devices heading")),$.length>0&&React.createElement(List,null,$.map(X=>React.createElement(DeviceListItem,{key:X.deviceKey.toHex(),device:X,onClickEdit:()=>j==null?void 0:j(X),onClickReset:U,onClickRecover:G,onClickJoinExisting:q,connectionState:_,onAgentDestroy:K}))),React.createElement(Button,{variant:"ghost",classNames:"justify-start gap-2 !pis-0 !pie-3 is-full","data-testid":"devices-panel.create-invitation",onClick:I},React.createElement("div",{role:"img",className:mx(getSize(8),"m-1 rounded-sm bg-input grid place-items-center")},React.createElement(react.Plus,{weight:"light",className:getSize(6)})),React.createElement("span",{className:"grow font-medium text-start"},Y("choose add device label")),React.createElement(react.CaretRight,{weight:"bold",className:getSize(4)})))},minutesInMonth=43200,minutesInDay=1440;function getTimezoneOffsetInMilliseconds($){const _=toDate($),I=new Date(Date.UTC(_.getFullYear(),_.getMonth(),_.getDate(),_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()));return I.setUTCFullYear(_.getFullYear()),+$-+I}function compareAsc($,_){const I=toDate($),j=toDate(_),U=I.getTime()-j.getTime();return U<0?-1:U>0?1:U}function differenceInCalendarMonths($,_){const I=toDate($),j=toDate(_),U=I.getFullYear()-j.getFullYear(),G=I.getMonth()-j.getMonth();return U*12+G}function getRoundingMethod($){return _=>{const j=($?Math[$]:Math.trunc)(_);return j===0?0:j}}function differenceInMilliseconds($,_){return+toDate($)-+toDate(_)}function endOfDay($){const _=toDate($);return _.setHours(23,59,59,999),_}function endOfMonth($){const _=toDate($),I=_.getMonth();return _.setFullYear(_.getFullYear(),I+1,0),_.setHours(23,59,59,999),_}function isLastDayOfMonth($){const _=toDate($);return+endOfDay(_)==+endOfMonth(_)}function differenceInMonths($,_){const I=toDate($),j=toDate(_),U=compareAsc(I,j),G=Math.abs(differenceInCalendarMonths(I,j));let q;if(G<1)q=0;else{I.getMonth()===1&&I.getDate()>27&&I.setDate(30),I.setMonth(I.getMonth()-U*G);let K=compareAsc(I,j)===-U;isLastDayOfMonth(toDate($))&&G===1&&compareAsc($,j)===1&&(K=!1),q=U*(G-Number(K))}return q===0?0:q}function differenceInSeconds($,_,I){const j=differenceInMilliseconds($,_)/1e3;return getRoundingMethod(I==null?void 0:I.roundingMethod)(j)}function formatDistance($,_,I){const j=getDefaultOptions(),U=(I==null?void 0:I.locale)??j.locale??enUS$1,G=2520,q=compareAsc($,_);if(isNaN(q))throw new RangeError("Invalid time value");const K=Object.assign({},I,{addSuffix:I==null?void 0:I.addSuffix,comparison:q});let Y,X;q>0?(Y=toDate(_),X=toDate($)):(Y=toDate($),X=toDate(_));const J=differenceInSeconds(X,Y),Z=(getTimezoneOffsetInMilliseconds(X)-getTimezoneOffsetInMilliseconds(Y))/1e3,Q=Math.round((J-Z)/60);let ee;if(Q<2)return I!=null&&I.includeSeconds?J<5?U.formatDistance("lessThanXSeconds",5,K):J<10?U.formatDistance("lessThanXSeconds",10,K):J<20?U.formatDistance("lessThanXSeconds",20,K):J<40?U.formatDistance("halfAMinute",0,K):J<60?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",1,K):Q===0?U.formatDistance("lessThanXMinutes",1,K):U.formatDistance("xMinutes",Q,K);if(Q<45)return U.formatDistance("xMinutes",Q,K);if(Q<90)return U.formatDistance("aboutXHours",1,K);if(Q<minutesInDay){const ne=Math.round(Q/60);return U.formatDistance("aboutXHours",ne,K)}else{if(Q<G)return U.formatDistance("xDays",1,K);if(Q<minutesInMonth){const ne=Math.round(Q/minutesInDay);return U.formatDistance("xDays",ne,K)}else if(Q<minutesInMonth*2)return ee=Math.round(Q/minutesInMonth),U.formatDistance("aboutXMonths",ee,K)}if(ee=differenceInMonths(X,Y),ee<12){const ne=Math.round(Q/minutesInMonth);return U.formatDistance("xMonths",ne,K)}else{const ne=ee%12,re=Math.trunc(ee/12);return ne<3?U.formatDistance("aboutXYears",re,K):ne<9?U.formatDistance("overXYears",re,K):U.formatDistance("almostXYears",re+1,K)}}function formatDistanceToNow($,_){return formatDistance($,Date.now(),_)}var SpaceState;(function($){$[$.INVALID=0]="INVALID",$[$.SPACE_INACTIVE=2]="SPACE_INACTIVE",$[$.SPACE_ACTIVE=6]="SPACE_ACTIVE",$[$.SPACE_CLOSED=1]="SPACE_CLOSED",$[$.SPACE_CONTROL_ONLY=7]="SPACE_CONTROL_ONLY",$[$.SPACE_INITIALIZING=4]="SPACE_INITIALIZING",$[$.SPACE_READY=3]="SPACE_READY",$[$.SPACE_ERROR=5]="SPACE_ERROR",$[$.SPACE_REQUIRES_MIGRATION=8]="SPACE_REQUIRES_MIGRATION"})(SpaceState||(SpaceState={}));var Invitation;(function($){(function(_){_[_.INTERACTIVE=0]="INTERACTIVE",_[_.DELEGATED=1]="DELEGATED",_[_.MULTIUSE=2]="MULTIUSE"})($.Type||($.Type={})),function(_){_[_.DEVICE=0]="DEVICE",_[_.SPACE=1]="SPACE"}($.Kind||($.Kind={})),function(_){_[_.NONE=0]="NONE",_[_.SHARED_SECRET=1]="SHARED_SECRET",_[_.KNOWN_PUBLIC_KEY=2]="KNOWN_PUBLIC_KEY"}($.AuthMethod||($.AuthMethod={})),function(_){_[_.INIT=0]="INIT",_[_.CONNECTING=1]="CONNECTING",_[_.CONNECTED=2]="CONNECTED",_[_.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",_[_.AUTHENTICATING=4]="AUTHENTICATING",_[_.SUCCESS=5]="SUCCESS",_[_.CANCELLED=6]="CANCELLED",_[_.TIMEOUT=7]="TIMEOUT",_[_.ERROR=8]="ERROR",_[_.EXPIRED=9]="EXPIRED"}($.State||($.State={}))})(Invitation||(Invitation={}));var SystemStatus;(function($){$[$.INACTIVE=0]="INACTIVE",$[$.ACTIVE=1]="ACTIVE"})(SystemStatus||(SystemStatus={}));var GetDiagnosticsRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.TRUNCATE=1]="TRUNCATE",_[_.HUMANIZE=2]="HUMANIZE"})($.KEY_OPTION||($.KEY_OPTION={}))})(GetDiagnosticsRequest||(GetDiagnosticsRequest={}));var Platform;(function($){(function(_){_[_.BROWSER=0]="BROWSER",_[_.SHARED_WORKER=1]="SHARED_WORKER",_[_.NODE=2]="NODE"})($.PLATFORM_TYPE||($.PLATFORM_TYPE={}))})(Platform||(Platform={}));var DeviceKind;(function($){$[$.CURRENT=0]="CURRENT",$[$.TRUSTED=1]="TRUSTED"})(DeviceKind||(DeviceKind={}));var Device;(function($){(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE",_[_.REMOVED=2]="REMOVED"})($.PresenceState||($.PresenceState={}))})(Device||(Device={}));var SpaceMember;(function($){(function(_){_[_.OFFLINE=0]="OFFLINE",_[_.ONLINE=1]="ONLINE"})($.PresenceState||($.PresenceState={}))})(SpaceMember||(SpaceMember={}));var CreateEpochRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",_[_.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY",_[_.FRAGMENT_AUTOMERGE_ROOT=3]="FRAGMENT_AUTOMERGE_ROOT",_[_.REPLACE_AUTOMERGE_ROOT=4]="REPLACE_AUTOMERGE_ROOT",_[_.MIGRATE_REFERENCES_TO_DXN=5]="MIGRATE_REFERENCES_TO_DXN"})($.Migration||($.Migration={}))})(CreateEpochRequest||(CreateEpochRequest={}));var QueryInvitationsResponse;(function($){(function(_){_[_.ADDED=0]="ADDED",_[_.REMOVED=1]="REMOVED",_[_.SAVED=2]="SAVED",_[_.LOAD_COMPLETE=3]="LOAD_COMPLETE"})($.Action||($.Action={})),function(_){_[_.CREATED=0]="CREATED",_[_.ACCEPTED=1]="ACCEPTED"}($.Type||($.Type={}))})(QueryInvitationsResponse||(QueryInvitationsResponse={}));var ConnectionState;(function($){$[$.OFFLINE=0]="OFFLINE",$[$.ONLINE=1]="ONLINE"})(ConnectionState||(ConnectionState={}));var QueryAgentStatusResponse;(function($){(function(_){_[_.UNKNOWN=0]="UNKNOWN",_[_.ACTIVE=1]="ACTIVE",_[_.INACTIVE=2]="INACTIVE",_[_.NOT_FOUND=3]="NOT_FOUND"})($.AgentStatus||($.AgentStatus={}))})(QueryAgentStatusResponse||(QueryAgentStatusResponse={}));var LogLevel;(function($){$[$.NONE=0]="NONE",$[$.TRACE=5]="TRACE",$[$.DEBUG=10]="DEBUG",$[$.VERBOSE=11]="VERBOSE",$[$.INFO=12]="INFO",$[$.WARN=13]="WARN",$[$.ERROR=14]="ERROR"})(LogLevel||(LogLevel={}));var QueryLogsRequest;(function($){(function(_){_[_.NONE=0]="NONE",_[_.INCLUSIVE=1]="INCLUSIVE",_[_.EXPLICIT=2]="EXPLICIT"})($.MatchingOptions||($.MatchingOptions={}))})(QueryLogsRequest||(QueryLogsRequest={}));var ContextDisposedError=class extends Error{constructor(){super("Context disposed.")}};function _ts_decorate$1($,_,I,j){var U=arguments.length,G=U<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,I):j,q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate($,_,I,j);else for(var K=$.length-1;K>=0;K--)(q=$[K])&&(G=(U<3?q(G):U>3?q(_,I,G):q(_,I))||G);return U>3&&G&&Object.defineProperty(_,I,G),G}var __dxlog_file$6="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",MAX_SAFE_DISPOSE_CALLBACKS=300,DEFAULT_ERROR_HANDLER=($,_)=>{if(!($ instanceof ContextDisposedError))throw _.dispose(),$},CONTEXT_FLAG_IS_DISPOSED=1,CONTEXT_FLAG_LEAK_DETECTED=2,_a$1,_b,Context=(dn=class{constructor(_={},I){nn(this,qt);nn(this,Kt);nn(this,rn);nn(this,ln);nn(this,bn);nn(this,On);nn(this,Yt);nn(this,fn);Gt(this,Kt,[]),Gt(this,rn,void 0),Gt(this,ln,void 0),Gt(this,Yt,0),Gt(this,fn,void 0),this.maxSafeDisposeCallbacks=MAX_SAFE_DISPOSE_CALLBACKS,this[_b]="Context",this[_a$1]=()=>this.toString(),Gt(this,rn,getContextName(_,I)),Gt(this,ln,_.parent),Gt(this,bn,_.attributes??{}),Gt(this,On,_.onError??DEFAULT_ERROR_HANDLER)}static default(){return new dn}get disposed(){return St(this,qt,Hn)}get disposeCallbacksLength(){return St(this,Kt).length}onDispose(_){if(St(this,qt,Hn)&&(async()=>{try{await _()}catch(I){log$2.catch(I,{context:St(this,rn)},{F:__dxlog_file$6,L:119,S:this,C:(j,U)=>j(...U)})}})(),St(this,Kt).push(_),St(this,Kt).length>this.maxSafeDisposeCallbacks&&!St(this,qt,Fr)){Gt(this,qt,!0,Lr);const I=new StackTrace().getStackArray(1)[0].trim();log$2.warn("Context has a large number of dispose callbacks (this might be a memory leak).",{context:St(this,rn),callSite:I,count:St(this,Kt).length},{F:__dxlog_file$6,L:128,S:this,C:(j,U)=>j(...U)})}return()=>{const I=St(this,Kt).indexOf(_);I!==-1&&St(this,Kt).splice(I,1)}}async dispose(_=!1){if(St(this,fn))return St(this,fn);Gt(this,qt,!0,Dr);let I;const j=new Promise(Y=>{I=Y});Gt(this,fn,j);const U=Array.from(St(this,Kt)).reverse();St(this,Kt).length=0;let G=0,q=!0;const K=[];for(const Y of U)try{await Y(),G++}catch(X){q=!1,_?K.push(X):log$2.catch(X,{context:St(this,rn),callback:G,count:U.length},{F:__dxlog_file$6,L:188,S:this,C:(J,Z)=>J(...Z)})}if(K.length>0)throw new AggregateError(K);return I(q),q}raise(_){if(!St(this,qt,Hn))try{St(this,On).call(this,_,this)}catch(I){Promise.reject(I)}}derive({onError:_,attributes:I}={}){const j=new dn({onError:async G=>{if(!_)this.raise(G);else try{await _(G,this)}catch{this.raise(G)}},attributes:I}),U=this.onDispose(()=>j.dispose());return j.onDispose(U),j}getAttribute(_){if(_ in St(this,bn))return St(this,bn)[_];if(St(this,ln))return St(this,ln).getAttribute(_)}toString(){return`Context(${St(this,qt,Hn)?"disposed":"active"})`}async[(_b=Symbol.toStringTag,_a$1=export_inspect.custom,Symbol.asyncDispose)](){await this.dispose()}},Kt=new WeakMap,rn=new WeakMap,ln=new WeakMap,bn=new WeakMap,On=new WeakMap,Yt=new WeakMap,fn=new WeakMap,qt=new WeakSet,Hn=function(){return!!(St(this,Yt)&CONTEXT_FLAG_IS_DISPOSED)},Dr=function(_){Gt(this,Yt,_?St(this,Yt)|CONTEXT_FLAG_IS_DISPOSED:St(this,Yt)&~CONTEXT_FLAG_IS_DISPOSED)},Fr=function(){return!!(St(this,Yt)&CONTEXT_FLAG_LEAK_DETECTED)},Lr=function(_){Gt(this,Yt,_?St(this,Yt)|CONTEXT_FLAG_LEAK_DETECTED:St(this,Yt)&~CONTEXT_FLAG_LEAK_DETECTED)},dn);Context=_ts_decorate$1([safeInstanceof("Context")],Context);var getContextName=($,_)=>{var I;if($.name)return $.name;if((I=_==null?void 0:_.F)!=null&&I.length){const j=_==null?void 0:_.F.split("/");return`${j[j.length-1]}#${(_==null?void 0:_.L)??0}`}},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($,_){let I=$[_];if(I!=null){if(typeof I!="function")throw new TypeError(I+" is not a function");return I}}function getSpecies($){let _=$.constructor;return _!==void 0&&(_=_[SymbolSpecies],_===null&&(_=void 0)),_!==void 0?_:Observable$1}function isObservable$1($){return $ instanceof Observable$1}function hostReportError($){hostReportError.log?hostReportError.log($):setTimeout(()=>{throw $})}function enqueue($){Promise.resolve().then(()=>{try{$()}catch(_){hostReportError(_)}})}function cleanupSubscription($){let _=$._cleanup;if(_!==void 0&&($._cleanup=void 0,!!_))try{if(typeof _=="function")_();else{let I=getMethod(_,"unsubscribe");I&&I.call(_)}}catch(I){hostReportError(I)}}function closeSubscription($){$._observer=void 0,$._queue=void 0,$._state="closed"}function flushSubscription($){let _=$._queue;if(_){$._queue=void 0,$._state="ready";for(let I=0;I<_.length&&(notifySubscription($,_[I].type,_[I].value),$._state!=="closed");++I);}}function notifySubscription($,_,I){$._state="running";let j=$._observer;try{let U=getMethod(j,_);switch(_){case"next":U&&U.call(j,I);break;case"error":if(closeSubscription($),U)U.call(j,I);else throw I;break;case"complete":closeSubscription($),U&&U.call(j);break}}catch(U){hostReportError(U)}$._state==="closed"?cleanupSubscription($):$._state==="running"&&($._state="ready")}function onNotify($,_,I){if($._state!=="closed"){if($._state==="buffering"){$._queue.push({type:_,value:I});return}if($._state!=="ready"){$._state="buffering",$._queue=[{type:_,value:I}],enqueue(()=>flushSubscription($));return}notifySubscription($,_,I)}}class Subscription{constructor(_,I){this._cleanup=void 0,this._observer=_,this._queue=void 0,this._state="initializing";let j=this,U={get closed(){return j._state==="closed"},next(G){onNotify(j,"next",G)},error(G){onNotify(j,"error",G)},complete(){onNotify(j,"complete")}};try{this._cleanup=I.call(void 0,U)}catch(G){U.error(G)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(closeSubscription(this),cleanupSubscription(this))}}let Observable$1=class nr{constructor(_){if(!(this instanceof nr))throw new TypeError("Observable cannot be called as a function");if(typeof _!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=_}subscribe(_){return(typeof _!="object"||_===null)&&(_={next:_,error:arguments[1],complete:arguments[2]}),new Subscription(_,this._subscriber)}forEach(_){return new Promise((I,j)=>{if(typeof _!="function"){j(new TypeError(_+" is not a function"));return}function U(){G.unsubscribe(),I()}let G=this.subscribe({next(q){try{_(q,U)}catch(K){j(K),G.unsubscribe()}},error:j,complete:I})})}map(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{U=_(U)}catch(G){return j.error(G)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}filter(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>this.subscribe({next(U){try{if(!_(U))return}catch(G){return j.error(G)}j.next(U)},error(U){j.error(U)},complete(){j.complete()}}))}reduce(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this),j=arguments.length>1,U=!1,q=arguments[1];return new I(K=>this.subscribe({next(Y){let X=!U;if(U=!0,!X||j)try{q=_(q,Y)}catch(J){return K.error(J)}else q=Y},error(Y){K.error(Y)},complete(){if(!U&&!j)return K.error(new TypeError("Cannot reduce an empty sequence"));K.next(q),K.complete()}}))}async all(){let _=[];return await this.forEach(I=>_.push(I)),_}concat(..._){let I=getSpecies(this);return new I(j=>{let U,G=0;function q(K){U=K.subscribe({next(Y){j.next(Y)},error(Y){j.error(Y)},complete(){G===_.length?(U=void 0,j.complete()):q(I.from(_[G++]))}})}return q(this),()=>{U&&(U.unsubscribe(),U=void 0)}})}flatMap(_){if(typeof _!="function")throw new TypeError(_+" is not a function");let I=getSpecies(this);return new I(j=>{let U=[],G=this.subscribe({next(K){if(_)try{K=_(K)}catch(X){return j.error(X)}let Y=I.from(K).subscribe({next(X){j.next(X)},error(X){j.error(X)},complete(){let X=U.indexOf(Y);X>=0&&U.splice(X,1),q()}});U.push(Y)},error(K){j.error(K)},complete(){q()}});function q(){G.closed&&U.length===0&&j.complete()}return()=>{U.forEach(K=>K.unsubscribe()),G.unsubscribe()}})}[SymbolObservable](){return this}static from(_){let I=typeof this=="function"?this:nr;if(_==null)throw new TypeError(_+" is not an object");let j=getMethod(_,SymbolObservable);if(j){let U=j.call(_);if(Object(U)!==U)throw new TypeError(U+" is not an object");return isObservable$1(U)&&U.constructor===I?U:new I(G=>U.subscribe(G))}if(hasSymbol("iterator")&&(j=getMethod(_,SymbolIterator),j))return new I(U=>{enqueue(()=>{if(!U.closed){for(let G of j.call(_))if(U.next(G),U.closed)return;U.complete()}})});if(Array.isArray(_))return new I(U=>{enqueue(()=>{if(!U.closed){for(let G=0;G<_.length;++G)if(U.next(_[G]),U.closed)return;U.complete()}})});throw new TypeError(_+" is not observable")}static of(..._){let I=typeof this=="function"?this:nr;return new I(j=>{enqueue(()=>{if(!j.closed){for(let U=0;U<_.length;++U)if(j.next(_[U]),j.closed)return;j.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,j){return Function.prototype.apply.call(_,I,j)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:ReflectOwnKeys=function(_){return Object.getOwnPropertyNames(_)};function ProcessEmitWarning($){console&&console.warn&&console.warn($)}var NumberIsNaN=Number.isNaN||function(_){return _!==_};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(_){if(typeof _!="number"||_<0||NumberIsNaN(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function _getMaxListeners($){return $._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:$._maxListeners}EventEmitter$1.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter$1.prototype.emit=function(_){for(var I=[],j=1;j<arguments.length;j++)I.push(arguments[j]);var U=_==="error",G=this._events;if(G!==void 0)U=U&&G.error===void 0;else if(!U)return!1;if(U){var q;if(I.length>0&&(q=I[0]),q instanceof Error)throw q;var K=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw K.context=q,K}var Y=G[_];if(Y===void 0)return!1;if(typeof Y=="function")ReflectApply(Y,this,I);else for(var X=Y.length,J=arrayClone(Y,X),j=0;j<X;++j)ReflectApply(J[j],this,I);return!0};function _addListener($,_,I,j){var U,G,q;if(checkListener(I),G=$._events,G===void 0?(G=$._events=Object.create(null),$._eventsCount=0):(G.newListener!==void 0&&($.emit("newListener",_,I.listener?I.listener:I),G=$._events),q=G[_]),q===void 0)q=G[_]=I,++$._eventsCount;else if(typeof q=="function"?q=G[_]=j?[I,q]:[q,I]:j?q.unshift(I):q.push(I),U=_getMaxListeners($),U>0&&q.length>U&&!q.warned){q.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=$,K.type=_,K.count=q.length,ProcessEmitWarning(K)}return $}EventEmitter$1.prototype.addListener=function(_,I){return _addListener(this,_,I,!1)},EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener,EventEmitter$1.prototype.prependListener=function(_,I){return _addListener(this,_,I,!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){var j={fired:!1,wrapFn:void 0,target:$,type:_,listener:I},U=onceWrapper.bind(j);return U.listener=I,j.wrapFn=U,U}EventEmitter$1.prototype.once=function(_,I){return checkListener(I),this.on(_,_onceWrap(this,_,I)),this},EventEmitter$1.prototype.prependOnceListener=function(_,I){return checkListener(I),this.prependListener(_,_onceWrap(this,_,I)),this},EventEmitter$1.prototype.removeListener=function(_,I){var j,U,G,q,K;if(checkListener(I),U=this._events,U===void 0)return this;if(j=U[_],j===void 0)return this;if(j===I||j.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete U[_],U.removeListener&&this.emit("removeListener",_,j.listener||I));else if(typeof j!="function"){for(G=-1,q=j.length-1;q>=0;q--)if(j[q]===I||j[q].listener===I){K=j[q].listener,G=q;break}if(G<0)return this;G===0?j.shift():spliceOne(j,G),j.length===1&&(U[_]=j[0]),U.removeListener!==void 0&&this.emit("removeListener",_,K||I)}return this},EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener,EventEmitter$1.prototype.removeAllListeners=function(_){var I,j,U;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[_]),this;if(arguments.length===0){var G=Object.keys(j),q;for(U=0;U<G.length;++U)q=G[U],q!=="removeListener"&&this.removeAllListeners(q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=j[_],typeof I=="function")this.removeListener(_,I);else if(I!==void 0)for(U=I.length-1;U>=0;U--)this.removeListener(_,I[U]);return this};function _listeners($,_,I){var j=$._events;if(j===void 0)return[];var U=j[_];return U===void 0?[]:typeof U=="function"?I?[U.listener||U]:[U]:I?unwrapListeners(U):arrayClone(U,U.length)}EventEmitter$1.prototype.listeners=function(_){return _listeners(this,_,!0)},EventEmitter$1.prototype.rawListeners=function(_){return _listeners(this,_,!1)},EventEmitter$1.listenerCount=function($,_){return typeof $.listenerCount=="function"?$.listenerCount(_):listenerCount.call($,_)},EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount($){var _=this._events;if(_!==void 0){var I=_[$];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone($,_){for(var I=new Array(_),j=0;j<_;++j)I[j]=$[j];return I}function spliceOne($,_){for(;_+1<$.length;_++)$[_]=$[_+1];$.pop()}function unwrapListeners($){for(var _=new Array($.length),I=0;I<_.length;++I)_[I]=$[I].listener||$[I];return _}function once$2($,_){return new Promise(function(I,j){function U(q){$.removeListener(_,G),j(q)}function G(){typeof $.removeListener=="function"&&$.removeListener("error",U),I([].slice.call(arguments))}eventTargetAgnosticAddListener($,_,G,{once:!0}),_!=="error"&&addErrorHandlerIfEventEmitter($,U,{once:!0})})}function addErrorHandlerIfEventEmitter($,_,I){typeof $.on=="function"&&eventTargetAgnosticAddListener($,"error",_,I)}function eventTargetAgnosticAddListener($,_,I,j){if(typeof $.on=="function")j.once?$.once(_,I):$.on(_,I);else if(typeof $.addEventListener=="function")$.addEventListener(_,function U(G){j.once&&$.removeEventListener(_,U),I(G)});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$1=0,len=code.length;i$1<len;++i$1)lookup[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;revLookup[45]=62,revLookup[95]=63;function getLens($){var _=$.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=$.indexOf("=");I===-1&&(I=_);var j=I===_?0:4-I%4;return[I,j]}function byteLength($){var _=getLens($),I=_[0],j=_[1];return(I+j)*3/4-j}function _byteLength($,_,I){return(_+I)*3/4-I}function toByteArray($){var _,I=getLens($),j=I[0],U=I[1],G=new Arr(_byteLength($,j,U)),q=0,K=U>0?j-4:j,Y;for(Y=0;Y<K;Y+=4)_=revLookup[$.charCodeAt(Y)]<<18|revLookup[$.charCodeAt(Y+1)]<<12|revLookup[$.charCodeAt(Y+2)]<<6|revLookup[$.charCodeAt(Y+3)],G[q++]=_>>16&255,G[q++]=_>>8&255,G[q++]=_&255;return U===2&&(_=revLookup[$.charCodeAt(Y)]<<2|revLookup[$.charCodeAt(Y+1)]>>4,G[q++]=_&255),U===1&&(_=revLookup[$.charCodeAt(Y)]<<10|revLookup[$.charCodeAt(Y+1)]<<4|revLookup[$.charCodeAt(Y+2)]>>2,G[q++]=_>>8&255,G[q++]=_&255),G}function tripletToBase64($){return lookup[$>>18&63]+lookup[$>>12&63]+lookup[$>>6&63]+lookup[$&63]}function encodeChunk($,_,I){for(var j,U=[],G=_;G<I;G+=3)j=($[G]<<16&16711680)+($[G+1]<<8&65280)+($[G+2]&255),U.push(tripletToBase64(j));return U.join("")}function fromByteArray($){for(var _,I=$.length,j=I%3,U=[],G=16383,q=0,K=I-j;q<K;q+=G)U.push(encodeChunk($,q,q+G>K?K:q+G));return j===1?(_=$[I-1],U.push(lookup[_>>2]+lookup[_<<4&63]+"==")):j===2&&(_=($[I-2]<<8)+$[I-1],U.push(lookup[_>>10]+lookup[_>>4&63]+lookup[_<<2&63]+"=")),U.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function($,_,I,j,U){var G,q,K=U*8-j-1,Y=(1<<K)-1,X=Y>>1,J=-7,Z=I?U-1:0,Q=I?-1:1,ee=$[_+Z];for(Z+=Q,G=ee&(1<<-J)-1,ee>>=-J,J+=K;J>0;G=G*256+$[_+Z],Z+=Q,J-=8);for(q=G&(1<<-J)-1,G>>=-J,J+=j;J>0;q=q*256+$[_+Z],Z+=Q,J-=8);if(G===0)G=1-X;else{if(G===Y)return q?NaN:(ee?-1:1)*(1/0);q=q+Math.pow(2,j),G=G-X}return(ee?-1:1)*q*Math.pow(2,G-j)},ieee754.write=function($,_,I,j,U,G){var q,K,Y,X=G*8-U-1,J=(1<<X)-1,Z=J>>1,Q=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=j?0:G-1,ne=j?1:-1,re=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(K=isNaN(_)?1:0,q=J):(q=Math.floor(Math.log(_)/Math.LN2),_*(Y=Math.pow(2,-q))<1&&(q--,Y*=2),q+Z>=1?_+=Q/Y:_+=Q*Math.pow(2,1-Z),_*Y>=2&&(q++,Y/=2),q+Z>=J?(K=0,q=J):q+Z>=1?(K=(_*Y-1)*Math.pow(2,U),q=q+Z):(K=_*Math.pow(2,Z-1)*Math.pow(2,U),q=0));U>=8;$[I+ee]=K&255,ee+=ne,K/=256,U-=8);for(q=q<<U|K,X+=U;X>0;$[I+ee]=q&255,ee+=ne,q/=256,X-=8);$[I+ee-ne]|=re*128};/*!
|
|
962
962
|
* The buffer module from node.js, for the browser.
|
|
963
963
|
*
|
|
964
964
|
* @author Feross Aboukhadijeh <https://feross.org>
|