@neurodyn/ar 0.0.12 → 0.0.13

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.
@@ -0,0 +1,61 @@
1
+ "use strict";(self.webpackChunk_neurodyn_ar=self.webpackChunk_neurodyn_ar||[]).push([["600"],{4892(e,t,r){r.r(t),r.d(t,{ArExperience:()=>il});var n=r(8525),i=r(828),a=r(6514),l=r(9081),o=r(243);function s(e){if(!e||"object"!=typeof e||!("response"in e))return;let t=e.response;if(t&&"object"==typeof t&&"status"in t)return"number"==typeof t.status?t.status:void 0}function c(e,t){let r=s(e);return 401===r||403===r?"access-denied":404===r&&"object"===t?"object-not-published":"object"===t?"object-load-failed":"catalog-load-failed"}var u=r(9811),d=r(1131);function m(e,t){var r,n;let i=(0,d.sq)(e),a=(0,d.Dj)(e),l=(0,d.uW)(e,t),o=a[0],s=(null==l||null==(n=l.native)||null==(r=n.glbUrl)?void 0:r.trim())?{glbUrl:l.native.glbUrl,hid:l.hid??null}:o?{glbUrl:o.glbUrl,hid:o.hid}:null;return s?{dimensions:i.dimensions,glbUrl:s.glbUrl,id:e.uuid??e.tinuuid??s.glbUrl,mechanic:i.mechanic,variantId:s.hid,variants:a}:null}var h=r(683),p=r(7218),f=r(6486),g=r(2838),b=r(851);let x=(0,r(1137).zu)({extend:{theme:{shadow:["surface","control","modal","switch-thumb"]}}});function v(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return x((0,b.$)(t))}var j=r(4656);function w(e){let{className:t,size:r="default",...i}=e;return(0,n.jsx)(j.bL,{"data-slot":"avatar","data-size":r,className:v("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",t),...i})}function y(e){let{className:t,...r}=e;return(0,n.jsx)(j._V,{"data-slot":"avatar-image",className:v("aspect-square size-full rounded-full object-cover",t),...r})}function N(e){let{className:t,...r}=e;return(0,n.jsx)(j.H4,{"data-slot":"avatar-fallback",className:v("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",t),...r})}var M=r(8763),C=r(384),I=r(8128),z=r(4382),R=r(1213),L=r(5445),Z=r(2849);let S=(0,L.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-control hover:bg-primary/80",outline:"border-border bg-background shadow-control hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-control hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive shadow-control hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*=size-])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*=size-])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W(e){let{className:t,variant:r="default",size:i="default",asChild:a=!1,...l}=e,o=a?Z.bL:"button";return(0,n.jsx)(o,{"data-slot":"button","data-variant":r,"data-size":i,className:v(S({variant:r,size:i,className:t})),...l})}var Y=r(5444);let k="var(--v-borders-medium, #bebec8)";function T(e){let{className:t,role:r,"aria-label":i,"aria-live":a,size:l="default",state:o="loading",variant:s="default",...c}=e,u=i??("success"===o?"Success":"error"===o?"Error":"Loading");if("logo"===s){let e="sm"===l?4:5;return(0,n.jsxs)("svg",{...c,role:r??"status","aria-live":a??"polite","aria-label":u,width:"93",height:"91",viewBox:"0 0 93 91",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-slot":"spinner","data-size":l,"data-state":o,className:v("spinner-logo shrink-0","sm"===l?"size-9":"size-22",t),children:[(0,n.jsx)("g",{className:"spinner-logo__intro-shell",children:(0,n.jsx)("path",{d:"M15.7495 62.7798L46.4936 45.0297M46.4936 45.0297L77.2661 62.5451M46.4936 45.0297L46.7111 9.62225M49.9213 79.4237L74.5719 65.1917C75.6436 64.5705 76.5344 63.6811 77.1541 62.6137C77.7738 61.5462 78.1003 60.3385 78.1007 59.1129L78.1729 30.7811C78.1734 29.5494 77.851 28.3427 77.2373 27.2798C76.6236 26.2169 75.7398 25.3343 74.6729 24.7189L50.1007 10.6155C47.926 9.3694 45.2455 9.37719 43.0689 10.6339L18.4183 24.8659C16.2385 26.1244 14.8946 28.4401 14.8895 30.9447L14.8173 59.2766C14.8168 60.5082 15.1392 61.7149 15.7529 62.7778C16.3666 63.8408 17.2504 64.7233 18.3173 65.3387L42.8895 79.4421C45.0642 80.6882 47.7447 80.6805 49.9213 79.4237Z",className:"spinner-logo__outline spinner-logo__outline--intro",vectorEffect:"sm"===l?void 0:"non-scaling-stroke"})}),(0,n.jsx)("circle",{className:"spinner-logo__intro-orb",cx:"46.27",cy:"45.8",r:"11.18",fill:"white",stroke:k,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("circle",{className:"spinner-logo__result-ring",cx:"46.5",cy:"45.5",r:"33.46",fill:"white",stroke:k,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("g",{transform:"translate(27.786 31.4489)",children:(0,n.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--success",children:(0,n.jsx)("path",{d:"M13.6758 28.1023C13.3559 28.101 13.0397 28.0341 12.7467 27.9057C12.4537 27.7772 12.1902 27.59 11.9725 27.3557L0.632479 15.2923C0.208575 14.8406 -0.0185097 14.2389 0.00118164 13.6198C0.020873 13.0006 0.285727 12.4146 0.737479 11.9907C1.18923 11.5668 1.79088 11.3397 2.41006 11.3594C3.02924 11.3791 3.61524 11.6439 4.03915 12.0957L13.6525 22.339L33.2758 0.87233C33.475 0.624349 33.7227 0.419696 34.0038 0.270944C34.2849 0.122191 34.5935 0.0324784 34.9105 0.00731496C35.2276 -0.0178485 35.5464 0.0220682 35.8475 0.124615C36.1485 0.227162 36.4254 0.390174 36.6612 0.603637C36.897 0.8171 37.0866 1.07651 37.2185 1.36593C37.3503 1.65535 37.4216 1.96867 37.428 2.28665C37.4344 2.60463 37.3756 2.92056 37.2555 3.21502C37.1353 3.50949 36.9562 3.77627 36.7291 3.999L15.4025 27.3323C15.1868 27.5709 14.9242 27.7625 14.6311 27.895C14.338 28.0275 14.0208 28.0981 13.6991 28.1023H13.6758Z",fill:k})})}),(0,n.jsx)("g",{transform:"translate(32.4879 31.4885)",children:(0,n.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--error",children:(0,n.jsx)("path",{d:"M17.3045 14.0095L27.3378 3.99955C27.5554 3.78199 27.728 3.52371 27.8457 3.23946C27.9635 2.95521 28.0241 2.65055 28.0241 2.34288C28.0241 2.03521 27.9635 1.73055 27.8457 1.4463C27.728 1.16205 27.5554 0.903769 27.3378 0.686213C27.1203 0.468656 26.862 0.296082 26.5778 0.178341C26.2935 0.0606 25.9889 -4.58466e-09 25.6812 0C25.3735 4.58466e-09 25.0689 0.0606 24.7846 0.178341C24.5003 0.296082 24.2421 0.468656 24.0245 0.686213L14.0145 10.7195L4.00451 0.686213C3.56514 0.246838 2.96921 -4.62957e-09 2.34784 0C1.72647 4.62957e-09 1.13055 0.246838 0.691177 0.686213C0.251802 1.12559 0.0049634 1.72151 0.0049634 2.34288C0.00496339 2.96425 0.251802 3.56017 0.691177 3.99955L10.7245 14.0095L0.691177 24.0195C0.472196 24.2363 0.29836 24.4943 0.179723 24.7787C0.0610849 25.063 0 25.3681 0 25.6762C0 25.9843 0.0610849 26.2894 0.179723 26.5737C0.29836 26.8581 0.472196 27.1161 0.691177 27.3329C0.908091 27.5516 1.16616 27.7252 1.4505 27.8436C1.73484 27.9621 2.03982 28.0231 2.34784 28.0231C2.65587 28.0231 2.96085 27.9621 3.24519 27.8436C3.52953 27.7252 3.7876 27.5516 4.00451 27.3329L14.0145 17.2995L24.0245 27.3329C24.296 27.6078 24.6314 27.8111 25.0007 27.9245C25.3701 28.0379 25.7618 28.0579 26.1407 27.9828C26.5197 27.9077 26.8741 27.7397 27.1722 27.4939C27.4703 27.2481 27.7028 26.9322 27.8488 26.5745C28.0272 26.1459 28.0736 25.6738 27.9821 25.2187C27.8907 24.7636 27.6655 24.346 27.3355 24.0195L17.3045 14.0095Z",fill:k})})})]})}return(0,n.jsx)(Y.A,{"data-slot":"spinner",role:r??"status","aria-live":a??"polite","aria-label":u,className:v("size-4 animate-spin",t),...c})}function D(e){return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,n.jsx)("path",{d:"M22.5601 16.3031L14.8901 3.58311C14.58 3.09793 14.1526 2.69864 13.6476 2.42205C13.1425 2.14546 12.5759 2.00049 12.0001 2.00049C11.4243 2.00049 10.8577 2.14546 10.3526 2.42205C9.84755 2.69864 9.42024 3.09793 9.1101 3.58311L1.4401 16.3031C1.16915 16.7548 1.02189 17.2698 1.01311 17.7964C1.00434 18.323 1.13436 18.8427 1.3901 19.3031C1.68578 19.8214 2.11376 20.2518 2.6303 20.5505C3.14684 20.8492 3.73343 21.0054 4.3301 21.0031H19.6701C20.2629 21.0094 20.8468 20.8593 21.363 20.5678C21.8792 20.2764 22.3093 19.8539 22.6101 19.3431C22.8734 18.8779 23.0075 18.3508 22.9987 17.8163C22.9899 17.2818 22.8385 16.7594 22.5601 16.3031ZM20.8601 18.3531C20.7399 18.5597 20.5655 18.7295 20.3557 18.8441C20.146 18.9586 19.9089 19.0136 19.6701 19.0031H4.3301C4.09132 19.0136 3.85422 18.9586 3.64446 18.8441C3.4347 18.7295 3.26029 18.5597 3.1401 18.3531C3.05233 18.2011 3.00613 18.0286 3.00613 17.8531C3.00613 17.6776 3.05233 17.5051 3.1401 17.3531L10.8201 4.62311C10.9581 4.44082 11.1365 4.29298 11.3412 4.19119C11.5459 4.08939 11.7715 4.03642 12.0001 4.03642C12.2287 4.03642 12.4543 4.08939 12.659 4.19119C12.8637 4.29298 13.0421 4.44082 13.1801 4.62311L20.8501 17.3431C20.9413 17.4954 20.9902 17.6693 20.992 17.8468C20.9937 18.0243 20.9482 18.199 20.8601 18.3531Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M12.0001 17.0001C12.2653 17.0001 12.5197 16.8948 12.7072 16.7073C12.8948 16.5197 13.0001 16.2654 13.0001 16.0001C13.0001 15.7349 12.8948 15.4806 12.7072 15.293C12.5197 15.1055 12.2653 15.0001 12.0001 15.0001C11.7349 15.0001 11.4806 15.1055 11.293 15.293C11.1055 15.4806 11.0001 15.7349 11.0001 16.0001C11.0001 16.2654 11.1055 16.5197 11.293 16.7073C11.4806 16.8948 11.7349 17.0001 12.0001 17.0001Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M12.0001 8.00023C11.7349 8.00023 11.4806 8.10559 11.293 8.29313C11.1055 8.48066 11.0001 8.73502 11.0001 9.00023V13.0002C11.0001 13.2655 11.1055 13.5198 11.293 13.7073C11.4806 13.8949 11.7349 14.0002 12.0001 14.0002C12.2653 14.0002 12.5197 13.8949 12.7072 13.7073C12.8948 13.5198 13.0001 13.2655 13.0001 13.0002V9.00023C13.0001 8.73502 12.8948 8.48066 12.7072 8.29313C12.5197 8.10559 12.2653 8.00023 12.0001 8.00023Z",fill:"currentColor"})]})}function P(e){return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,n.jsx)("path",{d:"M18 3H6C5.20435 3 4.44129 3.31607 3.87868 3.87868C3.31607 4.44129 3 5.20435 3 6V18C3 18.7956 3.31607 19.5587 3.87868 20.1213C4.44129 20.6839 5.20435 21 6 21H18C18.7956 21 19.5587 20.6839 20.1213 20.1213C20.6839 19.5587 21 18.7956 21 18V6C21 5.20435 20.6839 4.44129 20.1213 3.87868C19.5587 3.31607 18.7956 3 18 3ZM6 5H18C18.2652 5 18.5196 5.10536 18.7071 5.29289C18.8946 5.48043 19 5.73478 19 6V14.36L15.8 11.63C15.3042 11.222 14.6821 10.999 14.04 10.999C13.3979 10.999 12.7758 11.222 12.28 11.63L5 17.7V6C5 5.73478 5.10536 5.48043 5.29289 5.29289C5.48043 5.10536 5.73478 5 6 5ZM18 19H6.56L13.56 13.16C13.6945 13.0602 13.8575 13.0062 14.025 13.0062C14.1925 13.0062 14.3555 13.0602 14.49 13.16L19 17V18C19 18.2652 18.8946 18.5196 18.7071 18.7071C18.5196 18.8946 18.2652 19 18 19Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M7.99983 9.99992C8.39766 9.99992 8.77919 9.84188 9.06049 9.56058C9.34179 9.27927 9.49983 8.89774 9.49983 8.49992C9.49983 8.10209 9.34179 7.72056 9.06049 7.43925C8.77919 7.15795 8.39766 6.99992 7.99983 6.99992C7.60201 6.99992 7.22047 7.15795 6.93917 7.43925C6.65787 7.72056 6.49983 8.10209 6.49983 8.49992C6.49983 8.89774 6.65787 9.27927 6.93917 9.56058C7.22047 9.84188 7.60201 9.99992 7.99983 9.99992Z",fill:"currentColor"})]})}function X(e){return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,n.jsx)("path",{d:"M12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V5C11 5.26522 11.1054 5.51957 11.2929 5.70711C11.4804 5.89464 11.7348 6 12 6C12.2652 6 12.5196 5.89464 12.7071 5.70711C12.8946 5.51957 13 5.26522 13 5V3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M21.0002 11H19.0002C18.735 11 18.4806 11.1054 18.2931 11.2929C18.1055 11.4804 18.0002 11.7348 18.0002 12C18.0002 12.2652 18.1055 12.5196 18.2931 12.7071C18.4806 12.8946 18.735 13 19.0002 13H21.0002C21.2654 13 21.5197 12.8946 21.7073 12.7071C21.8948 12.5196 22.0002 12.2652 22.0002 12C22.0002 11.7348 21.8948 11.4804 21.7073 11.2929C21.5197 11.1054 21.2654 11 21.0002 11Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M6 12C6 11.7348 5.89464 11.4804 5.70711 11.2929C5.51957 11.1054 5.26522 11 5 11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H5C5.26522 13 5.51957 12.8946 5.70711 12.7071C5.89464 12.5196 6 12.2652 6 12Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M6.22009 5.00298C6.02357 4.82786 5.76656 4.7362 5.50358 4.74744C5.2406 4.75869 4.99234 4.87196 4.8115 5.06322C4.63065 5.25447 4.53143 5.50867 4.5349 5.77187C4.53838 6.03507 4.64426 6.28656 4.83009 6.47298L6.27009 7.86298C6.36673 7.95629 6.48117 8.02917 6.60659 8.07728C6.73201 8.12538 6.86584 8.14773 7.00009 8.14298C7.1348 8.14246 7.26801 8.11474 7.39173 8.06147C7.51546 8.0082 7.62714 7.93048 7.72009 7.83298C7.90634 7.64561 8.01088 7.39216 8.01088 7.12798C8.01088 6.86379 7.90634 6.61034 7.72009 6.42298L6.22009 5.00298Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M17 8.14285C17.2575 8.14182 17.5047 8.04153 17.69 7.86285L19.13 6.47285C19.3057 6.2893 19.4049 6.04577 19.4075 5.79172C19.4102 5.53767 19.316 5.29214 19.1441 5.10502C18.9723 4.91789 18.7356 4.80319 18.4823 4.78421C18.2289 4.76524 17.9779 4.84341 17.78 5.00285L16.34 6.42285C16.1538 6.61021 16.0493 6.86366 16.0493 7.12785C16.0493 7.39203 16.1538 7.64548 16.34 7.83285C16.5132 8.01557 16.7489 8.12627 17 8.14285Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M12 17.9999C11.7348 17.9999 11.4804 18.1053 11.2929 18.2928C11.1054 18.4803 11 18.7347 11 18.9999V20.9999C11 21.2651 11.1054 21.5195 11.2929 21.707C11.4804 21.8946 11.7348 21.9999 12 21.9999C12.2652 21.9999 12.5196 21.8946 12.7071 21.707C12.8946 21.5195 13 21.2651 13 20.9999V18.9999C13 18.7347 12.8946 18.4803 12.7071 18.2928C12.5196 18.1053 12.2652 17.9999 12 17.9999Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M17.7302 16.1399C17.5392 15.9556 17.2829 15.8547 17.0175 15.8594C16.7521 15.864 16.4995 15.974 16.3152 16.1649C16.1309 16.3559 16.0299 16.6122 16.0346 16.8776C16.0393 17.143 16.1492 17.3956 16.3402 17.5799L17.7802 18.9999C17.9702 19.1835 18.2251 19.2845 18.4893 19.2808C18.7535 19.277 19.0055 19.1688 19.1902 18.9799C19.2837 18.8868 19.3579 18.7762 19.4085 18.6543C19.4591 18.5325 19.4851 18.4019 19.4851 18.2699C19.4851 18.138 19.4591 18.0073 19.4085 17.8855C19.3579 17.7637 19.2837 17.653 19.1902 17.5599L17.7302 16.1399Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M6.27011 16.141L4.83011 17.531C4.73638 17.624 4.66198 17.7346 4.61121 17.8564C4.56045 17.9783 4.53431 18.109 4.53431 18.241C4.53431 18.373 4.56045 18.5037 4.61121 18.6256C4.66198 18.7474 4.73638 18.858 4.83011 18.951C4.9239 19.0467 5.03596 19.1226 5.15965 19.1741C5.28333 19.2256 5.41612 19.2518 5.55011 19.251C5.79662 19.2531 6.03522 19.1641 6.22011 19.001L7.66011 17.611C7.75466 17.5197 7.83031 17.4107 7.88273 17.2902C7.93516 17.1697 7.96334 17.0401 7.96566 16.9087C7.96798 16.7773 7.9444 16.6467 7.89626 16.5244C7.84813 16.4022 7.77637 16.2905 7.68511 16.196C7.59384 16.1014 7.48484 16.0258 7.36433 15.9734C7.24383 15.9209 7.11418 15.8928 6.98278 15.8904C6.85139 15.8881 6.72082 15.9117 6.59854 15.9598C6.47626 16.008 6.36466 16.0797 6.27011 16.171V16.141Z",fill:"currentColor"})]})}var O=r(6642);function G(e){let{className:t,...r}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:(0,O.cn)("size-6",t),...r,children:[(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0625 1.70412C12.1393 1.70359 12.2136 1.7151 12.2842 1.73439C12.6576 1.76978 13.0261 1.88527 13.3604 2.08303L19.7012 5.84084L19.7031 5.84181C20.1036 6.08032 20.4348 6.42322 20.665 6.83498C20.8952 7.24671 21.0168 7.71415 21.0166 8.19142V8.19338L20.998 15.7403C20.9979 16.1352 20.9124 16.526 20.751 16.8848C20.7319 16.9557 20.7049 17.026 20.667 17.0928C20.6355 17.1482 20.5983 17.1987 20.5576 17.2442C20.3296 17.6 20.023 17.8979 19.6631 18.1133L13.2998 21.9072C12.4738 22.3996 11.4611 22.4004 10.6436 21.917L10.6416 21.916L4.30078 18.1582L4.29883 18.1572C3.91023 17.9258 3.58764 17.5957 3.3584 17.2002C3.35105 17.1885 3.34181 17.1773 3.33496 17.1651C3.32803 17.1526 3.32268 17.1387 3.31641 17.126C3.09976 16.7236 2.98517 16.2703 2.98535 15.8076V15.8057L3.00391 8.25588C3.00603 7.28279 3.51293 6.37777 4.33984 5.88478L10.7021 2.09181C11.0682 1.87369 11.4708 1.75231 11.877 1.72658C11.9365 1.71245 11.999 1.70462 12.0625 1.70412ZM5.16895 7.36818C4.87108 7.54583 4.6844 7.87497 4.68359 8.23635L4.66602 15.3838L9.45801 12.5254C9.51085 12.7718 9.60256 13.0142 9.73535 13.2442C9.90127 13.5315 10.1161 13.7727 10.3633 13.9639L5.49512 16.8662L11.499 20.4248C11.8036 20.6044 12.1738 20.6008 12.4707 20.4238L18.5107 16.8233L13.4971 13.877C13.9543 13.482 14.2391 12.9423 14.3242 12.3672L19.3193 15.3037L19.3379 8.21291L19.3369 8.21388C19.3369 8.03517 19.2923 7.85955 19.2061 7.7051C19.1196 7.55056 18.9947 7.42151 18.8447 7.33205L12.8887 3.80275L12.8535 9.73439C12.3304 9.51037 11.7366 9.46806 11.1738 9.63576L11.21 3.76662L5.16895 7.36818Z",fill:"currentColor"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.91641 8.60885C11.7928 7.52595 14.1912 8.16845 15.2748 10.0444C16.3582 11.9209 15.7156 14.3211 13.8393 15.4047C11.9627 16.4879 9.56339 15.8446 8.47989 13.9682C7.39671 12.0916 8.03987 9.69227 9.91641 8.60885ZM13.8031 10.894C13.189 9.83118 11.8293 9.46704 10.766 10.0805C9.7026 10.6945 9.33693 12.0551 9.95059 13.1186C10.5646 14.1821 11.9261 14.5469 12.9897 13.9331C14.0529 13.3189 14.4171 11.9575 13.8031 10.894Z",fill:"currentColor"})]})}var A=r(6103);function U(e){return(0,R.J)(e.uuid)??(0,R.J)(e.tinuuid)}function H(e){var t;return null==(t=(0,d.Dj)(e)[0])?void 0:t.hid}function E(e,t){return(!t||(0,d.nf)(e)===t)&&(0,d.Dj)(e).length>0}function F(e){let{catalog:t,isEmptySearch:r,isFetchingNextPage:i,mechanic:a,placingObject:l,search:s,onSelectObject:c,onShowAllItems:u}=e,{t:d}=(0,o.Bd)();return r?(0,n.jsx)("div",{className:"grid min-h-[360px] place-items-center px-8 text-center",children:(0,n.jsxs)("div",{className:"grid justify-items-center gap-3",children:[(0,n.jsxs)("div",{className:"grid gap-1",children:[(0,n.jsx)("p",{className:"text-base font-medium text-[#212124]",children:d("catalog.noResults",{search:s.trim()})}),(0,n.jsx)("p",{className:"text-sm font-medium text-[#64646c]",children:d("catalog.noResultsHint")})]}),(0,n.jsx)(W,{type:"button",variant:"outline",className:"h-8 rounded-full border-[#dadae0] px-4 text-xs font-semibold text-[#212124]",onClick:u,children:d("catalog.showAllItems")})]})}):0===t.length?(0,n.jsx)("div",{className:"grid min-h-[300px] place-items-center px-8 text-center",children:(0,n.jsxs)("div",{className:"grid max-w-64 justify-items-center gap-2",children:[(0,n.jsx)(A.A,{"aria-hidden":"true",className:"size-8 text-[#bebec8]"}),(0,n.jsx)("p",{className:"text-sm font-medium text-[#64646c]",children:d("catalog.empty")})]})}):(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-x-2.5 gap-y-4 px-5 pt-4",children:[t.map((e,t)=>{let r=(0,R.J)(e.name)??d("catalog.unnamedProduct"),i=(0,z.pU)(e),o=E(e,a),s=l===e;return(0,n.jsxs)("button",{type:"button","aria-label":r,className:"ar-catalog-card group relative grid min-w-0 touch-manipulation gap-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-45",disabled:!o||null!==l,onClick:()=>c(e),children:[(0,n.jsx)("span",{className:"ar-catalog-media-frame",children:i?(0,n.jsx)("img",{src:i,alt:"",loading:"lazy",className:"ar-catalog-media-img",decoding:"async",draggable:!1}):(0,n.jsx)(P,{"aria-hidden":"true",className:"size-8 text-[#bebec8]"})}),(0,n.jsx)("span",{className:"line-clamp-2 text-[13px] leading-snug font-medium text-[#212124]",children:r}),s&&(0,n.jsx)("span",{className:"absolute inset-0 grid place-items-center rounded-lg bg-white/75",role:"status",children:(0,n.jsx)(T,{className:"size-6"})})]},U(e)??`catalog-object-${t}`)}),i&&(0,n.jsx)("div",{className:"col-span-full grid h-16 place-items-center",role:"status","aria-label":d("catalog.loadingMore"),children:(0,n.jsx)(T,{className:"size-6"})})]})}function V(e){let{className:t,type:r,...i}=e;return(0,n.jsx)("input",{type:r,"data-slot":"input",className:v("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base shadow-control transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...i})}var J=r(876);function B(e){let{className:t,onClear:r}=e,{t:i}=(0,o.Bd)();return(0,n.jsx)("button",{type:"button",className:t,onPointerDown:e=>e.preventDefault(),onClick:r,children:i("catalog.clear")})}function _(e){let{onClose:t}=e,{t:r}=(0,o.Bd)();return(0,n.jsx)(W,{type:"button","aria-label":r("close"),variant:"secondary",size:"icon-lg",className:"size-11 rounded-full bg-[#ededed] text-[#212124] hover:bg-[#e3e3e8]",onClick:t,children:(0,n.jsx)(g.A,{className:"size-5","aria-hidden":"true"})})}function Q(e){let{catalog:t,gridRef:r,isEmptySearch:i,isFetchingNextPage:a,mechanic:s,placingObject:c,search:u,onClearSearch:d,onClose:m,onScroll:h,onSearchChange:p,onSelectObject:f,onShowAllItems:g}=e,{t:b}=(0,o.Bd)(),x=(0,l.useRef)(null),v=u.trim().length>0;return(0,l.useLayoutEffect)(()=>{var e;null==(e=x.current)||e.focus({preventScroll:!0})},[]),(0,n.jsxs)("div",{className:"absolute inset-0 z-30 flex flex-col bg-white text-[#212124]","data-testid":"ar-catalog-search-overlay",children:[(0,n.jsxs)("div",{className:"flex gap-2 px-5 pt-[max(1rem,env(safe-area-inset-top))] pb-3",children:[(0,n.jsxs)("div",{className:"relative flex h-11 min-w-0 flex-1 items-center rounded-full bg-[#ededed] text-[#64646c]",children:[(0,n.jsx)(J.A,{className:"ml-3 size-5 shrink-0","aria-hidden":"true"}),(0,n.jsx)(V,{ref:x,autoFocus:!0,value:u,"aria-label":b("catalog.searchPlaceholder"),className:"h-11 flex-1 border-0 bg-transparent px-2 pr-24 text-base font-medium text-[#212124] shadow-none placeholder:text-[#64646c] focus-visible:ring-0 md:text-sm",autoComplete:"off",enterKeyHint:"search",inputMode:"search",placeholder:b("catalog.searchPlaceholder"),role:"searchbox",type:"text",onChange:e=>p(e.currentTarget.value)}),v&&(0,n.jsx)(B,{className:"absolute right-5 text-sm font-semibold text-primary",onClear:d})]}),(0,n.jsx)(_,{onClose:m})]}),(0,n.jsx)("div",{ref:r,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain pt-2 pb-[calc(1.5rem+var(--ar-catalog-keyboard-bottom,0px)+env(safe-area-inset-bottom))] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden","data-testid":"ar-catalog-search-results",onScroll:h,children:(0,n.jsx)(F,{catalog:t,isEmptySearch:i,isFetchingNextPage:a,mechanic:s,placingObject:c,search:u,onSelectObject:f,onShowAllItems:g})})]})}function K(e){let{search:t,onClearSearch:r,onClose:i,onOpenSearch:a}=e,{t:l}=(0,o.Bd)(),s=t.trim().length>0;return(0,n.jsxs)("div",{className:"absolute inset-x-0 bottom-0 z-20 flex gap-2 bg-white px-5 pt-4 pb-[max(1.5rem,env(safe-area-inset-bottom))]",children:[(0,n.jsxs)("div",{className:"relative flex min-w-0 flex-1",children:[(0,n.jsxs)("button",{type:"button","aria-label":l("catalog.searchPlaceholder"),className:v("flex h-11 min-w-0 flex-1 items-center rounded-full bg-[#ededed] px-3 text-left text-base font-medium text-[#212124] md:text-sm",s?"pr-24":"text-[#64646c]"),onClick:a,children:[(0,n.jsx)(J.A,{className:"mr-2 size-5 shrink-0 text-[#64646c]","aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s?t:l("catalog.searchPlaceholder")})]}),s&&(0,n.jsx)(B,{className:"absolute top-1/2 right-5 -translate-y-1/2 text-sm font-semibold text-primary",onClear:r})]}),(0,n.jsx)(_,{onClose:i})]})}var q=r(7984);let $=l.createContext(null);function ee(){let e=l.use($);if(!e)throw Error("useCarousel must be used within a <Carousel />");return e}function et(e){let{orientation:t="horizontal",opts:r,setApi:i,plugins:a,className:o,children:s,...c}=e,[u,d]=(0,q.A)({...r,axis:"horizontal"===t?"x":"y"},a),[m,h]=l.useState(!1),[p,f]=l.useState(!1),g=l.useCallback(e=>{e&&(h(e.canScrollPrev()),f(e.canScrollNext()))},[]),b=l.useCallback(()=>{null==d||d.scrollPrev()},[d]),x=l.useCallback(()=>{null==d||d.scrollNext()},[d]),j=l.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),b()):"ArrowRight"===e.key&&(e.preventDefault(),x())},[b,x]);return l.useEffect(()=>{d&&i&&i(d)},[d,i]),l.useEffect(()=>{if(d)return g(d),d.on("reInit",g),d.on("select",g),()=>{null==d||d.off("select",g)}},[d,g]),(0,n.jsx)($,{value:{carouselRef:u,api:d,opts:r,orientation:t||((null==r?void 0:r.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:x,canScrollPrev:m,canScrollNext:p},children:(0,n.jsx)("div",{onKeyDownCapture:j,className:v("relative",o),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...c,children:s})})}function er(e){let{className:t,...r}=e,{carouselRef:i,orientation:a}=ee();return(0,n.jsx)("div",{ref:i,className:"overflow-hidden","data-slot":"carousel-content",children:(0,n.jsx)("div",{className:v("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",t),...r})})}function en(e){let{className:t,...r}=e,{orientation:i}=ee();return(0,n.jsx)("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:v("min-w-0 shrink-0 grow-0 basis-full","horizontal"===i?"pl-4":"pt-4",t),...r})}var ei=r(295);function ea(e){let{...t}=e;return(0,n.jsx)(ei._s.Root,{"data-slot":"drawer",...t})}function el(e){let{...t}=e;return(0,n.jsx)(ei._s.Portal,{"data-slot":"drawer-portal",...t})}function eo(e){let{className:t,...r}=e;return(0,n.jsx)(ei._s.Overlay,{"data-slot":"drawer-overlay",className:v("fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...r})}function es(e){let{className:t,children:r,overlayClassName:i,portalContainer:a,showHandle:l=!0,...o}=e;return(0,n.jsxs)(el,{"data-slot":"drawer-portal",container:a,children:[(0,n.jsx)(eo,{className:i}),(0,n.jsxs)(ei._s.Content,{"data-slot":"drawer-content",className:v("group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",t),...o,children:[l&&(0,n.jsx)("div",{className:"mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),r]})]})}function ec(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"drawer-header",className:v("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left",t),...r})}function eu(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:v("mt-auto flex flex-col gap-2 p-4",t),...r})}function ed(e){let{className:t,...r}=e;return(0,n.jsx)(ei._s.Title,{"data-slot":"drawer-title",className:v("font-heading text-base font-medium text-foreground",t),...r})}function em(e){let{className:t,...r}=e;return(0,n.jsx)(ei._s.Description,{"data-slot":"drawer-description",className:v("text-sm text-muted-foreground",t),...r})}var eh=r(9748);function ep(e){let{className:t,children:r,...i}=e;return(0,n.jsxs)(eh.bL,{"data-slot":"scroll-area",className:v("relative",t),...i,children:[(0,n.jsx)(eh.LM,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:r}),(0,n.jsx)(ef,{}),(0,n.jsx)(eh.OK,{})]})}function ef(e){let{className:t,orientation:r="vertical",...i}=e;return(0,n.jsx)(eh.VM,{"data-slot":"scroll-area-scrollbar","data-orientation":r,orientation:r,className:v("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",t),...i,children:(0,n.jsx)(eh.lr,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}var eg=r(2828),eb=r(8930);async function ex(e){var t;let{title:r,url:n}=e;if("u"<typeof navigator)return"unavailable";if("function"==typeof navigator.share)try{return await navigator.share({title:r,url:n}),"shared"}catch{return"cancelled"}if(null==(t=navigator.clipboard)?void 0:t.writeText)try{return await navigator.clipboard.writeText(n),"copied"}catch{}return"unavailable"}function ev(e){let{object:t,placing:r=!1,portalContainer:i,showcaseHost:a,testId:s,onOpenChange:c,onPlace:u,onShared:d,onViewOnSite:m}=e,{t:h}=(0,o.Bd)(),[p,f]=(0,l.useState)(),[g,b]=(0,l.useReducer)((e,t)=>t,0),x=(0,l.useMemo)(()=>t?(0,z.H7)(t):[],[t]),j=t?(0,R.J)(t.name)??h("catalog.unnamedProduct"):"",w=(0,R.J)(null==t?void 0:t.description),y=(0,R.R)(a,null==t?void 0:t.tinuuid),N=async()=>{let e=await ex({title:j,url:y??("u"<typeof location?"":location.href)});null==d||d(e)};return(0,l.useEffect)(()=>{b(0)},[t]),(0,l.useEffect)(()=>{if(!p)return;let e=()=>b(p.selectedScrollSnap());return e(),p.on("select",e),p.on("reInit",e),()=>{p.off("select",e),p.off("reInit",e)}},[p]),(0,n.jsx)(ea,{open:!!t,onOpenChange:c,children:(0,n.jsxs)(es,{"data-testid":s,overlayClassName:"bg-[#212124]/60 backdrop-blur-0",portalContainer:i,showHandle:!1,className:"right-2 bottom-2 left-2 mx-auto max-h-[calc(100svh-72px)] max-w-[386px] overflow-hidden rounded-[24px] border-0 bg-white text-[#212124] shadow-2xl data-[vaul-drawer-direction=bottom]:inset-x-2 data-[vaul-drawer-direction=bottom]:bottom-2 data-[vaul-drawer-direction=bottom]:mt-[72px] data-[vaul-drawer-direction=bottom]:max-h-[calc(100svh-72px)] data-[vaul-drawer-direction=bottom]:rounded-[24px]",children:[(0,n.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-[#dadae0]"}),(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,n.jsxs)(ec,{className:"px-6 pt-4 pb-0 text-left",children:[(0,n.jsx)(ed,{className:"text-base font-medium leading-snug text-[#212124]",children:j}),(0,n.jsx)(em,{className:"sr-only",children:h("catalog.productDetails")})]}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pt-4",children:(0,n.jsx)(ep,{className:"h-full pr-1",children:(0,n.jsxs)("div",{className:"grid gap-4 pb-4",children:[(0,n.jsx)("div",{className:"grid gap-2",children:x.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(et,{className:"select-none touch-pan-y",setApi:f,opts:{duration:18,loop:x.length>1},children:(0,n.jsx)(er,{className:"-ml-0 touch-pan-y will-change-transform",children:x.map(e=>(0,n.jsx)(en,{className:"pl-0",children:(0,n.jsx)("div",{className:"ar-catalog-media-frame",children:(0,n.jsx)("img",{src:e,alt:"",className:"ar-catalog-media-img ar-catalog-media-img--passive",decoding:"async",draggable:!1,loading:"eager"})})},e))})}),x.length>1&&(0,n.jsx)("div",{className:"flex justify-center gap-1.5","aria-hidden":"true",children:x.map((e,t)=>(0,n.jsx)("span",{className:v("size-1.5 rounded-full",t===g?"bg-primary":"bg-[#d9d9d9]")},e))})]}):(0,n.jsx)("div",{className:"grid aspect-[338/237] place-items-center rounded-lg bg-[#ededed]",children:(0,n.jsx)(P,{"aria-hidden":"true",className:"size-10 text-[#bebec8]"})})}),w&&(0,n.jsx)("p",{className:"whitespace-pre-line text-sm font-medium leading-[1.5] text-[#212124]",children:w})]})})}),(0,n.jsxs)(eu,{className:"sticky bottom-0 gap-3 bg-white px-6 pt-3 pb-[max(1.875rem,env(safe-area-inset-bottom))]",children:[u&&(0,n.jsxs)(W,{className:"w-full",size:"lg","data-testid":"ar-product-place",disabled:r,onClick:()=>void u(),children:[r?(0,n.jsx)(T,{className:"size-5"}):(0,n.jsx)(G,{className:"size-6","aria-hidden":"true"}),h("catalog.tryInRoom")]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[y&&(0,n.jsx)(W,{asChild:!0,className:"min-w-0 flex-1",size:"lg",variant:u?"secondary":"default",children:(0,n.jsxs)("a",{href:y,target:"_blank",rel:"noreferrer",onClick:m,children:[h("catalog.viewOnSite"),(0,n.jsx)(eg.A,{className:"size-4","aria-hidden":"true"})]})}),(0,n.jsxs)(W,{className:"min-w-0 flex-1",size:"lg",variant:"secondary","data-testid":"ar-product-share",onClick:()=>void N(),children:[(0,n.jsx)(eb.A,{className:"size-4","aria-hidden":"true"}),h("share")]})]})]})]})]})})}function ej(){if("u"<typeof document)return;let e=document.activeElement;e instanceof HTMLElement&&e.blur()}function ew(e,t){return{category:e.category,resultCount:t,search:e.search.trim()}}function ey(e){var t;let{catalog:r,categories:i,filters:a,isLoadingCategories:s,mechanic:c,owner:u,ownerAccount:d,pagination:m,setFilters:h,showcaseHost:p,onOpenChange:g,onPlace:b,open:x,portalContainer:v}=e,{t:j}=(0,o.Bd)(),w=(0,I.Xf)(),y=(0,C.Rl)(x),N=(0,C.f3)(x),{fetchNextPage:M,hasNextPage:L,isFetchingNextPage:Z}=m,S=(0,l.useRef)(null),W=(0,l.useRef)(ew(a,r.length)),Y=(0,l.useRef)(a.search.trim()),[k,T]=(0,l.useState)(null),[D,P]=(0,l.useState)(null),[X,O]=(0,l.useState)(!1),[G,A]=(0,l.useState)(!1),U=(0,l.useRef)(!1);x&&(W.current=ew(a,r.length)),(0,l.useEffect)(()=>{if(x)return w({catalog:W.current,name:"catalog_opened"}),()=>w({catalog:W.current,name:"catalog_closed"})},[w,x]),(0,l.useEffect)(()=>{let e=a.search.trim();if(!x){Y.current=e;return}if(e===Y.current)return;let t=window.setTimeout(()=>{Y.current=e,w({catalog:{category:a.category,search:e},name:"catalog_search_changed"})},400);return()=>window.clearTimeout(t)},[w,a.category,a.search,x]),(0,l.useEffect)(()=>{let e=S.current;x&&e&&!Z&&L&&e.scrollHeight<=e.clientHeight&&M()},[r.length,M,L,Z,x,G]);let V=(0,l.useCallback)(e=>{if(!L||Z)return;let{clientHeight:t,scrollHeight:r,scrollTop:n}=e.currentTarget;n+t>=r-96&&M()},[M,L,Z]),J=(0,l.useCallback)(e=>{e||(A(!1),T(null),P(null),O(!1),h({category:null,search:""})),g(e)},[g,h]),B=(0,l.useCallback)(e=>{h(t=>({...t,search:e}))},[h]),_=(0,l.useCallback)(e=>{h(t=>({...t,category:e})),w({catalog:{category:e,search:a.search.trim()},name:"catalog_category_selected"})},[w,a.search,h]),q=(0,l.useCallback)(()=>{h(e=>({...e,search:""}))},[h]),$=(0,l.useCallback)(()=>{q(),ej()},[q]),ee=(0,l.useCallback)(()=>{A(!1),ej()},[]);(0,l.useEffect)(()=>{if(!G){U.current=!1;return}if(N){U.current=!0;return}if(!U.current)return;let e=window.setTimeout(ee,200);return()=>window.clearTimeout(e)},[ee,N,G]);let et=(0,l.useCallback)(()=>{h({category:null,search:""}),ee(),w({catalog:{category:null,search:""},name:"catalog_show_all_clicked"})},[ee,w,h]),er=(0,l.useCallback)(e=>{E(e,c)&&(ee(),O(!1),T(e),w({object:(0,I.ZY)(e,H(e)),name:"catalog_product_opened"}))},[ee,w,c]),en=(0,l.useCallback)(async()=>{if(!k)return;let e=H(k);e&&(P(k),O(!1),w({object:(0,I.ZY)(k,e),name:"catalog_product_place_clicked"}),await b(k,e).catch(()=>!1)?(w({object:(0,I.ZY)(k,e),name:"catalog_product_place_succeeded"}),J(!1)):(w({object:(0,I.ZY)(k,e),name:"catalog_product_place_failed"}),O(!0)),P(null))},[w,J,b,k]),ei=(t=j("catalog.unnamedOwner"),(0,R.J)(null==d?void 0:d.name)??(0,R.J)(null==u?void 0:u.name)??t),ea=(0,z.cV)(null==d?void 0:d.avatar)??(0,z.cV)(null==u?void 0:u.avatar),el=(0,z.cV)(null==d?void 0:d.background),eo=a.search.trim().length>0&&0===r.length;return(0,n.jsx)(f.lG,{open:x,onOpenChange:J,children:(0,n.jsxs)(f.Cf,{contentInsideOverlay:!0,"data-testid":"ar-catalog-dialog",className:"inset-0 top-0 left-0 flex h-[100svh] max-h-none w-full !max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 bg-white p-0 text-[#212124] shadow-none",portalContainer:v,style:y,showCloseButton:!1,onOpenAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,n.jsx)(f.L3,{className:"sr-only",children:j("catalog.title")}),(0,n.jsx)(f.rr,{className:"sr-only",children:j("catalog.description")}),(0,n.jsxs)("div",{ref:G?void 0:S,"aria-hidden":G,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain pb-[calc(5.75rem+var(--ar-catalog-keyboard-bottom,0px)+env(safe-area-inset-bottom))] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden","data-testid":"ar-catalog-grid",onScroll:V,children:[(0,n.jsx)(eN,{accountName:ei,avatarUrl:ea,backgroundUrl:el}),(0,n.jsx)(eM,{categories:i,filters:a,isLoading:s,onChange:_}),X&&(0,n.jsx)("p",{className:"mx-5 mt-4 rounded-xl bg-red-50 p-3 text-sm font-medium text-red-600","aria-live":"polite",children:j("catalog.placementFailed")}),(0,n.jsx)(F,{catalog:r,isEmptySearch:eo,isFetchingNextPage:Z,mechanic:c,placingObject:D,search:a.search,onSelectObject:er,onShowAllItems:et})]}),G?(0,n.jsx)(Q,{catalog:r,gridRef:S,isEmptySearch:eo,isFetchingNextPage:Z,mechanic:c,placingObject:D,search:a.search,onClearSearch:q,onClose:ee,onScroll:V,onSearchChange:B,onSelectObject:er,onShowAllItems:et}):(0,n.jsx)(K,{search:a.search,onClearSearch:$,onClose:()=>J(!1),onOpenSearch:()=>A(!0)}),(0,n.jsx)(ev,{object:k,placing:D===k,portalContainer:v,showcaseHost:p,onOpenChange:e=>{e||T(null)},onPlace:en,onViewOnSite:()=>{k&&w({object:(0,I.ZY)(k,H(k)),name:"catalog_product_view_on_site_clicked"})}})]})})}function eN(e){let{accountName:t,avatarUrl:r,backgroundUrl:i}=e;return(0,n.jsxs)("section",{"data-testid":"ar-catalog-hero",children:[(0,n.jsx)("div",{className:"relative aspect-[4/1] w-full overflow-hidden bg-[#dadae0]",children:i?(0,n.jsx)("img",{src:i,alt:"",className:"absolute inset-0 size-full object-cover",decoding:"async"}):null}),(0,n.jsxs)("div",{className:"px-5 pb-4",children:[(0,n.jsxs)(w,{className:"-mt-9 size-[72px] border-[3px] border-white bg-[#c9c9d2] shadow-sm",children:[(0,n.jsx)(y,{src:r,alt:"",className:"object-cover"}),(0,n.jsx)(N,{className:"bg-[#c9c9d2] text-[#64646c]",children:(0,n.jsx)(M.A,{className:"size-8","aria-hidden":"true"})})]}),(0,n.jsx)("h2",{className:"mt-3 text-xl leading-tight font-semibold text-[#212124]",children:t})]})]})}function eM(e){let{categories:t,filters:r,isLoading:i,onChange:a}=e,{t:l}=(0,o.Bd)();return i?(0,n.jsx)("div",{className:"flex gap-5 overflow-x-auto px-5 pt-5 pb-3 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",children:[0,1,2].map(e=>(0,n.jsx)("span",{className:"h-5 w-20 shrink-0 rounded bg-[#ededed]"},e))}):0===t.length?null:(0,n.jsxs)("div",{className:"flex gap-5 overflow-x-auto border-b border-[#ededed] px-5 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",children:[(0,n.jsx)(eC,{active:!r.category,label:l("catalog.all"),onClick:()=>a(null)}),t.map(e=>{var t;return(0,n.jsx)(eC,{active:(null==(t=r.category)?void 0:t.id)===e.id&&r.category.kind===e.kind,label:e.name,onClick:()=>a(e)},`${e.kind}:${e.id}`)})]})}function eC(e){let{active:t,label:r,onClick:i}=e;return(0,n.jsxs)("button",{type:"button","aria-pressed":t,className:v("relative shrink-0 py-3 text-base font-medium whitespace-nowrap",t?"text-[#212124]":"text-[#64646c]"),onClick:i,children:[r,t?(0,n.jsx)("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-primary"}):null]})}let eI="text-white/90 [text-shadow:0_1px_4px_rgba(0,0,0,.6)]",ez={"camera-intro":r.p+"static/svg/camera-intro.59d57f3d.svg","gesture-move":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwMCIgaGVpZ2h0PSI2MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iLTE3LjAgMTkuNCAxMzYuNSA4MS45IiBhcmlhLWhpZGRlbj0idHJ1ZSIgeG1sbnM6YzJwYT0iaHR0cDovL2MycGEub3JnL21hbmlmZXN0Ij4KPHN0eWxlPgouZ2VzdHVyZS1tb3ZlLXBlcnNwZWN0aXZlX19jdWJlLC5nZXN0dXJlLW1vdmUtcGVyc3BlY3RpdmVfX2Zpbmdlcnt0cmFuc2Zvcm0tYm94OnZpZXctYm94O3RyYW5zZm9ybS1vcmlnaW46MCAwO2FuaW1hdGlvbi1kdXJhdGlvbjoyLjRzO2FuaW1hdGlvbi1pdGVyYXRpb24tY291bnQ6aW5maW5pdGU7YW5pbWF0aW9uLWRpcmVjdGlvbjphbHRlcm5hdGU7YW5pbWF0aW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M1WiIgZmlsbD0iIzQ1NDY0RSIvPjxwYXRoIGQ9Ik02Ny42OCA0MS4yN0w3NC43NSAzNy43MUw3NC43NSAxNy43N0w2Ny42OCAyMS4zNFoiIGZpbGw9IiMzMzM0M0IiLz48cGF0aCBkPSJNNjYuMzIgMTQuNzlMNzQuNzUgMTcuNzdMNzQuNzUgMzcuNzFMNjcuNjggNDEuMjdMNTkuMjUgMzguMjlMNTkuMjUgMTguMzVaTTU5LjI1IDE4LjM1TDY3LjY4IDIxLjM0TDc0Ljc1IDE3Ljc3TTY3LjY4IDIxLjM0TDY3LjY4IDQxLjI3IiBmaWxsPSJub25lIiBzdHJva2U9IiNGNEY1RjgiIHN0cm9rZS13aWR0aD0iMS4yNCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9nPgo8ZyBjbGFzcz0icmVzY2FuX19saWZ0Ij48ZyBjbGFzcz0icmVzY2FuX19wYW4iPgo8cmVjdCB4PSI0MCIgeT0iNTIiIHdpZHRoPSIxNiIgaGVpZ2h0PSIyOCIgcng9IjQuNSIgZmlsbD0iIzFCMUMyMSIgc3Ryb2tlPSIjRjRGNUY4IiBzdHJva2Utd2lkdGg9IjEuMjQiLz4KPHJlY3QgeD0iNDUiIHk9IjU1IiB3aWR0aD0iNiIgaGVpZ2h0PSIyLjUiIHJ4PSIxLjI1IiBmaWxsPSIjRjRGNUY4IiBmaWxsLW9wYWNpdHk9Ii44Ii8+CjwvZz48L2c+Cjwvc3ZnPgo=","scan-floor":r.p+"static/svg/scan-floor.5dee2ec3.svg","scan-wall":r.p+"static/svg/scan-wall.23490063.svg"};function eR(e){let{className:t,name:r,size:i=120}=e,a=ez[r];return a?(0,n.jsx)("img",{alt:"",className:v("shrink-0 select-none",t),"data-illustration":r,"data-testid":`ar-illustration-${r}`,draggable:!1,src:a,style:{maxHeight:i,maxWidth:i}}):(0,n.jsx)("div",{"aria-hidden":"true",className:v("grid shrink-0 place-items-center rounded-2xl border-2 border-dashed border-white/45 bg-black/55 p-3 text-center",t),"data-illustration":r,"data-testid":`ar-illustration-${r}`,style:{height:i,width:i},children:(0,n.jsx)("span",{className:"text-[10px] leading-tight font-medium tracking-wide text-white/70 uppercase",children:r})})}let eL={all:"scan-floor",ceiling:"scan-floor",floor:"scan-floor",wall:"scan-wall"};function eZ(e){let{mechanic:t,positionStyle:r,showHelp:i}=e,{t:a}=(0,o.Bd)();return(0,n.jsxs)("div",{className:"pointer-events-none absolute inset-x-6 z-10 flex flex-col items-center gap-3","data-testid":"ar-scan-guide",style:r,children:[(0,n.jsxs)("div",{"aria-live":"polite",className:`grid max-w-full justify-items-center gap-3 px-8 pt-4 pb-6 text-center text-sm ${eI}`,"data-testid":"ar-scan-instruction",children:[(0,n.jsx)(eR,{name:eL[t],size:252}),(0,n.jsxs)("span",{className:"grid gap-1",children:[(0,n.jsx)("span",{className:"text-base font-semibold",children:a(`${t}.searching`)}),(0,n.jsx)("span",{children:a(`${t}.scanMove`)})]})]}),i?(0,n.jsx)("p",{"aria-live":"polite",className:"max-w-full px-3 py-1.5 text-center text-xs text-white/70 [text-shadow:0_1px_4px_rgba(0,0,0,.6)]","data-testid":"ar-scan-help",children:a("scan.help")}):null]})}function eS(e){let{mechanic:t,positionStyle:r}=e,[i,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=setTimeout(()=>a(!0),8e3);return()=>clearTimeout(e)},[t]),(0,n.jsx)(eZ,{mechanic:t,positionStyle:r,showHelp:i})}var eW=r(2083),eY=r(251),ek=r(4856),eT=r(9690);let eD={"camera-denied":"cameraDenied",error:"error",rescan:"rescan",unsupported:"unsupported",webview:"webview"},eP={"camera-denied":eW.A,error:eY.A,rescan:ek.A,unsupported:eY.A,webview:eg.A},eX={rescan:"rescan"};function eO(e){let{cameraSettingsBrowser:t,variant:r}=e,{t:i}=(0,o.Bd)(),a=void 0===t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof navigator?"":navigator.userAgent;if(!e)return null;let t=new eT.O(e),r=t.getBrowser().name??"";return"iOS"===(t.getOS().name??"")?/^(?:Safari|Mobile Safari)$/i.test(r)?"safari":null:/Firefox/i.test(r)?"firefox":/^(?:Chrome|Chromium|Edge|Mobile Chrome|Mobile Edge)$/i.test(r)?"chrome":null}():t,l=eD[r],s=r in eX?eX[r]:null,c=eP[r];return(0,n.jsxs)("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-black/85 p-8 text-center text-white",role:"alert",children:[s?(0,n.jsx)(eR,{className:"mb-3",name:s,size:192}):(0,n.jsx)(c,{"aria-hidden":"true",className:"size-10"}),(0,n.jsx)("h2",{className:"text-lg font-medium",children:i(`runtimeState.${l}.title`)}),(0,n.jsx)("p",{className:"max-w-sm text-sm text-white/80",children:i(`runtimeState.${l}.body`)}),"camera-denied"===r&&a?(0,n.jsx)("p",{className:"max-w-sm rounded-xl bg-white/10 px-3 py-2 text-sm text-white/90","data-testid":"ar-camera-settings-path",children:i(`runtimeState.cameraDenied.path.${a}`)}):null]})}function eG(e){let{status:t}=e;return"lost"!==t?null:(0,n.jsx)(eO,{variant:"rescan"})}function eA(e){return Math.min(10,Math.max(.45,e))}function eU(e,t){if("floor"!==e.kind)throw Error("Ceiling calibration requires a floor surface hit.");let r=eA(t),n=e.pose.position.y;return{floorY:n,position:{x:e.pose.position.x,y:n+r,z:e.pose.position.z},scale:1,suspensionHeight:r,yaw:0}}function eH(e){return{startedAt:e}}function eE(e,t,r){return r?e.suspensionHeight:Math.max(0,e.suspensionHeight-t*e.scale)}function eF(e){let{active:t=!1}=e;return(0,n.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0","data-testid":"ar-bottom-scrim",style:{backgroundImage:"linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.86) 26%, rgba(0,0,0,.80) 46%, rgba(0,0,0,.68) 62%, rgba(0,0,0,.48) 75%, rgba(0,0,0,.26) 86%, rgba(0,0,0,.09) 94%, rgba(0,0,0,0) 100%)",height:"34%",opacity:t?1:.2,transition:t?"opacity 180ms cubic-bezier(0, 0, .2, 1)":"opacity 260ms cubic-bezier(.4, 0, 1, 1)"}})}var eV=r(308);function eJ(){return{missingSince:null,status:"tracking"}}function eB(e,t){if(t.hasPose)return eJ();let r=e.missingSince??t.now,n=t.now-r;return n>=5e3?{missingSince:r,status:"lost"}:n>=1e3?{missingSince:r,status:"relocalizing"}:{missingSince:r,status:"tracking"}}let e_=`
2
+ uniform float uWidth, uDepth;
3
+ varying vec2 vPos;
4
+ void main() {
5
+ vec3 p = position;
6
+ p.x *= uWidth;
7
+ p.z *= uDepth;
8
+ vPos = p.xz;
9
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
10
+ }
11
+ `,eQ=`
12
+ precision highp float;
13
+ uniform float uWidth, uDepth, uBorder, uRadius, uInset, uOpacity;
14
+ uniform vec3 uColor;
15
+ varying vec2 vPos;
16
+
17
+ float sdRoundRect(vec2 p, vec2 b, float r) {
18
+ vec2 q = abs(p) - (b - vec2(r));
19
+ return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r;
20
+ }
21
+
22
+ void main() {
23
+ vec2 halfSize = 0.5 * vec2(uWidth, uDepth);
24
+ float safeRadius = max(0.0, min(halfSize.x, halfSize.y) - 0.0001);
25
+ float r = clamp(uRadius, 0.0, safeRadius);
26
+ float dOuter = sdRoundRect(vPos, halfSize - vec2(uInset), max(0.0, r - uInset));
27
+ float dInner = sdRoundRect(vPos, halfSize - vec2(uInset + uBorder), max(0.0, r - (uInset + uBorder)));
28
+
29
+ float aa = max(fwidth(dOuter), 0.0005);
30
+ float outer = smoothstep(0.0, aa, -dOuter);
31
+ float inner = smoothstep(0.0, aa, -dInner);
32
+ float borderMask = clamp(outer - inner, 0.0, 1.0);
33
+
34
+ float alpha = borderMask * uOpacity;
35
+ if (alpha < 0.001) discard;
36
+ gl_FragColor = vec4(uColor, alpha);
37
+ }
38
+ `,eK=`
39
+ varying vec2 vUv;
40
+ void main() {
41
+ vUv = uv;
42
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
43
+ }
44
+ `,eq=`
45
+ precision highp float;
46
+ varying vec2 vUv;
47
+ uniform vec3 uColor;
48
+ uniform float uOpacity;
49
+ uniform float uSoftness;
50
+
51
+ void main() {
52
+ vec2 p = vUv * 2.0 - 1.0;
53
+ float radial = length(p);
54
+ float edge = max(0.01, min(0.99, 1.0 - uSoftness));
55
+ float mask = 1.0 - smoothstep(edge, 1.0, radial);
56
+ float alpha = mask * uOpacity;
57
+ if (alpha < 0.001) discard;
58
+ gl_FragColor = vec4(uColor, alpha);
59
+ }
60
+ `,e$="arSessionHelper";function e0(e){e.userData[e$]=!0}function e1(e){return!0===e.userData[e$]}function e2(e){for(let t=e;t;t=t.parent)if(!t.visible)return!1;return!0}let e4=new eV.kn4,e3=new eV.RlV,e5=new eV.Zcv(new eV.Pq0(0,1,0),0),e9=new eV.Pq0;function e7(e,t,r,n,i){if(!e2(e)||(e4.copy(e.matrixWorld).invert(),e3.copy(t.ray).applyMatrix4(e4),!e3.intersectPlane(e5,e9)||Math.abs(e9.x)>n||Math.abs(e9.z)>i))return;let a=e9.clone().applyMatrix4(e.matrixWorld),l=t.ray.origin.distanceTo(a);l<t.near||l>t.far||r.push({distance:l,object:e,point:a})}function e6(e,t){let{uniforms:r}=this.material;e7(this,e,t,r.uWidth.value/2,r.uDepth.value/2)}function e8(e,t){e2(this)&&eV.eaF.prototype.raycast.call(this,e,t)}function te(e){let{border:t,color:r,depth:n,doubleSide:i,inset:a,opacity:l,radius:o,renderOrder:s,width:c}=e,u=new eV.bdM(1,1).rotateX(-Math.PI/2),d=new eV.BKk({depthWrite:!1,fragmentShader:eQ,side:2*!!i,transparent:!0,uniforms:{uBorder:{value:t},uColor:{value:new eV.Q1f(r)},uDepth:{value:n},uInset:{value:a},uOpacity:{value:l},uRadius:{value:o},uWidth:{value:c}},vertexShader:e_}),m=new eV.eaF(u,d);return m.renderOrder=s,m.raycast=e6,e0(m),m}function tt(e,t){let{depth:r,radius:n,width:i}=t,a=e.material;a.uniforms.uDepth.value=r,a.uniforms.uRadius.value=n,a.uniforms.uWidth.value=i}function tr(e){if(!e)return;e.geometry.dispose();let t=e.material;Array.isArray(t)?t.forEach(e=>e.dispose()):t.dispose()}let tn="#ffffff",ti={depth:.36,radius:.09,width:.36};function ta(e){let{phase:t,placing:r,selected:n}=e;return n||r&&"preview"===t}function tl(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;e.updateWorldMatrix(!0,!0);let n=r.matrixWorld.clone().invert(),i=new eV.NRn,a=new eV.NRn,l=new eV.kn4,o=!1;for(let r of(t=[],e.traverse(e=>{"isMesh"in e&&e.isMesh&&!e1(e)&&t.push(e)}),t))r.geometry.boundingBox||r.geometry.computeBoundingBox(),r.geometry.boundingBox&&(a.copy(r.geometry.boundingBox),a.applyMatrix4(l.multiplyMatrices(n,r.matrixWorld)),o?i.union(a):(i.copy(a),o=!0));return o?{max:{x:i.max.x,y:i.max.y,z:i.max.z},min:{x:i.min.x,y:i.min.y,z:i.min.z}}:null}function to(e,t){return{height:Math.max(.1,t+.1),width:Math.max(.1,e+.1)}}function ts(e){let{elapsedMs:t,from:r,to:n}=e;return r+(n-r)*(1-(1-Math.min(1,Math.max(0,t/240)))**3)}let tc={floorY:0,position:{x:0,y:2,z:-1},scale:1,suspensionHeight:2,yaw:0};function tu(){return{...tc,position:{...tc.position}}}function td(e){return e.runtime.modelHeight??e.resource.dimensions.height}var tm=r(2326);let th=Object.freeze({engine:!0});function tp(e){let{bridge:t}=e;(0,tm.D)(()=>void 0,1);let r=(0,tm.C)(),n=(0,l.useRef)(r);return n.current=r,(0,l.useEffect)(()=>t.onFrame(e=>{let{time:t}=e;return(0,tm.n)(t/1e3,!0,n.current,th)}),[t]),null}function tf(e){return e.slice(e.indexOf(".")+1)}function tg(e){return e.slice(0,e.indexOf("."))}let tb=new Set(["catalog","finish","gestures","move","rotate","select"]),tx=new Set(["catalog","finish","rotate"]),tv=["move","rotate","finish"],tj=["select","catalog"],tw=new Set(["ceiling","wall"]),ty={finish:"gesture-tap-away",move:"gesture-move",rotate:"gesture-rotate",select:"gesture-tap"};function tN(e){let t=tf(e);return tb.has(t)?tx.has(t)?t:tw.has(tg(e))?`${t}-with-floor-circle`:t:null}let tM={wall:{move:"gesture-move-wall"}},tC={move:"move",release:"finish",rotate:"rotate"};function tI(e){let{texture:t}=e,r=(0,tm.C)(e=>e.scene);return(0,l.useEffect)(()=>(function(e,t){if(!e)return()=>void 0;let r=e.environment;return e.environment=t,()=>{e.environment=r}})(r,t),[r,t]),null}function tz(e){return{mechanic:e.mechanic,objectId:e.id,variantId:e.variantId}}function tR(e){return e instanceof Error?{message:e.message,name:e.name}:{message:"string"==typeof e?e:void 0}}var tL=r(7503),tZ=r(2002),tS=r(112);let tW="max(1.5rem, env(safe-area-inset-bottom))";function tY(e){let{currentVariantId:t,variants:r,onSelect:i}=e,{t:a}=(0,o.Bd)();return r.length<2?null:(0,n.jsx)("div",{className:"-mx-5 overflow-x-auto overscroll-x-contain px-5 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden","data-testid":"ar-session-variant-tiles",children:(0,n.jsx)("div",{className:"flex w-max gap-2",children:r.map(e=>{let r=e.hid===t;return(0,n.jsx)("button",{type:"button","aria-label":e.name??a("variant"),"aria-pressed":r,className:`size-20 shrink-0 rounded-2xl p-[3px] shadow-[0_2px_10px_rgba(0,0,0,0.25)] transition-colors ${r?"bg-[#5B6BFF]":"bg-white/85"}`,"data-testid":r?"ar-session-variant-tile-current":"ar-session-variant-tile",onClick:()=>i(e.hid),children:e.previewUrl?(0,n.jsx)("img",{alt:"",className:"size-full rounded-[11px] object-cover",draggable:!1,src:e.previewUrl}):(0,n.jsx)("span",{className:"grid size-full place-items-center rounded-[11px] bg-[#e7e7ea] px-1 text-[11px] leading-tight text-[#44444c]",children:e.name})},e.hid)})})})}let tk="flex h-11 min-w-0 items-center gap-1.5 rounded-full bg-white px-4 text-sm font-medium text-[#212124] shadow-[0_2px_10px_rgba(0,0,0,0.18)]",tT="rounded-full bg-white text-[#212124] shadow-[0_2px_10px_rgba(0,0,0,0.18)] hover:bg-[#f3f3f5] active:bg-[#ededed]",tD="grid grid-cols-[minmax(0,1fr)] gap-3";function tP(e){let{children:t,show:r}=e,[i,a]=(0,l.useState)(r),o=(0,l.useRef)(t);return(r&&(o.current=t),(0,l.useEffect)(()=>{if(r)return void a(!0);let e=setTimeout(()=>a(!1),150);return()=>clearTimeout(e)},[r]),i||r)?(0,n.jsx)("div",{className:"ar-panel col-start-1 row-start-1","data-state":r?"entering":"exiting",inert:!r||void 0,children:r?t:o.current}):null}function tX(e){let{currentVariantId:t,productName:r,showShareButton:i,showVariantChip:a,variants:l,onOpenProduct:s,onOpenVariants:c,onShare:u}=e,{t:d}=(0,o.Bd)(),m=l.find(e=>e.hid===t)??null;return(0,n.jsxs)("div",{className:"flex items-center gap-2","data-testid":"ar-session-object-row",children:[i?(0,n.jsx)(p.$,{className:tT,size:"icon-lg",variant:"secondary","aria-label":d("share"),"data-testid":"ar-session-share",onClick:u,children:(0,n.jsx)(eb.A,{"aria-hidden":"true"})}):null,(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-2",children:[a&&l.length>1?(0,n.jsxs)("button",{type:"button","aria-label":d("catalog.selectVariant"),className:`${tk} shrink-0`,"data-testid":"ar-session-variant-chip",onClick:c,children:[(0,n.jsx)("span",{className:"max-w-32 truncate",children:(null==m?void 0:m.name)||d("variant")}),(0,n.jsx)(tL.A,{"aria-hidden":"true",className:"size-4 shrink-0 text-[#64646c]"})]}):null,(0,n.jsxs)("button",{type:"button",className:`${tk} min-w-0 shrink`,"data-testid":"ar-session-product",onClick:s,children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:r}),(0,n.jsx)(tL.A,{"aria-hidden":"true",className:"size-4 shrink-0 text-[#64646c]"})]})]})]})}function tO(e){let{confirmDisabled:t,confirmLabel:r,controlsRef:i,currentVariantId:a,productName:l,calledOutCatalog:s=!1,showAddObjectButton:c=!1,showCatalogButton:u,showConfirmButton:d,showSetFloorButton:m,showShareButton:h,variantPicker:f="tiles",variants:g,onConfirm:b,onOpenCatalog:x,onOpenProduct:v,onOpenVariants:j,onSelectVariant:w,onSetFloorPoint:y,onShare:N}=e,{t:M}=(0,o.Bd)(),C=m||d||u||c,I=!!l,z=I&&C?"both":I?"object":C?"slots":"none",R="tiles"===f&&g.length>1,L=l?(0,n.jsxs)("div",{className:tD,children:[R?(0,n.jsx)(tY,{currentVariantId:a,variants:g,onSelect:w}):null,(0,n.jsx)(tX,{currentVariantId:a,productName:l,showShareButton:h,showVariantChip:!R,variants:g,onOpenProduct:v,onOpenVariants:j,onShare:N})]}):null,Z=(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center",children:[(0,n.jsx)("div",{}),(0,n.jsxs)("div",{className:"flex justify-center",children:[m?(0,n.jsxs)(p.$,{size:"lg",onClick:y,children:[(0,n.jsx)(tZ.A,{"aria-hidden":"true"}),M("ceiling.setFloor")]}):null,d?(0,n.jsxs)(p.$,{size:"lg","data-testid":"ar-session-confirm",disabled:t,onClick:b,children:[(0,n.jsx)(tZ.A,{"aria-hidden":"true"}),r]}):null,c?(0,n.jsxs)(p.$,{size:"lg","data-testid":"ar-session-add-object",onClick:x,children:[(0,n.jsx)(tS.A,{"aria-hidden":"true"}),M("addObject")]}):null]}),(0,n.jsx)("div",{className:"flex justify-end",children:u?(0,n.jsx)(p.$,{className:`${tT} ${s?"ring-[3px] ring-[#5B6BFF] ring-offset-0":""}`,size:"icon-lg",variant:"secondary","aria-label":M("catalog.open"),"data-testid":"ar-session-catalog",onClick:x,children:(0,n.jsx)(tS.A,{"aria-hidden":"true"})}):null})]});return(0,n.jsxs)("div",{ref:i,className:`absolute inset-x-5 z-10 grid grid-cols-[minmax(0,1fr)] items-end ${"none"===z?"":"min-h-11"}`,style:{bottom:tW},"data-testid":"ar-session-controls",children:[(0,n.jsx)(tP,{show:"object"===z,children:L}),(0,n.jsx)(tP,{show:"slots"===z,children:Z}),(0,n.jsx)(tP,{show:"both"===z,children:(0,n.jsxs)("div",{className:tD,children:[L,Z]})})]})}var tG=r(350),tA=r(2585),tU=r(5148);function tH(e){for(let t of Object.values(e))t instanceof eV.gPd&&t.dispose();e.dispose()}function tE(e){e.traverse(e=>{var t;null==(t=e.geometry)||t.dispose(),Array.isArray(e.material)?e.material.forEach(tH):e.material&&tH(e.material)})}class tF{register(e,t,r){this.holders.set(e,(this.holders.get(e)??0)+1),this.requested.add(e);let n=!1;this.scenes.get(e)!==t&&(this.scenes.set(e,t),n=!0),void 0!==r&&this.shownBy.get(r)!==e&&(this.shownBy.set(r,e),n=!0),n&&this.notify();let i=!0;return()=>{i&&(i=!1,this.holders.set(e,(this.holders.get(e)??1)-1),void 0!==r&&this.shownBy.get(r)===e&&(this.shownBy.delete(r),this.notify()),queueMicrotask(()=>this.dropUnheld(e)))}}request(e){this.requested.add(e)}want(e){this.requested.add(e),this.wanted.set(e,(this.wanted.get(e)??0)+1);let t=!0;return()=>{t&&(t=!1,this.wanted.set(e,(this.wanted.get(e)??1)-1),queueMicrotask(()=>this.dropUnheld(e)))}}has(e){return this.scenes.has(e)}showsModel(e){return this.shownBy.has(e)}get size(){return this.scenes.size}release(){if(!this.requested.size&&!this.scenes.size)return;this.scenes.forEach(tE);let e=new Set(this.scenes.keys());this.requested.forEach(t=>e.add(t)),e.forEach(e=>tU.p.clear(e)),this.scenes.clear(),this.holders.clear(),this.wanted.clear(),this.requested.clear(),this.shownBy.clear(),this.notify()}dropUnheld(e){if((this.holders.get(e)??0)>0||(this.wanted.get(e)??0)>0)return;let t=this.scenes.get(e),r=void 0!==t||this.requested.has(e);this.holders.delete(e),this.wanted.delete(e),this.requested.delete(e),t&&(tE(t),this.scenes.delete(e),this.notify()),r&&tU.p.clear(e)}notify(){this.listeners.forEach(e=>e())}constructor(){(0,tA._)(this,"scenes",new Map),(0,tA._)(this,"holders",new Map),(0,tA._)(this,"wanted",new Map),(0,tA._)(this,"requested",new Set),(0,tA._)(this,"shownBy",new Map),(0,tA._)(this,"listeners",new Set),(0,tA._)(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}))}}let tV=(0,l.createContext)(null);function tJ(e){let{cache:t,children:r}=e,[i]=(0,l.useState)(()=>new tF),a=t??i;return(0,l.useEffect)(()=>()=>a.release(),[a]),(0,n.jsx)(tV,{value:a,children:r})}function tB(e){let t=(0,l.use)(tV),r=(0,l.useCallback)(e=>t?t.subscribe(e):()=>void 0,[t]),n=(0,l.useCallback)(()=>!!(e&&(null==t?void 0:t.showsModel(e))),[t,e]);return(0,l.useSyncExternalStore)(r,n,n)}function t_(e){let{illustration:t=null,loadingProgress:r,loadingTitle:i=null,notice:a=null,positionStyle:l,text:s}=e,{t:c}=(0,o.Bd)();if(null===r&&!a&&!s)return null;let u=!!t&&null===r&&!a&&!!s,d=null!==r&&!!i,m=["max-w-full text-center text-sm",eI,u?"grid justify-items-center gap-3 px-8 pt-4 pb-6":d?"grid gap-1 px-6 py-4":"px-4 py-2"].join(" ");return(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-6 z-10 flex justify-center",style:l,"data-testid":"ar-session-hint-shell",children:null!==r?(0,n.jsx)("div",{className:m,"aria-live":"polite","data-testid":"ar-session-loading",role:"status",children:i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:i}),(0,n.jsx)("span",{className:"opacity-65",children:c("preparingObject",{progress:Math.round(r)})})]}):(0,n.jsx)("span",{children:c("loadingModel",{progress:Math.round(r)})})}):a?(0,n.jsxs)("p",{className:`${m} flex items-center gap-2`,"aria-live":"polite","data-testid":"ar-session-notice",role:"status",children:[(0,n.jsx)(tZ.A,{"aria-hidden":"true",className:"size-4 shrink-0"}),a]}):(0,n.jsxs)("div",{className:m,"aria-live":"polite","data-testid":"ar-session-hint",role:"status",children:[u&&t?(0,n.jsx)(eR,{name:t,size:148}):null,(0,n.jsx)("span",{children:s})]})})}function tQ(e){let t,r,{illustration:i=null,loadingTitle:a=null,modelCache:o,notice:s=null,pendingModelUrl:c,positionStyle:u,text:d}=e,{active:m,progress:h}=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{active:t,progress:r}=(0,tG.p)(),[n,i]=(0,l.useState)({active:!1,progress:0}),a=(0,l.useRef)(0);return(0,l.useEffect)(()=>{if(e){a.current=0,i({active:!1,progress:0});return}if(t){a.current=Math.max(a.current,Math.round(r)),i({active:!0,progress:a.current});return}let n=window.setTimeout(()=>{a.current=0,i({active:!1,progress:0})},400);return()=>window.clearTimeout(n)},[t,e,r]),n}((t=(0,l.useCallback)(e=>o?o.subscribe(e):()=>void 0,[o]),r=(0,l.useCallback)(()=>!!(c&&(null==o?void 0:o.has(c))),[o,c]),(0,l.useSyncExternalStore)(t,r,r)||!c));return(0,n.jsx)(t_,{illustration:i,loadingProgress:a&&m?h:null,loadingTitle:a,notice:s,positionStyle:u,text:d})}var tK=r(5807);function tq(e){let{w:t,x:r,y:n,z:i}=e.orientation;return Math.atan2(2*(t*n+r*i),1-2*(r*r+n*n))}function t$(e,t,r){let n=tq(r)-tq(t),i=Math.atan2(Math.sin(n),Math.cos(n)),a=Math.cos(i),l=Math.sin(i),o=e.position.x-t.position.x,s=e.position.z-t.position.z;return{...e,position:{x:r.position.x+a*o+l*s,y:e.position.y+r.position.y-t.position.y,z:r.position.z-l*o+a*s},yaw:e.yaw+i}}function t0(e,t){if("floor"!==e.kind)throw Error("Floor placement requires a floor surface hit.");return{position:{...e.pose.position},scale:(null==t?void 0:t.scale)??1,yaw:(null==t?void 0:t.yaw)??0}}function t1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0,z:1},r=Math.hypot(e.x,e.z);return 0===r?{...t,y:0}:{x:0===e.x?0:e.x/r,y:0,z:0===e.z?0:e.z/r}}function t2(e,t){let r=t1(e),n=t1(t);return Math.min(1,Math.max(-1,r.x*n.x+r.z*n.z))}function t4(e,t){let r=t1(e.normal),n={x:t.x-e.pose.position.x,y:0,z:t.z-e.pose.position.z};return r.x*n.x+r.z*n.z>=0?r:{x:0===r.x?0:-r.x,y:0,z:0===r.z?0:-r.z}}function t3(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.height,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.depth/2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(0,tK.aq)(e))throw Error("Wall placement requires a wall surface hit.");let l=t4(e,r);return{orientationRoot:{pitch:0,position:{x:0,y:-(a+n/2),z:0}},userRoot:{scale:1,yaw:0},worldRoot:{normal:l,position:{x:e.pose.position.x+l.x*i,y:e.pose.position.y,z:e.pose.position.z+l.z*i},yaw:Math.atan2(l.x,l.z)}}}let t5=new WeakSet;function t9(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return-e.minZ*t}function t7(e){return{surface:e.surface,orientationRoot:{position:{...e.orientationRoot.position}},userRoot:{...e.userRoot},worldRoot:{normal:{...e.worldRoot.normal},position:{...e.worldRoot.position},yaw:e.worldRoot.yaw}}}let t6=.4*Math.PI/180,t8=1e3/60;function re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.22;if(!Number.isFinite(e)||e<=0)return t;let r=Math.min(4,e/t8);return 1-(1-t)**r}function rt(e,t,r){let n=rr({position:e.worldRoot.position,scale:1,yaw:e.worldRoot.yaw},{position:t.worldRoot.position,scale:1,yaw:t.worldRoot.yaw},r),i=rr({position:{x:0,y:0,z:0},scale:e.userRoot.scale,yaw:e.userRoot.yaw},{position:{x:0,y:0,z:0},scale:t.userRoot.scale,yaw:t.userRoot.yaw},r);return{...t,userRoot:{scale:i.scale,yaw:i.yaw},worldRoot:{...t.worldRoot,position:n.position,yaw:n.yaw}}}function rr(e,t){var r,n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.22,a=t.position.x-e.position.x,l=t.position.y-e.position.y,o=t.position.z-e.position.z,s=Math.hypot(a,l,o),c=(r=e.yaw,Math.atan2(Math.sin((n=t.yaw)-r),Math.cos(n-r)));return{position:s<.001?{...t.position}:{x:e.position.x+a*i,y:e.position.y+l*i,z:e.position.z+o*i},scale:.001>Math.abs(t.scale-e.scale)?t.scale:e.scale+(t.scale-e.scale)*i,yaw:Math.abs(c)<t6?t.yaw:e.yaw+c*i}}function rn(e,t){return null==e?1:Math.max(0,1-Math.min(1,Math.max(0,(t-e)/220))**2)}var ri=r(8413),ra=r(2402),rl=r(2662),ro=r(2588);function rs(e){return new eV.BKk({depthTest:!1,depthWrite:!1,fragmentShader:e.fragmentShader,uniforms:eV.LlO.clone(e.uniforms),vertexShader:e.vertexShader})}let rc=(0,l.createContext)(null);function ru(e){let{children:t,renderer:r}=e;return(0,n.jsx)(rc,{value:r,children:t})}function rd(e){let{active:t,root:r,surface:i}=e,{shadow:a,stand:o,standShape:s}=(0,l.useMemo)(()=>{let e=tl(r);if(!e)return{shadow:null,stand:null,standShape:null};let t=function(e,t){let r={x:e.max.x-e.min.x,y:e.max.y-e.min.y,z:e.max.z-e.min.z},n={x:(e.min.x+e.max.x)/2,y:(e.min.y+e.max.y)/2,z:(e.min.z+e.max.z)/2};if("wall"===t){let t=to(r.x,r.y);return{shadow:null,stand:{border:.016,color:tn,depth:t.height,doubleSide:!0,inset:.02,opacity:.92,position:{x:n.x,y:n.y,z:e.min.z-.006},radius:.06,renderOrder:15,rotationX:Math.PI/2,width:t.width}}}let i="ceiling"===t;return{shadow:i?null:{color:"#000000",depth:Math.max(.12,1.08*r.z),opacity:.28,position:{x:n.x,y:e.min.y+.002,z:n.z},renderOrder:12,softness:.7,width:Math.max(.12,1.08*r.x)},stand:{border:.02,color:tn,depth:Math.max(.14,r.z+.12),doubleSide:i,inset:.03,opacity:.94,position:{x:n.x,y:i?e.max.y-.006:e.min.y+.006,z:n.z},radius:.09,renderOrder:14,rotationX:0,width:Math.max(.14,r.x+.12)}}}(e,i),n=te(t.stand);n.position.set(t.stand.position.x,t.stand.position.y,t.stand.position.z),n.rotation.x=t.stand.rotationX,n.visible=!1,tt(n,ti);let a={depth:t.stand.depth,radius:t.stand.radius,width:t.stand.width};if(!t.shadow)return{shadow:null,stand:n,standShape:a};let l=function(e){let{color:t,depth:r,opacity:n,renderOrder:i,softness:a,width:l}=e,o=new eV.bdM(l,r).rotateX(-Math.PI/2),s=new eV.BKk({depthWrite:!1,fragmentShader:eq,side:2,transparent:!0,uniforms:{uColor:{value:new eV.Q1f(t)},uOpacity:{value:n},uSoftness:{value:a}},vertexShader:eK}),c=new eV.eaF(o,s);return c.renderOrder=i,c.raycast=e8,e0(c),c}(t.shadow);return l.position.set(t.shadow.position.x,t.shadow.position.y,t.shadow.position.z),{shadow:l,stand:n,standShape:a}},[r,i]);(0,l.useEffect)(()=>()=>{tr(o),tr(a)},[a,o]);let c=function(e,t){let r=function(){let e=(0,l.use)(rc),{gl:t}=(0,tm.C)();return e??t}(),[n,i]=(0,l.useState)(!1),a=(0,l.useRef)(!1),o=(0,l.useRef)(null);return(0,l.useEffect)(()=>(a.current=t,()=>{a.current=!1;let e=o.current;o.current=null,null==e||e.removeFromParent(),tr(e),i(!1)}),[t,r,e]),(0,tm.D)(()=>{if(!a.current)return;a.current=!1;let t=tl(e);if(t)try{let n,a,l,s,c=function(e,t,r){let n,i=new eV.nWS(256,256),a=new eV.nWS(256,256),l=new eV.qUd(-r.width/2,r.width/2,r.depth/2,-r.depth/2,0,r.reach+.002);l.rotation.x=Math.PI/2,l.position.set(r.center.x,r.floorY-.002,r.center.z);let o=((n=new eV.CSG({side:2})).onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );",`float closeness = 1.0 - fragCoordZ;
61
+ gl_FragColor = vec4( vec3( 0.0 ), 0.30 + 0.70 * closeness * closeness * closeness );`)},n),s=rs(rl.F),c=rs(ro.r),u=new ra.F(s),d=[];t.traverse(e=>{if(e1(e)){e.visible&&(e.visible=!1,d.push(()=>{e.visible=!0}));return}if(e instanceof eV.eaF){let t=e.material;e.material=o,d.push(()=>{e.material=t})}});let m=e.getRenderTarget(),h=e.xr.enabled,p=e.autoClear,f=e.getClearColor(new eV.Q1f),g=e.getClearAlpha();t.add(l);let b=t=>{u.material=s,s.uniforms.tDiffuse.value=i.texture,s.uniforms.h.value=t/256,e.setRenderTarget(a),u.render(e),u.material=c,c.uniforms.tDiffuse.value=a.texture,c.uniforms.v.value=t/256,e.setRenderTarget(i),u.render(e)},x=!1;try{e.xr.enabled=!1,e.autoClear=!0,e.setClearColor(0,0),e.setRenderTarget(i),e.render(t,l),b(1.5),b(.6000000000000001),x=!0}finally{x||i.dispose(),l.removeFromParent(),d.forEach(e=>e()),e.setRenderTarget(m),e.xr.enabled=h,e.autoClear=p,e.setClearColor(f,g),o.dispose(),s.dispose(),c.dispose(),u.dispose(),a.dispose()}let v=new eV.bdM(r.width,r.depth).rotateX(Math.PI/2),j=new eV.V9B({depthWrite:!1,map:i.texture,opacity:.65,side:2,toneMapped:!1,transparent:!0}),w=new eV.eaF(v,j);w.position.set(r.center.x,r.floorY+.001,r.center.z),w.renderOrder=12;let y=r.footprint.width/2+.05,N=r.footprint.depth/2+.05;return w.raycast=function(e,t){e7(this,e,t,y,N)},e0(w),j.addEventListener("dispose",()=>i.dispose()),w}(r,e,(n=t.max.x-t.min.x,a=t.max.y-t.min.y,l=t.max.z-t.min.z,s=.05+.05*Math.max(n,l),{center:{x:(t.min.x+t.max.x)/2,z:(t.min.z+t.max.z)/2},depth:l+2*s,footprint:{depth:l,width:n},floorY:t.min.y,reach:Math.min(1.5,Math.max(.2,a)),width:n+2*s}));e.add(c),o.current=c,i(!0)}catch(e){(0,ri.Q0)()&&console.warn("[react-ar] the contact shadow could not be rendered.",e)}}),n}(r,null!==a),u=(0,l.useRef)({active:!1,elapsedMs:240,fromShape:ti});return((0,l.useEffect)(()=>{let e,r=u.current;r.active=t,r.elapsedMs=0,r.fromShape=o?{depth:(e=o.material).uniforms.uDepth.value,radius:e.uniforms.uRadius.value,width:e.uniforms.uWidth.value}:r.fromShape},[t,o]),(0,tm.D)((e,t)=>{let r=u.current;if(r.elapsedMs>=240)return;r.elapsedMs+=1e3*t;let n=r.active||r.elapsedMs<240;if(!o||!s)return;let i=r.active?s:ti,a=r.fromShape;tt(o,{depth:ts({elapsedMs:r.elapsedMs,from:a.depth,to:i.depth}),radius:ts({elapsedMs:r.elapsedMs,from:a.radius,to:i.radius}),width:ts({elapsedMs:r.elapsedMs,from:a.width,to:i.width})}),o.visible=n}),o)?(0,tm.o)((0,n.jsxs)(n.Fragment,{children:[a&&!c?(0,n.jsx)("primitive",{object:a}):null,(0,n.jsx)("primitive",{object:o})]}),r):null}class rm{follow(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(!e)return;let a=t.x,l=t.y+n,o=t.z,s=e.position,c=Math.hypot(a-s.x,l-s.y,o-s.z);if(!this.tracking||i!==this.surface||c>.3){s.set(a,l,o),this.surface=i,this.tracking=!0;return}let u=re(r,.3);s.set(s.x+(a-s.x)*u,s.y+(l-s.y)*u,s.z+(o-s.z)*u)}reset(){this.tracking=!1}constructor(){(0,tA._)(this,"surface",null),(0,tA._)(this,"tracking",!1)}}function rh(e){let{doubleSided:t=!1,flat:r=!1,ref:i}=e,a=(0,l.useMemo)(()=>te(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{border:.02,color:tn,depth:ti.depth,doubleSide:e,inset:.03,opacity:.94,radius:ti.radius,renderOrder:14,width:ti.width}}(t)),[t]);return(0,l.useEffect)(()=>()=>tr(a),[a]),(0,n.jsx)("group",{ref:i,"rotation-x":r?-Math.PI/2:0,visible:!1,children:(0,n.jsx)("primitive",{object:a,"rotation-x":Math.PI/2})})}function rp(e,t,r){return r<=0?0:(t-e)/r*Math.PI}function rf(e,t){return Math.min(2,Math.max(.6,e*t))}class rg{get count(){return this.pointers.size}get moved(){return this.hasMoved}get multiTouch(){return this.hadSecondPointer}get startX(){return this.startXValue}get startY(){return this.startYValue}down(e){this.pointers.set(e.pointerId,e),1===this.pointers.size?(this.hasMoved=!1,this.hadSecondPointer=!1,this.startXValue=e.clientX,this.startYValue=e.clientY):this.hadSecondPointer=!0}has(e){return this.pointers.has(e)}move(e){this.pointers.set(e.pointerId,e),this.hasMoved||(this.hasMoved=Math.hypot(e.clientX-this.startXValue,e.clientY-this.startYValue)>=4)}up(e){this.pointers.delete(e.pointerId)}beginPinch(){let e=this.measureSpan();return null!==e&&(this.pinchStart=e,!0)}pinchRatio(){let e=this.measureSpan();return null===e?1:e/Math.max(1,this.pinchStart)}reset(){this.pointers.clear(),this.hasMoved=!1,this.hadSecondPointer=!1}measureSpan(){if(this.pointers.size<2)return null;let e=this.pointers.values(),t=e.next().value,r=e.next().value;return t&&r?Math.hypot(r.clientX-t.clientX,r.clientY-t.clientY):null}constructor(){(0,tA._)(this,"pointers",new Map),(0,tA._)(this,"hasMoved",!1),(0,tA._)(this,"hadSecondPointer",!1),(0,tA._)(this,"pinchStart",0),(0,tA._)(this,"startXValue",0),(0,tA._)(this,"startYValue",0)}}class rb{measure(){let e=this.element.getBoundingClientRect();this.height=e.height,this.left=e.left,this.top=e.top,this.width=e.width}setRay(e){this.setPoint(e),this.castThroughPoint()}beginAnchoredDrag(e,t){this.setPoint(e),this.projected.copy(t).project(this.camera),this.projected.z>1?this.anchorOffset.set(0,0):this.anchorOffset.set(this.projected.x-this.point.x,this.projected.y-this.point.y)}setAnchoredRay(e){this.setPoint(e),this.point.add(this.anchorOffset),this.castThroughPoint()}intersectPlane(e,t){let r=this.raycaster.ray.intersectPlane(e,t);return r&&20>=r.distanceTo(this.raycaster.ray.origin)?r:null}castThroughPoint(){this.camera.projectionMatrixInverse.copy(this.camera.projectionMatrix).invert(),this.raycaster.setFromCamera(this.point,this.camera)}setPoint(e){this.point.set((e.clientX-this.left)/this.width*2-1,-(e.clientY-this.top)/this.height*2+1)}get ray(){return this.raycaster.ray}intersect(e){return e?this.raycaster.intersectObject(e,!0)[0]??null:null}nearest(e,t){let r=null;for(let n of e){let e=this.intersect(t(n));e&&(!r||e.distance<r.distance)&&(r={candidate:n,distance:e.distance,point:e.point})}return r?{candidate:r.candidate,point:r.point}:null}constructor(e,t){(0,tA._)(this,"element",void 0),(0,tA._)(this,"camera",void 0),(0,tA._)(this,"raycaster",void 0),(0,tA._)(this,"anchorOffset",void 0),(0,tA._)(this,"point",void 0),(0,tA._)(this,"projected",void 0),(0,tA._)(this,"height",void 0),(0,tA._)(this,"left",void 0),(0,tA._)(this,"top",void 0),(0,tA._)(this,"width",void 0),this.element=e,this.camera=t,this.raycaster=new eV.tBo,this.anchorOffset=new eV.I9Y,this.point=new eV.I9Y,this.projected=new eV.Pq0,this.height=0,this.left=0,this.top=0,this.width=0,this.measure()}}function rx(e,t){let r=new rb(e,t),n=()=>r.measure();return window.addEventListener("resize",n),window.addEventListener("orientationchange",n),{dispose:()=>{window.removeEventListener("resize",n),window.removeEventListener("orientationchange",n)},raycaster:r}}var rv=r(7734);function rj(e){let{interactionEnabledRef:t,onCentreHit:r,relocalize:n,sceneObjects:i,sessionHasTrackingRef:a,sessionRef:o,setTrackingStatus:s,updateObject:c}=e,u=(0,l.useRef)("tracking");(0,tm.D)((e,l,d)=>{let m=o.current,h=performance.now(),p=1e3*l;if(m&&d){let e=(0,rv.Y)(d);r(m.getCenterHit(e),h,p);let l=function(e,t,r,n){let i=!0,a="tracking";for(let s of e){var l,o;let e=s.runtime;if(e.anchor){let a=e.anchor.getPose(t);if(!a){let r=(0,tK.gD)(e.anchor,e.lastAnchorPose??null);r&&(e.anchor=r,a=r.getPose(t))}i&&(i=null!==a),e.tracking=eB(e.tracking,{hasPose:null!==a,now:r}),a&&n(s,a)}l=a,o=e.tracking.status,a="lost"===l||"lost"===o?"lost":"relocalizing"===l||"relocalizing"===o?"relocalizing":"tracking"}return{allAnchorPosesAvailable:i,status:a}}(i,e,h,n);t.current=a.current&&l.allAnchorPosesAvailable,u.current!==l.status&&(u.current=l.status,s(l.status))}for(let e of i)(a.current&&null===e.runtime.tracking.missingSince||null!=e.removingSince)&&c(e,h,p)})}function rw(e){return .5+.5*Math.sin(2*e)}let ry=null,rN=0;function rM(e,t){var r;let n,i,a,{shownUrl:o,swapping:s}=(null==(n=(0,l.use)(tV))||n.request(e),i=(0,l.useDeferredValue)(e),(0,l.useLayoutEffect)(()=>null==n?void 0:n.want(e),[n,e]),{shownUrl:i,swapping:e!==i}),c=(0,tU.p)(o),u=(0,l.useMemo)(()=>c.scene.clone(!0),[c.scene]);return r=c.scene,a=(0,l.use)(tV),(0,l.useLayoutEffect)(()=>null==a?void 0:a.register(o,r,t),[a,t,r,o]),(0,l.useLayoutEffect)(()=>{let e,t,r;return s?(ry??(ry=new eV.V9B({color:0xffffff,opacity:rw(performance.now()/1e3),toneMapped:!1,transparent:!0})),rN+=1,e=ry,t=new Map,u.traverse(r=>{!(r instanceof eV.eaF)||e1(r)||(t.set(r,r.material),r.material=Array.isArray(r.material)?r.material.map(()=>e):e)}),r=!0,()=>{r&&(r=!1,t.forEach((e,t)=>{t.material=e}),0===(rN=Math.max(0,rN-1))&&ry&&(ry.dispose(),ry=null))}):void 0},[s,u]),(0,tm.D)(()=>{var e;s&&(e=performance.now()/1e3,ry&&(ry.opacity=rw(e)))}),{scene:u,swapping:s}}function rC(e){let{currentHitRef:t,manager:r,phase:i,phaseRef:a,placingObjectId:o,scaleEnabled:s,sceneObjects:c,selectedObjectId:u,sessionHasTrackingRef:d,sessionRef:m,setTrackingStatus:h,updatePhase:p}=e,{camera:f}=(0,tm.C)(),g=(0,l.useRef)(null),b=(0,l.useMemo)(()=>new rm,[]),x=(0,l.useRef)(!0),v=tB(o);return!function(e){let{interactionEnabledRef:t,manager:r,scaleEnabled:n}=e,{camera:i,gl:a}=(0,tm.C)();(0,l.useEffect)(()=>{let e=a.domElement,{dispose:l,raycaster:o}=rx(e,i),s=new eV.Zcv,c=new eV.Pq0,u=new eV.Pq0,d=new eV.Pq0,m=new eV.Pq0,h=new rg,p=null,f=null,g=null,b=1,x=e=>e?r.getSnapshot().objects.find(t=>t.id===e):void 0,v=i=>{if(t.current&&r.isGestureEnabled()){if(i.preventDefault(),e.setPointerCapture(i.pointerId),o.measure(),h.down(i),1===h.count){var a;let e=r.beginGesture((o.setRay(i),(null==(a=o.nearest(r.getSnapshot().objects,e=>e.runtime.anchor?e.runtime.hitTarget:null))?void 0:a.candidate.id)??null));e&&((e,t)=>{let r=x(t.objectId);if(r&&(p=t,f=t.mode,g=t7(r.runtime.targetTransform),r.runtime.lastInteractionRef.current=performance.now(),"move"===f)){var n;let t={normal:{...(n=g).worldRoot.normal},point:{...n.worldRoot.position}};c.set(t.normal.x,t.normal.y,t.normal.z),u.set(t.point.x,t.point.y,t.point.z),s.setFromNormalAndCoplanarPoint(c,u),o.beginAnchoredDrag(e,u),o.setAnchoredRay(e),o.intersectPlane(s,d)?m.copy(d):f=null}})(i,e)}else if(2===h.count&&p&&n){let e=x(p.objectId);e&&h.beginPinch()&&(f="pinch",b=e.runtime.targetTransform.userRoot.scale)}}},j=n=>{if(!t.current||!r.isGestureEnabled()||!h.has(n.pointerId)||!p||!g)return;h.move(n);let i=x(p.objectId);if(i)if(i.runtime.lastInteractionRef.current=performance.now(),"pinch"===f&&2===h.count)i.runtime.targetTransform.userRoot.scale=rf(b,h.pinchRatio());else if(1===h.count&&h.moved&&"rotate"===f){var a,l;i.runtime.targetTransform=(a=g,l=rp(h.startX,n.clientX,e.clientWidth),{...a,userRoot:{...a.userRoot,yaw:a.userRoot.yaw+l}})}else 1===h.count&&h.moved&&"move"===f&&(o.setAnchoredRay(n),o.intersectPlane(s,d)&&(i.runtime.targetTransform=function(e,t,r){let{normal:n}=e.worldRoot,i={x:r.x-t.x,y:r.y-t.y,z:r.z-t.z},a=i.x*n.x+i.y*n.y+i.z*n.z;return{...e,worldRoot:{...e.worldRoot,position:{x:e.worldRoot.position.x+i.x-n.x*a,y:e.worldRoot.position.y+i.y-n.y*a,z:e.worldRoot.position.z+i.z-n.z*a}}}}(g,m,d),i.runtime.draggedAtRef.current=performance.now()))},w=e=>{h.up(e),h.count>0||(p&&r.endGesture({moved:h.moved,multiTouch:h.multiTouch}),p=null,f=null,g=null,h.reset())};return e.addEventListener("pointerdown",v),e.addEventListener("pointermove",j),e.addEventListener("pointerup",w),e.addEventListener("pointercancel",w),()=>{e.removeEventListener("pointerdown",v),e.removeEventListener("pointermove",j),e.removeEventListener("pointerup",w),e.removeEventListener("pointercancel",w),l()}},[i,a,t,r,n])}({interactionEnabledRef:x,manager:r,scaleEnabled:s}),rj({interactionEnabledRef:x,onCentreHit:(e,r,n)=>{let i=c.find(e=>e.id===o);if(t.current=i?e:null,g.current&&(g.current.visible=!!(i&&e)&&!v,g.current.visible||b.reset(),e)){let t=Math.abs(e.normal.y)>=.75;b.follow(g.current,e.pose.position,n,0,t?"flat":"upright"),t?g.current.rotation.set(-Math.PI/2,0,0):g.current.lookAt(f.position)}if(!e||!i)return;let l=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{height:t.height,maxY:t.height,minY:0},i=(0,tK.Q3)(e.normal);if("wall"===i){let a=t3({...e,kind:"wall"},t,r,n.height);return{surface:i,orientationRoot:{position:{...a.orientationRoot.position}},userRoot:{...a.userRoot},worldRoot:{normal:{...a.worldRoot.normal},position:{...a.worldRoot.position},yaw:a.worldRoot.yaw}}}if("floor"===i){let t=t0({...e,kind:"floor"});return{surface:i,orientationRoot:{position:{x:0,y:-n.minY,z:0}},userRoot:{scale:t.scale,yaw:t.yaw},worldRoot:{normal:{x:0,y:1,z:0},position:t.position,yaw:0}}}return{surface:i,orientationRoot:{position:{x:0,y:-n.maxY,z:0}},userRoot:{scale:1,yaw:0},worldRoot:{normal:{x:0,y:-1,z:0},position:{...e.pose.position},yaw:0}}}(e,i.resource.dimensions,f.position,i.runtime.modelBounds);l.userRoot={...i.runtime.targetTransform.userRoot},i.runtime.targetTransform=l,"searching"===a.current&&(i.runtime.currentTransform=t7(l),i.runtime.lastInteractionRef.current=r,p("preview"))},relocalize:(e,t)=>{var r,n;let i,a,l,o,s,c=e.runtime;c.lastAnchorPose&&(r=c.targetTransform,n=c.lastAnchorPose,l=Math.cos(a=(i=t$({position:r.worldRoot.position,scale:1,yaw:r.worldRoot.yaw},n,t)).yaw-r.worldRoot.yaw),o=Math.sin(a),s=r.worldRoot.normal,c.targetTransform={...r,worldRoot:{...r.worldRoot,normal:{x:l*s.x+o*s.z,y:s.y,z:-o*s.x+l*s.z},position:i.position,yaw:i.yaw}}),c.lastAnchorPose=t},sceneObjects:c,sessionHasTrackingRef:d,sessionRef:m,setTrackingStatus:h,updateObject:(e,t,r)=>{let n=e.runtime;if(!n.root||!n.userRoot||!n.orientationRoot)return;let i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.22,n=rt(e,t,r),i=rr({position:e.orientationRoot.position,scale:1,yaw:0},{position:t.orientationRoot.position,scale:1,yaw:0},r);return{...n,orientationRoot:{position:i.position}}}(n.currentTransform,n.targetTransform,re(r)),a=t-n.draggedAtRef.current<120?{...i,worldRoot:{...i.worldRoot,position:{...n.targetTransform.worldRoot.position}}}:i;n.currentTransform=a,n.root.position.set(a.worldRoot.position.x,a.worldRoot.position.y,a.worldRoot.position.z),n.root.rotation.set(0,a.worldRoot.yaw,0),n.userRoot.rotation.set(0,a.userRoot.yaw,0),n.userRoot.scale.setScalar(a.userRoot.scale*rn(e.removingSince,t)),n.orientationRoot.position.set(a.orientationRoot.position.x,a.orientationRoot.position.y,a.orientationRoot.position.z)}}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rh,{ref:g,doubleSided:!0}),c.map(e=>(0,n.jsx)(l.Suspense,{fallback:null,children:(0,n.jsx)(rI,{decorated:ta({phase:i,placing:e.id===o,selected:e.id===u}),object:e,visible:e.id!==o||"searching"!==i})},e.id))]})}function rI(e){let{decorated:t,object:r,visible:i}=e;return(0,n.jsx)("group",{ref:e=>{r.runtime.root=e},visible:i,children:(0,n.jsx)("group",{ref:e=>{r.runtime.userRoot=e},children:(0,n.jsx)("group",{ref:e=>{r.runtime.orientationRoot=e},children:(0,n.jsx)("group",{ref:e=>{r.runtime.hitTarget=e},children:(0,n.jsx)(rz,{decorated:t,object:r})})})})})}function rz(e){let{decorated:t,object:r}=e,{scene:i}=rM(r.resource.glbUrl,r.id),a=function(e){let[t,r]=(0,l.useState)(e.runtime.currentTransform.surface);return(0,tm.D)(()=>{let n=e.runtime.currentTransform.surface;n!==t&&r(n)}),t}(r);return(0,l.useLayoutEffect)(()=>{let e=tl(i),t=e?e.max.y-e.min.y:0;r.runtime.modelBounds={height:t>0?t:r.resource.dimensions.height,maxY:e?e.max.y:r.resource.dimensions.height,minY:e?e.min.y:0}},[r,i]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("primitive",{object:i}),(0,n.jsx)(rd,{active:t,root:i,surface:a})]})}let rR=new eV.Pq0(0,1,0);function rL(e){return{...e,position:{...e.position}}}function rZ(e){let{currentHitRef:t,heightModeRef:r,manager:i,phase:a,phaseRef:o,placingObjectId:s,scaleEnabled:c,sceneObjects:u,selectedObjectId:d,sessionHasTrackingRef:m,sessionRef:h,setHeightLabel:p,setTrackingStatus:f,updatePhase:g}=e,b=(0,l.useRef)(null),x=(0,l.useMemo)(()=>new rm,[]),v=(0,l.useRef)(!0),j=(0,l.useRef)({count:0,firstHit:null}),w=(0,l.useRef)({hit:null,seenAt:0}),y=(0,l.useRef)(null);y.current="calibrating"===o.current?s:null;let N=(0,l.useCallback)(e=>{p(eE(e.runtime.targetTransform,td(e),"calibrating"===o.current))},[o,p]),M=(0,l.useCallback)((e,t)=>{e.runtime.modelHeight!==t&&(e.runtime.modelHeight=t,(e.id===s||e.id===d)&&N(e))},[N,s,d]);return!function(e){let{calibrationObjectIdRef:t,heightModeRef:r,interactionEnabledRef:n,manager:i,onHeightChange:a,scaleEnabled:o}=e,{camera:s,gl:c}=(0,tm.C)();(0,l.useEffect)(()=>{let e=c.domElement,{dispose:l,raycaster:u}=rx(e,s),d=new eV.Zcv(new eV.Pq0(0,1,0)),m=new eV.Pq0,h=new eV.Pq0,p=new eV.Pq0,f=new rg,g=null,b=null,x=null,v=1,j=e=>e?i.getSnapshot().objects.find(t=>t.id===e):void 0,w=a=>{if(n.current&&i.isGestureEnabled()){if(a.preventDefault(),e.setPointerCapture(a.pointerId),u.measure(),f.down(a),1===f.count)(e=>{let n=t.current,a=r.current?i.getSnapshot().selectedObjectId:n;if(a){let e=j(a);if(!e)return;g={mode:"move",objectId:a},b="height",x=rL(e.runtime.targetTransform);return}let l=(e=>{u.setRay(e);let t=null;for(let e of i.getSnapshot().objects){if(!e.runtime.anchor)continue;let r=u.intersect(e.runtime.hitTarget);r&&(!t||r.distance<t.distance)&&(t={distance:r.distance,floorGizmo:!1,id:e.id});let n=u.intersect(e.runtime.floorGizmo);n&&(!t||n.distance<t.distance)&&(t={distance:n.distance,floorGizmo:!0,id:e.id})}return t})(e),o=i.beginGesture((null==l?void 0:l.id)??null);if(!o)return;let s=j(o.objectId);if(s&&(g=o,b=o.mode,x=rL(s.runtime.targetTransform),s.runtime.lastInteractionRef.current=performance.now(),"move"===b)){let t=(null==l?void 0:l.floorGizmo)?x.floorY:x.position.y;p.set(x.position.x,t,x.position.z),d.set(rR,-t),u.beginAnchoredDrag(e,p),u.setAnchoredRay(e),u.intersectPlane(d,m)?h.copy(m):b=null}})(a);else if(2===f.count&&g&&o&&"height"!==b){let e=j(g.objectId);e&&f.beginPinch()&&(b="pinch",v=e.runtime.targetTransform.scale)}}},y=t=>{if(!i.isGestureEnabled()||!f.has(t.pointerId)||!g||!x)return;f.move(t);let r=j(g.objectId);if(r){if(r.runtime.lastInteractionRef.current=performance.now(),"pinch"===b&&2===f.count)r.runtime.targetTransform.scale=rf(v,f.pinchRatio());else if(1===f.count&&f.moved&&"height"===b)r.runtime.targetTransform=function(e,t,r,n){if(n<=0)return e;let i=eA(e.suspensionHeight+(t-r)/n*2.6);return{...e,position:{...e.position,y:e.floorY+i},suspensionHeight:i}}(x,f.startY,t.clientY,e.clientHeight),r.runtime.draggedAtRef.current=performance.now(),a(r);else if(1===f.count&&f.moved&&"rotate"===b)r.runtime.targetTransform.yaw=x.yaw+rp(f.startX,t.clientX,e.clientWidth);else if(1===f.count&&f.moved&&"move"===b&&(u.setAnchoredRay(t),u.intersectPlane(d,m))){var n;r.runtime.targetTransform={...n=x,position:{x:n.position.x+m.x-h.x,y:n.position.y,z:n.position.z+m.z-h.z}},r.runtime.draggedAtRef.current=performance.now()}}},N=e=>{f.up(e),f.count>0||(!t.current&&g&&i.endGesture({moved:f.moved,multiTouch:f.multiTouch}),g=null,b=null,x=null,f.reset())};return e.addEventListener("pointerdown",w),e.addEventListener("pointermove",y),e.addEventListener("pointerup",N),e.addEventListener("pointercancel",N),()=>{e.removeEventListener("pointerdown",w),e.removeEventListener("pointermove",y),e.removeEventListener("pointerup",N),e.removeEventListener("pointercancel",N),l()}},[t,s,c,r,n,i,a,o])}({calibrationObjectIdRef:y,heightModeRef:r,interactionEnabledRef:v,manager:i,onHeightChange:N,scaleEnabled:c}),rj({interactionEnabledRef:v,onCentreHit:(e,r,n)=>{let i=(null==e?void 0:e.kind)==="floor"?e:null,a=(null==e?void 0:e.kind)==="ceiling"?e:null,l=function(e,t){if(!t||"floor"!==t.kind)return{stableHit:null,state:{count:0,firstHit:null}};let r=null==e?void 0:e.firstHit,n=null!=r&&.25>=Math.hypot(t.pose.position.x-r.pose.position.x,t.pose.position.y-r.pose.position.y,t.pose.position.z-r.pose.position.z)?{count:((null==e?void 0:e.count)??0)+1,firstHit:r}:{count:1,firstHit:t};return{stableHit:n.count>=8?t:null,state:n}}(j.current,i);if(j.current=l.state,b.current){b.current.visible=function(e){let{hasHit:t,phase:r,placingObjectId:n}=e;return null!==n&&("searching"===r||"floor-ready"===r)&&t}({hasHit:null!==i||null!==a,phase:o.current,placingObjectId:s}),b.current.visible||x.reset();let e=i??a;e&&x.follow(b.current,e.pose.position,n,.002,e.kind)}let c=u.find(e=>e.id===s);if(a&&c&&"searching"===o.current)t.current=a,c.runtime.targetTransform=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("ceiling"!==e.kind)throw Error("Direct ceiling placement requires a ceiling surface hit.");let r=eA(e.pose.position.y-t);return{floorY:t,position:{x:e.pose.position.x,y:t+r,z:e.pose.position.z},scale:1,suspensionHeight:r,yaw:0}}(a),c.runtime.currentTransform={...c.runtime.targetTransform,position:{...c.runtime.targetTransform.position}},c.runtime.rise=eH(r),g("preview");else if(l.stableHit&&c&&"searching"===o.current){t.current=l.stableHit,w.current={hit:l.stableHit,seenAt:r};let e=c.runtime.targetTransform.suspensionHeight;c.runtime.targetTransform=eU(l.stableHit,e),c.runtime.currentTransform={...c.runtime.targetTransform,position:{...c.runtime.targetTransform.position}},p(null),g("floor-ready")}else if("floor-ready"===o.current){var d;d=w.current,w.current=(null==i?void 0:i.kind)==="floor"?{hit:i,seenAt:r}:r-d.seenAt>500?{hit:null,seenAt:d.seenAt}:d,t.current=w.current.hit,w.current.hit||g("searching")}},relocalize:(e,t)=>{let r=e.runtime;if(r.lastAnchorPose){let e=t.position.y-r.lastAnchorPose.position.y,n=t$(r.targetTransform,r.lastAnchorPose,t);r.targetTransform={...r.targetTransform,...n,floorY:r.targetTransform.floorY+e}}r.lastAnchorPose=t},sceneObjects:u,sessionHasTrackingRef:m,sessionRef:h,setTrackingStatus:f,updateObject:(e,t,r)=>{var n,i;if(!e.runtime.root)return;let a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.22,n=rr(e,t,r);return{...t,position:n.position,scale:n.scale,suspensionHeight:n.position.y-t.floorY,yaw:n.yaw}}(e.runtime.currentTransform,e.runtime.targetTransform,re(r)),l=e.runtime.targetTransform,o=t-e.runtime.draggedAtRef.current<120?{...a,position:{...l.position},suspensionHeight:l.suspensionHeight}:a;e.runtime.currentTransform=o;let s=function(e,t,r,n){if(!e)return 0;let i=t.position.y-(t.floorY+r*t.scale);if(i<=0)return 0;let a=Math.min(1,Math.max(0,(n-e.startedAt)/1100));return i*(1-(a<.5?4*a**3:1-(-2*a+2)**3/2))}(e.runtime.rise,o,td(e),t);i=e.runtime.rise,(!i||t-i.startedAt>=1100)&&(e.runtime.rise=null),e.runtime.root.position.set(o.position.x,o.position.y-s,o.position.z),e.runtime.root.rotation.set(0,o.yaw,0),null==(n=e.runtime.modelRoot)||n.scale.setScalar(o.scale*rn(e.removingSince,t))}}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rh,{ref:b,flat:!0}),u.map(e=>(0,n.jsx)(l.Suspense,{fallback:null,children:(0,n.jsx)(rS,{decorated:ta({phase:a,placing:e.id===s,selected:e.id===d}),object:e,onMeasured:M,visible:function(e){let{isPlacing:t,phase:r}=e;return!t||"searching"!==r&&"floor-ready"!==r}({isPlacing:e.id===s,phase:a})})},e.id))]})}function rS(e){let{decorated:t,object:r,onMeasured:i,visible:a}=e,l=r.runtime.currentTransform;return(0,n.jsx)("group",{ref:e=>{r.runtime.root=e},children:(0,n.jsx)("group",{visible:a,children:(0,n.jsx)("group",{ref:e=>{r.runtime.hitTarget=e,r.runtime.modelRoot=e},scale:l.scale,children:(0,n.jsx)(rW,{decorated:t,glbUrl:r.resource.glbUrl,objectId:r.id,onMeasured:e=>i(r,e)})})})})}function rW(e){let{decorated:t,glbUrl:r,objectId:i,onMeasured:a}=e,{scene:o}=rM(r,i),s=(0,l.useRef)(null),c=(0,l.useRef)(a);return c.current=a,(0,l.useLayoutEffect)(()=>{let e,t=s.current;if(!t)return;let r=(e=tl(o,t))?(t.position.y=0===e.max.y?0:-e.max.y,e.max.y-e.min.y):(t.position.y=0,0);r>0&&c.current(r);let n=function(e){let t=tl(e);if(!t)return null;let r=new eV.eaF(new eV.iNn(Math.max(.01,t.max.x-t.min.x),Math.max(.01,t.max.y-t.min.y),Math.max(.01,t.max.z-t.min.z)),new eV.V9B({side:2,visible:!1}));return r.position.set((t.min.x+t.max.x)/2,(t.min.y+t.max.y)/2,(t.min.z+t.max.z)/2),e0(r),r}(o);if(n)return o.add(n),()=>{n.removeFromParent(),tr(n)}},[o]),(0,n.jsxs)("group",{ref:s,children:[(0,n.jsx)("primitive",{object:o}),(0,n.jsx)(rd,{active:t,root:o,surface:"ceiling"})]})}let rY=new eV.Pq0(0,1,0);function rk(e){let{currentHitRef:t,manager:r,phase:i,phaseRef:a,placingObjectId:o,scaleEnabled:s,sceneObjects:c,selectedObjectId:u,sessionHasTrackingRef:d,sessionRef:m,setTrackingStatus:h,updatePhase:p}=e,f=(0,l.useRef)(null),g=(0,l.useMemo)(()=>new rm,[]),b=(0,l.useRef)(0),x=(0,l.useRef)(!0),v=tB(o);return!function(e){let{interactionEnabledRef:t,manager:r,scaleEnabled:n}=e,{camera:i,gl:a}=(0,tm.C)();(0,l.useEffect)(()=>{let e=a.domElement,{dispose:l,raycaster:o}=rx(e,i),s=new eV.Zcv(new eV.Pq0(0,1,0)),c=new eV.Pq0,u=new rg,d=new eV.Pq0,m=new eV.Pq0,h=null,p=0,f=1,g=null,b=e=>e?r.getSnapshot().objects.find(t=>t.id===e):void 0,x=i=>{if(t.current&&r.isGestureEnabled()){if(i.preventDefault(),e.setPointerCapture(i.pointerId),o.measure(),u.down(i),1===u.count){var a;let e,t=r.beginGesture((o.setRay(i),(null==(a=o.nearest(r.getSnapshot().objects,e=>e.runtime.anchor?e.runtime.hitTarget:null))?void 0:a.candidate.id)??null));t&&(e=b(t.objectId))&&(h=t,g=t.mode,p=e.runtime.targetTransform.yaw,e.runtime.lastInteractionRef.current=performance.now(),"move"===g&&(d.set(e.runtime.targetTransform.position.x,e.runtime.targetTransform.position.y,e.runtime.targetTransform.position.z),s.set(rY,-d.y),o.beginAnchoredDrag(i,d),o.setAnchoredRay(i),o.intersectPlane(s,c)?m.copy(c):g=null));return}if(2===u.count&&h&&n){let e=b(h.objectId);e&&u.beginPinch()&&(g="pinch",f=e.runtime.targetTransform.scale)}}},v=n=>{if(!t.current||!r.isGestureEnabled()||!u.has(n.pointerId)||!h)return;u.move(n);let i=b(h.objectId);if(i){if(i.runtime.lastInteractionRef.current=performance.now(),"pinch"===g&&2===u.count){i.runtime.targetTransform.scale=rf(f,u.pinchRatio());return}if(1===u.count&&u.moved)if("rotate"===g)i.runtime.targetTransform.yaw=p+rp(u.startX,n.clientX,e.clientWidth);else"move"===g&&(o.setAnchoredRay(n),o.intersectPlane(s,c))&&(i.runtime.targetTransform.position={x:d.x+c.x-m.x,y:d.y,z:d.z+c.z-m.z},i.runtime.draggedAtRef.current=performance.now())}},j=e=>{u.up(e),u.count>0||(h&&r.endGesture({moved:u.moved,multiTouch:u.multiTouch}),h=null,g=null,u.reset())};return e.addEventListener("pointerdown",x),e.addEventListener("pointermove",v),e.addEventListener("pointerup",j),e.addEventListener("pointercancel",j),()=>{e.removeEventListener("pointerdown",x),e.removeEventListener("pointermove",v),e.removeEventListener("pointerup",j),e.removeEventListener("pointercancel",j),l()}},[i,a,t,r,n])}({interactionEnabledRef:x,manager:r,scaleEnabled:s}),rj({interactionEnabledRef:x,onCentreHit:(e,r,n)=>{let i=f.current,l=(null==e?void 0:e.kind)==="floor"?e:null;l?(t.current=l,b.current=r):r-b.current>250&&(t.current=null),i&&(i.visible=!!o&&function(e){let{hasFloorHit:t,lastFloorHitAt:r,modelInRoom:n,now:i,phase:a}=e;return"preview"===a&&!n&&(t||i-r<=250)}({hasFloorHit:null!==l,lastFloorHitAt:b.current,modelInRoom:v,now:r,phase:a.current}),i.visible||g.reset());let s=c.find(e=>e.id===o);l&&s&&(g.follow(i,l.pose.position,n,.002),s.runtime.targetTransform=t0(l,s.runtime.targetTransform),"searching"===a.current&&(s.runtime.lastInteractionRef.current=r,p("preview")))},relocalize:(e,t)=>{let r=e.runtime;r.lastAnchorPose&&(r.targetTransform=t$(r.targetTransform,r.lastAnchorPose,t)),r.lastAnchorPose=t},sceneObjects:c,sessionHasTrackingRef:d,sessionRef:m,setTrackingStatus:h,updateObject:(e,t,r)=>{let n=e.runtime;if(!n.root)return;let i=rr(n.currentTransform,n.targetTransform,re(r)),a=t-n.draggedAtRef.current<120?{...i,position:{...n.targetTransform.position}}:i;n.currentTransform=a,n.root.position.set(a.position.x,a.position.y,a.position.z),n.root.rotation.set(0,a.yaw,0),n.root.scale.setScalar(a.scale*rn(e.removingSince,t))}}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rh,{ref:f,flat:!0}),c.map(e=>(0,n.jsx)(l.Suspense,{fallback:null,children:(0,n.jsx)(rT,{decorated:ta({phase:i,placing:e.id===o,selected:e.id===u}),object:e,visible:e.id!==o||"searching"!==i})},e.id))]})}function rT(e){let{decorated:t,object:r,visible:i}=e;return(0,n.jsx)("group",{ref:e=>{r.runtime.root=e},visible:i,children:(0,n.jsx)("group",{ref:e=>{r.runtime.hitTarget=e},children:(0,n.jsx)(rD,{decorated:t,glbUrl:r.resource.glbUrl,objectId:r.id})})})}function rD(e){let{decorated:t,glbUrl:r,objectId:i}=e,{scene:a}=rM(r,i);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("primitive",{object:a}),(0,n.jsx)(rd,{active:t,root:a,surface:"floor"})]})}function rP(e){return"floor"===e.mechanic}function rX(e){return"wall"===e.mechanic}function rO(e){return"ceiling"===e.mechanic}function rG(e){return"all"===e.mechanic}function rA(e,t,r){for(let n of(t.current=r,e))rX(n)&&(n.runtime.gestureEnabledRef.current=null==n.removingSince&&(null===r||n.id===r))}function rU(e){let{sessionHasTrackingRef:t,sessionRef:r,setTrackingStatus:n}=e,i=(0,l.useRef)(eJ());return(0,tm.D)((e,a,l)=>{let o=r.current;if(!o||!l){t.current=!1;return}let s=o.isTracking((0,rv.Y)(l)),c=i.current.status;t.current=s,i.current=eB(i.current,{hasPose:s,now:performance.now()}),i.current.status!==c&&n(i.current.status)}),null}function rH(e){let{gestureOwnerIdRef:t,manager:r,placingObjectId:n}=e,{camera:i,gl:a}=(0,tm.C)();return(0,l.useEffect)(()=>{let e=a.domElement,{dispose:l,raycaster:o}=rx(e,i),s=new Set,c=e=>{let i=s.size>0;if(s.add(e.pointerId),n||i)return;o.measure(),o.setRay(e);let a=r.getSnapshot(),l=null;for(let e of a.objects)if(null==e.removingSince&&("wall"===e.mechanic?null!==e.runtime.anchorRef.current:null!==e.runtime.anchor))for(let t of function(e){if("wall"!==e.mechanic)return e.runtime.hitTarget?[e.runtime.hitTarget]:[];let{floorControlRef:t,hitTargetRef:r}=e.runtime,n=[];return r.current&&n.push(r.current),t.current&&n.push(t.current.group),n}(e)){let r=o.intersect(t);r&&(!l||r.distance<l.distance)&&(l={distance:r.distance,object:e})}l&&(r.selectObject(l.object.id),rA(r.getSnapshot().objects,t,l.object.id))},u=e=>{s.delete(e.pointerId)};return e.addEventListener("pointerdown",c,!0),e.addEventListener("pointerup",u,!0),e.addEventListener("pointercancel",u,!0),()=>{e.removeEventListener("pointerdown",c,!0),e.removeEventListener("pointerup",u,!0),e.removeEventListener("pointercancel",u,!0),l()}},[i,t,a,r,n]),null}let rE={position:{x:0,y:0,z:-1},scale:1,yaw:0};function rF(){return{...rE,position:{...rE.position}}}function rV(e,t){switch(e.mechanic){case"floor":let r;return{dispose:()=>{var e;return null==(e=r.anchor)?void 0:e.delete()},id:t,mechanic:"floor",resource:e,runtime:r={anchor:null,currentTransform:rF(),hitTarget:null,lastAnchorPose:null,draggedAtRef:{current:-1/0},lastInteractionRef:{current:0},root:null,targetTransform:rF(),tracking:eJ()}};case"wall":let n;return{dispose:()=>{var e;return null==(e=n.current)?void 0:e.delete()},id:t,mechanic:"wall",resource:e,runtime:{anchorRef:n={current:null},confirmPlacementRef:{current:null},floorControlRef:{current:null},gestureEnabledRef:{current:!1},hitTargetRef:{current:null},phaseRef:{current:"searching"},tracking:eJ()}};case"ceiling":let i;return{dispose:()=>{var e;return null==(e=i.anchor)?void 0:e.delete()},id:t,mechanic:"ceiling",resource:e,runtime:i={anchor:null,currentTransform:tu(),floorGizmo:null,hitTarget:null,lastAnchorPose:null,draggedAtRef:{current:-1/0},lastInteractionRef:{current:0},modelHeight:null,modelRoot:null,rise:null,root:null,targetTransform:tu(),tracking:eJ()}};case"all":let a,l;return{dispose:()=>{var e;return null==(e=l.anchor)?void 0:e.delete()},id:t,mechanic:"all",resource:e,runtime:l={anchor:null,currentTransform:t7(a={surface:"floor",orientationRoot:{position:{x:0,y:0,z:0}},userRoot:{scale:1,yaw:0},worldRoot:{normal:{x:0,y:1,z:0},position:{x:0,y:0,z:-1},yaw:0}}),hitTarget:null,lastAnchorPose:null,draggedAtRef:{current:-1/0},lastInteractionRef:{current:0},modelBounds:{height:e.dimensions.height,maxY:e.dimensions.height,minY:0},orientationRoot:null,root:null,targetTransform:t7(a),tracking:eJ(),userRoot:null}}}}let rJ=45*Math.PI/180,rB=8*Math.PI/180,r_=19*Math.PI/180;function rQ(e){let t=e.worldRoot.yaw+e.userRoot.yaw;return{x:Math.sin(t),y:0,z:Math.cos(t)}}function rK(e){for(let t of[1.45,1.07])if(.03>=Math.abs(e-t))return t;return e}function rq(e,t,r){let n=Math.cos(rJ);if(!r||t2(t,r.normal)>=n-4*Number.EPSILON)return{candidateNormal:null,candidatePoint:null,count:0,shouldSwitch:!1};let i=(null==e?void 0:e.candidateNormal)&&e.candidatePoint&&Math.acos(t2(e.candidateNormal,r.normal))<r_&&.5>=Math.hypot(e.candidatePoint.x-r.point.x,e.candidatePoint.y-r.point.y,e.candidatePoint.z-r.point.z),a=i?e.count+1:1;return{candidateNormal:t1(r.normal),candidatePoint:i?e.candidatePoint:{...r.point},count:a,shouldSwitch:a>=8}}function r$(e,t,r,n){let i=Math.abs(Math.atan2(Math.sin(e-t),Math.cos(e-t))),a=r<=.4&&i<=(n?r_:rB);return{snapped:a,yaw:a?t:e}}function r0(e,t){let r=null;return t.forEach((t,n)=>{let i=t1(t.normal),a=Math.abs((e.x-t.point.x)*i.x+(e.z-t.point.z)*i.z);(!r||a<r.distance)&&(r={distance:a,index:n,wall:t})}),r}function r1(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=r?r0(e,[r]):r0(e,t),a=r?.35:.12;if(!i||i.distance>a)return{attachedWall:null,position:e,wall:null};let l=t1(i.wall.normal),o=(e.x-i.wall.point.x)*l.x+(e.z-i.wall.point.z)*l.z;return{attachedWall:i.wall,position:{x:e.x-l.x*(o-n),y:e.y,z:e.z-l.z*(o-n)},wall:i.wall}}function r2(e,t){if(e.some(e=>{let r=Math.abs(t2(e.normal,t.normal)),n=t1(e.normal),i=Math.abs((t.point.x-e.point.x)*n.x+(t.point.z-e.point.z)*n.z);return r>=Math.cos(15*Math.PI/180)&&i<=.12}))return e;let r=[...e,t];return r.length>12?r.slice(r.length-12):r}function r4(e,t){return(e.x-t.point.x)*t.normal.x+(e.z-t.point.z)*t.normal.z}function r3(e,t){let r=r4(e,t);return{x:e.x-t.normal.x*r,y:e.y,z:e.z-t.normal.z*r}}function r5(e){return{normal:e,yaw:Math.atan2(e.x,e.z)}}function r9(e){return e.bounds.height*e.scale/2}function r7(e,t,r){let n=t9(r.bounds,r.scale);return{orientationRoot:{pitch:0,position:{x:0,y:-(r.bounds.minY+r.bounds.height/2),z:0}},userRoot:{scale:r.scale,yaw:r.target.userRoot.yaw},worldRoot:{normal:{...e.normal},position:{x:t.x+e.normal.x*n,y:t.y,z:t.z+e.normal.z*n},yaw:e.yaw}}}let r6=Math.cos(15*Math.PI/180);function r8(){}function ne(e,t){if(!e2(this))return;let r=t.length;eV.eaF.prototype.raycast.call(this,e,t);for(let n=r;n<t.length;n+=1)t[n].distance=e.near}function nt(e){return{orientationRoot:{pitch:e.orientationRoot.pitch,position:{...e.orientationRoot.position}},userRoot:{...e.userRoot},worldRoot:{normal:{...e.worldRoot.normal},position:{...e.worldRoot.position},yaw:e.worldRoot.yaw}}}function nr(e,t){return{normal:e.worldRoot.normal,point:{x:e.worldRoot.position.x-e.worldRoot.normal.x*t,y:e.worldRoot.position.y,z:e.worldRoot.position.z-e.worldRoot.normal.z*t},yaw:e.worldRoot.yaw}}function nn(e){let{anchorRef:t,confirmPlacementRef:r,decorated:i,dimensions:a,floorControlRef:o,gestureEnabledRef:s,glbUrl:c,objectId:u,onGesture:d,phaseRef:m,removingSince:h,resourceHitTargetRef:p,scaleEnabled:f,sessionHasTrackingRef:g,sessionRef:b,setPlacementPending:x,setPlacementError:v,setTrackingStatus:j,updateAnchorTracking:w,updatePhase:y}=e,{camera:N}=(0,tm.C)(),{scene:M}=rM(c,u),C=(0,l.useMemo)(()=>{M.updateMatrixWorld(!0);let e=new eV.NRn().setFromObject(M);if(e.isEmpty())return{height:a.height,minY:0,minZ:0,width:a.width};let t=e.getSize(new eV.Pq0);return{height:t.y,minY:e.min.y,minZ:e.min.z,width:t.x}},[a.height,a.width,M]),I=t9(C),z=(0,l.useRef)(null),R=(0,l.useRef)(null),L=(0,l.useRef)(null),Z=(0,l.useRef)(null),S=p??Z,W=(0,l.useRef)(null),Y=(0,l.useMemo)(()=>new rm,[]),k=(0,l.useMemo)(()=>{let e=function(){let e=new eV.YJl,t=[],r=[],n=function(){let e=document.createElement("canvas");e.width=128,e.height=128;let t=e.getContext("2d");if(!t)return null;let r=t.createRadialGradient(64,64,0,64,64,64);r.addColorStop(0,"rgba(255,255,255,0.5)"),r.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=r,t.fillRect(0,0,128,128);let n=new eV.GOR(e);return n.minFilter=1006,n}(),i=(e,t)=>(t.push(e),e),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(new eV.V9B({color:0xffffff,depthTest:!1,opacity:e,side:t,transparent:!0}),r)},l=(r,n,a)=>{let l=new eV.eaF(i(r,t),n);return l.renderOrder=a,e.add(l),l},o=l(new eV.iNn(1,1,1),a(.92),15);o.frustumCulled=!1,o.raycast=r8;let s=a(.92),c=[-1,1].map(e=>{let t=l(new eV.iNn(1,1,1),s,15);return t.frustumCulled=!1,t.raycast=r8,t.userData.side=e,t});if(n){let e=l(new eV.bdM(.4,.4).rotateX(-Math.PI/2),i(new eV.V9B({depthTest:!1,depthWrite:!1,map:n,transparent:!0}),r),13);e.position.y=.002,e.raycast=r8}let u=l(new eV.tcD(.075,40).rotateX(-Math.PI/2),a(.96,2),17);u.position.y=.004,u.raycast=ne;let d=l(new eV.O3Y(.1,.006,14,44).rotateX(-Math.PI/2),a(.75,2),17);d.position.y=.004,d.raycast=ne;let m=a(.95,2),h=Array.from({length:4},(e,t)=>{var r;let n,i,a,o,s,c,u=l((r=t*Math.PI/2,n=new eV.Pq0(Math.cos(r),0,Math.sin(r)),i=new eV.Pq0(-Math.sin(r),0,Math.cos(r)),a=n.clone().multiplyScalar(.155),o=n.clone().multiplyScalar(.115).addScaledVector(i,.028),s=n.clone().multiplyScalar(.115).addScaledVector(i,-.028),(c=new eV.LoY).setAttribute("position",new eV.THS(new Float32Array([a.x,.005,a.z,o.x,.005,o.z,s.x,.005,s.z]),3)),c),m,17);return u.raycast=ne,u}),p=l(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=Math.PI-.35999999999999993-.3,r=[],n=[],i=(e,t)=>(r.push(Math.cos(e)*t,0,Math.sin(e)*t),r.length/3-1);for(let a=0;a<2;a+=1){let l=a*Math.PI+.15,o=r.length/3;for(let r=0;r<=e;r+=1){let n=l+t*r/e;i(n,.10600000000000001),i(n,.094)}for(let t=0;t<e;t+=1){let e=o+2*t;n.push(e,e+1,e+2,e+1,e+3,e+2)}let s=l+t;n.push(i(s,.124),i(s,.1-.024),i(s+.35999999999999993,.1))}let a=new eV.LoY;return a.setAttribute("position",new eV.qtW(r,3)),a.setIndex(n),a}(),a(.95,2),17);p.position.y=.004,p.raycast=ne;let f="move",g=0,b=()=>{let e="placement"===f;d.visible=!e,h.forEach(t=>{t.visible=!e}),p.visible=e;let t=e?.145:.175,r=Math.max(.06,Math.max(.12,g)-t);c.forEach(e=>{e.scale.set(r,.006,.006),e.position.set(e.userData.side*(t+r/2),.004,0)})};b();let x=l(new eV.tcD(.3,28,Math.PI,Math.PI).rotateX(-Math.PI/2),i(new eV.V9B({side:2,visible:!1}),r),17);return x.position.y=.004,x.frustumCulled=!1,x.raycast=e8,{dispose:()=>{t.forEach(e=>e.dispose()),r.forEach(e=>e.dispose()),null==n||n.dispose()},grabArea:x,group:e,setStyle:e=>{e!==f&&(f=e,b())},update:t=>{let{floor:r,frameBottomHeight:n,wallYaw:i,yaw:a}=t;e.position.set(r.x,r.y,r.z),e.rotation.set(0,a,0),x.rotation.set(0,i-a,0);let l=Math.max(.02,n);o.scale.set(.006,l,.006),o.position.set(0,l/2+.003,0),g=t.halfWidth,b()}}}();return e.group.visible=!1,e.group.scale.setScalar(1e-4),e},[]);(0,l.useEffect)(()=>(o&&(o.current=k),()=>{(null==o?void 0:o.current)===k&&(o.current=null),k.dispose()}),[k,o]);let T=(0,l.useRef)({elapsedMs:240,from:1e-4,shown:!1}),D=(0,l.useRef)(null),P=(0,l.useRef)({freeHeading:null,lockedWall:null,switchFrames:0}),X=(0,l.useRef)(null),O=(0,l.useMemo)(()=>new eV.Pq0,[]),G=(0,l.useRef)(!1),A=(0,l.useRef)(!1);G.current=null!==h,(0,l.useEffect)(()=>(A.current=!0,()=>{A.current=!1}),[]);let U=(0,l.useMemo)(()=>({orientationRoot:{pitch:0,position:{x:0,y:-a.height/2,z:0}},userRoot:{scale:1,yaw:0},worldRoot:{normal:{x:0,y:0,z:1},position:{x:0,y:1.45,z:-1.25},yaw:0}}),[a]),H=(0,l.useRef)(nt(U)),E=(0,l.useRef)(nt(U)),F=(0,l.useRef)({count:0,hit:null}),V=(0,l.useRef)(null),J=(0,l.useRef)(!1),B=(0,l.useRef)([]),_=(0,l.useRef)({candidateNormal:null,candidatePoint:null,count:0,shouldSwitch:!1}),Q=(0,l.useRef)(!1),K=(0,l.useRef)(null),q=(0,l.useRef)(null),$=(0,l.useRef)(0),ee=(0,l.useRef)(-1/0),et=(0,l.useRef)(!1),er=(0,l.useRef)("tracking"),en=(0,l.useCallback)((e,r,n,i,a,l)=>{var o;G.current||!A.current?r.delete():(null==(o=t.current)||o.delete(),t.current=r,q.current=new eV.Pq0(e.pose.position.x,e.pose.position.y,e.pose.position.z),E.current=n,a&&(H.current=nt(n)),l&&(B.current=r2(B.current,nr(n,t9(C,n.userRoot.scale)))),$.current=performance.now(),v(!1),y(i))},[t,C,v,y]);r.current=(0,l.useCallback)(()=>{let e=V.current,t=b.current;if(!e||!t||J.current||"preview"!==m.current)return;J.current=!0,null==x||x(!0);let r=nt(E.current),n=null!==P.current.lockedWall;t.createAnchor(e).catch(()=>(0,tK.em)(e.pose)).then(t=>en(e,t,r,"placed",!0,n)).catch(()=>v(!0)).finally(()=>{J.current=!1,null==x||x(!1)})},[en,m,b,v,x]);let ei=(0,l.useCallback)(e=>{let t=b.current;t&&!J.current&&(J.current=!0,t.createAnchor(e).then(t=>{var r;let n=t3(e,a,N.position,C.height,t9(C,E.current.userRoot.scale),C.minY),i=null==(r=K.current)?void 0:r.call(K,n);i?(en(e,t,i,"selected",!1,!0),Q.current&&(ee.current=performance.now())):t.delete()}).catch(()=>v(!0)).finally(()=>{J.current=!1}))},[N.position,a,en,C,b,v]);!function(e){let{draggedAtRef:t,floorControl:r=null,floorYRef:n,gestureEnabledRef:i,interactionEnabledRef:a,knownWallsRef:o,lastInteractionRef:s,onGesture:c,phaseRef:u,resourceRef:d,scaleEnabled:m,targetTransformRef:h,updatePhase:p,wallOffset:f,wallSlideActiveRef:g,wallSlideSwitchRef:b}=e,{camera:x,gl:v}=(0,tm.C)(),j=(0,l.useRef)(f);(0,l.useLayoutEffect)(()=>{j.current=f},[f]);let w=(0,l.useRef)(c);(0,l.useLayoutEffect)(()=>{w.current=c},[c]),(0,l.useEffect)(()=>{let e=v.domElement,{dispose:l,raycaster:c}=rx(e,x),f=new eV.Zcv(new eV.Pq0(0,1,0),0),y=new eV.Zcv,N=new eV.Pq0,M=new eV.Pq0,C=new eV.Pq0,I=new Map,z=null,R=0,L=0,Z=0,S=new eV.Pq0,W=new eV.Pq0,Y=new eV.Pq0,k=new eV.Pq0,T=null,D=!1,P=0,X=1,O=!1,G=!1,A=!1,U=()=>j.current*h.current.userRoot.scale,H=(e,t)=>{var r;return t?(c.setRay(e),(null==(r=c.intersect(t))?void 0:r.distance)??null):null},E=()=>{let e=h.current;if("preview"===u.current)return{distance:0,yaw:0};let t=r0(e.worldRoot.position,o.current);return t?t2(t.wall.normal,e.worldRoot.normal)>=r6&&.12>=Math.abs(t.distance-U())?{distance:0,yaw:0}:{distance:t.distance,yaw:t.wall.yaw-e.worldRoot.yaw}:null},F=()=>{let e=E();return null!==e&&r$(h.current.userRoot.yaw,e.yaw,e.distance,!1).snapped},V=e=>{let t=H(e,d.current),i=null!==t;if("preview"===u.current){z="rotate",R=e.clientX,L=e.clientY,Z=h.current.userRoot.yaw,D=F();return}if("placed"===u.current){i&&p("selected"),z=null;return}if("selected"!==u.current){z=null;return}let a=r?H(e,r.group):null;if(g.current="wall-slide"===(z=function(e){let{startsOnFloorControl:t,startsOnResource:r}=e;return t?"floor-move":r?"wall-slide":"rotate"}({startsOnFloorControl:null!==a&&(null===t||a<t),startsOnResource:i})),R=e.clientX,L=e.clientY,Z=h.current.userRoot.yaw,S.set(h.current.worldRoot.position.x,h.current.worldRoot.position.y,h.current.worldRoot.position.z),"rotate"===z&&(D=F()),"wall-slide"===z){let t,r;t=h.current,S.set(t.worldRoot.position.x,t.worldRoot.position.y,t.worldRoot.position.z),r=rQ(t),N.set(r.x,r.y,r.z),y.setFromNormalAndCoplanarPoint(N,S),c.beginAnchoredDrag(e,S),c.setAnchoredRay(e),(!c.intersectPlane(y,C)||(W.copy(C),0))&&(z=null,g.current=!1)}else if("floor-move"===z){T=r1(S,o.current,null,U()).attachedWall;let t=(null==n?void 0:n.current)??0;if(f.constant=-t,M.set(S.x,t,S.z),c.beginAnchoredDrag(e,M),c.setAnchoredRay(e),!c.intersectPlane(f,C)){z=null;return}Y.copy(C),k.copy(S)}},J=t=>{if(a.current&&(null==i?void 0:i.current)!==!1){if(t.preventDefault(),e.setPointerCapture(t.pointerId),c.measure(),I.set(t.pointerId,t),s.current=performance.now(),1===I.size){G=!1,A=!1,O="selected"===u.current,V(t);return}if(A=!0,z=null,g.current=!1,2===I.size&&m&&O){let[e,t]=Array.from(I.values());z="pinch",P=Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),X=h.current.userRoot.scale}}},B=r=>{if(a.current&&(null==i?void 0:i.current)!==!1&&I.has(r.pointerId)){if(I.set(r.pointerId,r),s.current=performance.now(),G||(G=Math.hypot(r.clientX-R,r.clientY-L)>=4),"pinch"===z&&2===I.size){let[e,t]=Array.from(I.values()),r=Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),n=h.current,i=n.userRoot.scale,a=rf(X,r/Math.max(1,P));n.userRoot.scale=a;let l=j.current*(a-i);n.worldRoot.position={x:n.worldRoot.position.x+n.worldRoot.normal.x*l,y:n.worldRoot.position.y,z:n.worldRoot.position.z+n.worldRoot.normal.z*l};return}if(1===I.size){if("rotate"===z&&G){let t=Z+rp(R,r.clientX,e.clientWidth),n=E(),i=n?r$(t,n.yaw,n.distance,D):{snapped:!1,yaw:t};D=i.snapped,h.current.userRoot.yaw=i.yaw}else if("wall-slide"===z){if(c.setAnchoredRay(r),c.intersectPlane(y,C)){let e,r,n;h.current.worldRoot.position=(e=t1(rQ(h.current)),n=(r={x:C.x-W.x,y:C.y-W.y,z:C.z-W.z}).x*e.x+r.z*e.z,{x:S.x+r.x-e.x*n,y:rK(S.y+r.y),z:S.z+r.z-e.z*n}),t&&(t.current=performance.now())}}else if("floor-move"===z&&(c.setAnchoredRay(r),c.intersectPlane(f,C))){let e=r1({x:k.x+C.x-Y.x,y:k.y,z:k.z+C.z-Y.z},o.current,T,U());T=e.attachedWall,h.current.worldRoot.position=e.position,t&&(t.current=performance.now()),e.wall&&(h.current.worldRoot.normal={...e.wall.normal},h.current.worldRoot.yaw=e.wall.yaw,h.current.userRoot.yaw=0,D=!0)}}}},_=e=>{let t=z,r=I.delete(e.pointerId);if(z=null,g.current=!1,1===I.size)V(Array.from(I.values())[0]);else if(0===I.size){let e;r&&(e=w.current)&&O&&!A&&("rotate"===t?e(G?"rotate":"release"):G&&("wall-slide"===t||"floor-move"===t)&&e("move")),O=!1}},Q=e=>{var t,r;let n,i,a,l;if("wall-slide"!==z)return null;let o=I.values().next().value;if(!o)return null;let s=rQ({userRoot:h.current.userRoot,worldRoot:e.worldRoot});if(N.set(s.x,s.y,s.z),M.set(e.worldRoot.position.x,e.worldRoot.position.y,e.worldRoot.position.z),y.setFromNormalAndCoplanarPoint(N,M),c.setAnchoredRay(o),!c.intersectPlane(y,C))return null;let u=(t=h.current,r={offsetFromCurrentCenter:{x:W.x-S.x,y:W.y-S.y,z:W.z-S.z},pointOnNextWall:C},i=Math.cos(n=e.worldRoot.yaw-t.worldRoot.yaw),a=Math.sin(n),l={x:r.offsetFromCurrentCenter.x*i+r.offsetFromCurrentCenter.z*a,y:r.offsetFromCurrentCenter.y,z:-r.offsetFromCurrentCenter.x*a+r.offsetFromCurrentCenter.z*i},e.userRoot={...t.userRoot},e.worldRoot.position={x:r.pointOnNextWall.x-l.x,y:r.pointOnNextWall.y-l.y,z:r.pointOnNextWall.z-l.z},e);S.set(u.worldRoot.position.x,u.worldRoot.position.y,u.worldRoot.position.z),W.copy(C);let d=rQ(u);return N.set(d.x,d.y,d.z),y.setFromNormalAndCoplanarPoint(N,S),u};return b.current=Q,e.addEventListener("pointerdown",J),e.addEventListener("pointermove",B),e.addEventListener("pointerup",_),e.addEventListener("pointercancel",_),()=>{e.removeEventListener("pointerdown",J),e.removeEventListener("pointermove",B),e.removeEventListener("pointerup",_),e.removeEventListener("pointercancel",_),b.current===Q&&(b.current=null),l()}},[x,t,r,n,i,v,a,o,s,u,d,m,h,p,j,g,b])}({draggedAtRef:ee,floorControl:k,floorYRef:D,gestureEnabledRef:s,interactionEnabledRef:et,knownWallsRef:B,lastInteractionRef:$,onGesture:d,phaseRef:m,resourceRef:S,scaleEnabled:f,targetTransformRef:E,updatePhase:y,wallOffset:I,wallSlideActiveRef:Q,wallSlideSwitchRef:K});let ea=(e,t)=>{let r="preview"===m.current,n=(r||"selected"===m.current)&&null===h,i=T.current;if(k.setStyle(r?"placement":"move"),i.shown!==n&&(i.shown=n,i.elapsedMs=0,i.from=k.group.scale.x),i.elapsedMs=Math.min(240,i.elapsedMs+t),k.group.scale.setScalar(ts({elapsedMs:i.elapsedMs,from:i.from,to:n?1:1e-4})),k.group.visible=n||i.elapsedMs<240,k.group.visible){let t=D.current??0,r=e.userRoot.scale,n=to(C.width,C.height);k.update({floor:{x:e.worldRoot.position.x,y:t,z:e.worldRoot.position.z},frameBottomHeight:e.worldRoot.position.y-n.height*r/2-t,halfWidth:C.width*r/2+.05,wallYaw:e.worldRoot.yaw,yaw:e.worldRoot.yaw+e.userRoot.yaw})}};return(0,tm.D)((e,r,n)=>{var i,l,o,s;let c=1e3*r,u=performance.now(),d=b.current,p=!0;if(et.current=g.current,d&&n){let e=(0,rv.Y)(n),r=d.getCenterHit(e),h=(0,tK.aq)(r)?r:null,f=function(e,t){var r,n,i,a;let l;if(!(0,tK.aq)(t))return{stableHit:null,state:{count:0,hit:null}};let o=(null==e||null==(r=e.hit)?void 0:r.kind)==="wall"&&(n=e.hit,l=Math.abs(t2(n.normal,t.normal)),i=n.pose.position,a=t.pose.position,.5>=Math.hypot(i.x-a.x,i.y-a.y,i.z-a.z)&&l>=Math.cos(15*Math.PI/180)),s={count:o?e.count+1:1,hit:o?e.hit:t};return{stableHit:s.count>=8?t:null,state:s}}(F.current,h),b=null;if(F.current=f.state,(null==r?void 0:r.kind)==="floor"&&(D.current=Math.min(D.current??r.pose.position.y,r.pose.position.y)),h&&(b=t3(h,a,N.position,C.height,t9(C,E.current.userRoot.scale),C.minY)),f.stableHit){let e=t3(f.stableHit,a,N.position,C.height,I,C.minY);B.current=r2(B.current,nr(e,I))}Q.current?(_.current=rq(_.current,E.current.worldRoot.normal,b&&h?{normal:b.worldRoot.normal,point:h.pose.position}:null),h&&_.current.shouldSwitch&&ei(h)):_.current=rq(void 0,E.current.worldRoot.normal,null);let x=null,v="searching"===m.current||"preview"===m.current,M=function(e){let{hit:t,now:r,searching:n,seenAt:i,tracking:a}=e;if(!n)return{assume:!1,seenAt:null};let l=(null==t?void 0:t.kind)==="floor",o=(0,tK.aq)(t),s=o||null===i&&a?r:i;return{assume:null!==s&&r-s>=1e4&&!o&&!l,seenAt:s}}({hit:r,now:u,searching:v&&!!d.guessesWalls,seenAt:X.current,tracking:g.current});if(X.current=M.seenAt,v&&!J.current){let e=r;if(M.assume){let t,r,n,a,l;N.getWorldDirection(O),i=N.position,r=(t=Math.hypot(O.x,O.z))>1e-6?{x:O.x/t,y:0,z:O.z/t}:{x:0,y:0,z:-1},n=t>1e-6?O.y/t*1.25:0,a=i.y+Math.min(.9,Math.max(-1.2,n)),l={kind:"wall",normal:{x:-r.x,y:0,z:-r.z},pose:{orientation:{w:1,x:0,y:0,z:0},position:{x:i.x+1.25*r.x,y:a,z:i.z+1.25*r.z}}},t5.add(l),e=l}let t=function(e,t){let{hit:r}=t,n=(0,tK.aq)(r)?r:null;if(n)return function(e,t,r){let n=t4(t,r.cameraPosition),i={...r5(n),point:{...t.pose.position}},a=e.lockedWall,l=e.switchFrames,o=!1;if(a)!(null!==t&&t5.has(t))&&.5>t2(a.normal,n)?(l+=1)>=8&&(a=i,l=0,o=!0):(a=i,l=0);else a=i,o=!0;let s=r3(t.pose.position,a);s.y=Math.max(r.floorY+rK(t.pose.position.y-r.floorY),r.floorY+r9(r)+.02);let c=r7(a,s,r);return o&&(c.userRoot.yaw=0),{placement:c,source:"wall",state:{freeHeading:null,lockedWall:a,switchFrames:l}}}(e,n,t);let i={...e,switchFrames:0};return(null==r?void 0:r.kind)==="floor"?function(e,t,r){var n;let{freeHeading:i,lockedWall:a}=e;if(a){if(.35>Math.abs(r4(t,a))){let e=r3(t,a);return e.y=r.target.worldRoot.position.y,{placement:r7(a,e,r),source:"wall-held",state:{freeHeading:null,lockedWall:a,switchFrames:0}}}i={normal:a.normal,yaw:a.yaw},a=null}return{placement:r7(i??r5(t1({x:(n=r.cameraPosition).x-t.x,y:0,z:n.z-t.z})),{x:t.x,y:t.y+r9(r)+.02,z:t.z},r),source:"floor",state:{freeHeading:i,lockedWall:null,switchFrames:0}}}(i,r.pose.position,t):{placement:null,source:null,state:i}}(P.current,{bounds:C,cameraPosition:N.position,floorY:D.current??0,hit:e,scale:E.current.userRoot.scale,target:E.current});P.current=t.state,x=t.placement?e:null,l=V.current,o=x,s="preview"===m.current,V.current=o??(s?l:null),t.placement&&(E.current=t.placement,"searching"===m.current&&(H.current=nt(t.placement),$.current=u,y("preview")))}if(W.current&&(W.current.visible="searching"===m.current&&null!==x&&!J.current,W.current.visible||Y.reset(),x&&(Y.follow(W.current,x.pose.position,c,0,x.kind),W.current.lookAt(N.position))),("placed"===m.current||"selected"===m.current)&&t.current){let r=t.current.getPose(e),n=q.current;if(!r){let i=(0,tK.gD)(t.current,n?{orientation:t.current.pose.orientation,position:{x:n.x,y:n.y,z:n.z}}:null);i&&(t.current=i,r=i.getPose(e))}let i=w(null!==r,u);p=null!==r,et.current&&(et.current=p),er.current!==i&&(er.current=i,j(i)),r&&n&&(E.current.worldRoot.position={x:E.current.worldRoot.position.x+r.position.x-n.x,y:E.current.worldRoot.position.y+r.position.y-n.y,z:E.current.worldRoot.position.z+r.position.z-n.z},n.set(r.position.x,r.position.y,r.position.z))}}if((!g.current||!p)&&null===h)return void ea(H.current,c);let f=z.current,x=R.current,v=L.current;if(!f||!x||!v)return;f.visible="searching"!==m.current;let M=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.22;return rt(e,t,r)}(H.current,E.current,re(c,"preview"===m.current?.15:.22)),Z=u-ee.current<120?{...M,worldRoot:{...M.worldRoot,position:{...E.current.worldRoot.position}}}:M;H.current=Z,f.position.set(Z.worldRoot.position.x,Z.worldRoot.position.y,Z.worldRoot.position.z),f.rotation.set(0,Z.worldRoot.yaw,0),x.rotation.set(0,Z.userRoot.yaw,0),x.scale.setScalar(Z.userRoot.scale*rn(h,u)),v.position.set(Z.orientationRoot.position.x,Z.orientationRoot.position.y,Z.orientationRoot.position.z),v.rotation.set(Z.orientationRoot.pitch,0,0),ea(Z,c)}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rh,{ref:W}),(0,n.jsx)("primitive",{object:k.group}),(0,n.jsx)("group",{ref:z,visible:!1,children:(0,n.jsx)("group",{ref:R,children:(0,n.jsx)("group",{ref:L,children:(0,n.jsx)("group",{ref:S,children:(0,n.jsx)(ni,{decorated:i,scene:M})})})})})]})}function ni(e){let{decorated:t,scene:r}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("primitive",{object:r}),(0,n.jsx)(rd,{active:t,root:r,surface:"wall"})]})}function na(e){let{forgetTrackingStatus:t,manager:r,object:i,onPlaced:a,phase:o,placing:s,scaleEnabled:c,selected:u,sessionHasTrackingRef:d,sessionRef:m,setPlacementError:h,setPlacementPending:p,setTrackingStatus:f,updateSessionPhase:g}=e,b=s?"preview"===o?"preview":"searching":u?"selected":"placed";(0,l.useLayoutEffect)(()=>{i.runtime.phaseRef.current=b},[i,b]);let x=(0,l.useCallback)(e=>{i.runtime.phaseRef.current=e,"selected"===e&&r.selectObject(i.id),s&&(g(e),"placed"===e&&a())},[r,i,a,s,g]),v=(0,l.useCallback)(e=>{"release"===e?r.releaseObject(i.id):r.reportGesture({kind:e,objectId:i.id})},[r,i.id]),j=null!=i.removingSince,w=(0,l.useCallback)(e=>{j||f(i.id,e)},[i.id,j,f]);(0,l.useEffect)(()=>()=>t(i.id),[t,i.id]);let y=(0,l.useCallback)((e,t)=>{var r;return r=i.runtime,r.tracking=eB(r.tracking,{hasPose:e,now:t}),r.tracking.status},[i.runtime]);return(0,n.jsx)(nn,{anchorRef:i.runtime.anchorRef,confirmPlacementRef:i.runtime.confirmPlacementRef,floorControlRef:i.runtime.floorControlRef,decorated:ta({phase:o,placing:s,selected:u}),dimensions:i.resource.dimensions,gestureEnabledRef:i.runtime.gestureEnabledRef,glbUrl:i.resource.glbUrl,objectId:i.id,onGesture:v,phaseRef:i.runtime.phaseRef,removingSince:i.removingSince??null,resourceHitTargetRef:i.runtime.hitTargetRef,scaleEnabled:c,sessionHasTrackingRef:d,sessionRef:m,setPlacementError:h,setPlacementPending:p,setTrackingStatus:w,updateAnchorTracking:y,updatePhase:x})}let nl=(0,l.memo)(e=>{let{objects:t,phaseRef:r,placement:i,scaleEnabled:a,sessionHasTrackingRef:o,sessionRef:s,tracking:c}=e,{allManager:u,ceilingManager:d,floorManager:m,gestureOwnerIdRef:h,manager:p,snapshot:f}=t,{allHitRef:g,ceilingHitRef:b,floorHitRef:x,handleWallPlaced:v,heightModeRef:j,phase:w,placingObjectId:y,setHeightLabel:N,setPlacementError:M,setPlacementPending:C,updatePhase:I}=i,z=f.objects.find(e=>e.id===y)??null,R=e=>(null==z?void 0:z.mechanic)===e?z.id:null;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rU,{sessionHasTrackingRef:o,sessionRef:s,setTrackingStatus:c.setSession}),(0,n.jsx)(rH,{gestureOwnerIdRef:h,manager:p,placingObjectId:y}),(0,n.jsx)(rk,{currentHitRef:x,manager:m,phase:w,phaseRef:r,placingObjectId:R("floor"),scaleEnabled:a,sceneObjects:f.objects.filter(rP),selectedObjectId:f.selectedObjectId,sessionHasTrackingRef:o,sessionRef:s,setTrackingStatus:c.setFloor,updatePhase:I}),(0,n.jsx)(rZ,{currentHitRef:b,heightModeRef:j,manager:d,phase:w,phaseRef:r,placingObjectId:R("ceiling"),scaleEnabled:a,sceneObjects:f.objects.filter(rO),selectedObjectId:f.selectedObjectId,sessionHasTrackingRef:o,sessionRef:s,setHeightLabel:N,setTrackingStatus:c.setCeiling,updatePhase:I}),(0,n.jsx)(rC,{currentHitRef:g,manager:u,phase:w,phaseRef:r,placingObjectId:R("all"),scaleEnabled:a,sceneObjects:f.objects.filter(rG),selectedObjectId:f.selectedObjectId,sessionHasTrackingRef:o,sessionRef:s,setTrackingStatus:c.setAll,updatePhase:I}),f.objects.filter(rX).map(e=>(0,n.jsx)(l.Suspense,{fallback:null,children:(0,n.jsx)(na,{forgetTrackingStatus:c.forgetWall,manager:p,object:e,phase:w,placing:e.id===y,scaleEnabled:a,selected:e.id===f.selectedObjectId,sessionHasTrackingRef:o,sessionRef:s,setPlacementError:M,setPlacementPending:C,setTrackingStatus:c.setWall,updateSessionPhase:I,onPlaced:v})},e.id))]})});nl.displayName="ArSessionLayers";let no="var(--v-borders-medium)";function ns(e){let{className:t,variant:r="default",size:i="default",state:a="loading",role:l,"aria-live":o,"aria-label":s,...c}=e;switch(r){case"logo":{let e="sm"===i?4:5;return(0,n.jsxs)("svg",{...c,role:l??"status","aria-live":o??"polite","aria-label":s??("success"===a?"Success":"error"===a?"Error":"Loading"),width:"93",height:"91",viewBox:"0 0 93 91",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-slot":"spinner","data-size":i,"data-state":a,className:(0,O.cn)("spinner-logo shrink-0","sm"===i?"size-9":"size-22",t),children:[(0,n.jsx)("g",{className:"spinner-logo__intro-shell",children:(0,n.jsx)("path",{d:"M15.7495 62.7798L46.4936 45.0297M46.4936 45.0297L77.2661 62.5451M46.4936 45.0297L46.7111 9.62225M49.9213 79.4237L74.5719 65.1917C75.6436 64.5705 76.5344 63.6811 77.1541 62.6137C77.7738 61.5462 78.1003 60.3385 78.1007 59.1129L78.1729 30.7811C78.1734 29.5494 77.851 28.3427 77.2373 27.2798C76.6236 26.2169 75.7398 25.3343 74.6729 24.7189L50.1007 10.6155C47.926 9.3694 45.2455 9.37719 43.0689 10.6339L18.4183 24.8659C16.2385 26.1244 14.8946 28.4401 14.8895 30.9447L14.8173 59.2766C14.8168 60.5082 15.1392 61.7149 15.7529 62.7778C16.3666 63.8408 17.2504 64.7233 18.3173 65.3387L42.8895 79.4421C45.0642 80.6882 47.7447 80.6805 49.9213 79.4237Z",className:"spinner-logo__outline spinner-logo__outline--intro",vectorEffect:"sm"===i?void 0:"non-scaling-stroke"})}),(0,n.jsx)("circle",{className:"spinner-logo__intro-orb",cx:"46.27",cy:"45.8",r:"11.18",fill:"white",stroke:no,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("circle",{className:"spinner-logo__result-ring",cx:"46.5",cy:"45.5",r:"33.46",fill:"white",stroke:no,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("g",{transform:"translate(27.786 31.4489)",children:(0,n.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--success",children:(0,n.jsx)("path",{d:"M13.6758 28.1023C13.3559 28.101 13.0397 28.0341 12.7467 27.9057C12.4537 27.7772 12.1902 27.59 11.9725 27.3557L0.632479 15.2923C0.208575 14.8406 -0.0185097 14.2389 0.00118164 13.6198C0.020873 13.0006 0.285727 12.4146 0.737479 11.9907C1.18923 11.5668 1.79088 11.3397 2.41006 11.3594C3.02924 11.3791 3.61524 11.6439 4.03915 12.0957L13.6525 22.339L33.2758 0.87233C33.475 0.624349 33.7227 0.419696 34.0038 0.270944C34.2849 0.122191 34.5935 0.0324784 34.9105 0.00731496C35.2276 -0.0178485 35.5464 0.0220682 35.8475 0.124615C36.1485 0.227162 36.4254 0.390174 36.6612 0.603637C36.897 0.8171 37.0866 1.07651 37.2185 1.36593C37.3503 1.65535 37.4216 1.96867 37.428 2.28665C37.4344 2.60463 37.3756 2.92056 37.2555 3.21502C37.1353 3.50949 36.9562 3.77627 36.7291 3.999L15.4025 27.3323C15.1868 27.5709 14.9242 27.7625 14.6311 27.895C14.338 28.0275 14.0208 28.0981 13.6991 28.1023H13.6758Z",fill:no})})}),(0,n.jsx)("g",{transform:"translate(32.4879 31.4885)",children:(0,n.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--error",children:(0,n.jsx)("path",{d:"M17.3045 14.0095L27.3378 3.99955C27.5554 3.78199 27.728 3.52371 27.8457 3.23946C27.9635 2.95521 28.0241 2.65055 28.0241 2.34288C28.0241 2.03521 27.9635 1.73055 27.8457 1.4463C27.728 1.16205 27.5554 0.903769 27.3378 0.686213C27.1203 0.468656 26.862 0.296082 26.5778 0.178341C26.2935 0.0606 25.9889 -4.58466e-09 25.6812 0C25.3735 4.58466e-09 25.0689 0.0606 24.7846 0.178341C24.5003 0.296082 24.2421 0.468656 24.0245 0.686213L14.0145 10.7195L4.00451 0.686213C3.56514 0.246838 2.96921 -4.62957e-09 2.34784 0C1.72647 4.62957e-09 1.13055 0.246838 0.691177 0.686213C0.251802 1.12559 0.0049634 1.72151 0.0049634 2.34288C0.00496339 2.96425 0.251802 3.56017 0.691177 3.99955L10.7245 14.0095L0.691177 24.0195C0.472196 24.2363 0.29836 24.4943 0.179723 24.7787C0.0610849 25.063 0 25.3681 0 25.6762C0 25.9843 0.0610849 26.2894 0.179723 26.5737C0.29836 26.8581 0.472196 27.1161 0.691177 27.3329C0.908091 27.5516 1.16616 27.7252 1.4505 27.8436C1.73484 27.9621 2.03982 28.0231 2.34784 28.0231C2.65587 28.0231 2.96085 27.9621 3.24519 27.8436C3.52953 27.7252 3.7876 27.5516 4.00451 27.3329L14.0145 17.2995L24.0245 27.3329C24.296 27.6078 24.6314 27.8111 25.0007 27.9245C25.3701 28.0379 25.7618 28.0579 26.1407 27.9828C26.5197 27.9077 26.8741 27.7397 27.1722 27.4939C27.4703 27.2481 27.7028 26.9322 27.8488 26.5745C28.0272 26.1459 28.0736 25.6738 27.9821 25.2187C27.8907 24.7636 27.6655 24.346 27.3355 24.0195L17.3045 14.0095Z",fill:no})})})]})}case"default":return(0,n.jsx)(X,{...c,role:l??"status","aria-live":o??"polite","aria-label":s??"Loading","data-slot":"spinner",className:(0,O.cn)("size-4 animate-spin",t)});default:return r}}function nc(e){let{isStarting:t,onStart:r}=e,{t:i}=(0,o.Bd)();return(0,n.jsxs)("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-6 bg-[#17171b] px-8 text-center text-white","data-testid":"ar-intro",children:[(0,n.jsx)(f.HM,{asChild:!0,children:(0,n.jsx)(p.$,{className:"absolute right-6 bg-white/10 text-white hover:bg-white/20 active:bg-white/25",style:{top:"max(1.5rem, env(safe-area-inset-top))"},size:"icon","aria-label":i("close"),"data-testid":"ar-intro-close",children:(0,n.jsx)(g.A,{"aria-hidden":"true"})})}),(0,n.jsxs)("div",{className:"relative -mx-8 flex w-screen max-w-[calc(100%+4rem)] justify-center",children:[(0,n.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-1/2 aspect-square w-[160%] -translate-x-1/2 -translate-y-1/2 rounded-full bg-[radial-gradient(circle,rgba(255,255,255,0.15)_0%,rgba(255,255,255,0.06)_45%,transparent_72%)]"}),(0,n.jsx)(eR,{className:"relative",name:"camera-intro",size:390})]}),(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)("h2",{className:"typo-base-18 font-medium",children:i("intro.title")}),(0,n.jsx)("p",{className:"typo-base-14 max-w-xs text-white/75",children:i("intro.body")})]}),(0,n.jsx)(p.$,{"data-testid":"ar-intro-start",disabled:t,size:"lg",onClick:r,children:i(t?"intro.starting":"intro.action")}),(0,n.jsx)("p",{className:"typo-base-14 max-w-xs text-xs text-white/55",children:i("intro.privacy")})]})}var nu=r(557),nd=r(1083),nm=r(3761);function nh(e){return e&&"renderBridge"in e?e.renderBridge??null:null}var np=r(985);let nf=(0,l.createContext)(null);function ng(){return(0,l.use)(nf)}function nb(){let{t:e}=(0,o.Bd)();return(0,n.jsx)(f.HM,{asChild:!0,children:(0,n.jsxs)(p.$,{className:"absolute top-3 right-6 z-30",variant:"secondary",children:[e("close"),(0,n.jsx)(g.A,{})]})})}function nx(e){var t,r;let i,a,{children:o,tracker:s,waiting:c=!1}=e,u=(0,l.useMemo)(()=>(0,ri.Bo)().backend,[]),d=(0,l.useMemo)(()=>(0,nu.N0)(),[]),m=function(e){let{tracker:t,webview:r}=e,n=(0,l.useRef)(null),i=(0,l.useRef)(null),a=(0,l.useRef)(null),o=(0,l.useRef)(!1),s=(0,l.useRef)(!0),c=(0,l.useRef)(!1),[u,d]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[p,f]=(0,l.useState)(!1),[g,b]=(0,l.useState)(0),[x,v]=(0,l.useState)(null),[j,w]=(0,l.useState)(!1),[y,N]=(0,l.useState)(null);(0,l.useEffect)(()=>{let e=!0;return s.current=!0,t.isSupported().then(t=>{e&&(t?w(!0):N(r?"webview":"unsupported"))}).catch(t=>e&&N((0,np.W)(t))),()=>{e=!1,s.current=!1;let t=a.current;a.current=null,o.current=!1,null==t||t.end().catch(()=>void 0)}},[t,r]);let M=(0,l.useCallback)(async(e,t)=>{a.current=null,o.current=!1,await (null==e?void 0:e.end().catch(()=>void 0)),d(!1),h(!1),N(r?"webview":(0,np.W)(t)),v({error:t})},[r]),C=(0,l.useCallback)(async e=>{let t=i.current;if(t&&!o.current){o.current=!0;try{await e.attachRenderer(t),h(!0)}catch(t){a.current===e&&await M(e,t)}}},[M]),I=(0,l.useCallback)(async()=>{let e=n.current;if(!e||a.current||c.current)return;c.current=!0,o.current=!1,h(!1),f(!0),b(e=>e+1),v(null),N(null);let r=null;try{if(r=await t.startSession({overlayRoot:e}),!s.current)return void await r.end().catch(()=>void 0);a.current=r,d(!0),await C(r)}catch(e){await M(r,e)}finally{c.current=!1,f(!1)}},[C,M,t]),z=(0,l.useCallback)(e=>{n.current=e},[]),R=(0,l.useCallback)(e=>{i.current=e;let t=a.current;t&&C(t)},[C]);return(0,l.useMemo)(()=>({hasStarted:u,isAttached:m,isStarting:p,runtimeState:y,sessionRef:a,setOverlayRoot:z,setRenderer:R,start:I,startAttempts:g,startFailure:x,supported:j}),[u,m,p,y,z,R,I,g,x,j])}({tracker:(0,l.useMemo)(()=>s??new nm.f({backend:u,webview:d}),[u,d,s]),webview:d}),[h,p]=(0,l.useState)(null),[f,g]=(0,l.useState)(null),[b,x]=(0,l.useState)(!1),j=(t=m.sessionRef,r=m.hasStarted,i=(0,l.useCallback)(e=>{if(!r)return()=>void 0;let n=0,i=()=>{if(t.current&&"renderBridge"in t.current){if(nh(t.current))return void e();n=requestAnimationFrame(i)}};return i(),()=>cancelAnimationFrame(n)},[r,t]),a=(0,l.useCallback)(()=>r?nh(t.current):null,[r,t]),(0,l.useSyncExternalStore)(i,a,()=>null)),w=(0,l.useCallback)(e=>{m.setOverlayRoot(e),p(e)},[]),y=(0,l.useCallback)(()=>{x(!0),(0,nd.oP)(),m.start()},[m]),N=m.supported&&!m.runtimeState&&!m.hasStarted&&(!b||m.isStarting),M=`${m.startAttempts}:${c}`;(0,l.useEffect)(()=>{let e=window.setTimeout(()=>g(M),4e3);return()=>window.clearTimeout(e)},[M]);let C=m.sessionRef.current,I=C&&"renderBridge"in C?!!j:m.isAttached,z=c||function(e){let{hasStarted:t,isDrawing:r,runtimeState:n,timedOut:i}=e;return!n&&!i&&(!t||!r)}({hasStarted:m.hasStarted,isDrawing:I,runtimeState:m.runtimeState,timedOut:f===M}),R=(0,l.useMemo)(()=>({overlayRoot:h,renderBridge:j,runtime:m}),[h,j,m]);return(0,n.jsxs)("div",{ref:w,className:"absolute inset-0 overflow-hidden bg-black","data-testid":"ar-session-surface",children:[(0,n.jsx)(nf,{value:R,children:o}),(0,n.jsx)("div",{"aria-hidden":!z,className:v("absolute inset-0 z-10 flex items-center justify-center bg-radial from-background-containers to-background-base-2 transition-opacity",z?"pointer-events-auto opacity-100 duration-0":"pointer-events-none opacity-0 duration-300 ease-in-out"),"data-testid":"ar-session-cover",children:(0,n.jsx)(ns,{variant:"logo"})}),N?(0,n.jsx)(nc,{isStarting:m.isStarting,onStart:y}):null,m.runtimeState?(0,n.jsx)(eO,{variant:m.runtimeState}):null,(z||m.runtimeState)&&!N?(0,n.jsx)(nb,{}):null]})}var nv=r(5615);function nj(e){let{asCancel:t,show:r,onDelete:i}=e,{t:a}=(0,o.Bd)();return r?(0,n.jsx)(p.$,{className:"absolute left-6 z-10 bg-black/50 text-white hover:bg-black/60 active:bg-black/70",style:{top:"max(1.5rem, env(safe-area-inset-top))"},size:"icon",variant:"secondary","aria-label":a(t?"cancelPlacement":"deleteObject"),"data-testid":"ar-session-delete",onClick:i,children:t?(0,n.jsx)(g.A,{"aria-hidden":"true"}):(0,n.jsx)(nv.A,{"aria-hidden":"true"})}):null}function nw(e){return Math.min(4.5,Math.max(.45,e))}function ny(e){return`${e.toFixed(1)} m`}function nN(e){let{currentVariantId:t,open:r,portalContainer:i,variants:a,onOpenChange:l,onSelect:s}=e,{t:c}=(0,o.Bd)();return(0,n.jsx)(ea,{open:r,onOpenChange:l,children:(0,n.jsxs)(es,{className:"bg-white text-[#212124]",portalContainer:i,children:[(0,n.jsxs)(ec,{className:"px-6 pt-4 pb-0 text-left",children:[(0,n.jsx)(ed,{className:"text-left text-base font-medium",children:c("catalog.selectVariant")}),(0,n.jsx)(em,{className:"sr-only",children:c("catalog.selectVariant")})]}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-3 p-6","data-testid":"ar-session-variant-sheet",children:a.map(e=>(0,n.jsxs)("button",{type:"button","aria-pressed":e.hid===t,className:v("grid gap-1 rounded-xl border-2 bg-white p-2 text-left",e.hid===t?"border-primary":"border-[#ededed]"),onClick:()=>s(e.hid),children:[(0,n.jsx)("span",{className:"ar-catalog-media-frame",children:e.previewUrl?(0,n.jsx)("img",{alt:"",className:"ar-catalog-media-img",src:e.previewUrl}):null}),e.name?(0,n.jsx)("span",{className:"truncate text-xs text-[#64646c]",children:e.name}):null]},e.hid))})]})})}var nM=r(8993);function nC(e){let{ariaLabel:t,className:r,formatHeight:i=ny,height:a,onHeightChange:o}=e,s=100-100*((nw(a)-.45)/4.05),c=(0,l.useRef)(null),u=void 0!==o,d=(0,l.useCallback)(e=>{if(!o)return;let t=e.currentTarget.getBoundingClientRect();t.height<=0||o(.45+(1-Math.min(1,Math.max(0,(e.clientY-t.top)/t.height*100/100)))*4.05)},[o]),m=(0,l.useCallback)(e=>{o&&(e.preventDefault(),e.stopPropagation(),c.current=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),d(e))},[o,d]),h=(0,l.useCallback)(e=>{c.current===e.pointerId&&(e.preventDefault(),e.stopPropagation(),d(e))},[d]),p=(0,l.useCallback)(e=>{c.current===e.pointerId&&(e.preventDefault(),e.stopPropagation(),c.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},[]),f=(0,l.useCallback)(e=>{if(!o)return;let t=e.shiftKey?.5:.1,r={ArrowDown:-t,ArrowLeft:-t,ArrowRight:t,ArrowUp:t,End:.45-a,Home:4.5-a,PageDown:-.5,PageUp:.5}[e.key];void 0!==r&&(e.preventDefault(),o(nw(a+r)))},[a,o]);return(0,n.jsxs)("div",{"aria-hidden":!u||void 0,"aria-label":u?t:void 0,"aria-valuemax":u?4.5:void 0,"aria-valuemin":u?.45:void 0,"aria-valuenow":u?Number(a.toFixed(1)):void 0,"aria-valuetext":u?i(a):void 0,className:v("absolute top-1/2 right-5 z-10 h-[clamp(180px,56vh,500px)] w-11 -translate-y-1/2 touch-none select-none",u?"pointer-events-auto cursor-ns-resize":"pointer-events-none",r),"data-testid":"ar-session-ceiling-height-scale",role:u?"slider":void 0,tabIndex:u?0:void 0,onKeyDown:f,onPointerCancel:p,onPointerDown:m,onPointerMove:h,onPointerUp:p,children:[(0,n.jsx)("div",{className:"absolute top-0 left-1/2 h-full w-1 -translate-x-1/2 rounded-full bg-[#212124]/50"}),(0,n.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 -translate-y-1/2","data-testid":"ar-session-ceiling-height-scale-handle",style:{"--ar-ceiling-height-scale-top":`${s}%`,top:"var(--ar-ceiling-height-scale-top)"},children:[(0,n.jsx)("div",{className:"grid size-11 place-items-center rounded-full bg-[#4796ff] [background-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#4796ff_0%,#3f73ed_100%)] text-white shadow-[0_4px_12px_rgba(51,51,65,0.12)]",children:(0,n.jsx)(nM.A,{"aria-hidden":"true",className:"size-6",strokeWidth:2})}),(0,n.jsx)("span",{className:"absolute top-1/2 right-full mr-2 -translate-y-1/2 rounded-[4px] bg-[#212124] px-1 text-[12px] leading-[1.6] font-medium tracking-[0.24px] whitespace-nowrap text-white tabular-nums","data-testid":"ar-session-ceiling-height-scale-label",children:i(a)})]})]})}var nI=r(7807);let nz="neurodyn_ar_learned_lessons";function nR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nL();if(!e)return[];try{let t=JSON.parse(e.getItem(nz)??"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function nL(){try{return void 0===globalThis.localStorage?null:globalThis.localStorage}catch{return null}}function nZ(e,t,r){let n,i=null,a=null,l=()=>{let l=e.getSnapshot(),o=null==r?void 0:r.current;if(a&&i===l&&n===o)return a;let s=l.objects.filter(e=>t(e)&&null==e.removingSince&&(!r||e.id===o)),c=s.some(e=>e.id===l.selectedObjectId)?l.selectedObjectId:null;return i=l,n=o,a={objects:s,selectedObjectId:c}};return{beginGesture(t,n){let i=l(),a=null===t?i.selectedObjectId??(null==r?void 0:r.current)??(null==n?void 0:n.backgroundObjectId)??null:null;return(null===t?null!==a&&i.objects.some(e=>e.id===a):i.objects.some(e=>e.id===t))?e.beginGesture(t,{backgroundObjectId:a}):null},endGesture:t=>e.endGesture(t),getSnapshot:l,isGestureEnabled:()=>!r||l().objects.length>0}}class nS{addObject(e){if(this.snapshot.objects.some(t=>t.id===e.id))throw Error(`Scene object already exists: ${e.id}`);this.setSnapshot({...this.snapshot,objects:[...this.snapshot.objects,e]})}beginGesture(e,t){if(this.activeGesture)return null;if(e)return this.hasObject(e)?(this.selectObject(e),this.activeGesture={mode:"move",objectId:e,startedOnBackground:!1},{mode:"move",objectId:e}):null;let r=this.snapshot.selectedObjectId,n=(null==t?void 0:t.backgroundObjectId)??r;return n&&this.hasObject(n)?(this.activeGesture={mode:"rotate",objectId:n,startedOnBackground:!0},{mode:"rotate",objectId:n}):null}endGesture(e){let{moved:t,multiTouch:r=!1}=e,n=this.activeGesture;if(this.activeGesture=null,n&&!r){if(t)return void this.reportGesture({kind:n.mode,objectId:n.objectId});n.startedOnBackground&&this.releaseObject(n.objectId)}}beginObjectRemoval(e,t){let r=this.snapshot.objects.find(t=>t.id===e);return!!r&&null==r.removingSince&&(this.activeGesture=null,this.setSnapshot({objects:this.snapshot.objects.map(r=>r.id===e?{...r,removingSince:t}:r),selectedObjectId:this.snapshot.selectedObjectId===e?null:this.snapshot.selectedObjectId}),this.removalTimers.set(e,setTimeout(()=>this.removeObject(e),270)),!0)}removeObject(e){var t;let r=this.snapshot.objects.find(t=>t.id===e),n=this.removalTimers.get(e);return void 0!==n&&(clearTimeout(n),this.removalTimers.delete(e)),!!r&&(this.activeGesture=null,null==(t=r.dispose)||t.call(r),this.setSnapshot({objects:this.snapshot.objects.filter(t=>t.id!==e),selectedObjectId:this.snapshot.selectedObjectId===e?null:this.snapshot.selectedObjectId}),!0)}removeSelectedObject(){return!!this.snapshot.selectedObjectId&&this.removeObject(this.snapshot.selectedObjectId)}releaseObject(e){this.snapshot.selectedObjectId===e&&(this.selectObject(null),this.reportGesture({kind:"release",objectId:e}))}reportGesture(e){this.gestureListeners.forEach(t=>t(e))}selectObject(e){(null===e||this.hasObject(e))&&this.snapshot.selectedObjectId!==e&&this.setSnapshot({...this.snapshot,selectedObjectId:e})}replaceObjectResource(e,t){let r=this.snapshot.objects.find(t=>t.id===e);return!!r&&r.resource!==t&&(this.setSnapshot({...this.snapshot,objects:this.snapshot.objects.map(r=>r.id===e?{...r,resource:t}:r)}),!0)}dispose(){this.removalTimers.forEach(e=>clearTimeout(e)),this.removalTimers.clear()}hasObject(e){return this.snapshot.objects.some(t=>t.id===e&&null==t.removingSince)}setSnapshot(e){this.snapshot=e,this.listeners.forEach(e=>e())}constructor(){(0,tA._)(this,"activeGesture",null),(0,tA._)(this,"gestureListeners",new Set),(0,tA._)(this,"listeners",new Set),(0,tA._)(this,"removalTimers",new Map),(0,tA._)(this,"snapshot",{objects:[],selectedObjectId:null}),(0,tA._)(this,"getSnapshot",()=>this.snapshot),(0,tA._)(this,"isGestureEnabled",()=>!0),(0,tA._)(this,"subscribe",e=>(this.listeners.add(e),()=>this.listeners.delete(e))),(0,tA._)(this,"subscribeGestures",e=>(this.gestureListeners.add(e),()=>this.gestureListeners.delete(e)))}}let nW={tracking:0,relocalizing:1,lost:2};function nY(e){return e.reduce((e,t)=>nW[t]>nW[e]?t:e,"tracking")}function nk(e){return ng()?(0,n.jsx)(nT,{...e}):(0,n.jsx)(nx,{children:(0,n.jsx)(nT,{...e})})}function nT(e){var t,r;let{catalog:i,catalogCategories:a,catalogFilters:s,catalogPagination:c,environmentUrl:u,initialResource:d,isLoadingCatalogCategories:b,object:x,owner:v,ownerAccount:j,resolveCatalogObjectVariant:w,scaleEnabled:y=!1,setCatalogFilters:N,showcaseHost:M}=e,{t:C}=(0,o.Bd)(),z=(0,I.Xf)(),L=(0,l.useRef)(!1),Z=(0,l.useRef)("searching"),S=(0,l.useRef)("tracking"),{overlayRoot:W,renderBridge:Y,runtime:k}=function(){let e=ng();if(!e)throw Error("An AR scene has to render inside an <ArSessionSurface>.");return e}(),T=`${d.id}:0`,D=function(e){let{initialObject:t,initialObjectId:r,initialResource:n}=e,i=(0,l.useRef)(null),a=(0,l.useRef)(1),[o]=(0,l.useState)(()=>{let e=new nS;return e.addObject(rV(n,r)),e}),s=(0,l.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot);(0,l.useEffect)(()=>()=>o.dispose(),[o]);let c=(0,l.useMemo)(()=>nZ(o,rP,i),[o]),u=(0,l.useMemo)(()=>nZ(o,rO,i),[o]),d=(0,l.useMemo)(()=>nZ(o,rG,i),[o]),m=(0,l.useRef)(null);m.current??(m.current=new Map(t?[[r,t]]:[]));let h=m.current,p=(0,l.useCallback)(e=>`${e}:${a.current++}`,[]);return(0,l.useMemo)(()=>({allManager:d,ceilingManager:u,createInstanceId:p,floorManager:c,gestureOwnerIdRef:i,manager:o,snapshot:s,sourceObjects:h}),[d,u,p,c,o,s,h])}({initialObject:x,initialObjectId:T,initialResource:d}),{createInstanceId:P,gestureOwnerIdRef:X,manager:O,snapshot:G,sourceObjects:A}=D,[U,H]=(0,l.useState)(!1),{learn:E,learnedLessons:F}=function(){let[e,t]=(0,l.useState)(()=>nR());return(0,l.useEffect)(()=>{!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nL();if(!t||0===e.length)return;let r=nR(t),n=e.filter(e=>!r.includes(e));if(0!==n.length)try{t.setItem(nz,JSON.stringify([...r,...n]))}catch{}}(e)},[e]),{learn:(0,l.useCallback)(e=>{e&&t(t=>t.includes(e)?t:[...t,e])},[]),learnedLessons:e}}(),[V,J]=(0,l.useState)(!1),[B,_]=(0,l.useState)(0),[Q,K]=(0,l.useState)(null),q=(0,l.useRef)(null),$=(0,l.useCallback)(e=>{q.current&&clearTimeout(q.current),K(e),q.current=setTimeout(()=>K(null),2500)},[]);(0,l.useEffect)(()=>()=>{q.current&&clearTimeout(q.current)},[]);let ee=(0,l.useRef)(null),[et,er]=(0,l.useState)(null),[en]=(0,l.useState)(()=>new tF),ei=function(){let e=(0,l.useRef)(new Map),[t,r]=(0,l.useState)("tracking"),[n,i]=(0,l.useState)({all:"tracking",ceiling:"tracking",floor:"tracking",wall:"tracking"}),a=(0,l.useCallback)((e,t)=>{i(r=>r[e]===t?r:{...r,[e]:t})},[]),o=(0,l.useCallback)((t,r)=>{e.current.set(t,r),a("wall",nY(Array.from(e.current.values())))},[a]),s=(0,l.useCallback)(t=>{e.current.delete(t),a("wall",nY(Array.from(e.current.values())))},[a]),c=(0,l.useCallback)(e=>a("all",e),[a]),u=(0,l.useCallback)(e=>a("ceiling",e),[a]),d=(0,l.useCallback)(e=>a("floor",e),[a]);return(0,l.useMemo)(()=>({forgetWall:s,setAll:c,setCeiling:u,setFloor:d,setSession:r,setWall:o,status:nY([t,...Object.values(n)])}),[s,n,t,c,u,d,o])}(),ea=k.sessionRef;!function(e){let{emitAnalytics:t,phaseRef:r,resource:n,runtime:i}=e,a=(0,l.useRef)({emitAnalytics:t,phaseRef:r,resource:n});(0,l.useLayoutEffect)(()=>{a.current={emitAnalytics:t,phaseRef:r,resource:n}});let o=(0,l.useRef)(0),s=(0,l.useRef)(!1),c=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(i.startAttempts<=o.current)return;o.current=i.startAttempts;let{emitAnalytics:e,phaseRef:t,resource:r}=a.current;e({name:"ar_session_start_clicked",object:tz(r),session:{phase:t.current}})},[i.startAttempts]),(0,l.useEffect)(()=>{if(!i.hasStarted||s.current)return;s.current=!0;let{emitAnalytics:e,phaseRef:t,resource:r}=a.current;e({name:"ar_session_started",object:tz(r),session:{phase:t.current}})},[i.hasStarted]),(0,l.useEffect)(()=>{if(!i.startFailure||c.current===i.startFailure)return;c.current=i.startFailure;let{emitAnalytics:e,phaseRef:t,resource:r}=a.current;e({error:tR(i.startFailure.error),name:"ar_session_failed",object:tz(r),session:{phase:t.current}})},[i.startFailure])}({emitAnalytics:z,phaseRef:Z,resource:d,runtime:k}),(0,l.useEffect)(()=>()=>O.getSnapshot().objects.forEach(e=>{var t;return null==(t=e.dispose)?void 0:t.call(e)}),[O]);let el=function(e){let{createInstanceId:t,emitAnalytics:r,forgetWallTracking:n,initialPlacingObjectId:i,manager:a,phaseRef:o,resolveCatalogObjectVariant:s,sessionRef:c,sourceObjects:u}=e,d=(0,l.useRef)(null),h=(0,l.useRef)(null),p=(0,l.useRef)(null),f=(0,l.useRef)(!1),g=(0,l.useRef)(!1),[b,x]=(0,l.useState)(i),[v,j]=(0,l.useState)("searching"),[w,y]=(0,l.useState)(null),[N,M]=(0,l.useState)(null),[C,z]=(0,l.useState)(!1),[R,L]=(0,l.useState)(!1),Z=(0,l.useCallback)(e=>{o.current=e,j(e)},[o]),S=(0,l.useCallback)(e=>{g.current=e,L(e)},[]),W=(0,l.useCallback)(()=>a.getSnapshot().objects.find(e=>e.id===b)??null,[a,b]),Y=(0,l.useCallback)(()=>{x(null),M(null),f.current=!1,Z("placed")},[Z]),k=(0,l.useCallback)(()=>{let e=W();e&&r({name:"object_placed",object:tz(e.resource),session:{phase:"placed"}}),x(null),Z("placed")},[r,W,Z]),T=(0,l.useCallback)(async()=>{var e,t,n;let i=W(),l=c.current;if(!i||!l||g.current)return;if("wall"===i.mechanic){r({name:"object_place_clicked",object:tz(i.resource),session:{phase:o.current}}),null==(e=(t=i.runtime.confirmPlacementRef).current)||e.call(t);return}let s=function(e,t){switch(e.mechanic){case"floor":var r;return(null==(r=t.floor)?void 0:r.kind)==="floor"?t.floor:null;case"ceiling":return t.ceiling;case"all":return t.all}}(i,{all:p.current,ceiling:h.current,floor:d.current});if(s){z(!1),S(!0),r({name:"object_place_clicked",object:tz(i.resource),session:{phase:o.current}});try{let e=await l.createAnchor(s),t=a.getSnapshot().objects.find(e=>e.id===i.id);if(!t||null!=t.removingSince)return void e.delete();null==(n=i.runtime.anchor)||n.delete(),i.runtime.anchor=e,i.runtime.lastAnchorPose=e.pose,"ceiling"===i.mechanic&&null===w&&y(i.runtime.targetTransform.suspensionHeight),i.runtime.lastInteractionRef.current=performance.now(),Y(),r({name:"object_placed",object:tz(i.resource),session:{phase:"placed"}})}catch(e){z(!0),r({error:tR(e),name:"object_place_failed",object:tz(i.resource),session:{phase:o.current}})}finally{S(!1)}}},[w,r,W,a,o,c,Y,S]),D=(0,l.useCallback)(()=>{var e;let t=W();if((null==t?void 0:t.mechanic)!=="ceiling")return;let r=h.current;if(!r||"floor"!==r.kind)return;let n=(e=t.runtime.targetTransform.suspensionHeight,eA(w??e));t.runtime.targetTransform=eU(r,n),t.runtime.currentTransform={...t.runtime.targetTransform,position:{...t.runtime.targetTransform.position}},t.runtime.rise=eH(performance.now());let i=null===w?"calibrating":"preview";M(eE(t.runtime.targetTransform,td(t),"calibrating"===i)),Z(i)},[w,W,Z]),P=(0,l.useCallback)(async(e,n)=>{if(b)return!1;let i=await s(e,n),l=m(i,n);if(!l)return r({name:"object_unavailable",object:(0,I.ZY)(i,n)}),!1;let o=t(l.id);return u.set(o,i),a.selectObject(null),a.addObject(rV(l,o)),x(o),M(null),f.current=!1,d.current=null,h.current=null,p.current=null,Z("searching"),S(!1),r({name:"object_ready",object:(0,I.ZY)(i,n)}),!0},[t,r,a,b,s,u,Z,S]),X=(0,l.useCallback)(e=>{let t=a.getSnapshot(),n=t.objects.find(e=>e.id===(b??t.selectedObjectId));if(!n)return!1;let i=n.resource.variants.find(t=>t.hid===e);return!!i&&i.hid!==n.resource.variantId&&(a.replaceObjectResource(n.id,{...n.resource,glbUrl:i.glbUrl,variantId:i.hid}),r({name:"object_variant_changed",object:{...tz(n.resource),variantId:i.hid},session:{phase:o.current}}),!0)},[r,a,o,b]),O=(0,l.useCallback)(()=>{let e=a.getSnapshot(),t=e.objects.find(e=>e.id===b)??null,i=t??e.objects.find(t=>t.id===e.selectedObjectId)??null;i&&(r({name:"object_removed",object:tz(i.resource),session:{phase:t?o.current:"selected"}}),"wall"===i.mechanic&&n(i.id),a.beginObjectRemoval(i.id,performance.now()),u.delete(i.id),t&&(x(null),Z("placed")),M(null),f.current=!1)},[r,n,a,o,b,u,Z]);return(0,l.useMemo)(()=>({addCatalogObject:P,allHitRef:p,ceilingHitRef:h,floorHitRef:d,handleWallPlaced:k,heightLabel:N,heightModeRef:f,phase:v,place:T,placementError:C,placementPending:R,placingObjectId:b,removeActiveObject:O,selectCeilingFloorPoint:D,setHeightLabel:M,setPlacementError:z,setPlacementPending:S,switchVariant:X,updatePhase:Z}),[P,k,N,v,T,C,R,b,O,D,X,Z,S])}({createInstanceId:P,emitAnalytics:z,forgetWallTracking:ei.forgetWall,initialPlacingObjectId:(null==(t=G.objects[0])?void 0:t.id)??null,manager:O,phaseRef:Z,resolveCatalogObjectVariant:w,sessionRef:ea,sourceObjects:A}),{addCatalogObject:eo,heightLabel:es,phase:ec,place:eu,placementError:ed,placementPending:em,placingObjectId:eh,removeActiveObject:ep,selectCeilingFloorPoint:ef,setHeightLabel:eg,switchVariant:eb}=el,ej=function(e,t){let[r,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!t||!e)return;let r=!0,i=null;return new nI.Y().loadAsync(e).then(e=>{r?(e.mapping=303,i=e,n(e)):e.dispose()}).catch(()=>{}),()=>{r=!1,n(null),null==i||i.dispose()}},[t,e]),r}(u??null,k.isStarting||k.hasStarted),ew=(0,l.useMemo)(()=>{if(!Y)return;let e=Y.camera;return e.manual=!0,e},[Y]),eN=ei.status,{activeCeilingObject:eM,activeMechanic:eC,activeObject:eI,activeSourceObject:ez,ceilingHeightScaleValue:eR,ceilingScaleCalibrating:eL,currentVariant:eZ,displayPhase:eW,hintKey:eY,placingObject:ek,primaryAction:eT,productCardObject:eD,selectedObject:eP,showCeilingScale:eX,showConfirm:eO,showObjectBar:eV,trackingLossStatus:eJ}=function(e){var t,r,n,i;let a,l,{initialObjectId:o,initialResource:s,phase:c,placingObjectId:u,productCardObjectId:d,snapshot:m,sourceObjects:h,trackingStatus:p}=e,f=m.objects.find(e=>e.id===u)??null,g=m.objects.find(e=>e.id===m.selectedObjectId)??null,b=f??g,x=(t=m.objects,r=m.selectedObjectId,n=s.mechanic,(null==(l=(a=u??r)?t.find(e=>e.id===a):t.at(-1))?void 0:l.mechanic)??n),v=f?c:g?"selected":"placed",j=(i=(null==f?void 0:f.mechanic)??null,i?"ceiling"===i&&"floor-ready"===c?"set-floor":"ceiling"===i&&"calibrating"===c?"set-height":"preview"===c?"done":null:null),w="searching"===v,y="tracking"===p||w?`${x}.${"placed"===v?"select":"selected"===v?"gestures":"floor-ready"===v?"floorReady":v}`:`${x}.relocalizing`,N=(null==b?void 0:b.resource.variants)??[],M=Math.max(0,N.findIndex(e=>e.hid===(null==b?void 0:b.resource.variantId))),C=b?h.get(b.id)??null:null,I=(null==b?void 0:b.id)===o,z="done"===j||"set-height"===j,R=!!b&&(!f||z),L=!!f&&I&&z,Z=(null==b?void 0:b.mechanic)==="ceiling"?b:null,S=!!(f&&(null==Z?void 0:Z.id)===f.id&&"calibrating"===c);return{activeCeilingObject:Z,activeMechanic:x,activeObject:b,activeSourceObject:C,ceilingHeightScaleValue:Z?eE(Z.runtime.targetTransform,td(Z),S):null,ceilingScaleCalibrating:S,currentVariant:N[M]??null,displayPhase:v,hintKey:y,nextVariant:N.length>1?N[(M+1)%N.length]??null:null,placingObject:f,primaryAction:j,productCardObject:b&&d===b.id?C:null,selectedObject:g,showCeilingScale:function(e){let{isPlacingCeiling:t,isSelectedCeiling:r,phase:n}=e;return t&&("calibrating"===n||"preview"===n)||!t&&r}({isPlacingCeiling:(null==f?void 0:f.mechanic)==="ceiling",isSelectedCeiling:!!(!f&&(null==g?void 0:g.mechanic)==="ceiling"),phase:v}),showConfirm:R,showObjectBar:R&&!L,trackingLossStatus:w?"tracking":p}}({initialObjectId:T,initialResource:d,phase:ec,placingObjectId:eh,productCardObjectId:et,snapshot:G,sourceObjects:A,trackingStatus:eN}),eB=eh??G.selectedObjectId;rA(G.objects,X,eB),(0,l.useEffect)(()=>{var e,t;null==(t=ea.current)||null==(e=t.setMechanic)||e.call(t,eC)},[eC,k.hasStarted,ea]);let e_=function(e){var t;let r,{hintKey:n,learnedLessons:i,roomEmpty:a,rising:l=!1}=e,o=function(e,t){let r=tf(e);if("select"===r){let r=tg(e),n=tj.find(e=>{let n=tN(`${r}.${e}`);return null!==n&&!t.includes(n)});return`${r}.${n??"catalog"}`}if("gestures"!==r)return e;let n=tg(e),i=tv.find(e=>{let r=tN(`${n}.${e}`);return null!==r&&!t.includes(r)});return`${n}.${i??"finish"}`}(n,i),s=!a&&function(e){let{hintKey:t,learnedLessons:r}=e,n=tN(t);return null===n||!r.includes(n)}({hintKey:o,learnedLessons:i}),c=s&&!l;return{callsOutCatalog:s&&"catalog"===tf(o),illustration:c?(r=tf(o),(null==(t=tM[tg(o)])?void 0:t[r])??ty[r]??null):null,key:o,shown:c}}({hintKey:eY,learnedLessons:F,roomEmpty:0===G.objects.length}),eQ=e_.shown?C(e_.key):null,eK=eY.endsWith(".searching");(0,l.useEffect)(()=>O.subscribeGestures(e=>{var t;let{kind:r,objectId:n}=e,i=O.getSnapshot().objects.find(e=>e.id===n);i&&E((t=i.mechanic,tN(`${t}.${tC[r]}`)))}),[E,O]);let eq=(null==eP?void 0:eP.mechanic)??null;(0,l.useEffect)(()=>{eq&&E(tN(`${eq}.select`))},[E,eq]);let e$=()=>(0,I.ZY)(ez,null==eI?void 0:eI.resource.variantId,null==eI?void 0:eI.mechanic),e0=(0,l.useCallback)(e=>{if(eM){var t,r;let n;eM.runtime.targetTransform=(t=eM.runtime.targetTransform,r=td(eM),n=eA(eL?e:e+r*t.scale),{...t,position:{...t.position,y:t.floorY+n},suspensionHeight:n}),eM.runtime.lastInteractionRef.current=performance.now(),eM.runtime.draggedAtRef.current=performance.now(),eg(eE(eM.runtime.targetTransform,td(eM),eL))}},[eM,eL,eg]);(0,l.useLayoutEffect)(()=>{let e=ee.current;if(!e)return;let t=()=>_(Math.round(e.getBoundingClientRect().height));if(t(),"u"<typeof ResizeObserver)return;let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]);let e1=(0,l.useMemo)(()=>({"--ar-session-hint-bottom":B>0?`calc(${tW} + ${B}px + 0.375rem)`:tW,bottom:"var(--ar-session-hint-bottom)"}),[B]);return(0,l.useEffect)(()=>{if(S.current===eN)return;S.current=eN;let e=ek??eP;z({name:"tracking_status_changed",object:e?tz(e.resource):tz(d),session:{phase:eW,trackingStatus:eN}})},[eW,z,d,ek,eP,eN]),(0,n.jsxs)("div",{className:"absolute inset-0 z-[1] overflow-hidden","data-testid":"ar-session-scene",children:[(0,n.jsxs)(h.Hl,{className:"relative z-[1] touch-none",camera:ew??{far:100,near:.01},frameloop:Y?"never":"always",gl:{alpha:!0,antialias:!0},scene:Y?Y.sceneRoot:void 0,onCreated:e=>{let{gl:t}=e;return k.setRenderer(t)},children:[Y?(0,n.jsx)(tp,{bridge:Y}):null,(0,n.jsx)(tI,{texture:ej}),ej?null:(0,n.jsx)("ambientLight",{intensity:1.2}),(0,n.jsx)(tJ,{cache:en,children:(0,n.jsx)(ru,{renderer:(null==Y?void 0:Y.renderer)??null,children:(0,n.jsx)(nl,{objects:D,phaseRef:Z,placement:el,scaleEnabled:y,sessionHasTrackingRef:L,sessionRef:ea,tracking:ei})})})]},Y?"engine":"host"),eX&&null!==eR?(0,n.jsx)(nC,{formatHeight:e=>C("ceiling.heightValue",{height:e.toFixed(1)}),ariaLabel:C("ceiling.heightMode"),height:eR,onHeightChange:e0}):null,(0,n.jsx)(eF,{active:eK||!!(eQ||Q)}),eK?(0,n.jsx)(eS,{mechanic:eC,positionStyle:e1}):(0,n.jsx)(tQ,{illustration:e_.illustration,loadingTitle:C(`${eC}.found`),modelCache:en,pendingModelUrl:(null==eI?void 0:eI.resource.glbUrl)??null,notice:Q,positionStyle:e1,text:eQ}),(0,n.jsx)(eG,{status:eJ}),(0,n.jsx)(nj,{asCancel:!!ek,show:eV&&!!eI,onDelete:ep}),(0,n.jsx)(tO,{onSelectVariant:eb,calledOutCatalog:e_.callsOutCatalog,confirmDisabled:em||"set-height"===eT&&null===es,confirmLabel:C(`${eC}.${ek?"place":"done"}`),controlsRef:ee,currentVariantId:(null==eZ?void 0:eZ.hid)??null,productName:eV&&!ek&&ez?(null==(r=ez.name)?void 0:r.trim())||C("catalog.unnamedProduct"):null,showAddObjectButton:0===G.objects.length,showCatalogButton:!eI&&G.objects.length>0,showConfirmButton:eO&&!!ek,showSetFloorButton:"set-floor"===eT,showShareButton:eV&&!ek&&!!ez,variants:(null==eI?void 0:eI.resource.variants)??[],onConfirm:()=>ek?void eu():O.selectObject(null),onOpenCatalog:()=>{H(!0),E(tN(`${eC}.catalog`))},onOpenProduct:()=>{er((null==eI?void 0:eI.id)??null),z({name:"catalog_product_opened",object:e$()})},onOpenVariants:()=>J(!0),onSetFloorPoint:ef,onShare:()=>{var e;let t=(0,R.R)(M,null==ez?void 0:ez.tinuuid);ez&&t&&ex({title:(null==(e=ez.name)?void 0:e.trim())||C("catalog.unnamedProduct"),url:t}).then(e=>"copied"===e&&$(C("linkCopied")))}}),(0,n.jsx)(f.HM,{asChild:!0,children:(0,n.jsx)(p.$,{className:"absolute top-6 right-6 z-10 bg-black/50 text-white hover:bg-black/60 active:bg-black/70",style:{top:"max(1.5rem, env(safe-area-inset-top))"},size:"icon","aria-label":C("close"),children:(0,n.jsx)(g.A,{"aria-hidden":"true"})})}),ed?(0,n.jsx)("p",{className:"absolute inset-x-6 bottom-24 z-10 rounded-xl bg-black/70 p-4 text-center text-sm text-white",role:"alert",children:C(`${eC}.anchorError`)}):null,(0,n.jsx)(ev,{object:eD,portalContainer:W,showcaseHost:M,testId:"ar-session-product-card",onOpenChange:e=>!e&&er(null),onShared:e=>"copied"===e&&$(C("linkCopied")),onViewOnSite:()=>z({name:"catalog_product_view_on_site_clicked",object:e$()})}),(0,n.jsx)(nN,{currentVariantId:null==eI?void 0:eI.resource.variantId,open:V,portalContainer:W,variants:(null==eI?void 0:eI.resource.variants)??[],onOpenChange:J,onSelect:e=>eb(e)&&J(!1)}),(0,n.jsx)(ey,{catalog:i,categories:a,filters:s,isLoadingCategories:b,owner:v,ownerAccount:j,pagination:c,showcaseHost:M,setFilters:N,onOpenChange:H,onPlace:eo,open:U,portalContainer:W})]})}function nD(e){let{children:t}=e,{t:r}=(0,o.Bd)();return(0,n.jsxs)("div",{className:"relative flex size-full flex-col items-center justify-center gap-4 overflow-auto bg-radial from-background-containers to-background-base-2 p-4 text-foreground","data-neurodyn-ar-mount":"",children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("h1",{className:"typo-base-18 font-medium",children:r("android.title")}),(0,n.jsx)("p",{className:"mt-1 typo-base-14 text-text-light",children:r("android.description")})]}),t]})}function nP(e){let{variant:t,showDialogCloseButton:r=!1}=e,{t:i}=(0,o.Bd)();return(0,n.jsxs)("div",{className:"relative z-30 flex size-full flex-col items-center justify-center gap-4 bg-radial from-background-containers to-background-base-2 p-4 text-center",children:[(0,n.jsx)(D,{className:"size-8 text-icons-light"}),(0,n.jsx)("h2",{className:"typo-base-16 font-medium text-text-dark",children:i(`accessError.${t}`)}),r&&(0,n.jsx)(f.HM,{asChild:!0,children:(0,n.jsx)(p.$,{variant:"secondary",children:i("close")})})]})}var nX=r(4956),nO=r(9055),nG=r(2966),nA=r(6198),nU=r(575);async function nH(e,t){let{uuid:r,username:n}=e,i=null==r?void 0:r.trim(),a=null==n?void 0:n.trim().toLowerCase();if(!i&&!a)throw Error("fetchPublicAccount: uuid or username is required");let l=await (0,nU.DFU)(i?{userId:i}:{username:a},t);if(!(null==l?void 0:l.id))throw Error(`Account ${i??n} not found`);return{uuid:l.id,username:l.username,name:l.name??"",type:l.type,useObjTags:l.useObjTags,privacy:"public",...l.avatarUrl?{avatar:{uuid:l.avatarFileId??void 0,url:l.avatarUrl}}:{},...l.backgroundUrl?{background:{uuid:l.backgroundFileId??void 0,url:l.backgroundUrl}}:{}}}let nE="core-ar";function nF(e){let t="string"==typeof e&&e.trim()?Number(e):e;return"number"==typeof t&&Number.isFinite(t)?t:void 0}function nV(e){return{baseURL:e.baseURL,signal:e.signal}}function nJ(e){return{baseURL:e.baseURL,headers:{"x-api-key":e.apiKey},signal:e.signal}}async function nB(e,t){return t.apiKey?await (0,nU.ytc)({tinuuid:e},{productType:nE,variantId:t.variantId},nJ(t)):await (0,nU.Ago)({tinuuid:e},nV(t))}async function n_(e,t,r){var n,i;let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=(0,R.J)(a.search),o=nF(null==(n=a.category)?void 0:n.id),s=null==(i=a.category)?void 0:i.kind,c={owners:[e],page:t,...l?{search:l}:{},..."category"===s&&void 0!==o?{catId:o}:{},..."tag"===s&&void 0!==o?{tagId:o}:{}};return r.apiKey?await (0,nU.avi)(c,{productType:nE},nJ(r)):await (0,nU.qgy)(c,nV(r))}async function nQ(e,t){return nH({uuid:e},{baseURL:t.baseURL,signal:t.signal})}function nK(e){let t=nF(e.id),r=(0,R.J)(e.name);return void 0!==t&&r&&e.hasObjs?{id:t,kind:"category",name:r}:null}function nq(e){let t=nF(e.id),r=(0,R.J)(e.name);return void 0!==t&&r?{id:t,kind:"tag",name:r}:null}function n$(e,t){return e.id===t.id?0:90===e.id?1:90===t.id?-1:0}async function n0(e,t){return t.apiKey?await (0,nU.c03)(nJ(t)):await (0,nU._8U)({ownerUuid:e},nV(t))}async function n1(e,t){return t.apiKey?await (0,nU.T07)(nJ(t)):await (0,nU.adr)({ownerUuid:e},nV(t))}async function n2(e,t,r){return"custom"===t?((await n0(e,r)).tags??[]).map(nq).filter(e=>!!e).sort(n$):((await n1(e,r)).cats??[]).map(nK).filter(e=>!!e).sort(n$)}let n4="https://cdn.neurodyn.ai/hdr/modern_bathroom_1k.hdr";function n3(e){return"string"==typeof e&&/^https?:\/\//i.test(e)}async function n5(e){try{let t=await (0,nU.b6)(void 0,{baseURL:e.baseURL,signal:e.signal});return function(e){var t,r,n;if(!e)return null;if(n3(e.hdr_neutral))return e.hdr_neutral;let i=null==(t=e.internal)?void 0:t.hdr_neutral;if(n3(i))return i;let a=null==(n=e.internal)||null==(r=n.links)?void 0:r.find(e=>"hdr_neutral"===e.type&&n3(e.url));return(null==a?void 0:a.url)??null}(t)??n4}catch{return n4}}let n9={category:null,search:""},n7=[],n6=(0,l.createContext)(null);function n8(e){var t,r,i;let{apiKey:a,children:o,hid:s,initialWidgetSessionToken:m,tenant:h,tinuuid:p}=e,f=(null==a?void 0:a.trim())||void 0,g=(null==s?void 0:s.trim())||void 0,b=(null==p?void 0:p.trim())??"",x={apiKey:f,baseURL:h.apiOrigin},v=!!b,j=(0,nO.I)({queryKey:["ar","object",{apiKey:(t={...x,variantId:g}).apiKey??null,baseURL:t.baseURL,tinuuid:b,variantId:t.variantId??null}],enabled:v,queryFn:e=>{let{signal:t}=e;return nB(b,{...x,signal:t,variantId:g})}}),w=(0,nO.I)({queryKey:["ar","scene-environment",{baseURL:x.baseURL}],queryFn:e=>{let{signal:t}=e;return n5({...x,signal:t})},retry:!1,staleTime:1/0}),y=(0,nO.I)({queryKey:["ar","widget-session",{apiKey:f??null,handoffTokenDigest:(0,u.a4)(m),baseURL:h.apiOrigin}],enabled:!!f,gcTime:0,refetchOnMount:"always",queryFn:e=>{let{signal:t}=e;if(!f)throw Error("API key is required to activate a widget session.");return(0,u.Uu)({apiBaseUrl:h.apiOrigin,apiKey:f,initialWidgetSessionToken:m,signal:t})}}),N=j.data??null,M=(null==N?void 0:N.owner)??null,C=null==M?void 0:M.uuid,[I,z]=(0,l.useState)({filters:n9}),L=I.ownerUuid===C?I.filters:n9,Z=(0,l.useCallback)(e=>{z(t=>{var r;return{filters:(r=t.ownerUuid===C?t.filters:n9,"function"==typeof e?e(r):e),ownerUuid:C}})},[C]),S=(0,nO.I)({queryKey:["ar","owner-account",{baseURL:x.baseURL,ownerUuid:C??null}],enabled:!!C,queryFn:e=>{let{signal:t}=e;if(!C)throw Error("Owner uuid is required.");return nQ(C,{...x,signal:t})}}),W=S.data??null,Y=(null==W?void 0:W.useObjTags)===!0?"custom":"standard",k=(0,nO.I)({queryKey:["ar","owner-categories",{apiKey:x.apiKey??null,categoryMode:Y,baseURL:x.baseURL,ownerUuid:C??null}],enabled:!!(C&&W),queryFn:e=>{let{signal:t}=e;if(!C)throw Error("Owner uuid is required.");return n2(C,Y,{...x,signal:t})}}),T=k.data??n7,D=!!(C&&(!W||S.isLoading||S.isError||k.isLoading||k.isError)),P=(0,l.useMemo)(()=>{let e,t=(e=L.search.trim(),{category:L.category,search:e}),r=t.category;return!r||D||T.some(e=>e.id===r.id&&e.kind===r.kind)?t:{...t,category:null}},[T,L,D]),X=function(e,t){let[r,n]=(0,l.useState)(e);return(0,l.useEffect)(()=>{if(r===e)return;let t=window.setTimeout(()=>n(e),400);return()=>window.clearTimeout(t)},[400,r,e]),r}(P.search,0),O=(0,l.useMemo)(()=>({category:P.category,search:X}),[X,P.category]),{data:G,error:A,fetchNextPage:H,hasNextPage:E,isFetchingNextPage:F}=(0,nG.q)({queryKey:["ar","owner-objects",{apiKey:x.apiKey??null,categoryId:(null==(r=O.category)?void 0:r.id)??null,categoryKind:(null==(i=O.category)?void 0:i.kind)??null,baseURL:x.baseURL,ownerUuid:C??null,search:(0,R.J)(O.search)??null}],enabled:!!C,queryFn:e=>{let{pageParam:t,signal:r}=e;if(!C)throw Error("Owner uuid is required.");return n_(C,t,{...x,signal:r},O)},initialPageParam:1,getNextPageParam:(e,t,r)=>{var n;return void 0!==e.pages_count?r<e.pages_count?r+1:void 0:(null==(n=e.objs)?void 0:n.length)?r+1:void 0},placeholderData:nA.rX}),V=(0,l.useMemo)(()=>(function(e,t){if(!e)return t;let r=U(e);return[e,...t.filter(e=>!r||U(e)!==r)]})(N,(null==G?void 0:G.pages.flatMap(e=>e.objs??[]))??[]),[null==G?void 0:G.pages,N]),J=(0,l.useCallback)(async(e,t)=>{var r;let n=null==(r=e.tinuuid)?void 0:r.trim();return n?nB(n,{apiKey:f,baseURL:h.apiOrigin,variantId:t}):e},[f,h.apiOrigin]),B=null;b?j.error?B=c(j.error,"object"):N&&!C?B="owner-missing":A&&(B=c(A,"catalog")):B="missing-tinuuid";let _=v&&j.isLoading,Q=B?"error":_||!N?"loading":"ready",K=(0,l.useMemo)(()=>({catalog:V,catalogCategories:T,catalogFilters:P,environmentUrl:w.data??null,error:B,fetchNextPage:async()=>{await H()},hasNextPage:!!E,isFetchingNextPage:F,isLoadingCatalogCategories:D,metadata:N?(0,d.sq)(N):null,object:N,owner:M,ownerAccount:W,resolveCatalogObjectVariant:J,setCatalogFilters:Z,showcaseHost:h.showcaseHost,status:Q,variant:N?(0,d.uW)(N,g):null,widgetSession:y.data??null}),[V,T,w.data,B,H,E,F,D,P,g,N,M,W,J,Z,Q,h.showcaseHost,y.data]);return(0,n.jsx)(n6,{value:K,children:o})}function ie(){let e=(0,l.use)(n6);if(!e)throw Error("useArData must be used inside ArDataProvider");return e}function it(e){let{label:t,value:r}=e;return(0,n.jsxs)("div",{className:"grid grid-cols-[7rem_minmax(0,1fr)] gap-3 border-b border-border py-2 last:border-0",children:[(0,n.jsx)("dt",{className:"text-text-light",children:t}),(0,n.jsx)("dd",{className:"min-w-0 break-words font-mono",children:r??"—"})]})}function ir(e){var t,r,i,a,l,s,c,u;let{showDialogCloseButton:d=!1,value:m}=e,{t:h}=(0,o.Bd)(),b=null==(t=m.metadata)?void 0:t.dimensions;return(0,n.jsxs)("section",{className:"w-full max-w-2xl overflow-auto rounded-xl border border-border bg-background-containers p-5 shadow-lg",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("h1",{className:"typo-base-18 font-medium",children:h("data.title")}),d&&(0,n.jsx)(f.HM,{asChild:!0,children:(0,n.jsx)(p.$,{size:"icon",variant:"secondary","aria-label":h("close"),children:(0,n.jsx)(g.A,{"aria-hidden":"true"})})})]}),(0,n.jsxs)("dl",{className:"mt-3 typo-base-14",children:[(0,n.jsx)(it,{label:h("data.object"),value:`${(null==(r=m.object)?void 0:r.name)??"—"} (${(null==(i=m.object)?void 0:i.tinuuid)??"—"})`}),(0,n.jsx)(it,{label:h("data.variant"),value:`${(null==(a=m.variant)?void 0:a.name)??"—"} (${(null==(l=m.variant)?void 0:l.hid)??"—"})`}),(0,n.jsx)(it,{label:h("data.owner"),value:`${(null==(s=m.owner)?void 0:s.name)??"—"} (${(null==(c=m.owner)?void 0:c.uuid)??"—"})`}),(0,n.jsx)(it,{label:h("data.mechanic"),value:null==(u=m.metadata)?void 0:u.mechanic}),(0,n.jsx)(it,{label:h("data.dimensions"),value:b?`${b.width} \xd7 ${b.height} \xd7 ${b.depth} ${b.unit}`:"—"})]}),(0,n.jsxs)("div",{className:"mt-5 flex items-center justify-between gap-3",children:[(0,n.jsxs)("h2",{className:"typo-base-16 font-medium",children:[h("data.catalog"),(0,n.jsxs)("span",{children:[" ","(",m.catalog.length,")"]})]}),m.hasNextPage&&(0,n.jsx)(p.$,{type:"button",variant:"secondary",disabled:m.isFetchingNextPage,onClick:()=>void m.fetchNextPage(),children:m.isFetchingNextPage?h("data.loading"):h("data.loadNextPage")})]}),(0,n.jsx)("ul",{className:"mt-2 grid gap-2",children:m.catalog.map((e,t)=>(0,n.jsx)("li",{className:"rounded-md border border-border px-3 py-2 typo-base-14",children:e.name??e.tinuuid??e.uuid??h("data.unnamedObject")},e.uuid??e.tinuuid??t))})]})}let ii=new Set(["catalog_category_selected","catalog_opened","catalog_product_opened","catalog_product_place_clicked","catalog_product_view_on_site_clicked","catalog_show_all_clicked","object_placed","object_removed","object_variant_changed"]),ia=new i.E({defaultOptions:{queries:{gcTime:3e5,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:(e,t)=>{let r=s(t);return("number"!=typeof r||!(r>=400)||!(r<500))&&e<2}}}});function il(e){let{apiKey:t,hid:r,initialWidgetSessionToken:i,language:s,onAnalyticsEvent:c,scaleEnabled:u=!1,tinuuid:d}=e,{i18n:m}=(0,o.Bd)(),h=function(){let{i18n:e}=(0,o.Bd)(),t=e.resolvedLanguage??e.language;return(0,nX.hs)(t)}(),p=(0,nX._K)(s?(0,nX.hs)(s):h);return(0,l.useEffect)(()=>{s&&m.language!==s&&m.changeLanguage(s)},[m,s]),(0,n.jsx)(a.Ht,{client:ia,children:(0,n.jsx)(n8,{apiKey:t,hid:r,initialWidgetSessionToken:i,tenant:p,tinuuid:d,children:(0,n.jsx)(io,{onAnalyticsEvent:c,children:(0,n.jsx)(is,{scaleEnabled:u})})})})}function io(e){var t,r,i;let{children:a,onAnalyticsEvent:o}=e,s=ie(),c=(0,l.useRef)([]),d=(0,l.useRef)(null),h=(0,l.useRef)(null),p=(0,l.useCallback)(()=>{var e,t;return(0,I.ZY)(s.object,null==(e=s.variant)?void 0:e.hid,null==(t=s.metadata)?void 0:t.mechanic)},[null==(t=s.metadata)?void 0:t.mechanic,s.object,null==(r=s.variant)?void 0:r.hid]),f=(0,l.useCallback)((e,t)=>{let r=s.widgetSession;if(!r)return!1;if("widget_opened"===e){if(r.continued||h.current===r.sid)return!0;h.current=r.sid}if("ar_launched"===e){if(d.current===r.sid)return!0;d.current=r.sid}return(0,u.Kq)(r,e,{objectId:t.objectId,variantId:t.variantId}),!0},[s.widgetSession]),g=(0,l.useCallback)(e=>{(0,I.lA)(o,e);let t="ar_session_started"===e.name?"ar_launched":ii.has(e.name)?"interacted":null;if(!t)return;let r=e.object??p();!f(t,r)&&c.current.length<10&&c.current.push({event:t,object:r})},[p,o,f]);return(0,l.useEffect)(()=>{var e;if(("ready"===s.status&&s.object?m(s.object,null==(e=s.variant)?void 0:e.hid):null)&&f("widget_opened",p()),!c.current.length)return;let t=c.current;c.current=t.filter(e=>!f(e.event,e.object))},[s.object,s.status,null==(i=s.variant)?void 0:i.hid,p,f]),(0,n.jsx)(I.Nz,{onEvent:g,children:a})}function is(e){var t,r,i;let{scaleEnabled:a}=e,o=ie(),s=(0,I.Xf)(),c=(0,l.useRef)(null),u=(0,l.useMemo)(()=>{var e;return"ready"===o.status&&o.object?m(o.object,null==(e=o.variant)?void 0:e.hid):null},[o.object,o.status,null==(t=o.variant)?void 0:t.hid]);if((0,l.useEffect)(()=>{if(!o.error)return;let e=`error:${o.error}`;c.current!==e&&(c.current=e,s({error:{code:o.error},name:"object_load_failed"}))},[o.error,s]),(0,l.useEffect)(()=>{var e,t,r,n,i;if("ready"!==o.status){"loading"===o.status&&(c.current=null);return}let a=u?`ready:${u.id}:${u.glbUrl}:${u.mechanic}:${(null==(e=o.variant)?void 0:e.hid)??""}`:`unavailable:${(null==(t=o.object)?void 0:t.uuid)??""}:${(null==(r=o.variant)?void 0:r.hid)??""}`;c.current!==a&&(c.current=a,s({name:u?"object_ready":"object_unavailable",object:(0,I.ZY)(o.object,null==(n=o.variant)?void 0:n.hid,null==(i=o.metadata)?void 0:i.mechanic)}))},[null==(r=o.metadata)?void 0:r.mechanic,o.object,o.status,null==(i=o.variant)?void 0:i.hid,s,u]),o.error)return(0,n.jsx)(nP,{variant:function(e){switch(e){case"access-denied":return"unauthorized";case"missing-tinuuid":case"object-not-published":return"not-found";default:return"unavailable"}}(o.error),showDialogCloseButton:!0});if("ready"===o.status&&!u)return(0,n.jsx)(nP,{variant:"unavailable",showDialogCloseButton:!0});if("ready"===o.status&&(0,ri.R5)())return(0,n.jsx)(ir,{showDialogCloseButton:!0,value:o});let d="loading"===o.status;return(0,n.jsx)(nD,{children:(0,n.jsx)(nx,{waiting:d,children:u?(0,n.jsx)(ic,{data:o,initialResource:u,scaleEnabled:a}):null})})}function ic(e){let{data:t,initialResource:r,scaleEnabled:i}=e;return(0,n.jsx)(nk,{catalog:t.catalog,catalogPagination:{fetchNextPage:t.fetchNextPage,hasNextPage:t.hasNextPage,isFetchingNextPage:t.isFetchingNextPage},catalogCategories:t.catalogCategories,catalogFilters:t.catalogFilters,environmentUrl:t.environmentUrl,initialResource:r,isLoadingCatalogCategories:t.isLoadingCatalogCategories,object:t.object,owner:t.owner,ownerAccount:t.ownerAccount,resolveCatalogObjectVariant:t.resolveCatalogObjectVariant,scaleEnabled:i,setCatalogFilters:t.setCatalogFilters,showcaseHost:t.showcaseHost},`${r.id}:${r.glbUrl}`)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_neurodyn_ar=self.webpackChunk_neurodyn_ar||[]).push([["206"],{985(e,t,n){n.d(t,{W:()=>r});function r(e){if(e&&"object"==typeof e&&"name"in e){let t=e.name;if("NotAllowedError"===t||"SecurityError"===t)return"camera-denied";if("NotSupportedError"===t)return"unsupported"}return"error"}},3761(e,t,n){n.d(t,{f:()=>a});var r=n(2585),i=n(985),o=n(1828);class a{async isSupported(){try{return await this.resolve(),!0}catch{return!1}}async startSession(e){let t=await this.resolve();for(let n=0;n<t.length;n+=1)try{return await t[n].startSession(e)}catch(e){if(n===t.length-1||"camera-denied"===(0,i.W)(e))throw e;this.resolution=Promise.resolve(t.slice(n+1))}throw Error("AR is not available on this device.")}resolve(){return this.resolution||(this.resolution=(0,o.Tn)(this.options).catch(e=>{throw this.resolution=null,e})),this.resolution}constructor(e={}){(0,r._)(this,"options",void 0),(0,r._)(this,"resolution",void 0),this.options=e,this.resolution=null}}},1828(e,t,n){n.d(t,{Sf:()=>s,Tn:()=>l,U4:()=>u,rZ:()=>a});var r=n(7292),i=n(342),o=n(7734);function a(){return{"8thwall":new i.VU,webxr:new o.c}}async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a(),[t,n]=await Promise.all([e.webxr.isSupported().catch(()=>!1),e["8thwall"].isSupported().catch(()=>!1)]);return{"8thwall":n,webxr:t}}async function l(){let{backend:e,registry:t=a(),webview:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e?[e]:n?["webxr"]:r.A,o=[];for(let e of i){let n=t[e];await n.isSupported().catch(()=>!1)&&o.push(n)}if(o.length)return o;if("u">typeof window&&!window.isSecureContext)throw Error("AR needs a secure connection. Open this page over HTTPS or localhost.");throw Error("AR is not available on this device.")}async function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t]=await l(e);return t}},7734(e,t,n){n.d(t,{Y:()=>s,c:()=>v});var r=n(2585),i=n(8413),o=n(7292),a=n(5807);function s(e){return e}function l(e){return{x:e.x,y:e.y,z:e.z}}function u(e){return{w:e.w,x:e.x,y:e.y,z:e.z}}let c=!1;function d(e,t,n,r){if(!e.getPose)return null;try{return e.getPose(t(),n)??null}catch(e){return null==r||r(),(0,i.Q0)()&&!c&&(c=!0,console.warn("[react-ar] a WebXR space stopped answering; treating it as lost tracking.",e)),null}}class h{setMechanic(e){e!==this.mechanic&&(this.mechanic=e,this.cachedFrame=null)}async attachRenderer(e){e.xr.enabled=!0,e.xr.setReferenceSpaceType("local-floor"),await e.xr.setSession(this.nativeSession)}getCenterHit(e){return this.cachedFrame===e||(this.cachedFrame=e,this.cachedHit=this.readCenterHit(e)),this.cachedHit}readCenterHit(e){let t=null;for(let n of this.readHitTestResults(e)){let e=function(e,t){var n;let r,i=e.getPose(t);if(!i)return null;let{matrix:o,orientation:s,position:c}=i.transform,d=(r=Math.hypot((n={x:o[4]??0,y:o[5]??1,z:o[6]??0}).x,n.y,n.z)||1,{x:n.x/r,y:n.y/r,z:n.z/r}),h={kind:(0,a.Q3)(d),nativeHit:e,normal:d,pose:{orientation:u(s),position:l(c)}};return"wall"!==h.kind||(0,a.aq)(h)?h:null}(n,this.floorSpace);if(e){if(function(e,t){switch(t){case"wall":return(0,a.aq)(e);case"ceiling":return"ceiling"===e.kind;case"floor":return"floor"===e.kind;case"all":return!0}}(e,this.mechanic))return e;t??(t=e)}}return t}readHitTestResults(e){try{return e.getHitTestResults(this.hitTestSource)}catch{return[]}}isTracking(e){return null!==d(e,()=>this.viewerSpace,this.floorSpace)}async createAnchor(e){var t;let n=e.nativeHit;if(!(null==n?void 0:n.createAnchor))throw Error("WebXR anchors are unavailable.");let r=await n.createAnchor(),i=!1;return{delete:()=>{try{null==r||r.delete()}catch{}},getPose:e=>{var t;if(i)return null;let n=d(e,()=>r.anchorSpace,this.floorSpace,()=>{i=!0});return n?{orientation:u((t=n.transform).orientation),position:l(t.position)}:null},isDetached:()=>i,nativeAnchor:r,pose:{orientation:u((t=e.pose).orientation),position:l(t.position)}}}async end(){this.cachedFrame=null,this.cachedHit=null,this.hitTestSource.cancel(),await this.nativeSession.end()}constructor(e,t,n,i){(0,r._)(this,"nativeSession",void 0),(0,r._)(this,"floorSpace",void 0),(0,r._)(this,"hitTestSource",void 0),(0,r._)(this,"viewerSpace",void 0),(0,r._)(this,"cachedFrame",void 0),(0,r._)(this,"cachedHit",void 0),(0,r._)(this,"mechanic",void 0),this.nativeSession=e,this.floorSpace=t,this.hitTestSource=n,this.viewerSpace=i,this.cachedFrame=null,this.cachedHit=null,this.mechanic="all"}}class v{async isSupported(){return(0,o.f)(this.xrSystem)}async startSession(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.xrSystem)throw Error("WebXR immersive AR is not supported.");let t={optionalFeatures:["dom-overlay","plane-detection"],requiredFeatures:["anchors","hit-test","local-floor"]};e.overlayRoot&&(t.domOverlay={root:e.overlayRoot});let n=await this.xrSystem.requestSession("immersive-ar",t),[r,i]=await Promise.all([n.requestReferenceSpace("viewer"),n.requestReferenceSpace("local-floor")]),o=await n.requestHitTestSource({space:r});if(!o)throw await n.end(),Error("WebXR hit testing is unavailable.");return new h(n,i,o,r)}constructor(e=function(){if("u">typeof navigator)return navigator.xr}()){(0,r._)(this,"xrSystem",void 0),this.xrSystem=e}}},384(e,t,n){n.d(t,{Cm:()=>l,Rl:()=>u,f3:()=>c});var r=n(9081);function i(){}function o(){return"u"<typeof navigator?null:navigator.virtualKeyboard??null}function a(){var e;return Math.round(window.innerHeight||document.documentElement.clientHeight||(null==(e=window.visualViewport)?void 0:e.height)||0)}function s(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}function l(e){let t=(0,r.useRef)(null);(0,r.useEffect)(()=>{e||(t.current=null)},[e]);let n=(0,r.useCallback)(t=>{if(!e||"u"<typeof window)return i;let n=window.visualViewport;return null==n||n.addEventListener("resize",t),null==n||n.addEventListener("scroll",t),window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{null==n||n.removeEventListener("resize",t),null==n||n.removeEventListener("scroll",t),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e]),o=(0,r.useCallback)(()=>{var n;let r,i;return!e||"u"<typeof window?null:(r=window.visualViewport,n={height:Math.ceil(Math.max(window.innerHeight||0,document.documentElement.clientHeight||0,(null==r?void 0:r.height)||0)),width:Math.ceil(Math.max(window.innerWidth||0,document.documentElement.clientWidth||0,(null==r?void 0:r.width)||0))},(i=t.current,i&&i.height===n.height&&i.width===n.width)?i:(t.current=n,n))},[e]),a=(0,r.useSyncExternalStore)(n,o,()=>null);return(0,r.useMemo)(()=>{if(a&&!(a.height<=0)&&!(a.width<=0))return{height:`${a.height}px`,width:`${a.width}px`}},[a])}function u(e){let t=(0,r.useRef)(0),n=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{if(!e)return i;let t=o();if(!t)return i;let n=t.overlaysContent;try{t.overlaysContent=!0}catch{return i}return()=>{try{t.overlaysContent=n}catch{}}},[e]);let l=(0,r.useCallback)(()=>{t.current=Math.max(t.current,a())},[]);(0,r.useEffect)(()=>{if(!e){t.current=0,n.current=null;return}l()},[e,l]);let u=(0,r.useCallback)(n=>{if(!e||"u"<typeof window)return i;let r=()=>{t.current=0,l(),n()},a=()=>{l(),n()},s=window.visualViewport,u=o();return null==s||s.addEventListener("resize",a),null==s||s.addEventListener("scroll",a),null==u||u.addEventListener("geometrychange",a),window.addEventListener("resize",a),window.addEventListener("orientationchange",r),()=>{null==s||s.removeEventListener("resize",a),null==s||s.removeEventListener("scroll",a),null==u||u.removeEventListener("geometrychange",a),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",r)}},[e,l]),c=(0,r.useCallback)(()=>{var r;let i;return!e||"u"<typeof window?null:(r=function(e){let t=o(),n=null==t?void 0:t.boundingRect;if(n&&n.height>0)return{bottom:s(e-n.top),height:e,top:0};let r=window.visualViewport;if(!r)return{bottom:0,height:e,top:0};let i=s(r.offsetTop);return{bottom:s(e-r.height-r.offsetTop),height:e,top:i}}(t.current||a()),(i=n.current,i&&i.bottom===r.bottom&&i.height===r.height&&i.top===r.top)?i:(n.current=r,r))},[e]),d=(0,r.useSyncExternalStore)(u,c,()=>null);return(0,r.useMemo)(()=>{if(d)return{"--ar-catalog-keyboard-bottom":`${d.bottom}px`,height:`${d.height}px`,paddingTop:`${d.top}px`}},[d])}function c(e){let t=(0,r.useCallback)(t=>{if(!e||"u"<typeof window)return i;let n=window.visualViewport,r=o();return null==n||n.addEventListener("resize",t),null==r||r.addEventListener("geometrychange",t),window.addEventListener("resize",t),()=>{null==n||n.removeEventListener("resize",t),null==r||r.removeEventListener("geometrychange",t),window.removeEventListener("resize",t)}},[e]),n=(0,r.useCallback)(()=>{var t;if(!e||"u"<typeof window)return!1;let n=null==(t=o())?void 0:t.boundingRect;if(n)return n.height>0;let r=window.visualViewport;return!!r&&a()-r.height-r.offsetTop>0},[e]);return(0,r.useSyncExternalStore)(t,n,()=>!1)}},7218(e,t,n){n.d(t,{$:()=>l});var r=n(8525),i=n(6218),o=n(6642),a=n(5445);n(9081);let s=(0,a.F)("cursor-pointer inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-xl transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary--hover active:bg-primary--pressed disabled:bg-primary--disabled disabled:opacity-20",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary--hover active:bg-secondary--pressed disabled:bg-secondary--disabled disabled:opacity-20",outline:"border border-button-outline bg-transparent text-foreground hover:border-button-outline-hover active:bg-button-outline-pressed disabled:border-border-dark disabled:opacity-20",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent--pressed",contrast:"bg-contrast text-contrast-foreground hover:bg-contrast--hover active:bg-contrast--pressed disabled:bg-contrast--disabled disabled:opacity-30"},size:{default:"h-9 px-3.5 typo-button-normal [&_svg]:size-5",sm:"h-8 px-3 typo-button-small [&_svg]:size-4",lg:"h-11 px-4 typo-button-big [&_svg]:size-6",icon:"size-9 rounded-full [&_svg]:size-5","icon-sm":"size-8 rounded-full [&_svg]:size-4","icon-lg":"size-11 rounded-full [&_svg]:size-6"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:a,asChild:l=!1,...u}=e,c=l?i.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,o.cn)(s({variant:n,size:a,className:t})),...u})}},6486(e,t,n){n.d(t,{Cf:()=>d,HM:()=>u,L3:()=>h,lG:()=>s,rr:()=>v});var r=n(8525),i=n(3285);n(7218);var o=n(6642),a=n(2838);function s(e){let{...t}=e;return(0,r.jsx)(i.bL,{"data-slot":"dialog",...t})}function l(e){let{...t}=e;return(0,r.jsx)(i.ZL,{"data-slot":"dialog-portal",...t})}function u(e){let{...t}=e;return(0,r.jsx)(i.bm,{"data-slot":"dialog-close",...t})}function c(e){let{className:t,...n}=e;return(0,r.jsx)(i.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...n})}function d(e){let{className:t,children:n,contentInsideOverlay:s=!1,showCloseButton:u=!0,portalContainer:d,...h}=e,v=(0,r.jsxs)(i.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background-containers data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-3xl border-0 p-6 shadow-[var(--shadow-login)] duration-200 outline-none sm:max-w-120 sm:p-10",t),...h,children:[n,u&&(0,r.jsxs)(i.bm,{"data-slot":"dialog-close",className:"focus-visible:ring-ring/30 absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[(0,r.jsx)(a.A,{className:"size-6"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]});return(0,r.jsx)(l,{"data-slot":"dialog-portal",container:d,children:s?(0,r.jsx)(c,{children:v}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c,{}),v]})})}function h(e){let{className:t,...n}=e;return(0,r.jsx)(i.hE,{"data-slot":"dialog-title",className:(0,o.cn)("typo-base-18 text-text-dark",t),...n})}function v(e){let{className:t,...n}=e;return(0,r.jsx)(i.VY,{"data-slot":"dialog-description",className:(0,o.cn)("typo-base-16 text-text-light",t),...n})}n(9081)},6642(e,t,n){n.d(t,{cn:()=>o});var r=n(851),i=n(1137);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,i.QP)((0,r.$)(t))}}}]);