@imagineio/configurator-sdk 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +294 -0
- package/README.md +103 -0
- package/dist/00a41227ff.js +1 -0
- package/dist/00ab3dcbb5.js +1 -0
- package/dist/01a664fa9f.css +51 -0
- package/dist/04746bff9a.js +1 -0
- package/dist/04931f795e.js +1 -0
- package/dist/05973a4da2.js +3 -0
- package/dist/061b81ad81.js +1 -0
- package/dist/066fc9aa40.js +1 -0
- package/dist/09c4973968.js +1 -0
- package/dist/0a35b2c5f4.js +1 -0
- package/dist/0af28430ab.js +1 -0
- package/dist/0e2dedae0d.js +1 -0
- package/dist/0f7c8345a8.js +1 -0
- package/dist/12b8165d6d.js +1 -0
- package/dist/1458417bdb.js +1 -0
- package/dist/14c83bc57a.js +1 -0
- package/dist/15d6bec3b5.css +150 -0
- package/dist/16a399703e.js +1 -0
- package/dist/17876f4322.css +114 -0
- package/dist/1870fc037b.js +1 -0
- package/dist/1a2629800a.css +196 -0
- package/dist/1e243363f6.js +1 -0
- package/dist/1fac915f8b.js +1 -0
- package/dist/1fff100656.js +1 -0
- package/dist/205827c5c8.js +1 -0
- package/dist/20b0104576.js +1 -0
- package/dist/2239b22616.js +1 -0
- package/dist/22bd38ddcf.js +1 -0
- package/dist/239b619005.css +1849 -0
- package/dist/23dc0ccf32.js +1 -0
- package/dist/26155bf68c.js +1 -0
- package/dist/2774152dd2.js +1 -0
- package/dist/27fee7007f.js +1 -0
- package/dist/281cf952fa.js +1 -0
- package/dist/28a9d58274.js +1 -0
- package/dist/28d887bf8a.js +1 -0
- package/dist/28df2aa12f.js +1 -0
- package/dist/297e653adf.js +1 -0
- package/dist/2990ba64d6.js +1 -0
- package/dist/2b6aa27f6d.js +1 -0
- package/dist/2c7c1bcef1.js +1 -0
- package/dist/2cab5c5c23.js +1 -0
- package/dist/2cafe3274b.js +1 -0
- package/dist/2e366d7386.js +1 -0
- package/dist/2f8cc8b292.js +1 -0
- package/dist/30be653f00.css +110 -0
- package/dist/31ea036f5c.js +1 -0
- package/dist/32861ea2b0.js +1 -0
- package/dist/33fa2c8ca2.js +1 -0
- package/dist/35d8449ed8.js +1 -0
- package/dist/3656ffa1b8.js +1 -0
- package/dist/367a479d3a.js +1 -0
- package/dist/371ed78aa2.js +1 -0
- package/dist/37596ace72.js +1 -0
- package/dist/37addc7fb3.js +1 -0
- package/dist/388cadacbd.js +1 -0
- package/dist/39a62ef7b8.js +1 -0
- package/dist/3bbcee0334.js +1 -0
- package/dist/3c916f744f.js +1 -0
- package/dist/3f37665dd1.js +1 -0
- package/dist/3fb3ab6757.js +1 -0
- package/dist/40d6aeb28c.js +1 -0
- package/dist/41ed5985ad.js +1 -0
- package/dist/431a2d8618.js +1 -0
- package/dist/44a229099f.js +1 -0
- package/dist/4741e5d07d.css +263 -0
- package/dist/4910c07ca8.css +411 -0
- package/dist/4a99ddb3fd.js +1 -0
- package/dist/4aa671f9f6.js +1 -0
- package/dist/4b8958aa4c.js +1 -0
- package/dist/4ba4f544b9.js +1 -0
- package/dist/4c24338793.js +1 -0
- package/dist/4d7a0d1897.js +1 -0
- package/dist/4e1db1e3b0.js +1 -0
- package/dist/4e7d0a0d4a.js +1 -0
- package/dist/51b23203e5.css +1447 -0
- package/dist/52436e0169.js +1 -0
- package/dist/54413c1eae.js +1 -0
- package/dist/54f0fcf38b.js +1 -0
- package/dist/55ab45ada4.css +370 -0
- package/dist/561dc3f1ab.js +1 -0
- package/dist/58e6419ba8.js +1 -0
- package/dist/5c9fd9201c.js +1 -0
- package/dist/5d05e8982e.js +1 -0
- package/dist/5d5e8a9c58.js +3 -0
- package/dist/5e4f2349ff.js +1 -0
- package/dist/609e5e5d28.js +1 -0
- package/dist/60d697292c.js +1 -0
- package/dist/61e0c0c9b5.js +1 -0
- package/dist/631a9f7fac.js +1 -0
- package/dist/64e9020b49.js +1 -0
- package/dist/66c461dc2c.js +1 -0
- package/dist/672404d987.js +1 -0
- package/dist/67f6338a4a.js +1 -0
- package/dist/6855e6a3b1.js +1 -0
- package/dist/6b0a81e4f8.js +1 -0
- package/dist/6ba86aa3b8.js +1 -0
- package/dist/6bff84d27e.js +1 -0
- package/dist/6c0a2572dd.js +1 -0
- package/dist/6d238282c1.js +1 -0
- package/dist/6e2595aa36.js +1 -0
- package/dist/6f9ae59d6c.js +1 -0
- package/dist/70dd811d74.js +1 -0
- package/dist/710c1ab641.js +1 -0
- package/dist/7206ce49c6.js +1 -0
- package/dist/7281d77ed9.js +1 -0
- package/dist/73f7d65985.js +1 -0
- package/dist/776277593f.js +1 -0
- package/dist/79a397bb92.js +1 -0
- package/dist/7a748aae59.js +1 -0
- package/dist/7bfb0ecfbb.css +572 -0
- package/dist/7bfcd0a517.js +1 -0
- package/dist/7d9ddaeb47.js +1 -0
- package/dist/7f833bc5af.js +1 -0
- package/dist/811b403d43.js +1 -0
- package/dist/817d930a49.js +1 -0
- package/dist/81802759ca.js +1 -0
- package/dist/81eb433604.js +1 -0
- package/dist/82a8a4bc35.js +1 -0
- package/dist/85af90fade.js +1 -0
- package/dist/872c4302e0.js +1 -0
- package/dist/87bb469216.js +1 -0
- package/dist/87dcc12b65.js +1 -0
- package/dist/87f511c4a8.js +1 -0
- package/dist/88251d6671.js +1 -0
- package/dist/882bc739c8.js +1 -0
- package/dist/89ab18ebc5.js +1 -0
- package/dist/8a22e8944f.css +563 -0
- package/dist/8a3a57c008.js +1 -0
- package/dist/8ade32d067.js +1 -0
- package/dist/8bf6d26ad6.css +233 -0
- package/dist/8c27edda0f.js +1 -0
- package/dist/8db8655f21.js +24 -0
- package/dist/8f60e5059a.js +1 -0
- package/dist/91707f5ca0.css +78 -0
- package/dist/921bf270dd.js +20 -0
- package/dist/9326c23506.js +1 -0
- package/dist/94a0a79c65.js +1 -0
- package/dist/9526094bb7.js +1 -0
- package/dist/9544661159.js +1 -0
- package/dist/95a44ebec2.js +1 -0
- package/dist/970313b92b.js +1 -0
- package/dist/9794652102.js +1 -0
- package/dist/983cbed22c.js +1 -0
- package/dist/9840b9ce12.js +1 -0
- package/dist/98f3644031.js +1 -0
- package/dist/992778075d.css +353 -0
- package/dist/9c6c598569.js +1 -0
- package/dist/9f474b5d1a.js +1 -0
- package/dist/a0f71d0bf5.js +1 -0
- package/dist/a3c983d431.js +1 -0
- package/dist/a3f18e76fe.js +1 -0
- package/dist/a493e9aa8f.js +1 -0
- package/dist/a77b15c0d6.js +1 -0
- package/dist/a811c90bd5.js +1 -0
- package/dist/a822c5e4f2.js +1 -0
- package/dist/aaa0e82d7f.css +69 -0
- package/dist/ab6c80484f.js +1 -0
- package/dist/ae96f219e3.js +1 -0
- package/dist/b11b38869d.css +427 -0
- package/dist/b1349d5a21.js +4 -0
- package/dist/b14379d31b.css +151 -0
- package/dist/b3efb26fd7.js +1 -0
- package/dist/b59b0dde17.js +1 -0
- package/dist/b5c372377f.js +1 -0
- package/dist/b976df09ec.js +1 -0
- package/dist/baeaed46c9.js +1 -0
- package/dist/bb719febc6.js +1 -0
- package/dist/bcd44b4040.js +1 -0
- package/dist/bdc4e4c5b9.css +209 -0
- package/dist/bdec200d00.js +1 -0
- package/dist/be0cfe2236.js +1 -0
- package/dist/be337ddda5.js +1 -0
- package/dist/c12c112c6f.js +1 -0
- package/dist/c2a14a77ae.js +1 -0
- package/dist/c3b8f1973b.js +1 -0
- package/dist/c44d37da7a.js +1 -0
- package/dist/c4790179f1.js +1 -0
- package/dist/c5e990946e.js +1 -0
- package/dist/c71892453b.js +1 -0
- package/dist/c9a1656c62.js +1 -0
- package/dist/ca497b066c.js +1 -0
- package/dist/cdb4a0f7b3.js +3 -0
- package/dist/ce663020e4.js +60 -0
- package/dist/cec035efb1.js +1 -0
- package/dist/d0f9681634.js +1 -0
- package/dist/d118c2e7ba.js +1 -0
- package/dist/d20718159b.js +3 -0
- package/dist/d30f1f506e.js +1 -0
- package/dist/d3cd7f1bc1.js +1 -0
- package/dist/d4378d9afa.js +1 -0
- package/dist/d464da28a5.js +1 -0
- package/dist/d566d3874b.js +1 -0
- package/dist/d617bbb9f5.js +26 -0
- package/dist/d65f32e004.js +1 -0
- package/dist/d6851ea979.js +1 -0
- package/dist/d7c9500ba9.js +1 -0
- package/dist/d803155241.js +1 -0
- package/dist/d903df4e0d.js +1 -0
- package/dist/d94df858ea.js +1 -0
- package/dist/da7b5f450d.js +1 -0
- package/dist/daa11edd01.js +1 -0
- package/dist/db4afd43c9.js +1 -0
- package/dist/dbd5ba1d07.js +1 -0
- package/dist/dc2a1a0e13.js +1 -0
- package/dist/dc812f3e14.js +1 -0
- package/dist/dcbf419090.css +122 -0
- package/dist/dcdba78ddf.js +1 -0
- package/dist/de408c4516.js +1 -0
- package/dist/e1cd279733.js +1 -0
- package/dist/e379e0039b.js +1 -0
- package/dist/e4fe0551fd.js +1 -0
- package/dist/e6eed481cc.css +28 -0
- package/dist/e75f1e5992.js +1 -0
- package/dist/ea8577d22b.js +1 -0
- package/dist/ec4a34fc80.css +313 -0
- package/dist/ed6a54cdf6.js +1 -0
- package/dist/ee242c0099.js +1 -0
- package/dist/ee9b9fd7d1.js +1 -0
- package/dist/f0c3d8a28a.js +1 -0
- package/dist/f11a45a150.js +1 -0
- package/dist/f1b3b2622a.js +1 -0
- package/dist/f7b4a178e3.js +1 -0
- package/dist/f89d7cd931.js +1 -0
- package/dist/f8cb80a93c.js +1 -0
- package/dist/f8fec86f10.js +1 -0
- package/dist/fbd844f2d1.js +1 -0
- package/dist/fe235d7160.js +1 -0
- package/dist/fe58a84b85.js +1 -0
- package/dist/fe68b361ba.js +1 -0
- package/dist/ff5b3d17e2.js +1 -0
- package/dist/styles/globals.css +442 -0
- package/dist/styles/themes.css +532 -0
- package/dist/styles/variables.css +299 -0
- package/package.json +68 -0
- package/static/assets/draco/README.md +32 -0
- package/static/assets/draco/draco_decoder.js +34 -0
- package/static/assets/draco/draco_decoder.wasm +0 -0
- package/static/assets/draco/draco_encoder.js +35 -0
- package/static/assets/draco/draco_encoder.wasm +0 -0
- package/static/assets/draco/draco_encoder_wrapper.js +98 -0
- package/static/assets/draco/draco_wasm_wrapper.js +117 -0
- package/static/favicon.svg +28 -0
- package/static/version.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{devtools as t}from"zustand/middleware";const e=typeof window>"u"?!1:window.__ENABLE_ZUSTAND_DEVTOOLS===!0,s=o=>o,r=e?t:s;export{r as devtools};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as _,jsx as o,jsxs as s}from"react/jsx-runtime";import{memo as x}from"react";import{useLabels as M}from"./28d887bf8a.js";import{useUIRegion as E}from"./9840b9ce12.js";import{DimensionsIcon as L,FullscreenIcon as B,WallIcon as G,ResetIcon as H,UndoIcon as A,RedoIcon as O,MobileFullscreenIcon as V,MobileExitFullscreenIcon as q}from"./c5e990946e.js";import z from"./d0f9681634.js";import{SlotHost as C}from"./73f7d65985.js";import{canUseFullscreen as J}from"./89ab18ebc5.js";const K=x(function({variant:w="desktop"}){const a=w==="mobile",v=E("toolbar"),t=M(),{is3D:r,showDimensions:N,showWalls:d,showFloor:Q,showCeiling:X,showWallGuide:c,isLayoutLoading:u,isFullscreen:b,canUndo:m,canRedo:p,handleToggleView:D,toggleDimensions:F,handleWallsToggle:$,toggleFloor:Y,toggleCeiling:Z,handleFullscreen:k,resetCameraToDefault:y,handleUndo:I,handleRedo:W,sceneCapabilities:R,isOn:e}=z({isMobile:a}),g=R||{},j=g.dimensions!==!1,oo=g.walls!==!1,to=(S,U)=>e(S)&&U,l=a?"mobile-toolbar__btn":"header__toolbar-btn",i=`${l}--active`,T=a?"":"header__toolbar-btn--guide",n=a?"title":"data-tooltip",h=s(_,{children:[e("undo")&&o("button",{"data-part":"toolbar-button","data-button":"undo",className:l,onClick:I,disabled:!m,style:{opacity:m?1:.35},[n]:t("toolbar.undo","Undo"),children:o(A,{})}),e("redo")&&o("button",{"data-part":"toolbar-button","data-button":"redo",className:l,onClick:W,disabled:!p,style:{opacity:p?1:.35},[n]:t("toolbar.redo","Redo"),children:o(O,{})})]}),f=s(_,{children:[e("toggle2d3d")&&o("button",{"data-part":"toolbar-button","data-button":"toggle2d3d",className:`${l} ${r?"":i}`,onClick:D,[n]:r?t("toolbar.to2d","Switch to 2D"):t("toolbar.to3d","Switch to 3D"),children:o("span",{className:a?"mobile-toolbar__label":"header__toolbar-label",children:r?"2D":"3D"})}),e("dimensions")&&o("button",{"data-part":"toolbar-button","data-button":"dimensions",className:`${l} ${N?i:""}`,onClick:F,[n]:t("toolbar.dimensions","Dimensions"),children:o(L,{})}),e("walls")&&o("button",{"data-part":"toolbar-button","data-button":"walls",className:`${l} ${d?i:""}${!a&&c?` ${T}`:""}`,onClick:$,[n]:d?t("toolbar.hideWalls","Hide Walls"):t("toolbar.showWalls","Show Walls"),...!a&&c?{"data-guide":t("toolbar.wallsGuide","Click here to show walls again")}:{},children:o(G,{})}),e("fullscreen")&&J()&&o("button",{"data-part":"toolbar-button","data-button":"fullscreen",className:`${l} ${b?i:""}`,onClick:k,[n]:b?t("toolbar.exitFullscreen","Exit Fullscreen"):t("toolbar.fullscreen","Fullscreen"),children:a?b?o(q,{}):o(V,{}):o(B,{})}),e("resetCamera")&&o("button",{"data-part":"toolbar-button","data-button":"resetCamera",className:l,onClick:y,[n]:t("toolbar.resetCamera","Reset Camera"),children:o(H,{})})]});return a?o("div",{className:"mobile-toolbar",style:u?{opacity:.5,pointerEvents:"none"}:void 0,children:s("div",{className:"mobile-toolbar__buttons",children:[o("div",{className:"mobile-toolbar__left",children:h}),s("div",{className:"mobile-toolbar__right",children:[f,o(C,{name:"toolbar",ctx:{isMobile:!0}})]})]})}):v?s("div",{className:"header__toolbar",style:u?{opacity:.5,pointerEvents:"none"}:void 0,children:[f,h,o(C,{name:"toolbar",ctx:{isMobile:!1}})]}):null});var bo=K;export{bo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as h}from"react/jsx-runtime";import{copilotAuthHeaders as _}from"./431a2d8618.js";import{useState as w,useRef as y,useEffect as u,lazy as k,Suspense as m}from"react";import{useLabels as I}from"./28d887bf8a.js";import{CopilotChat as g}from"@copilotkit/react-ui";import{useCopilotAvailable as x}from"./672404d987.js";import{getCopilotWarmupUrl as N}from"./fe58a84b85.js";import b from"./94a0a79c65.js";import A from"./88251d6671.js";import{resolveComponent as B,useComponentRegistry as E}from"./882bc739c8.js";import"./992778075d.css";import{useAiChatEntitled as H}from"./6b0a81e4f8.js";const v=k(()=>import("./27fee7007f.js"));function T(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor",width:"14",height:"14",children:e("path",{d:"M8 0l1.5 4.5L14 6l-4.5 1.5L8 12l-1.5-4.5L2 6l4.5-1.5L8 0z"})})}function W(){return e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"12",height:"12",children:e("path",{d:"M6 9l6 6 6-6"})})}let C=!1;function z({alwaysExpanded:r=!1}){const i=I();E();const f=B("LoadingScreen",A),[s,L]=w(!1),t=y(null),S=r||s,n=x();u(()=>{!n||C||(C=!0,fetch(N(),{method:"POST",headers:_()}).catch(()=>{}))},[n]),u(()=>{if(!t.current)return;const o=new MutationObserver(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)});return o.observe(t.current,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>o.disconnect()},[S]),u(()=>{if(!r||!t.current)return;const o=t.current,a=new IntersectionObserver(c=>{if(c[0].isIntersecting){const l=o.querySelector("textarea");if(l){l.style.height="auto";const p=l.scrollHeight;p>0&&(l.style.height=`${p}px`)}}},{threshold:.1});return a.observe(o),()=>a.disconnect()},[r]),u(()=>{if(!r||!t.current)return;const o=t.current,a=c=>{c.target.tagName==="TEXTAREA"&&setTimeout(()=>{c.target.scrollIntoView({behavior:"smooth",block:"center"})},350)};return o.addEventListener("focusin",a),()=>o.removeEventListener("focusin",a)},[r]);const d={title:"",initial:"Hi! \u{1F44B} How can I assist you today? You can ask me to change layouts, finishes, add-on products, and more."};return r?e("div",{className:"chat-bar chat-bar--embedded",children:e("div",{ref:t,className:"chat-bar__content",children:n?e(b,{children:e(g,{labels:d})}):e(m,{fallback:e(f,{compact:!0,message:i("chat.loading","Loading...")}),children:e(v,{})})})}):h("div",{className:"chat-bar",children:[h("div",{className:"chat-bar__label",onClick:()=>L(!s),children:[e(T,{}),h("span",{style:{fontWeight:"500",fontSize:"14px",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap",minWidth:"0",overflow:"visible"},children:["CHAT",!n&&h("span",{style:{fontSize:"12px",fontWeight:"500",whiteSpace:"nowrap",flexShrink:0},children:["(",e("span",{style:{color:"#ff6b6b"},children:i("chat.notConnected","Not Connected")}),")"]})]}),e("span",{className:`chat-bar__toggle ${s?"chat-bar__toggle--open":""}`,children:e(W,{})})]}),s&&e("div",{ref:t,className:"chat-bar__content",children:n?e(b,{children:e(g,{labels:d})}):e(m,{fallback:e(f,{compact:!0,message:i("chat.loading","Loading...")}),children:e(v,{})})})]})}function R(r){return H()?e(z,{...r}):null}var G=R;export{G as default};
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
@layer sdk-base, vendor, sdk;
|
|
2
|
+
@layer sdk {
|
|
3
|
+
/* ============================================================
|
|
4
|
+
SaveProjectModal
|
|
5
|
+
------------------------------------------------------------
|
|
6
|
+
Visual language matches GeneratedAssetsModal — warm gold
|
|
7
|
+
accent, numbered sections, generous spacing, refined inputs.
|
|
8
|
+
All layout stays inside the base Modal shell (`.modal` /
|
|
9
|
+
`.modal__content`); this file only styles what lives inside
|
|
10
|
+
`.modal__content` for the save flow.
|
|
11
|
+
============================================================ */
|
|
12
|
+
|
|
13
|
+
.spm {
|
|
14
|
+
--spm-accent: var(--color-brand-accent, #D4A853);
|
|
15
|
+
--spm-accent-light: var(--bg-muted, #FBF5E8);
|
|
16
|
+
--spm-text: var(--text-primary, #1a1a1a);
|
|
17
|
+
--spm-text-muted: var(--text-secondary, #6b6b6b);
|
|
18
|
+
--spm-text-faint: var(--text-tertiary, #999999);
|
|
19
|
+
--spm-border: var(--border-default, #e5e5e5);
|
|
20
|
+
--spm-bg: var(--bg-primary, #ffffff);
|
|
21
|
+
--spm-bg-alt: var(--bg-muted, #fafafa);
|
|
22
|
+
--spm-radius: 10px;
|
|
23
|
+
--spm-radius-sm: 6px;
|
|
24
|
+
--spm-gap: 20px;
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 28px;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
align-items: stretch;
|
|
30
|
+
color: var(--spm-text);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.spm__pane {
|
|
34
|
+
flex: 1 1 380px;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 20px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ── Numbered section header ─────────────────────────────── */
|
|
42
|
+
.spm-section__header {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: 6px;
|
|
46
|
+
padding-bottom: 4px;
|
|
47
|
+
border-bottom: 1px solid var(--spm-border);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.spm-section__num {
|
|
51
|
+
font-size: 11px;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
letter-spacing: 0.12em;
|
|
54
|
+
color: var(--spm-accent);
|
|
55
|
+
text-transform: uppercase;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.spm-section__title {
|
|
59
|
+
font-size: 20px;
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
margin: 0;
|
|
62
|
+
color: var(--spm-text);
|
|
63
|
+
letter-spacing: -0.01em;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.spm-section__desc {
|
|
67
|
+
font-size: 13px;
|
|
68
|
+
color: var(--spm-text-muted);
|
|
69
|
+
margin: 0;
|
|
70
|
+
line-height: 1.5;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ── Preview pane ────────────────────────────────────────── */
|
|
74
|
+
.spm-preview {
|
|
75
|
+
flex: 1;
|
|
76
|
+
min-height: 320px;
|
|
77
|
+
max-height: 66vh;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
padding: 4px;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: 14px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.spm-preview__card {
|
|
86
|
+
margin: 0;
|
|
87
|
+
/* Keep the natural 4:3 height — .spm-preview is a max-height flex column, and
|
|
88
|
+
without this the cards flex-SHRINK to fit, squashing each 4:3 image into a
|
|
89
|
+
short strip that overflow:hidden then clips (product ends up cropped at the
|
|
90
|
+
bottom). flex-shrink:0 makes the column SCROLL instead of squishing. */
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
border: 1px solid var(--spm-border);
|
|
93
|
+
border-radius: var(--spm-radius);
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
background: var(--spm-bg-alt);
|
|
96
|
+
transition: box-shadow 0.15s ease;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.spm-preview__card:hover {
|
|
100
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.spm-preview__caption {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
padding: 10px 14px;
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
letter-spacing: 0.02em;
|
|
111
|
+
color: var(--spm-text);
|
|
112
|
+
background: var(--spm-bg);
|
|
113
|
+
border-bottom: 1px solid var(--spm-border);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.spm-preview__caption-tag {
|
|
117
|
+
font-size: 10px;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
color: var(--spm-accent);
|
|
120
|
+
background: var(--spm-accent-light);
|
|
121
|
+
padding: 2px 8px;
|
|
122
|
+
border-radius: 999px;
|
|
123
|
+
letter-spacing: 0.06em;
|
|
124
|
+
text-transform: uppercase;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.spm-preview__img {
|
|
128
|
+
width: 100%;
|
|
129
|
+
display: block;
|
|
130
|
+
aspect-ratio: 4 / 3;
|
|
131
|
+
object-fit: cover;
|
|
132
|
+
background: var(--spm-bg);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.spm-preview__empty {
|
|
136
|
+
flex: 1;
|
|
137
|
+
min-height: 240px;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
color: var(--spm-text-muted);
|
|
142
|
+
font-size: 13px;
|
|
143
|
+
border: 1px dashed var(--spm-border);
|
|
144
|
+
border-radius: var(--spm-radius);
|
|
145
|
+
background: var(--spm-bg-alt);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ── Form pane ───────────────────────────────────────────── */
|
|
149
|
+
.spm-form {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
gap: 24px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.spm-fieldset {
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
gap: 14px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.spm-field {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: 6px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.spm-field__label {
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
color: var(--spm-text);
|
|
171
|
+
letter-spacing: 0.02em;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.spm-field__label--required::after {
|
|
175
|
+
content: '*';
|
|
176
|
+
color: var(--spm-accent);
|
|
177
|
+
margin-left: 4px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.spm-field__hint {
|
|
181
|
+
font-size: 11px;
|
|
182
|
+
color: var(--spm-text-faint);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.spm-input,
|
|
186
|
+
.spm-select,
|
|
187
|
+
.spm-textarea {
|
|
188
|
+
padding: 10px 12px;
|
|
189
|
+
border: 1px solid var(--spm-border);
|
|
190
|
+
border-radius: var(--spm-radius-sm);
|
|
191
|
+
background: var(--spm-bg);
|
|
192
|
+
color: var(--spm-text);
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
width: 100%;
|
|
195
|
+
box-sizing: border-box;
|
|
196
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
197
|
+
font-family: inherit;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.spm-input:hover,
|
|
201
|
+
.spm-select:hover,
|
|
202
|
+
.spm-textarea:hover {
|
|
203
|
+
border-color: var(--border-dark, #cccccc);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.spm-input:focus,
|
|
207
|
+
.spm-select:focus,
|
|
208
|
+
.spm-textarea:focus {
|
|
209
|
+
outline: none;
|
|
210
|
+
border-color: var(--spm-accent);
|
|
211
|
+
box-shadow: 0 0 0 3px rgba(var(--color-brand-primary-rgb, 212, 168, 83), 0.15);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.spm-input::placeholder,
|
|
215
|
+
.spm-textarea::placeholder {
|
|
216
|
+
color: var(--spm-text-faint);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.spm-textarea {
|
|
220
|
+
resize: vertical;
|
|
221
|
+
min-height: 60px;
|
|
222
|
+
line-height: 1.5;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.spm-row {
|
|
226
|
+
display: flex;
|
|
227
|
+
gap: 14px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.spm-row > .spm-field {
|
|
231
|
+
flex: 1;
|
|
232
|
+
min-width: 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.spm-phone {
|
|
236
|
+
display: flex;
|
|
237
|
+
gap: 8px;
|
|
238
|
+
align-items: stretch;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.spm-phone__code {
|
|
242
|
+
flex: 0 0 auto;
|
|
243
|
+
width: auto;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.spm-phone__number {
|
|
247
|
+
flex: 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* ── Error banner ────────────────────────────────────────── */
|
|
251
|
+
.spm-error {
|
|
252
|
+
padding: 10px 12px;
|
|
253
|
+
background: #fef2f2;
|
|
254
|
+
border: 1px solid #fecaca;
|
|
255
|
+
border-radius: var(--spm-radius-sm);
|
|
256
|
+
color: #b91c1c;
|
|
257
|
+
font-size: 13px;
|
|
258
|
+
margin: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* ── Actions ─────────────────────────────────────────────── */
|
|
262
|
+
.spm-actions {
|
|
263
|
+
display: flex;
|
|
264
|
+
gap: 12px;
|
|
265
|
+
justify-content: flex-end;
|
|
266
|
+
align-items: center;
|
|
267
|
+
padding-top: 8px;
|
|
268
|
+
border-top: 1px solid var(--spm-border);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.spm-actions__status {
|
|
272
|
+
margin-right: auto;
|
|
273
|
+
font-size: 13px;
|
|
274
|
+
color: var(--spm-text-muted);
|
|
275
|
+
display: flex;
|
|
276
|
+
align-items: center;
|
|
277
|
+
gap: 8px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.spm-actions__spinner {
|
|
281
|
+
width: 14px;
|
|
282
|
+
height: 14px;
|
|
283
|
+
border: 2px solid var(--spm-border);
|
|
284
|
+
border-top-color: var(--spm-accent);
|
|
285
|
+
border-radius: 50%;
|
|
286
|
+
animation: spm-spin 0.8s linear infinite;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@keyframes spm-spin {
|
|
290
|
+
to { transform: rotate(360deg); }
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* ── Submitted (success) state ───────────────────────────── */
|
|
294
|
+
.spm-success {
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
gap: 20px;
|
|
298
|
+
padding: 8px 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.spm-success__hero {
|
|
302
|
+
display: flex;
|
|
303
|
+
gap: 16px;
|
|
304
|
+
align-items: flex-start;
|
|
305
|
+
padding: 20px;
|
|
306
|
+
background: var(--spm-accent-light);
|
|
307
|
+
border-radius: var(--spm-radius);
|
|
308
|
+
border: 1px solid rgba(var(--color-brand-primary-rgb, 212, 168, 83), 0.3);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.spm-success__check {
|
|
312
|
+
flex: 0 0 auto;
|
|
313
|
+
width: 40px;
|
|
314
|
+
height: 40px;
|
|
315
|
+
border-radius: 50%;
|
|
316
|
+
background: var(--spm-accent);
|
|
317
|
+
color: white;
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
justify-content: center;
|
|
321
|
+
font-size: 22px;
|
|
322
|
+
line-height: 1;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.spm-success__text h3 {
|
|
326
|
+
margin: 0 0 6px;
|
|
327
|
+
font-size: 18px;
|
|
328
|
+
font-weight: 700;
|
|
329
|
+
color: var(--spm-text);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.spm-success__text p {
|
|
333
|
+
margin: 0;
|
|
334
|
+
font-size: 13px;
|
|
335
|
+
color: var(--spm-text-muted);
|
|
336
|
+
line-height: 1.55;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.spm-share {
|
|
340
|
+
display: flex;
|
|
341
|
+
gap: 8px;
|
|
342
|
+
align-items: stretch;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.spm-share__input {
|
|
346
|
+
flex: 1;
|
|
347
|
+
font-family: 'SF Mono', Monaco, Consolas, monospace;
|
|
348
|
+
font-size: 12px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.spm-success__footer {
|
|
352
|
+
display: flex;
|
|
353
|
+
gap: 10px;
|
|
354
|
+
justify-content: space-between;
|
|
355
|
+
padding-top: 16px;
|
|
356
|
+
border-top: 1px solid var(--spm-border);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* ── Responsive ──────────────────────────────────────────── */
|
|
360
|
+
@media (max-width: 720px) {
|
|
361
|
+
.spm {
|
|
362
|
+
gap: 20px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.spm-row {
|
|
366
|
+
flex-direction: column;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let n=0,t=0;function e(){n+=1}function o(){n=Math.max(0,n-1),n===0&&(t=Date.now())}function i(){return n>0}function r(){return t?Date.now()-t:1/0}function c(){n=0,t=0}export{c as _resetUserAction,e as beginUserAction,o as endUserAction,i as isUserActionOpen,r as msSinceUserAction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPlacementStrategy as h}from"./281cf952fa.js";function T(r,o={}){const n=h();if(!n||typeof n.computeTargets!="function")return[];try{const e=n.computeTargets(Array.isArray(r)?r:[],o);return Array.isArray(e)?e.filter(t=>t&&Array.isArray(t.position)).map((t,i)=>({id:String(t.id??`target-${i}`),position:t.position,rotation:Array.isArray(t.rotation)?t.rotation:[0,0,0],footprint:t.footprint&&Number.isFinite(Number(t.footprint.width))?{width:Number(t.footprint.width),depth:Number(t.footprint.depth??t.footprint.width)}:null,anchor:t.anchor??null,valid:t.valid!==!1,reason:t.reason??null,meta:t.meta??null})):[]}catch{return[]}}function x(r,o={}){if(!r||r.valid===!1)return null;const n=h();if(n&&typeof n.resolveTarget=="function")try{return n.resolveTarget(r,o)||null}catch{}const e=o.candidate||{};return{type:"product.add",productId:e.productId??null,variantId:e.variantId??e.productId??null,anchor:r.anchor??null,transform:{position:r.position,rotation:r.rotation},meta:r.meta??null}}function A(r,o,n){const e=Number(r?.sequence);if(Number.isFinite(e))return e;const t=r?.anchor??o?.anchor??null;if(!t)return;const i=Array.isArray(n)?n:[],s=a=>{const g=Number(a?.sequence);return Number.isFinite(g)?g:void 0},c=String(t.edge??"after").toLowerCase(),p=c==="before"||c==="start"||c==="left",m=t.placementId;if(m==null)return p?s(i[0]):void 0;const y=String(m),f=i.findIndex(a=>String(a?.id)===y||String(a?.instanceId)===y);if(!(f<0))return s(p?i[f]:i[f+1])}let u=null,b=0;const l=new Set;function d(){b+=1;for(const r of l)try{r()}catch{}}function I(r){return typeof r!="function"?()=>{}:(u=r,d(),()=>{u===r&&(u=null,d())})}function N(){return u}function S(r){return l.add(r),()=>{l.delete(r)}}function w(){return b}function _(){u=null,d()}export{_ as _resetTargets,T as computeTargets,w as getTargetsVersion,I as registerTargetRenderer,A as resolveInsertSequence,x as resolveTarget,N as resolveTargetRenderer,S as subscribeTargets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const I=new Set(["theme2","theme3"]),C=new Set(["default","theme1"]),V=new Set(["theme2","theme3","theme4","theme5"]);import{markHostTheme as J,isHostThemeApplied as Q,_resetHostTheme as X}from"./40d6aeb28c.js";import{validateTheme as Y,checkThemeContrast as Z,applyCustomCss as P,applyFontUrl as W}from"./b1349d5a21.js";import{setThemeLabels as tt,setLocale as rt}from"./28d887bf8a.js";import et from"./79a397bb92.js";import j from"./be337ddda5.js";const N={none:"none",sm:"0 1px 2px rgba(0,0,0,0.08)",md:"0 4px 12px rgba(0,0,0,0.12)"},ot=new Set(["Inter","Playfair Display","Nunito","Poppins","Roboto","Lato","Montserrat","Merriweather","Open Sans","Raleway","Work Sans"]),nt=["--color-primary","--color-primary-dark","--color-secondary","--color-accent","--color-brand-primary","--color-brand-primary-dark","--color-brand-primary-light","--color-brand-primary-rgb","--color-brand-accent","--color-background","--color-foreground","--color-surface","--color-border","--sidebar-width","--sidebar-content-padding","--radius-xl","--thumbnail-border-radius","--btn-height-md","--thumbnail-gap","--font-size-md","--sidebar-section-title-size","--font-size-2xl","--sidebar-section-title-weight","--font-family-base","--font-family-heading","--btn-border-radius","--btn-shadow","--layout-density","--brand-logo-url","--bg-primary","--bg-secondary","--bg-tertiary","--bg-muted","--text-primary","--text-primary-rgb","--text-secondary","--text-tertiary","--border-default","--border-light","--border-dark"];function T(t){return t?String(t).trim().toLowerCase():""}function it(t){return I.has(T(t))?"dark":"light"}function U(t){if(t==null)return null;if(typeof t=="string")return t.trim().toLowerCase()||null;if(typeof t=="object"){const r=t.layout??t.layoutKey??t.uiTemplate??t.ui_template??null;if(r){const o=String(r).trim().toLowerCase().replace(/[\s_-]+/g,"");if(o)return o}const e=t.name??t.themeName??t.key??null;if(e){const o=String(e).trim().toLowerCase().replace(/[\s_-]+/g,"");if(o)return o}if(t.id!=null)return`theme${t.id}`}return null}function st(t){J(),O(t),at(t)}function at(t){let r;if(t==null||t===""||typeof t=="string"&&C.has(T(t)))r={systemTheme:null,systemThemeRecord:null};else if(typeof t=="string")r={systemTheme:T(t).replace(/[\s_-]+/g,""),systemThemeRecord:null};else if(typeof t=="object")r={systemTheme:U(t),systemThemeRecord:t};else return;try{const e=j.getState();if(e.systemTheme===r.systemTheme&&e.systemThemeRecord===r.systemThemeRecord)return;j.setState(r)}catch{}}async function bt(t){if(t==null||t==="")return null;let r=null;try{r=await et.fetchTheme(t)}catch{return null}return!r||typeof r!="object"?null:(st(r),r)}function gt(t,{force:r=!1}={}){Q()&&!r||O(t)}function ht(){X()}function O(t){const r=typeof document<"u"?document.documentElement:null;if(r){if(t&&typeof t=="object"){const{errors:e,warnings:o}=Y(t),a=Z(t);if(!a.pass){const y=a.results.filter(u=>!u.pass).map(u=>`${u.pair} = ${u.ratio??"?"}:1 (needs ${u.min}:1)`).join(", ")}tt(t.labels),t.locale&&rt(t.locale)}if(t==null||t===""||typeof t=="string"&&C.has(T(t))){z(r);return}if(typeof t=="string"){z(r);const e=T(t).replace(/[\s_-]+/g,"");e&&!C.has(e)&&(r.setAttribute("data-theme",e),r.setAttribute("data-theme-preset",e),r.setAttribute("data-theme-mode",it(e)));return}if(typeof t=="object"){z(r);const e=t.colorTokens??t.color_tokens??{},o=t.typographyTokens??t.typography_tokens??{},a=t.layoutDensity??t.layout_density,y=t.logoUrl??t.logo_url,u=t.faviconUrl??t.favicon_url,b=t.config||{},i=b.colors||{},k=U(t);k&&r.setAttribute("data-theme",k),t.id!=null&&r.setAttribute("data-theme-id",String(t.id));const $=String(t.name??t.themeName??t.key??"").trim().toLowerCase().replace(/[\s_-]+/g,"");V.has($)&&(r.setAttribute("data-theme-preset",$),I.has($)&&r.setAttribute("data-theme-mode","dark"));const l=(S,D)=>h(S)?S.trim():h(D)?D.trim():null,f=l(i.primary,e.primary);s(r,"--color-primary",f),h(f)&&n(r,"--color-primary-dark",c(f,-.15));const F=l(i.accent,e.accent);if(s(r,"--color-accent",F),h(f)){n(r,"--color-brand-primary",f),n(r,"--color-brand-primary-dark",c(f,-.15)),n(r,"--color-brand-primary-light",c(f,.3));const S=v(f);S&&n(r,"--color-brand-primary-rgb",S),n(r,"--color-brand-accent",h(F)?F.trim():f)}s(r,"--color-background",l(i.background,e.background)),s(r,"--color-surface",l(i.surface,e.surface)),s(r,"--color-foreground",l(i.text,e.foreground)),s(r,"--color-secondary",l(i.textMuted,e.secondary)),s(r,"--color-border",l(i.border,e.border));const _=l(i.surface,e.surface),w=l(i.background,e.background),x=l(i.text,e.foreground),H=l(i.textMuted,e.secondary),B=l(i.border,e.border);s(r,"--bg-primary",_??w),s(r,"--bg-secondary",w??c(_,-.04)),s(r,"--bg-tertiary",c(w??_,-.08)),s(r,"--bg-muted",c(w??_,-.02)),s(r,"--text-primary",x);const L=v(x);L&&n(r,"--text-primary-rgb",L),s(r,"--text-secondary",H??c(x,.45)),s(r,"--text-tertiary",H??c(x,.6));const A=B??c(x,.86);s(r,"--border-default",A),s(r,"--border-light",c(A,.35)),s(r,"--border-dark",c(A,-.2));const M=l(i.background,e.background),K=t.mode??e.mode??(M&&ut(M)?"dark":"light");r.setAttribute("data-theme-mode",K);const g=b.sizing||{};n(r,"--sidebar-width",d(g.cardWidth)),n(r,"--sidebar-content-padding",d(g.cardPadding)),n(r,"--radius-xl",d(g.radius)),n(r,"--thumbnail-border-radius",d(g.radius)),n(r,"--btn-height-md",d(g.controlHeight)),n(r,"--thumbnail-gap",d(g.gap));const p=b.typography||{};n(r,"--font-size-md",d(p.baseSize)),n(r,"--sidebar-section-title-size",d(p.labelSize)),n(r,"--font-size-2xl",d(p.headingSize)),n(r,"--sidebar-section-title-weight",lt(p.fontWeight));const q=E(p.fontFamily)??E(o.bodyFont),G=E(o.headingFont)??E(p.fontFamily);n(r,"--font-family-base",q),n(r,"--font-family-heading",G),R(p.fontFamily),R(o.headingFont),R(o.bodyFont);const m=b.buttons||{};n(r,"--btn-border-radius",d(m.buttonRadius)),m.shadow!=null&&N[m.shadow]!=null&&n(r,"--btn-shadow",N[m.shadow]),(m.buttonStyle==="filled"||m.buttonStyle==="outline")&&r.setAttribute("data-button-style",m.buttonStyle),a&&n(r,"--layout-density",String(a)),y&&n(r,"--brand-logo-url",`url("${y}")`),u&&ct(u),W(t.fontUrl),P(t.customCss,{nonce:t.cspNonce})}}}const d=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:null,lt=t=>typeof t=="number"&&Number.isFinite(t)?String(t):null,h=t=>typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t.trim());function n(t,r,e){e!=null&&e!==""&&t.style.setProperty(r,e)}function s(t,r,e){h(e)&&t.style.setProperty(r,e.trim())}function E(t){if(!t||typeof t!="string")return null;const r=t.trim();return r?r.includes(",")?r:`'${r}', system-ui, sans-serif`:null}function R(t){if(typeof document>"u"||!t||typeof t!="string")return;const r=t.replace(/['"]/g,"").split(",")[0].trim();if(!ot.has(r))return;const e=`gf-${r.replace(/\s+/g,"-").toLowerCase()}`;if(document.getElementById(e))return;const o=document.createElement("link");o.id=e,o.rel="stylesheet",o.href=`https://fonts.googleapis.com/css2?family=${r.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`,document.head.appendChild(o)}function z(t){P(null),W(null),["data-theme","data-theme-mode","data-theme-preset","data-theme-id","data-button-style"].forEach(o=>t.removeAttribute(o)),nt.forEach(o=>t.style.removeProperty(o));const r=t.style,e=[];for(let o=0;o<r.length;o++){const a=r[o];(a.startsWith("--color-")||a.startsWith("--font-"))&&e.push(a)}e.forEach(o=>r.removeProperty(o))}function ct(t){if(typeof document>"u")return;let r=document.querySelector('link[rel="icon"]');r||(r=document.createElement("link"),r.rel="icon",document.head.appendChild(r)),r.href=t}function c(t,r){const e=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!e)return null;const o=parseInt(e[1],16),a=i=>{const k=Math.round(i+(r<0?i*r:(255-i)*r));return Math.max(0,Math.min(255,k))},y=a(o>>16&255),u=a(o>>8&255),b=a(o&255);return`#${((1<<24)+(y<<16)+(u<<8)+b).toString(16).slice(1)}`}function v(t){const r=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!r)return null;const e=parseInt(r[1],16);return`${e>>16&255}, ${e>>8&255}, ${e&255}`}function ut(t){const r=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!r)return!1;const e=parseInt(r[1],16),o=e>>16&255,a=e>>8&255,y=e&255;return .299*o+.587*a+.114*y<128}export{ht as _resetThemeOwnership,gt as applySystemTheme,st as applyTheme,bt as applyThemeById,T as normalizeThemeId,U as themeLayoutKey,it as themeMode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c,{ASSET_IDS as w}from"./3f37665dd1.js";import{runCommand as h,hasCommand as E,COMMANDS as d}from"./d6851ea979.js";import{getR3FState as v}from"./e1cd279733.js";import{generateARModel as T}from"./f7b4a178e3.js";const o=w,m=new Set(["complete","error","blocked"]),b=300*1e3,A=()=>{try{return c.getState().assets||[]}catch{return[]}},u=t=>A().filter(e=>t.includes(e.id)).map(e=>({id:e.id,type:e.type,label:e.label,status:e.status,progress:e.progress??0,url:e.url??null,error:e.error??null}));function f(t,{timeoutMs:e=b,onProgress:s}={}){const r=Array.isArray(t)?t:[t],n=()=>{const l=u(r);return l.length===r.length&&l.every(i=>m.has(i.status))&&!c.getState().isGenerating};return n()?Promise.resolve(u(r)):new Promise((l,a)=>{let i=()=>{};const y=setTimeout(()=>{i(),a(new Error(`[sdk] asset generation timed out after ${Math.round(e/1e3)}s: ${u(r).filter(p=>!m.has(p.status)).map(p=>p.id).join(", ")}`))},e);i=c.subscribe(()=>{try{s?.(u(r))}catch{}n()&&(clearTimeout(y),i(),l(u(r)))})})}function g(t,e){const s=t.filter(r=>r.status!=="complete"||!r.url);return t.filter(r=>r.status==="complete"&&r.url).map(r=>r.url)}function S(t,{modal:e=!1}={}){try{if(c.getState().isGenerating)return!0}catch{}return E(d.GENERATE_ASSETS)?(h(d.GENERATE_ASSETS,{families:t,silent:!e}),!0):!1}async function _(t={}){return S(["silo"],t),g(await f(o.silo,t),"silo")}async function x(t={}){return S(["lifestyle"],t),g(await f(o.lifestyle,t),"lifestyle")}async function R(t={}){const e=c.getState(),s=u(o.ar)[0];if(!s||s.status!=="generating"&&s.status!=="complete"){const r=v()?.scene??null;if(!r)return e.updateAsset?.("ar-viewer",{status:"error",progress:0,error:"No scene mounted \u2014 AR exports the live scene."}),null;e.updateAsset?.("ar-viewer",{status:"generating",progress:0,error:null}),T({scene:r,onProgress:n=>e.updateAsset?.("ar-viewer",{progress:n}),onComplete:n=>e.updateAsset?.("ar-viewer",{status:"complete",progress:100,url:n}),onError:n=>e.updateAsset?.("ar-viewer",{status:"error",progress:0,error:n||"AR generation failed"})}).catch(n=>e.updateAsset?.("ar-viewer",{status:"error",progress:0,error:n?.message||"AR generation failed"}))}return g(await f(o.ar,t),"ar")[0]??null}async function P(t={}){const e=c.getState(),s=u(o.pdf)[0];if(!s||s.status!=="generating"&&s.status!=="complete")try{e._generateBomPdf?.("bom-pdf")}catch{e.updateAsset?.("bom-pdf",{status:"error",progress:0,error:"BOM generation unavailable"})}return g(await f(o.pdf,t),"bom pdf")[0]??null}async function C(t={}){const[e,s,r,n]=await Promise.allSettled([_(t),x(t),R(t),P(t)]),l=(a,i)=>a.status==="fulfilled"?a.value:i;return{silo:l(e,[]),lifestyle:l(s,[]),ar:l(r,null),pdf:l(n,null),timedOut:[e,s,r,n].filter(a=>a.status==="rejected").map(a=>String(a.reason?.message??a.reason))}}function I(){const t=A(),e=s=>u(s);return{isGenerating:t.some(s=>s.status==="generating"),progress:t.length?Math.round(t.reduce((s,r)=>s+(r.progress??0),0)/t.length):0,silo:e(o.silo),lifestyle:e(o.lifestyle),ar:e(o.ar)[0]??null,pdf:e(o.pdf)[0]??null,quota:c.getState().aiQuota??null}}export{o as ASSET_GROUPS,C as generateAll,R as generateAr,P as generateBomPdf,x as generateLifestyle,_ as generateSilo,I as generationStatus,f as waitForAssets};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Fragment as me,jsx as e,jsxs as l}from"react/jsx-runtime";import{useEffect as J,useRef as T,useState as o}from"react";import{useLabels as X}from"./28d887bf8a.js";import y from"./8f60e5059a.js";import{captureDesignViews as q,buildDesignPdf as Z,saveProject as Q,generateArForCurrentScene as ee}from"./a77b15c0d6.js";import se from"./d566d3874b.js";import p from"./fe68b361ba.js";import{EmailIcon as ae,CopyIcon as le,CheckIcon as L}from"./c5e990946e.js";import"./55ab45ada4.css";function te(a){const d=String(a?.message??""),f=d.indexOf("{");if(f!==-1)try{const m=JSON.parse(d.slice(f)),r=m?.detail??(typeof m=="object"&&m!==null?Object.values(m).flat().find(t=>typeof t=="string"):null);if(typeof r=="string"&&r.trim())return r.trim()}catch{}const b=d.match(/failed:\s*(\d{3}\s+[^—]+)/);return b?`Could not submit your design (${b[1].trim()}).`:"Could not submit your design. Please try again."}const V={firstName:"",lastName:"",email:"",countryCode:"+1",phone:"",projectName:"",company:"",address:"",note:""},ne=[{code:"+1",label:"+1 US/CA"},{code:"+44",label:"+44 UK"},{code:"+91",label:"+91 IN"},{code:"+61",label:"+61 AU"},{code:"+64",label:"+64 NZ"},{code:"+49",label:"+49 DE"},{code:"+33",label:"+33 FR"},{code:"+39",label:"+39 IT"},{code:"+34",label:"+34 ES"},{code:"+31",label:"+31 NL"},{code:"+46",label:"+46 SE"},{code:"+47",label:"+47 NO"},{code:"+45",label:"+45 DK"},{code:"+41",label:"+41 CH"},{code:"+81",label:"+81 JP"},{code:"+82",label:"+82 KR"},{code:"+86",label:"+86 CN"},{code:"+65",label:"+65 SG"},{code:"+971",label:"+971 AE"},{code:"+52",label:"+52 MX"},{code:"+55",label:"+55 BR"},{code:"+7",label:"+7 RU"}],ie=[{key:"perspective",label:"Perspective View",tag:"Hero"},{key:"front",label:"Front View",tag:"Elevation"},{key:"top",label:"Plan View",tag:"Top-down"}];function oe(){const a=X(),d=y(s=>s.modalOpen),f=y(s=>s.activeModal),b=y(s=>s.closeModal),m=y(s=>s.addNotification),r=d&&f==="save",[t,E]=o(V),[N,_]=o(null),[A,C]=o(!1),[w,P]=o(!1),[x,c]=o(""),[u,D]=o(""),[k,S]=o(!1),[M,v]=o(""),U=T(null),R=T(0),i=s=>n=>E(g=>({...g,[s]:n.target.value}));J(()=>{if(!r)return;let s=!1;return v(""),C(!0),(async()=>{try{const n=await q();s||_(n)}catch{s||_({})}finally{s||C(!1)}})(),R.current=0,U.current=ee({onProgress:n=>{R.current=n}}),()=>{s=!0}},[r]);const h=()=>{E(V),_(null),C(!1),P(!1),c(""),D(""),S(!1),v(""),b()},B=["firstName","lastName","email","projectName"].filter(s=>!t[s].trim()),$=async()=>{if(B.length>0){v("Please fill in all required fields.");return}P(!0),v("");try{const s=t.phone.trim()?`${t.countryCode} ${t.phone.trim()}`.trim():"";c("Capturing your design\u2026");const n=N||await q();c("Finalizing AR link\u2026");const g=await Promise.race([U.current||Promise.resolve(null),new Promise(j=>setTimeout(()=>j(null),3e4))]),I={...t,phone:s,arUrl:g};c("Submitting\u2026");const{shareUrl:H}=await Q(I,{buildPdf:async({shareUrl:j})=>(c("Generating your design PDF\u2026"),Z({views:n,projectName:t.projectName,customer:I,shareUrl:j,arUrl:g}))});D(H||""),m({type:"success",message:"Design submitted"})}catch(s){v(te(s))}finally{P(!1),c("")}},W=async()=>{try{await navigator.clipboard.writeText(u),S(!0),setTimeout(()=>S(!1),2e3)}catch{m({type:"error",message:"Failed to copy link"})}},Y=()=>{const s=encodeURIComponent(t.projectName||"My design"),n=encodeURIComponent(`You can open and continue editing my design here:
|
|
2
|
+
|
|
3
|
+
${u}`);window.open(`mailto:?subject=${s}&body=${n}`)},F=!!u,O=N?ie.filter(s=>N[s.key]):[],K=l("div",{className:"spm__pane",children:[l("div",{className:"spm-section__header",children:[e("span",{className:"spm-section__num",children:"01 \xB7 Preview"}),a("save.snapshots","Design snapshots")?e("h3",{className:"spm-section__title",children:a("save.snapshots","Design snapshots")}):null,e("p",{className:"spm-section__desc",children:"Three 3D views captured from your current design \u2014 these are included in the submitted PDF."})]}),e("div",{className:"spm-preview",children:O.length>0?O.map(s=>l("figure",{className:"spm-preview__card",children:[l("figcaption",{className:"spm-preview__caption",children:[e("span",{children:s.label}),e("span",{className:"spm-preview__caption-tag",children:s.tag})]}),e("img",{className:"spm-preview__img",src:N[s.key],alt:s.label})]},s.key)):e("div",{className:"spm-preview__empty",children:A?"Capturing views\u2026":"Preview unavailable"})})]}),z=l("div",{className:"spm__pane",children:[l("div",{className:"spm-section__header",children:[e("span",{className:"spm-section__num",children:"02 \xB7 Your details"}),a("save.contactTitle","Where should we send updates?")?e("h3",{className:"spm-section__title",children:a("save.contactTitle","Where should we send updates?")}):null,e("p",{className:"spm-section__desc",children:"Name, email, and project name are required \u2014 the rest is optional context we\u2019ll include on the submission."})]}),l("form",{className:"spm-form",onSubmit:s=>{s.preventDefault(),$()},children:[l("fieldset",{className:"spm-fieldset",style:{border:"none",padding:0,margin:0},children:[l("div",{className:"spm-row",children:[l("label",{className:"spm-field",children:[a("save.firstName","First name")?e("span",{className:"spm-field__label spm-field__label--required",children:a("save.firstName","First name")}):null,e("input",{className:"spm-input",type:"text",value:t.firstName,onChange:i("firstName")})]}),l("label",{className:"spm-field",children:[a("save.lastName","Last name")?e("span",{className:"spm-field__label spm-field__label--required",children:a("save.lastName","Last name")}):null,e("input",{className:"spm-input",type:"text",value:t.lastName,onChange:i("lastName")})]})]}),l("label",{className:"spm-field",children:[a("save.email","Email")?e("span",{className:"spm-field__label spm-field__label--required",children:a("save.email","Email")}):null,e("input",{className:"spm-input",type:"email",value:t.email,onChange:i("email"),placeholder:"you@example.com"})]}),l("label",{className:"spm-field",children:[a("save.phone","Phone number")?e("span",{className:"spm-field__label",children:a("save.phone","Phone number")}):null,l("div",{className:"spm-phone",children:[e("select",{className:"spm-select spm-phone__code",value:t.countryCode,onChange:i("countryCode"),"aria-label":"Country code",children:ne.map(({code:s,label:n})=>e("option",{value:s,children:n},s))}),e("input",{className:"spm-input spm-phone__number",type:"tel",value:t.phone,onChange:i("phone"),placeholder:"555 123 4567"})]})]})]}),l("fieldset",{className:"spm-fieldset",style:{border:"none",padding:0,margin:0},children:[l("label",{className:"spm-field",children:[a("save.projectName","Project name")?e("span",{className:"spm-field__label spm-field__label--required",children:a("save.projectName","Project name")}):null,e("input",{className:"spm-input",type:"text",value:t.projectName,onChange:i("projectName"),placeholder:a("save.projectPlaceholder","e.g. My dream design")})]}),e("div",{className:"spm-row",children:l("label",{className:"spm-field",children:[a("save.company","Company")?e("span",{className:"spm-field__label",children:a("save.company","Company")}):null,e("input",{className:"spm-input",type:"text",value:t.company,onChange:i("company")})]})}),l("label",{className:"spm-field",children:[a("save.address","Address")?e("span",{className:"spm-field__label",children:a("save.address","Address")}):null,e("textarea",{className:"spm-textarea",rows:2,value:t.address,onChange:i("address")})]}),l("label",{className:"spm-field",children:[e("span",{className:"spm-field__label",children:"Note"}),e("textarea",{className:"spm-textarea",rows:3,value:t.note,onChange:i("note"),placeholder:"Anything else we should know?"})]})]}),M&&e("p",{className:"spm-error",children:M}),l("div",{className:"spm-actions",children:[w&&x&&l("span",{className:"spm-actions__status",children:[e("span",{className:"spm-actions__spinner"}),x]}),e(p,{variant:"ghost",type:"button",onClick:h,disabled:w,children:a("save.cancel","Cancel")}),e(p,{variant:"primary",type:"submit",loading:w,children:a("save.submit","Submit design")})]})]})]}),G=l("div",{className:"spm-success",children:[l("div",{className:"spm-success__hero",children:[e("div",{className:"spm-success__check",children:e(L,{})}),l("div",{className:"spm-success__text",children:[a("save.submitted","Design submitted \u2014 you\u2019re all set.")?e("h3",{children:a("save.submitted","Design submitted \u2014 you\u2019re all set.")}):null,e("p",{children:"Share the link with anyone to open this design and continue editing it anytime."})]})]}),u?l(me,{children:[l("div",{className:"spm-field",children:[a("save.shareLink","Share link")?e("span",{className:"spm-field__label",children:a("save.shareLink","Share link")}):null,l("div",{className:"spm-share",children:[e("input",{className:"spm-input spm-share__input",type:"text",value:u,readOnly:!0}),e(p,{variant:k?"primary":"outline",onClick:W,icon:k?e(L,{}):e(le,{}),children:k?"Copied":"Copy"})]})]}),l("div",{className:"spm-success__footer",children:[e(p,{variant:"ghost",onClick:Y,icon:e(ae,{}),children:a("save.emailLink","Email me the link")}),e(p,{variant:"primary",onClick:h,children:"Done"})]})]}):e("div",{style:{display:"flex",justifyContent:"flex-end"},children:e(p,{variant:"primary",onClick:h,children:a("save.close","Close")})})]});return e(se,{isOpen:r,onClose:h,title:F?a("save.titleDone","Design submitted"):a("save.title","Submit your design"),size:"xlarge",children:F?G:l("div",{className:"spm",children:[K,z]})})}var he=oe;export{he as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="wall_corner",e="wall_back_corner";function t(r){return r?.type===o||r?.placement_group===e||r?.placementGroup===e}export{e as WALL_CORNER_PLACEMENT_GROUP,o as WALL_CORNER_TYPE,t as isWallCornerProduct};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as h,useEffect as M}from"react";import y from"./872c4302e0.js";import{loadPhysicalMaterial as p,isPhysicalMaterial as c,getCachedMaterial as o}from"./c44d37da7a.js";function m(e,u={}){const r=y(t=>t.materials),{getMaterial:a}=u,s=t=>t?a?a(t):r[t]||null:null,[f,l]=h(()=>{const t=s(e);return t&&c(t)?o(t):null});return M(()=>{const t=s(e);if(t&&c(t)){const i=o(t);i?l(i):p(t).then(n=>{n&&l(n)})}else l(null)},[e,r,a]),{physicalMat:f,materials:r}}var S=m;export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as d,useMemo as v,useRef as y}from"react";import O from"./872c4302e0.js";import _ from"./9c6c598569.js";function j(){const r=O(e=>e.getProduct),s=_(e=>e.productInstances),u=d(e=>r(e?.variantId)?.edge||r(e?.productId)?.edge||""||null,[r]),l=d(e=>{const o=r(e?.variantId)||r(e?.productId);return o?.corner===!0||o?.corner==="true"||String(o?.edge??"").toLowerCase()==="corner"},[r]),f=d(e=>{if(e?.positionedAbove!=null)return!0;const o=r(e?.variantId)||r(e?.productId),c=o?.hostVariants??o?.host_variants;return Array.isArray(c)&&c.length>0},[r]),p=d(e=>!f(e)&&!!(r(e?.variantId)?.movable??r(e?.productId)?.movable),[r,f]),i=v(()=>Object.values(s||{}).filter(p),[s,p]),I=i.length>0&&i.length<Object.keys(s||{}).length,h=I?i:[],m=y(!1),b=v(()=>{const e=t=>t==="left"?-1:t==="right"?1:0,o=new Set(h.map(t=>t.id)),c=t=>{const n=Number(t?.sequence);return Number.isFinite(n)?n:t?.createdAt||0};return Object.values(s||{}).filter(t=>!o.has(t.id)).map(t=>({inst:{...t,corner:l(t)},edge:u(t)})).sort((t,n)=>e(t.edge)-e(n.edge)||c(t.inst)-c(n.inst)).map(t=>t.inst)},[s,u,l,h]),A=v(()=>{const e=[];for(const o of Object.values(s||{})){if(o.positionedAbove!=null)continue;const c=r(o.variantId)||r(o.productId),a=c?.hostVariants??c?.host_variants;if(!Array.isArray(a)||!a.length)continue;const t=a.find(g=>g?.isDefault??g?.is_default)||a[0],n=t?.hostVariantId??t?.host_variant_id;n==null||!r(n)||e.push({id:`${o.id}__host`,hostedProductId:o.id,hostVariantId:n,offset:Array.isArray(t?.position)?t.position:[0,0,0],rotDegY:Array.isArray(t?.rotation)&&t.rotation[1]||0})}return e},[s,r]);return{edgeOf:u,cornerOf:l,isHostAnchored:f,isMovable:p,rawFree:i,splitReliable:I,freeInstances:h,ordered:b,syntheticHosts:A,moveInFlightRef:m,productInstances:s,getProduct:r}}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSyncExternalStore as g}from"react";const r=new Map;let o=[],l=0;const f=new Set;function s(){l+=1;for(const t of f)try{t()}catch{}}const a=t=>{if(typeof t!="string")return null;const n=t.trim().toLowerCase();if(!n)return null;const e=n.length>1?n.replace(/\/+$/,""):n;return e.startsWith("/")?e:`/${e}`};function y(t,n){if(typeof n!="function")return()=>{};if(typeof t=="function"){const c=[t,n];return o=[c,...o],s(),()=>{const i=o.length;o=o.filter(p=>p!==c),o.length!==i&&s()}}const e=a(t);if(!e)return()=>{};const u=r.has(e)?r.get(e):void 0;return r.set(e,n),s(),()=>{r.get(e)===n&&(u!==void 0?r.set(e,u):r.delete(e),s())}}function d(t){let n=t;if(n==null)try{n=window.location.pathname}catch{return null}const e=a(n);if(!e)return null;const u=r.get(e);if(u)return u;for(const[c,i]of o)try{if(c(e))return i}catch{}return null}function _(t){return d(t)!==null}function R(){return{paths:[...r.keys()],matchers:o.length}}function m(t){return f.add(t),()=>{f.delete(t)}}const h=()=>l;function w(){return g(m,h,h)}function S(){r.clear(),o=[],s()}export{S as _resetRoutes,_ as hasRoute,R as listRoutes,y as registerRoute,d as resolveRoute,w as useRouteRegistry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let u=!1,n=null,t=null;const l=["/api/v1/configurator/status/","/api/v1/auth/token/"];function r(e){u||(u=!0,n=typeof e=="string"&&e.trim()?e:null)}function i(e){t||!e||(t={status:e.status??401,code:e.code??null,detail:e.detail??null,message:e.message??null})}function a(){return t!=null}function c(){return u}function d(){return n}function f(e){if(!u&&!t)return!1;const o=String(e||"").split("?")[0];return!l.some(s=>o.includes(s))}function k(e){if(t&&!u){const s=new Error(t.message||`[sdk] request to ${e} was not sent: the credential was already refused`);return s.status=t.status,t.code&&(s.code=t.code),t.detail&&(s.detail=t.detail),s.blockedLocally=!0,s}const o=new Error(`[sdk] request to ${e} was not sent: this configurator is not licensed to run here${n?` \u2014 ${n}`:""}`);return o.status=403,o.code="EMBED_NOT_LICENSED",o.detail=n,o.blockedLocally=!0,o}function p(){u=!1,n=null,t=null}export{p as _resetRequestBlock,r as blockAllRequests,i as blockForAuthFailure,d as getRequestBlockReason,a as isAuthRefused,c as isRequestBlocked,k as requestBlockedError,f as shouldBlockRequest};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as p}from"react/jsx-runtime";import{lazy as a,Suspense as o}from"react";const f=a(()=>import("./7a748aae59.js")),u=a(()=>import("./54f0fcf38b.js")),r=a(()=>import("./5d5e8a9c58.js")),n=a(()=>import("./28df2aa12f.js")),l=a(()=>import("./4c24338793.js")),s=a(()=>import("./f89d7cd931.js"));function i(t){return e(o,{fallback:null,children:e(f,{...t})})}function m(t){return e(o,{fallback:null,children:e(u,{...t})})}import{default as A}from"./2cab5c5c23.js";import{default as B}from"./26155bf68c.js";import{default as P}from"./37596ace72.js";import{default as g}from"./9794652102.js";function c(){return p(o,{fallback:null,children:[e(r,{}),e(n,{}),e(l,{}),e(s,{})]})}function x(t){return e(o,{fallback:null,children:e(r,{...t})})}function S(t){return e(o,{fallback:null,children:e(n,{...t})})}function b(t){return e(o,{fallback:null,children:e(l,{...t})})}function M(t){return e(o,{fallback:null,children:e(s,{...t})})}import{default as G}from"./a822c5e4f2.js";import{default as h}from"./54413c1eae.js";import{default as y}from"./bdec200d00.js";import{default as O}from"./d118c2e7ba.js";import{default as z}from"./4aa671f9f6.js";import{default as H}from"./88251d6671.js";import{default as T}from"./c4790179f1.js";import{default as q}from"./d566d3874b.js";import{default as J}from"./fe68b361ba.js";import{default as Q}from"./81eb433604.js";import{default as W}from"./d65f32e004.js";import{default as Y}from"./20b0104576.js";import{default as $}from"./14c83bc57a.js";export{b as ARModal,Q as ARViewer,J as Button,$ as CameraAnimator,m as ChatBar,T as ConfirmDialog,g as EvaluatingOverlay,S as ExportModal,B as GenerateAssetsButton,M as GeneratedAssetsModal,G as Header,i as LiveStatusPanel,H as LoadingScreen,q as Modal,c as Modals,P as NotificationContainer,z as OptionSidebar,A as SaveProjectButton,x as SaveProjectModal,Y as SceneDimensions,W as SceneRoom,h as SceneToolbar,y as Sidebar,O as SidebarFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l,jsxs as C}from"react/jsx-runtime";import{memo as u,useMemo as z}from"react";const m=Object.freeze([1,1,1]),T="#EC4E0B";function E({width:o,height:e,depth:r,color:c,thickness:i=.004,parentScale:g=m}){const p=c,f=z(()=>{const t=o/2,n=e/2,a=r/2,s=i;return[{pos:[0,-n,-a],size:[o+s,s,s]},{pos:[0,-n,a],size:[o+s,s,s]},{pos:[-t,-n,0],size:[s,s,r+s]},{pos:[t,-n,0],size:[s,s,r+s]},{pos:[0,n,-a],size:[o+s,s,s]},{pos:[0,n,a],size:[o+s,s,s]},{pos:[-t,n,0],size:[s,s,r+s]},{pos:[t,n,0],size:[s,s,r+s]},{pos:[-t,0,-a],size:[s,e+s,s]},{pos:[t,0,-a],size:[s,e+s,s]},{pos:[-t,0,a],size:[s,e+s,s]},{pos:[t,0,a],size:[s,e+s,s]}]},[o,e,r,i]);return l("group",{children:f.map((t,n)=>C("mesh",{position:t.pos,children:[l("boxGeometry",{args:t.size}),l("meshBasicMaterial",{color:p,depthTest:!1,transparent:!0,opacity:.5})]},n))})}function S(o,e){if(o.width!==e.width||o.height!==e.height||o.depth!==e.depth||o.color!==e.color||o.thickness!==e.thickness)return!1;const r=o.parentScale,c=e.parentScale;if(r===c)return!0;if(!r||!c||r.length!==c.length)return!1;for(let i=0;i<r.length;i++)if(r[i]!==c[i])return!1;return!0}var b=u(E,S);export{T as SELECTION_COLOR,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as t,useContext as e}from"react";const o=t({isAvailable:!1});function l(){return e(o).isAvailable}export{o as CopilotContext,l as useCopilotAvailable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"./ea8577d22b.js";import s from"./872c4302e0.js";import i from"./be337ddda5.js";import l from"./9c6c598569.js";import n from"./d94df858ea.js";import{resolveBasePrice as b}from"./b5c372377f.js";function g(e){if(!e||typeof e!="object")return!1;const t=e.grandTotal??e.grand_total??null;return n.getState().setBackendPricing?.(e),typeof t=="number"}function m(){const e=l.getState().productInstances,t=n.getState().instanceSelections,c=i.getState().getChannelPriceConfig();a.setPriceConfig(c);const o=s.getState(),r=a.calculateSceneTotal({productInstances:e,instanceSelections:t,products:o.products,options:o.options,features:o.features});return n.getState().applyRuleResults({lockedFeatures:{},disabledOptions:{},filteredOptions:{},calculatedValues:{},validationErrors:[],totalPrice:r.total,priceBreakdown:r.breakdown}),{prices:r}}export{g as applyBackendPricing,m as recomputePrice,b as resolveBasePrice};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as o}from"react";import u from"./be337ddda5.js";function i(){const e=u(r=>r.rulesReady),n=u(r=>r.rulesTriggerIndex);return o(()=>({ready:!!e,triggerIndex:n??null}),[e,n])}function c(){const e=u(t=>t.sceneConfigurations),n=u(t=>t.productConfigurations),r=u(t=>t.featuresConfiguration);return o(()=>({scene:e||{},product:n||{},features:r||{}}),[e,n,r])}function f(){return u(e=>e.getSceneFeatures)}function d(){const{scene:e,product:n,features:r}=c(),{ready:t,triggerIndex:s}=i();return o(()=>({scene:e,product:n,features:r,rulesReady:t,rulesTriggerIndex:s}),[e,n,r,t,s])}export{f as useSceneFeaturesReader,d as useSystemConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSyncExternalStore as r}from"react";import{getAiChatGranted as t,subscribeEntitlements as n}from"./87f511c4a8.js";function u(e){return e?.aiChat!==!1}function a(){return r(n,t,()=>!0)}function s(){return t()}export{s as getAiChatEntitled,u as isAiChatEntitled,a as useAiChatEntitled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as W}from"react";import t from"./8f60e5059a.js";function M(){const s=t(e=>e.hostFinishes),r=t(e=>e.hostWidths),o=t(e=>e.hostStyles),i=t(e=>e.hostHandleTypes),n=t(e=>e.hostHardwareFinishes),c=t(e=>e.hostDoorTypes),d=t(e=>e.hostProductOverrides),a=t(e=>e.hostMaterialOverrides),h=t(e=>e.hostMaterials),p=t(e=>e.freePieceTier),l=t(e=>e.freePieceWidthOption),y=t(e=>e.setHostFinish),u=t(e=>e.setHostWidth),H=t(e=>e.setHostStyle),T=t(e=>e.setHostHandleType),O=t(e=>e.setHostHardwareFinish),F=t(e=>e.setHostDoorType),P=t(e=>e.setHostProductOverride),f=t(e=>e.setHostMaterialOverride),m=t(e=>e.setFreePieceTier),v=t(e=>e.setFreePieceWidthOption);return W(()=>({finishes:s,widths:r,styles:o,handleTypes:i,hardwareFinishes:n,doorTypes:c,productOverrides:d,materialOverrides:a,materials:h,freePieceTier:p,freePieceWidthOption:l,setFinish:y,setWidth:u,setStyle:H,setHandleType:T,setHardwareFinish:O,setDoorType:F,setProductOverride:P,setMaterialOverride:f,setFreePieceTier:m,setFreePieceWidthOption:v,get(e,w){return{finish:s,width:r,style:o,handleType:i,hardwareFinish:n,doorType:c,product:d,material:a}[e]?.[w]??null}}),[s,r,o,i,n,c,d,a,h,p,l,y,u,H,T,O,F,P,f,m,v])}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import gt from"./d803155241.js";import{resolveLockVariantId as ht}from"./061b81ad81.js";const lt=E=>{const F=Number(E);return!Number.isFinite(F)||F===0?null:F},ft=(E,F)=>{const H=Array.isArray(E?.hostVariants)?E.hostVariants:Array.isArray(E?.host_variants)?E.host_variants:[];if(!H.length)return null;const R=K=>String(K?.hostVariantId??K?.host_variant_id)===String(F);return H.find(R)||H.find(K=>K?.isDefault??K?.is_default)||H[0]||null},xt=(E,F)=>{const H=E?.placementGroup??E?.placement_group;if(H!=null&&String(H)!=="")return String(H);const R=F?.(E?.variantId)||F?.(E?.productId);return String(R?.placementGroup??R?.placement_group??"")};var zt={id:"grouped-chain",label:"Grouped chain (backend + group attach)",mode:"compute",handlesCorners:!0,computeLayout(E,F={}){const{getProduct:H}=F,R=Array.isArray(E)?E:[],K=p=>String(p?.id??p?.instanceId??""),ut=new Map(R.map(p=>[K(p),p])),W=p=>H?.(p?.variantId)||H?.(p?.productId)||null,it=p=>{const d=W(p),z=d?.hostVariants??d?.host_variants;return Array.isArray(z)&&z.length?z:null},et=p=>{const d=p?.positionedAbove??p?.positioned_above??null;return d!=null?String(d):null},tt=p=>et(p)!=null,nt=p=>ht(p)??ht(W(p)),Mt=p=>nt(p)!=null,ct=p=>String(p?.variantId??p?.productId??""),ot=new Set,C=p=>ot.has(p),j=R.filter(p=>!tt(p)),U=R.filter(p=>tt(p));if(F.useTransform){const p=Math.PI/180;return R.map(d=>{const z=Array.isArray(d?.position)?d.position:[0,0,0],X=Array.isArray(d?.rotation)?d.rotation:[0,0,0];return{position:[Number(z[0])||0,Number(z[1])||0,Number(z[2])||0],rotation:[(Number(X[0])||0)*p,(Number(X[1])||0)*p,(Number(X[2])||0)*p]}})}const G=new Map;for(const p of j){const d=xt(p,H);G.has(d)||G.set(d,[]),G.get(d).push(p)}const x=new Map;for(const[,p]of G){const d=gt.computeLayout(p,F);p.forEach((z,X)=>{const a=d[X]||{position:[0,0,0],rotation:[0,0,0]},s=Array.isArray(z?.position)?z.position:[],t=a.position||[0,0,0],n=lt(s[1]);x.set(z,{position:[t[0],n??t[1],t[2]],rotation:a.rotation||[0,0,0]})})}for(const[,p]of G){const d=new Map;for(const a of p){const s=x.get(a)?.position?.[1]||0;s>.01&&d.set(s,(d.get(s)||0)+1)}if(!d.size)continue;let z=0,X=0;for(const[a,s]of d)s>X&&(X=s,z=a);if(!(X<p.length/2))for(const a of p){const s=x.get(a);s&&(s.position[1]||0)<=.01&&x.set(a,{position:[s.position[0],z,s.position[2]],rotation:s.rotation})}}{const d=t=>{const n=x.get(t);if(!n)return null;const g=n.position,i=-((Array.isArray(n.rotation)?n.rotation[1]:0)||0),h=Math.cos(i),e=Math.sin(i),r=-Math.sin(i),c=Math.cos(i),u=F.getDims?.(t.productId)??F.getDims?.(t.variantId)??null,l=W(t),m=u?.width>.05&&u?.depth>.05,f=m?u.width:l?.width>0?l.width*.0254:.9,w=m?u.depth:l?.depth>0?l.depth*.0254:.95,Z=m&&u.cx||0,N=m&&u.cz||0,I=g[0]+h*Z+r*N,M=g[2]+e*Z+c*N;return[I+h*(f/2)-r*(w/2),M+e*(f/2)-c*(w/2)]},z=new Set;for(const t of R){const n=nt(t);n!=null&&z.add(n)}let X=null,a=0;for(const[t,n]of G){const g=n.reduce((i,h)=>i+(z.has(ct(h))?1:0),0);g>a&&(a=g,X=t)}const s=X!=null?G.get(X):null;if(s){const t=new Map;for(const n of[...s].sort((g,i)=>Number(g.sequence)-Number(i.sequence))){const g=ct(n);t.has(g)||t.set(g,[]),t.get(g).push(n)}for(const[n,g]of G){if(n===X)continue;const i=g.map(c=>({inst:c,tv:nt(c),seq:Number(c.sequence)})).filter(c=>c.tv!=null&&Number.isFinite(c.seq)).sort((c,u)=>c.seq-u.seq);if(!i.length)continue;const h=new Map,e=[];for(const c of i){const u=t.get(c.tv);if(!u||!u.length)continue;const l=h.get(c.tv)||0,m=Math.min(l,u.length-1);h.set(c.tv,l+1);const f=u[m],w=d(c.inst),Z=d(f);!w||!Z||(e.push({seq:c.seq,delta:[Z[0]-w[0],Z[1]-w[1]],lockInst:c.inst}),ot.add(c.inst),ot.add(f))}if(!e.length)continue;e.sort((c,u)=>c.seq-u.seq);const r=new Map;for(const c of g){const u=Number(c?.sequence);let l=e[0];if(Number.isFinite(u))for(const m of e)if(m.seq<=u)l=m;else break;r.set(c,l.delta)}for(const c of g){const u=x.get(c);if(!u)continue;const l=r.get(c)||e[0].delta;x.set(c,{position:[u.position[0]+l[0],u.position[1],u.position[2]+l[1]],rotation:u.rotation})}}}}{const d=X=>{const a=F.getDims?.(X.productId)??F.getDims?.(X.variantId)??null,s=W(X),t=a?.width>.05&&a?.depth>.05;return{w:t?a.width:s?.width>0?s.width*.0254:.9,dp:t?a.depth:s?.depth>0?s.depth*.0254:.6,cx:t&&a.cx||0,cz:t&&a.cz||0}},z=X=>{const a=x.get(X);if(!a)return null;const[s,,t]=a.position,n=(Array.isArray(a.rotation)?a.rotation[1]:0)||0,{cx:g,cz:i}=d(X);return{x:s+g*Math.cos(n)+i*Math.sin(n),z:t-g*Math.sin(n)+i*Math.cos(n),y:a.position[1],r:n}};for(const[,X]of G){const a=X.filter(r=>C(r)&&Number.isFinite(Number(r.sequence))).map(r=>({inst:r,seq:Number(r.sequence)})).sort((r,c)=>r.seq-c.seq);if(a.length<2)continue;const s=[];for(let r=0;r<a.length-1;r++){const c=a[r].inst,u=a[r+1].inst,l=X.filter(Y=>{const _=Number(Y?.sequence);return!C(Y)&&Number.isFinite(_)&&_>a[r].seq&&_<a[r+1].seq}).sort((Y,_)=>Number(Y.sequence)-Number(_.sequence));if(!l.length)continue;const m=-((Array.isArray(x.get(l[0])?.rotation)?x.get(l[0]).rotation[1]:0)||0),f=Math.cos(m),w=Math.sin(m),Z=-w,N=f,I=Y=>Y.x*f+Y.z*w,M=Y=>{const{w:_,dp:T}=d(Y),V=z(Y);return V?Math.abs(Math.cos(V.r+m))*(_/2)+Math.abs(Math.sin(V.r+m))*(T/2):0},A=z(c),o=z(u);if(!A||!o)continue;const b=I(A),k=I(o),q=k>=b?1:-1,y=b+q*M(c),S=k-q*M(u),L=(S-y)*q,B=l.map(Y=>d(Y).w),v=B.reduce((Y,_)=>Y+_,0),P=new Array(l.length);if(v<=L+.02){const Y=v/2;let _=0,T=l.length;for(let D=0;D<l.length;D++)if(_+=B[D],_>Y){T=D;break}let V=y;for(let D=0;D<T;D++)P[D]=V+q*B[D]/2,V+=q*B[D];V=S;for(let D=l.length-1;D>=T;D--)P[D]=V-q*B[D]/2,V-=q*B[D]}else{let Y=0,_=0;for(let O=0;O<l.length&&!(_+B[O]>L+.02);O++)_+=B[O],Y=O+1;for(let O=Y;O<l.length;O++)s.push(l[O]);const V=B.slice(0,Y).reduce((O,dt)=>O+dt,0)/2;let D=0,Q=Y;for(let O=0;O<Y;O++)if(D+=B[O],D>V){Q=O;break}let J=y;for(let O=0;O<Q;O++)P[O]=J+q*B[O]/2,J+=q*B[O];J=S;for(let O=Y-1;O>=Q;O--)P[O]=J-q*B[O]/2,J-=q*B[O]}l.forEach((Y,_)=>{const T=z(Y);if(!T||P[_]==null)return;const{cx:V,cz:D}=d(Y),Q=T.x*Z+T.z*N,J=P[_]*f+Q*Z,O=P[_]*w+Q*N;x.set(Y,{position:[J-(V*Math.cos(T.r)+D*Math.sin(T.r)),T.y,O-(-V*Math.sin(T.r)+D*Math.cos(T.r))],rotation:x.get(Y).rotation})})}const t=(r,c,u)=>{if(!c.length||!r)return;const l=u&&u.rotY!=null,m=l?u.rotY:(Array.isArray(x.get(c[0])?.rotation)?x.get(c[0]).rotation[1]:0)||0,f=-m,w=Math.cos(f),Z=Math.sin(f),N=-Z,I=w,M=S=>S.x*w+S.z*Z,A=z(r);if(!A)return;const o=z(u?.dirRef||c[0]),b=o&&Math.sign(M(o)-M(A))||1,k=d(r),q=Math.abs(Math.cos(A.r+f))*(k.w/2)+Math.abs(Math.sin(A.r+f))*(k.dp/2);let y=M(A)+b*q;for(const S of c){const L=z(S);if(!L)continue;const{w:B,cx:v,cz:P}=d(S),Y=y+b*B/2,_=l?m:L.r,T=l?u.perpLine:L.x*N+L.z*I,V=Y*w+T*N,D=Y*Z+T*I;x.set(S,{position:[V-(v*Math.cos(_)+P*Math.sin(_)),L.y,D-(-v*Math.sin(_)+P*Math.cos(_))],rotation:l?[0,m,0]:x.get(S).rotation}),y+=b*B}},n=a[0].seq,g=a[a.length-1].seq,i=X.filter(r=>{const c=Number(r?.sequence);return!C(r)&&Number.isFinite(c)&&c<n}).sort((r,c)=>Number(c.sequence)-Number(r.sequence)),h=X.filter(r=>{const c=Number(r?.sequence);return!C(r)&&Number.isFinite(c)&&c>g}).sort((r,c)=>Number(r.sequence)-Number(c.sequence));t(a[0].inst,i);const e=a[a.length-1].inst;if(h.length){const r=z(h[0]),c=(Array.isArray(x.get(h[0])?.rotation)?x.get(h[0]).rotation[1]:0)||0,u=-c,l=-Math.sin(u),m=Math.cos(u),f=r?r.x*l+r.z*m:0;t(e,[...s,...h],{rotY:c,perpLine:f,dirRef:h[0]})}else t(e,s)}}const rt=new Map;for(const p of R){if(!C(p))continue;const d=x.get(p);d?.position&&rt.set(p,d.position.slice())}const mt=()=>{for(const[p,d]of rt){const z=x.get(p);z&&x.set(p,{position:d.slice(),rotation:z.rotation})}};{const d=a=>{const s=F.getDims?.(a.productId)??F.getDims?.(a.variantId)??null,t=W(a);return{w:s?.width>0?s.width:t?.width>0?t.width*.0254:.9,dp:s?.depth>0?s.depth:t?.depth>0?t.depth*.0254:.6,h:s?.height>0?s.height:t?.height>0?t.height*.0254:.9,cx:s?.cx||0,cz:s?.cz||0}},z=a=>{const s=x.get(a);if(!s)return null;const[t,n,g]=s.position,i=(Array.isArray(s.rotation)?s.rotation[1]:0)||0,{w:h,dp:e,h:r,cx:c,cz:u}=d(a),l=Math.cos(i),m=Math.sin(i),f=t+c*l+u*m,w=g-c*m+u*l,Z=Math.abs(l),N=Math.abs(m),I=(h*Z+e*N)/2,M=(h*N+e*Z)/2;let A=f-I,o=f+I,b=w-M,k=w+M;if(tt(a)?null:it(a)){const y=ft(W(a),null),S=Array.isArray(y?.position)?y.position:[0,0,0],L=f+(S[0]||0)*l+(S[2]||0)*m,B=w-(S[0]||0)*m+(S[2]||0)*l;A=Math.min(A,L-I),o=Math.max(o,L+I),b=Math.min(b,B-M),k=Math.max(k,B+M)}return{minX:A,maxX:o,minZ:b,maxZ:k,minY:n,maxY:n+r}};let X=1/0;for(const a of R){const s=x.get(a)?.position?.[1]||0;s>.01&&s<X&&(X=s)}if(Number.isFinite(X)){const a=new Map,s=new Map;for(const i of j){const h=z(i);h&&(a.set(i,h),s.set(i,(x.get(i)?.position?.[1]||0)>.01))}const t=j.filter(i=>{if(C(i))return!1;const h=a.get(i);return h&&!s.get(i)&&h.maxY>X+.05}),n=(i,h)=>i.minX<h.maxX-.02&&i.maxX>h.minX+.02&&i.minZ<h.maxZ-.02&&i.maxZ>h.minZ+.02&&i.minY<h.maxY-.02&&i.maxY>h.minY+.02,g=new Set(t);for(const i of t){const h=a.get(i),e=-(x.get(i)?.rotation?.[1]||0),r=Math.cos(e),c=Math.sin(e),u=-c,l=r,m=y=>({lo:Math.min(y.minX*r+y.minZ*c,y.maxX*r+y.maxZ*c),hi:Math.max(y.minX*r+y.minZ*c,y.maxX*r+y.maxZ*c)}),f=y=>(y.minX+y.maxX)/2*u+(y.minZ+y.maxZ)/2*l,w=f(h),Z=m(h);let N=!1;for(const y of j){if(!s.get(y))continue;const S=a.get(y);if(S&&n(h,S)){N=!0;break}}if(!N)continue;const I=j.filter(y=>{if(y===i||g.has(y))return!1;const S=-(x.get(y)?.rotation?.[1]||0);if(Math.abs(Math.cos(e-S))<.9)return!1;const L=a.get(y);return L&&Math.abs(f(L)-w)<1});if(!I.length)continue;let M=null;for(const y of[...j,...U]){if(!y?.corner)continue;const S=a.get(y)||z(y);if(!S||Math.abs(f(S)-w)>1.6)continue;const L=m(S);M=(L.lo+L.hi)/2;break}const A=(Z.lo+Z.hi)/2,o=M!=null&&A<M?-1:1;let b=0;const k=Math.max(...I.map(y=>m(a.get(y)).hi)),q=Math.min(...I.map(y=>m(a.get(y)).lo));if(o>0?b=Math.max(0,k+.005-Z.lo):b=Math.min(0,q-.005-Z.hi),Math.abs(b)>.005){const y=x.get(i);x.set(i,{position:[y.position[0]+r*b,y.position[1],y.position[2]+c*b],rotation:y.rotation}),a.set(i,z(i))}}}}const at=p=>String(p?.variantId??p?.productId??""),pt=p=>{const d=et(p);if(d!=null)return ut.get(d)||null;const z=it(p)||[],X=new Set(z.map(a=>String(a?.hostVariantId??a?.host_variant_id)));return R.find(a=>a!==p&&X.has(at(a)))||null};let $=U.slice(),st=!0;for(;$.length&&st;){st=!1;const p=[];for(const d of $){const z=pt(d),X=z?x.get(z):null;if(!X){p.push(d);continue}const a=ft(W(d),at(z)),s=X.position||[0,0,0],t=(Array.isArray(X.rotation)?X.rotation[1]:0)||0,n=Math.cos(t),g=Math.sin(t),i=a&&Array.isArray(a.position)?a.position:[0,0,0],e=(F.getDims?.(z.productId)??F.getDims?.(z.variantId)??null)?.cx||0,r=lt(Array.isArray(d?.position)?d.position[1]:null),c=[s[0]+e*n+(i[2]||0)*g,r??s[1]+(i[1]||0),s[2]-e*g+(i[2]||0)*n],u=a&&Array.isArray(a.rotation)?(a.rotation[1]||0)*Math.PI/180:0;x.set(d,{position:c,rotation:[0,t+u,0]}),st=!0}$=p}for(const p of $){const d=Array.isArray(p?.position)?p.position:[];x.set(p,{position:d.length?d:[0,0,0],rotation:p?.rotation||[0,0,0]})}{const d=[],z=t=>{const n=F.getDims?.(t.productId)??F.getDims?.(t.variantId)??null,g=W(t);return{w:n?.width>0?n.width:g?.width>0?g.width*.0254:.9,dp:n?.depth>0?n.depth:g?.depth>0?g.depth*.0254:.6,h:n?.height>0?n.height:g?.height>0?g.height*.0254:.9,cx:n?.cx||0,cz:n?.cz||0}},X=t=>{const n=x.get(t);if(!n)return null;const[g,i,h]=n.position,e=(Array.isArray(n.rotation)?n.rotation[1]:0)||0,{w:r,dp:c,h:u,cx:l,cz:m}=z(t),f=Math.cos(e),w=Math.sin(e),Z=g+l*f+m*w,N=h-l*w+m*f,I=Math.abs(f),M=Math.abs(w),A=(r*I+c*M)/2,o=(r*M+c*I)/2;return{minX:Z-A,maxX:Z+A,minZ:N-o,maxZ:N+o,minY:i,maxY:i+u}};let a=1/0;for(const t of R){const n=x.get(t)?.position?.[1]||0;n>.01&&n<a&&(a=n)}const s=t=>(x.get(t)?.position?.[1]||0)>.01;for(const t of U){const n=X(t);if(!n||n.maxY<=a+.05)continue;const g=-((Array.isArray(x.get(t)?.rotation)?x.get(t).rotation[1]:0)||0),i=Math.cos(g),h=Math.sin(g),e=-h,r=i,c=o=>Math.min(o.minX*i+o.minZ*h,o.maxX*i+o.maxZ*h),u=o=>Math.max(o.minX*i+o.minZ*h,o.maxX*i+o.maxZ*h),l=o=>(o.minX+o.maxX)/2*e+(o.minZ+o.maxZ)/2*r,m=o=>(o.minX+o.maxX)/2*i+(o.minZ+o.maxZ)/2*h,f=c(n),w=u(n),Z=(f+w)/2,N=l(n);let I=null;for(const o of[...j,...U]){if(!o?.corner)continue;const b=X(o);if(b&&!(Math.abs(l(b)-N)>1.6)){I=m(b);break}}const M=I!=null&&Z<I?-1:1,A=[];for(const o of j){if(C(o)||!s(o))continue;const b=X(o);if(!b)continue;const k=-((Array.isArray(x.get(o)?.rotation)?x.get(o).rotation[1]:0)||0);Math.abs(Math.cos(g-k))<.9||Math.abs(l(b)-N)>1||A.push({inst:o,lo:c(b),hi:u(b)})}if(M>0){const o=A.filter(k=>k.hi>f),b=o.filter(k=>k.lo<w);if(b.length){const k=w-Math.min(...b.map(q=>q.lo))+.01;for(const{inst:q}of o){const y=x.get(q);x.set(q,{...y,position:[y.position[0]+i*k,y.position[1],y.position[2]+h*k]})}d.push({chimShift:+k.toFixed(3),dir:"+run",n:o.length})}}else{const o=A.filter(k=>k.lo<w),b=o.filter(k=>k.hi>f);if(b.length){const k=Math.max(...b.map(q=>q.hi))-f+.01;for(const{inst:q}of o){const y=x.get(q);x.set(q,{...y,position:[y.position[0]-i*k,y.position[1],y.position[2]-h*k]})}d.push({chimShift:+k.toFixed(3),dir:"-run",n:o.length})}}}}{const d=s=>{const t=F.getDims?.(s.productId)??F.getDims?.(s.variantId)??null,n=H?.(s.variantId)||H?.(s.productId);return{w:t?.width>0?t.width:n?.width>0?n.width*.0254:.9,dp:t?.depth>0?t.depth:n?.depth>0?n.depth*.0254:.6,h:t?.height>0?t.height:n?.height>0?n.height*.0254:.9,cx:t?.cx||0,cz:t?.cz||0}},z=s=>{const t=x.get(s);if(!t)return null;const[n,g,i]=t.position,h=(Array.isArray(t.rotation)?t.rotation[1]:0)||0,{w:e,dp:r,h:c,cx:u,cz:l}=d(s),m=Math.cos(h),f=Math.sin(h),w=n+u*m+l*f,Z=i-u*f+l*m,N=Math.abs(m),I=Math.abs(f),M=(e*N+r*I)/2,A=(e*I+r*N)/2;return{minX:w-M,maxX:w+M,minZ:Z-A,maxZ:Z+A,minY:g,maxY:g+c}},X=(s,t)=>s&&t&&s.minX<t.maxX-.02&&s.maxX>t.minX+.02&&s.minZ<t.maxZ-.02&&s.maxZ>t.minZ+.02&&s.minY<t.maxY-.02&&s.maxY>t.minY+.02;let a=1/0;for(const s of R){const t=x.get(s)?.position?.[1]||0;t>.01&&t<a&&(a=t)}if(Number.isFinite(a)){const s=new Map;for(const i of R){const h=z(i);h&&s.set(i,h)}const t=i=>(x.get(i)?.position?.[1]||0)>.01,n=R.filter(i=>{if(C(i))return!1;const h=s.get(i);return h&&!t(i)&&h.maxY>a+.05}),g=new Set(n);for(const i of n){const h=-(x.get(i)?.rotation?.[1]||0),e=Math.cos(h),r=Math.sin(h),c=M=>({lo:Math.min(M.minX*e+M.minZ*r,M.maxX*e+M.maxZ*r),hi:Math.max(M.minX*e+M.minZ*r,M.maxX*e+M.maxZ*r)});let u=s.get(i),l=1/0,m=-1/0,f=!1;for(const M of R){if(M===i||g.has(M)||!t(M))continue;const A=s.get(M);if(!A||!X(u,A))continue;const o=c(A);l=Math.min(l,o.lo),m=Math.max(m,o.hi),f=!0}if(!f)continue;const w=c(u),Z=(w.lo+w.hi)/2,N=(l+m)/2,I=Z>=N?m+.005-w.lo:l-.005-w.hi;if(Math.abs(I)>.002){const M=x.get(i);x.set(i,{position:[M.position[0]+e*I,M.position[1],M.position[2]+r*I],rotation:M.rotation}),u=z(i),s.set(i,u)}}}}{const d=s=>{const t=F.getDims?.(s.productId)??F.getDims?.(s.variantId)??null,n=W(s),g=t?.width>.05&&t?.depth>.05;return{w:g?t.width:n?.width>0?n.width*.0254:.9,dp:g?t.depth:n?.depth>0?n.depth*.0254:.6,cx:g&&t.cx||0,cz:g&&t.cz||0}},z=s=>{const t=x.get(s);if(!t)return null;const[n,,g]=t.position,i=(Array.isArray(t.rotation)?t.rotation[1]:0)||0,{cx:h,cz:e}=d(s);return{x:n+h*Math.cos(i)+e*Math.sin(i),z:g-h*Math.sin(i)+e*Math.cos(i),y:t.position[1],r:i}},X=s=>{const t=z(s);if(!t)return null;const{w:n,dp:g}=d(s),i=Math.abs(Math.cos(t.r)),h=Math.abs(Math.sin(t.r)),e=(n*i+g*h)/2,r=(n*h+g*i)/2;return{minX:t.x-e,maxX:t.x+e,minZ:t.z-r,maxZ:t.z+r}},a=(s,t)=>s&&t&&s.minX<t.maxX-.04&&s.maxX>t.minX+.04&&s.minZ<t.maxZ-.04&&s.maxZ>t.minZ+.04;for(const[,s]of G){const t=s.filter(o=>C(o)&&Number.isFinite(Number(o.sequence))).map(o=>({inst:o,seq:Number(o.sequence)})).sort((o,b)=>o.seq-b.seq);if(!t.length)continue;const n=t[t.length-1].inst,g=t[t.length-1].seq,i=s.filter(o=>!C(o)&&Number.isFinite(Number(o.sequence))).sort((o,b)=>Number(o.sequence)-Number(b.sequence)),h=[];for(const o of t){const b=X(o.inst);b&&h.push(b)}const e=[];for(const o of i){const b=X(o);b&&(h.some(k=>a(b,k))?e.push(o):h.push(b))}if(!e.length)continue;const r=i.filter(o=>Number(o.sequence)>g&&!e.includes(o)),c=r.length?(Array.isArray(x.get(r[0])?.rotation)?x.get(r[0]).rotation[1]:0)||0:((Array.isArray(x.get(n)?.rotation)?x.get(n).rotation[1]:0)||0)-Math.PI/2,u=-c,l=Math.cos(u),m=Math.sin(u),f=-m,w=l,Z=o=>o.x*l+o.z*m,N=z(n);if(!N)continue;const I=r.length?(()=>{const o=z(r[0]);return o?o.x*f+o.z*w:N.x*f+N.z*w})():N.x*f+N.z*w;let M,A;if(r.length){const o=z(r[0]);M=Math.sign(Z(o)-Z(N))||1,A=Math.max(...r.map(b=>{const k=z(b);return k?Z(k)+M*d(b).w/2:-1/0}))}else{M=1;const o=d(n);A=Z(N)+M*(Math.abs(Math.cos(N.r+u))*(o.w/2)+Math.abs(Math.sin(N.r+u))*(o.dp/2))}if(Number.isFinite(A))for(const o of e){const b=z(o);if(!b)continue;const{w:k,cx:q,cz:y}=d(o),S=A+M*k/2,L=S*l+I*f,B=S*m+I*w;x.set(o,{position:[L-(q*Math.cos(c)+y*Math.sin(c)),b.y,B-(-q*Math.sin(c)+y*Math.cos(c))],rotation:[0,c,0]}),A+=M*k}}}{const d=t=>{const n=F.getDims?.(t.productId)??F.getDims?.(t.variantId)??null,g=W(t),i=n?.width>.05&&n?.depth>.05;return{w:i?n.width:g?.width>0?g.width*.0254:.9,dp:i?n.depth:g?.depth>0?g.depth*.0254:.6,cx:i&&n.cx||0,cz:i&&n.cz||0}},z=t=>{const n=x.get(t);if(!n)return null;const[g,,i]=n.position,h=(Array.isArray(n.rotation)?n.rotation[1]:0)||0,{w:e,dp:r,cx:c,cz:u}=d(t),l=g+c*Math.cos(h)+u*Math.sin(h),m=i-c*Math.sin(h)+u*Math.cos(h),f=Math.abs(Math.cos(h)),w=Math.abs(Math.sin(h)),Z=(e*f+r*w)/2,N=(e*w+r*f)/2;return{minX:l-Z,maxX:l+Z,minZ:m-N,maxZ:m+N}};let X=0,a=0,s=0;for(const t of R){const n=x.get(t);n&&(X+=n.position[0],a+=n.position[2],s+=1)}s&&(X/=s,a/=s);for(const[,t]of G){const n=t.filter(e=>C(e)).map(e=>({b:z(e)})).filter(e=>e.b);if(!n.length)continue;const g=t.filter(e=>!C(e)).map(e=>({inst:e,b:z(e)})).filter(e=>e.b);for(const{b:e}of n){const r=(l,m)=>n.some(({b:f})=>f===e?!1:l==="x"?f.minZ<e.maxZ-.05&&f.maxZ>e.minZ+.05&&(m?f.minX>e.maxX:f.maxX<e.minX):f.minX<e.maxX-.05&&f.maxX>e.minX+.05&&(m?f.minZ>e.maxZ:f.maxZ<e.minZ)),c={xp:[],xn:[],zp:[],zn:[]};for(const{inst:l,b:m}of g){const f=m.minZ<e.maxZ-.05&&m.maxZ>e.minZ+.05,w=m.minX<e.maxX-.05&&m.maxX>e.minX+.05;f&&!w?m.minX>=e.maxX?c.xp.push({inst:l,gap:m.minX-e.maxX}):m.maxX<=e.minX&&c.xn.push({inst:l,gap:e.minX-m.maxX}):w&&!f&&(m.minZ>=e.maxZ?c.zp.push({inst:l,gap:m.minZ-e.maxZ}):m.maxZ<=e.minZ&&c.zn.push({inst:l,gap:e.minZ-m.maxZ}))}const u=(l,m,f,w)=>{if(!l.length||r(m,f))return;const Z=Math.min(...l.map(I=>I.gap));if(Z>.015&&Z<.5){const I=w*Z;for(const{inst:M}of l){const A=x.get(M);A&&x.set(M,{position:[A.position[0]+(m==="x"?I:0),A.position[1],A.position[2]+(m==="z"?I:0)],rotation:A.rotation})}}const N=m==="x"?"z":"x";for(const{inst:I}of l){const M=z(I),A=x.get(I);if(!(!M||!A))if(N==="z"){const o=A.position[2]>a,b=o?M.maxZ:M.minZ,q=(o?e.maxZ:e.minZ)-b;(o?q>0:q<0)&&Math.abs(q)>.015&&Math.abs(q)<.5&&x.set(I,{position:[A.position[0],A.position[1],A.position[2]+q],rotation:A.rotation})}else{const o=A.position[0]>X,b=o?M.maxX:M.minX,q=(o?e.maxX:e.minX)-b;(o?q>0:q<0)&&Math.abs(q)>.015&&Math.abs(q)<.5&&x.set(I,{position:[A.position[0]+q,A.position[1],A.position[2]],rotation:A.rotation})}}};u(c.xp,"x",!0,-1),u(c.xn,"x",!1,1),u(c.zp,"z",!0,-1),u(c.zn,"z",!1,1)}const i=(e,r)=>r==="x"?(e.minX+e.maxX)/2:(e.minZ+e.maxZ)/2,h=(e,r)=>r==="x"?(e.minZ+e.maxZ)/2:(e.minX+e.maxX)/2;for(let e=0;e<n.length;e++)for(let r=e+1;r<n.length;r++){const c=n[e].b,u=n[r].b,l=Math.abs((c.minX+c.maxX)/2-(u.minX+u.maxX)/2),m=Math.abs((c.minZ+c.maxZ)/2-(u.minZ+u.maxZ)/2);let f=null;if(m<.35&&l>.5?f="x":l<.35&&m>.5&&(f="z"),!f)continue;const w=i(c,f)<i(u,f),Z=w?c:u,N=w?u:c,I=f==="x"?Z.maxX:Z.maxZ,M=f==="x"?N.minX:N.minZ,A=h(Z,f),o=t.filter(v=>!C(v)).map(v=>({inst:v,b:z(v)})).filter(({b:v})=>v&&i(v,f)>I-.15&&i(v,f)<M+.15&&Math.abs(h(v,f)-A)<.4).sort((v,P)=>i(v.b,f)-i(P.b,f));if(!o.length)continue;const b=o.map(({inst:v})=>d(v).w),k=b.reduce((v,P)=>v+P,0);if(k>M-I+.02)continue;const q=k/2;let y=0,S=o.length;for(let v=0;v<o.length;v++)if(y+=b[v],y>q){S=v;break}const L=(v,P)=>{const Y=x.get(v);if(!Y)return;const _=(Array.isArray(Y.rotation)?Y.rotation[1]:0)||0,{cx:T,cz:V}=d(v);f==="x"?x.set(v,{position:[P-(T*Math.cos(_)+V*Math.sin(_)),Y.position[1],Y.position[2]],rotation:Y.rotation}):x.set(v,{position:[Y.position[0],Y.position[1],P-(-T*Math.sin(_)+V*Math.cos(_))],rotation:Y.rotation})};let B=I;for(let v=0;v<S;v++)L(o[v].inst,B+b[v]/2),B+=b[v];B=M;for(let v=o.length-1;v>=S;v--)L(o[v].inst,B-b[v]/2),B-=b[v]}}}return mt(),R.map(p=>x.get(p)||{position:[0,0,0],rotation:[0,0,0]})}};import{appendTargetFor as Xt,neighborsFor as Zt,groupByPlacement as It}from"./dc812f3e14.js";export{Xt as appendTargetFor,zt as default,It as groupByPlacement,Zt as neighborsFor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as u}from"react/jsx-runtime";import{useEffect as d}from"react";import{useLabels as p}from"./28d887bf8a.js";import s from"./8f60e5059a.js";import f from"./be337ddda5.js";import v from"./3f37665dd1.js";import{readQuote as b}from"./3656ffa1b8.js";import{saveQuotePdf as q}from"./d20718159b.js";import{useQuoteTemplate as w,setBackendQuoteTemplate as _}from"./4ba4f544b9.js";import k from"./cdb4a0f7b3.js";import"./dcbf419090.css";function Q(){const i=f(o=>o.systemQuoteTemplate);d(()=>{_(i)},[i]);const l=w()??k,r=s(o=>o.activeModal),e=p(),c=s(o=>o.modalOpen),m=s(o=>o.closeModal);if(v(o=>o.assets),!c||r!=="quote")return null;const n=b(),a=()=>m?.();return t("div",{className:"quote-view__backdrop",onClick:a,role:"presentation",children:u("div",{className:"quote-view",role:"dialog","aria-modal":"true","aria-label":"Quote",onClick:o=>o.stopPropagation(),children:[t("div",{className:"quote-view__doc",children:t(l,{quote:n,close:a})}),u("div",{className:"quote-view__actions",children:[t("button",{type:"button",className:"quote-view__btn",onClick:()=>{q(n).catch(()=>{})},children:e("quote.downloadPdf","Download PDF")}),t("button",{type:"button",className:"quote-view__btn",onClick:()=>window.print(),children:e("quote.print","Print")}),t("button",{type:"button",className:"quote-view__btn",onClick:a,children:e("quote.close","Close")})]})]})})}export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{emitEvent as p,EVENTS as O}from"./2e366d7386.js";import{beginUserAction as a,endUserAction as i}from"./561dc3f1ab.js";const o=[],T=Object.freeze({OPTION_SELECT:"option.select",PRODUCT_ADD:"product.add",PRODUCT_REMOVE:"product.remove",PRODUCT_MOVE:"product.move",PRODUCT_DUPLICATE:"product.duplicate",LAYOUT_CHANGE:"layout.change",VIEW_MODE:"view.mode",VIEW_DIMENSIONS:"view.dimensions",VIEW_WALLS:"view.walls",VIEW_FULLSCREEN:"view.fullscreen",HISTORY_UNDO:"history.undo",HISTORY_REDO:"history.redo",SCENE_RESET:"scene.reset",MODAL_OPEN:"ui.modal.open",ASSETS_GENERATE:"assets.generate",QUOTE_OPEN:"quote.open"});function S(t){return typeof t!="function"?()=>{}:(o.push(t),()=>{const n=o.indexOf(t);n!==-1&&o.splice(n,1)})}function m(){return o.length}function N(){o.length=0}function l(t,n){if(!t||typeof n!="function")return;a();const c=e=>e&&typeof e.then=="function"?e.finally?e.finally(i):e.then(r=>(i(),r),r=>{throw i(),r}):(i(),e);if(o.length===0)try{return c(n(t))}catch(e){throw i(),e}const E=o.slice();let d=-1;const s=(e,r)=>{if(e<=d)return;if(d=e,e===E.length)return n(r);const f=E[e];try{return f(r,u=>s(e+1,u||r))}catch(u){try{p(O.EXTENSION_FAILED,{where:"middleware",intent:r?.type??null,message:String(u?.message||u)})}catch{}return s(e+1,r)}};try{return c(s(0,t))}catch(e){throw i(),e}}function w(t,n,c){return(...E)=>l({type:t,...c?c(E):{}},()=>n(...E))}export{T as INTENTS,N as _resetMiddleware,w as asIntent,m as listMiddleware,l as runIntent,S as use};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as r,useState as u}from"react";import t from"./8f60e5059a.js";import O from"./1fac915f8b.js";function D(){const[w,a]=u(null),l=O(e=>e.undo),i=t(e=>e.wallOverflowDetected),h=t(e=>e.wallOverflowSide),o=t(e=>e.showWalls),n=t(e=>e.toggleWalls),c=t(e=>e.pieceOverlapDetected),s=t(e=>e.tallWallOverlapDetected),p=t(e=>e.wallPieceOverlapDetected),d=t(e=>e.wallPieceHostedOverlapDetected),v=t(e=>e.cornerOverflowDetected),f=t(e=>e.currentPerpendicularWalls),g=t(e=>e.showWarning);return r(()=>{i&&o&&a({title:"Elevated piece overflow",message:"There is no space to fit an elevated piece. Do you want to hide walls?",confirmText:"Hide Walls",cancelText:"Cancel",onConfirm:()=>{n(),t.setState({wallOverflowDetected:!1,showWallGuide:!0,wallOverflowRecenterMode:!0,wallOverflowSuppressUntil:Date.now()+1e3})},onCancel:()=>{l(),t.setState({wallOverflowDetected:!1,wallOverflowRecenterMode:!1,wallOverflowSuppressUntil:Date.now()+600})}})},[i,h,o]),r(()=>{c&&a({title:"Piece overlap warning",message:"Pieces are overlapping with each other. The last change will be reverted.",hint:"Red highlighted pieces indicate where the overlap occurred.",confirmText:"OK",singleButton:!0,onConfirm:()=>{l(),t.setState({pieceOverlapDetected:!1,overlappingPieces:[]})},onCancel:()=>{l(),t.setState({pieceOverlapDetected:!1,overlappingPieces:[]})}})},[c]),r(()=>{s&&a({title:"Piece overlap warning",message:"A riser and an elevated piece are overlapping. The last change will be reverted.",hint:"Red highlighted pieces indicate where the overlap occurred.",confirmText:"OK",singleButton:!0,onConfirm:()=>{l(),t.setState({tallWallOverlapDetected:!1,overlappingPieces:[]})},onCancel:()=>{l(),t.setState({tallWallOverlapDetected:!1,overlappingPieces:[]})}})},[s]),r(()=>{p&&a({title:"Elevated piece overlap warning",message:"Elevated pieces are overlapping with each other. The last change will be reverted.",hint:"Red highlighted pieces indicate where the overlap occurred.",confirmText:"OK",singleButton:!0,onConfirm:()=>{l(),t.setState({wallPieceOverlapDetected:!1,wallPieceHostedOverlapDetected:!1,overlappingPieces:[]})},onCancel:()=>{l(),t.setState({wallPieceOverlapDetected:!1,wallPieceHostedOverlapDetected:!1,overlappingPieces:[]})}})},[p]),r(()=>{d&&(g("An elevated piece is overlapping with the overhead product."),t.setState({wallPieceHostedOverlapDetected:!1,overlappingPieces:[]}))},[d]),r(()=>{v&&o&&f.length!==0&&a({title:"Corner piece overflow",message:"The corner piece goes beyond the wall. Do you want to hide walls?",confirmText:"Hide Walls",cancelText:"Cancel",onConfirm:()=>{n(),t.setState({cornerOverflowDetected:!1})},onCancel:()=>{l(),t.setState({cornerOverflowDetected:!1})}})},[v,o,f]),{confirmDialog:w,setConfirmDialog:a}}export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={id:"scene-owned",label:"Scene-owned layout",mode:"scene-owned"};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u(a,i){const l=Array.isArray(a?.slots)?a.slots:[];for(const r of l){const n=r?.component_overrides;if(!(!n||typeof n!="object"))for(const o of Object.values(n)){const t=String(o?.variant_key??o?.variantKey??"");if(!t)continue;const s=t.match(/(_[a-z][a-z0-9]*)$/i);if(s)return s[1].toLowerCase()}}const e=Array.isArray(a?.hostVariants)?a.hostVariants:[];if(e.length>0&&i)for(const r of e){const n=r?.hostVariantId??r?.host_variant_id;if(n==null)continue;const o=i[n]||i[String(n)];if(!o)continue;const t=o.components_configuration??o.componentsConfiguration??{},s=t.comp_base_slab??t.comp_corner_slab??null,c=String(s?.variant_key??s?.variantKey??"");if(!c)continue;const f=c.match(/(_[a-z][a-z0-9]*)$/i);if(f)return f[1].toLowerCase()}return null}export{u as getHostedProductShapeSuffix};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import P from"./872c4302e0.js";import R from"./be337ddda5.js";import b from"./9c6c598569.js";const w=(e,n)=>{const o=e.getProduct?.(n?.variantId)||e.getProduct?.(n?.productId);return o?.product_graph??o?.productGraph??null},O=(e,n,o)=>{const i=r=>String(r?.id??r?.instanceId??""),c=n?.positionedAbove??n?.positioned_above??null;if(c!=null){const r=o.find(u=>i(u)===String(c));if(r)return r}const d=e.getProduct?.(n?.variantId)||e.getProduct?.(n?.productId),S=d?.hostVariants??d?.host_variants;if(Array.isArray(S)&&S.length){const r=new Set(S.map(s=>String(s?.hostVariantId??s?.host_variant_id))),u=o.find(s=>s!==n&&r.has(String(s?.variantId??s?.productId)));if(u)return u}return n};function C(e){const n=P.getState(),o=R.getState(),i=b.getState(),c=Object.values(i.productInstances||{});if(!c.length)return{ok:!1,message:"No instances."};const d=(o.constraints||[]).find(t=>String(t.id)===String(e?.constraintId));if((d?.constraintType??d?.constraint_type)!=="adjacency_required")return{ok:!1,message:"Not an adjacency rule."};const r=d?.value?.a,u=d?.value?.b;if(r==null||u==null)return{ok:!1,message:"Rule has no pair."};const s=t=>c.find(f=>String(w(n,f))===String(t)),p=s(r),g=s(u);if(!p||!g)return{ok:!1,message:!p&&!g?"Neither piece is in the scene.":"One of the two pieces is not in the scene."};const v=new Set((e?.offending||[]).map(String)).has(String(w(n,g)))?g:p,x=v===p?g:p,l=O(n,v,c),m=O(n,x,c),I=t=>String(t?.placementGroup??t?.placement_group??""),a=t=>String(t?.id??t?.instanceId??"");if(I(l)!==I(m))return{ok:!1,message:"Pieces are in different rows."};if(a(l)===a(m))return{ok:!0};const y=c.filter(t=>I(t)===I(m)).sort((t,f)=>(t.createdAt||0)-(f.createdAt||0)),h=y.findIndex(t=>a(t)===a(m)),A=y.findIndex(t=>a(t)===a(l));if(h===-1||A===-1)return{ok:!1,message:"Row slot not found."};if(Math.abs(h-A)===1)return{ok:!0};const _=y[h].createdAt||0,j=A>h?1:-1,k=y[h+j],G=k?(_+(k.createdAt||0))/2:_+j*1e3;return b.setState(t=>{const f=t.productInstances[a(l)];return f?{productInstances:{...t.productInstances,[a(l)]:{...f,createdAt:G}}}:t}),{ok:!0,message:"Reordered to satisfy adjacency."}}function T(e){const o=(Array.isArray(e)?e:[]).filter(i=>i?.constraintType==="adjacency_required");for(const i of o)C(i)}export{T as autoFixAdjacency,C as fixAdjacencyByReorder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as x}from"react/jsx-runtime";import{useCallback as L,useEffect as y,useLayoutEffect as g,useRef as k,useState as b}from"react";import{createPortal as M}from"react-dom";function P({anchorRef:u,open:d,onClose:a,placement:c="right-start",gap:i=8,className:h="",children:E}){const m=k(null),[f,p]=b(null),n=L(()=>{const r=u?.current;if(!r)return;const t=r.getBoundingClientRect(),o=m.current,w=o?.offsetWidth||240,v=o?.offsetHeight||0,s=8;let e,l=t.top;c==="bottom-start"?(e=t.left,l=t.bottom+i):c==="left-start"?(e=t.left-w-i,e<s&&(e=t.right+i)):(e=t.right+i,e+w>window.innerWidth-s&&(e=Math.max(s,t.left-w-i))),v&&l+v>window.innerHeight-s&&(l=Math.max(s,window.innerHeight-v-s)),p({left:Math.round(e),top:Math.round(l)})},[u,i,c]);return g(()=>{if(!d){p(null);return}n();const r=requestAnimationFrame(n);return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),()=>{cancelAnimationFrame(r),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}},[d,n]),y(()=>{if(!d)return;const r=o=>{o.key==="Escape"&&a?.()},t=o=>{m.current?.contains(o.target)||u?.current?.contains(o.target)||a?.()};return document.addEventListener("keydown",r),document.addEventListener("pointerdown",t,!0),()=>{document.removeEventListener("keydown",r),document.removeEventListener("pointerdown",t,!0)}},[d,a,u]),!d||typeof document>"u"?null:M(x("div",{ref:m,className:`sdk-popover ${h}`.trim(),"data-part":"popover",role:"dialog",style:{position:"fixed",left:f?f.left:-9999,top:f?f.top:-9999},children:E}),document.body)}var A=P;export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{uploadAiImage as s}from"./79a397bb92.js";function u(n){return/^silo/.test(String(n))?"silo":/^lifestyle/.test(String(n))?"lifestyle":"image"}const c={"image/png":"png","image/webp":"webp","image/jpeg":"jpg","image/gif":"gif"};async function l(n){const t=await fetch(n,{mode:"cors"});if(!t.ok)throw new Error(`image fetch failed: ${t.status} ${t.statusText}`);const a=await t.blob();if(!a||a.size===0)throw new Error("image fetch returned an empty body");return a}function g({blob:n,url:t,kind:a,assetId:r,systemId:o}){const e=new FormData,f=c[n.type]||"jpg";return e.append("image",n,`${r}.${f}`),e.append("source","configurator"),e.append("metadata",JSON.stringify({asset_id:r,kind:a,system:o??null,source_url:t})),e}let i=!1;async function m({assetId:n,url:t,systemId:a=null}){if(!t||typeof t!="string")return null;const r=u(n);try{const o=await l(t),e=await s(g({blob:o,url:t,kind:r,assetId:n,systemId:a}));return e&&typeof e=="object"&&e.quota&&typeof e.quota=="object"?e.quota:e??null}catch{return i||(i=!0),null}}export{u as aiImageKind,m as uploadGeneratedImage};
|