@peripheries/core 0.8.0 → 0.9.0

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Children as e,cloneElement as t,createContext as n,isValidElement as r,useCallback as i,useContext as a,useEffect as o,useId as s,useLayoutEffect as c,useMemo as l,useReducer as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";var _=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function v(e2){let t2={};for(let n2 in e2)_.has(n2)||(t2[n2]=e2[n2]);return t2}var y=(...e2)=>e2.filter(Boolean).join(" ")||void 0,b=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function x(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}var S=Symbol.for("peripheries.embed.context.v1"),C=globalThis,w=C[S]??=n(false);function T(){return a(w)}function E({as:e2,className:t2,children:n2,...r2}){return h(e2??"div",{className:y("core-box",t2),...v(r2),children:n2})}function D({minHeight:e2,className:t2,style:n2,children:r2,...i2}){return h(E,{...i2,className:y("core-center",t2),style:x({"--core-center-min-height":b(e2)},n2),children:r2})}function O({name:e2,className:t2,style:n2,children:r2,...i2}){return h(E,{...i2,className:y("core-container",t2),style:x({"--core-container-name":e2},n2),children:r2})}function k({orientation:e2="horizontal",weight:t2="subtle",spacing:n2,className:r2,style:i2,ref:a2,...o2}){let s2={className:y("core-divider",r2),"data-weight":t2,"data-orientation":e2,style:x({"--core-divider-spacing":b(n2)},i2)};return e2==="vertical"?h("span",{role:"separator","aria-orientation":"vertical",...s2}):h("hr",{ref:a2,...v(o2),...s2})}function A({when:e2,children:t2,as:n2="span"}){return h(n2,{className:"core-hide","data-when":e2,children:t2})}function j({gap:e2,align:t2="center",justify:n2="start",wrap:r2=true,stackWhen:i2,className:a2,style:o2,children:s2,...c2}){return h(E,{...c2,className:y("core-inline",a2),"data-align":t2,"data-justify":n2,"data-wrap":r2?"true":"false","data-stack-when":i2,style:x({"--core-inline-gap":b(e2)},o2),children:s2})}var M=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function N(e2){return[...e2.querySelectorAll(M)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var P=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,F=2;function I({label:t2,snap:n2="start",children:r2,className:a2,...s2}){let c2=d(null),[l2,u2]=f({prev:false,next:false}),[p2,m2]=f(false),_2=i(()=>{let e2=c2.current;if(!e2)return;let t3=e2.scrollLeft>F,n3=e2.scrollWidth-e2.clientWidth-e2.scrollLeft>F;u2(e3=>e3.prev===t3&&e3.next===n3?e3:{prev:t3,next:n3}),m2(e2.scrollWidth>e2.clientWidth&&N(e2).length===0)},[]);o(()=>{let e2=c2.current;if(!e2)return;_2();let t3=new ResizeObserver(_2);t3.observe(e2);for(let n3 of Array.from(e2.children))t3.observe(n3);return()=>t3.disconnect()},[_2,r2]);let b2=e2=>{let t3=c2.current;t3&&t3.scrollBy({left:e2*t3.clientWidth*.8,behavior:P()?"auto":"smooth"})};return g("div",{...v(s2),className:y("core-rail",a2),"data-snap":n2,"data-prev":l2.prev?"":void 0,"data-next":l2.next?"":void 0,children:[h("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${t2} back`,hidden:!l2.prev,onClick:()=>b2(-1),children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M10 3 5 8l5 5"})})}),h("ul",{ref:c2,role:"list","aria-label":t2,className:"core-rail__track",tabIndex:p2?0:void 0,onScroll:_2,children:e.toArray(r2).map((e2,t3)=>h("li",{className:"core-rail__item",children:e2},t3))}),h("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${t2} forward`,hidden:!l2.next,onClick:()=>b2(1),children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"m6 3 5 5-5 5"})})})]})}function L({when:e2,children:t2,as:n2="span"}){return h(n2,{className:"core-show","data-when":e2,children:t2})}function R(e2,t2,n2){let[r2,a2]=f(t2),o2=e2!==void 0,s2=o2?e2:r2,c2=d(n2);return c2.current=n2,[s2,i(e3=>{o2||a2(e3),c2.current?.(e3)},[o2])]}function z(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function B(e2){let[t2,n2]=f(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return o(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var V="core-overlay-dismiss",ee=Symbol.for("peripheries.overlay.host.v1"),H=globalThis,U=H[ee]??=n(null);function W(e2){let t2=e2&&typeof e2=="object"?e2:{},n2=typeof HTMLElement<"u"&&t2.mount instanceof HTMLElement?t2.mount:void 0,r2=typeof t2.portal=="function"?t2.portal:void 0;return{format:t2.format==="desktop"?"desktop":"mobile",...n2?{mount:n2}:{},...r2?{portal:r2}:{}}}function G({value:e2,children:t2}){return h(U.Provider,{value:W(e2),children:t2})}function K(){return a(U)}var te="(max-width: 640px)";function ne(){let e2=K(),t2=B(te);return e2?e2.format:t2?"mobile":"desktop"}var re=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function ie({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:re(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:re(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function q(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var ae=4;function oe({trigger:e2,label:n2,placement:r2="bottom-start",open:i2,defaultOpen:a2=false,onOpenChange:l2,popupRole:u2="dialog",initialFocus:p2,onTriggerKeyDown:_2,children:v2,className:b2}){let[x2,S2]=R(i2,a2,l2),C2=s(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=d(null),E2=d(null),[D2]=f(q),O2=d(x2);O2.current=x2;let k2=d("closed");c(()=>{let e3=T2.current;if(e3){if(x2&&k2.current==="closed")k2.current="open",e3.showPopover();else if(!x2&&k2.current==="open"){k2.current="closed";let t2=document.activeElement;(!t2||t2===document.body||e3.contains(t2))&&E2.current?.focus({preventScroll:true}),e3.hidePopover()}}},[x2]),o(()=>{let e3=T2.current;if(!e3)return;let t2=t3=>{let n4=t3.newState;if(k2.current=n4==="open"?"open":"closed",n4==="open"&&!O2.current&&S2(true),n4==="closed"&&O2.current){S2(false);let t4=document.activeElement;(!t4||t4===document.body||e3.contains(t4))&&E2.current?.focus({preventScroll:true})}},n3=t3=>{if(t3.newState!=="open"||p2===false)return;let n4=(typeof p2=="function"?p2(e3):p2?e3.querySelector(p2):null)??N(e3)[0];n4?n4.focus({preventScroll:true}):(e3.tabIndex=-1,e3.focus({preventScroll:true}))};return e3.addEventListener("beforetoggle",t2),e3.addEventListener("toggle",n3),()=>{e3.removeEventListener("beforetoggle",t2),e3.removeEventListener("toggle",n3)}},[S2,p2]),c(()=>{let e3=T2.current,t2=E2.current;if(D2||!x2||!e3||!t2)return;let n3=()=>{let n4=ie({anchor:t2.getBoundingClientRect(),size:{width:e3.offsetWidth,height:e3.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:r2,gap:ae});e3.style.setProperty("--core-popover-x",`${n4.x}px`),e3.style.setProperty("--core-popover-y",`${n4.y}px`),e3.dataset.placement=n4.placement,e3.dataset.placed=""};n3();let i3=new ResizeObserver(n3);return i3.observe(e3),window.addEventListener("resize",n3),window.addEventListener("scroll",n3,true),()=>{delete e3.dataset.placed,i3.disconnect(),window.removeEventListener("resize",n3),window.removeEventListener("scroll",n3,true)}},[D2,x2,r2]);let A2=()=>S2(false),j2=e2.props,M2={ref:z(E2,j2.ref),popoverTarget:C2,"aria-haspopup":u2,"aria-expanded":x2,"aria-controls":C2,className:y(j2.className,"core-popover-anchor"),style:{...j2.style,"--core-popover-anchor":w2},onKeyDown:e3=>{_2?.(e3),j2.onKeyDown?.(e3)}};return g(m,{children:[t(e2,M2),h("div",{ref:T2,id:C2,popover:"auto",role:u2==="menu"?void 0:u2,"aria-label":u2==="menu"?void 0:n2,className:y("core-popover",b2),"data-placement":r2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e3=>{let t2=e3.relatedTarget;t2&&!e3.currentTarget.contains(t2)&&t2!==E2.current&&A2()},children:x2?typeof v2=="function"?v2({close:A2}):v2:null})]})}var se=Symbol.for("peripheries.overlay.scrollLock.v1"),ce=globalThis;function le(){if(typeof document>"u")return()=>{};let e2=ce[se]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function ue(e2){let t2=K();return t2?h(pe,{...e2,host:t2}):h(me,{...e2})}var de={dialog:"center","sheet-bottom":"bottom","sheet-end":"end"};function fe(e2,t2){let n2=d({onClose:e2,onOpenChange:t2});return n2.current={onClose:e2,onOpenChange:t2},d(()=>{n2.current.onOpenChange?.(false),n2.current.onClose?.()}).current}function pe({variant:e2,kind:t2,open:n2,onClose:r2,onOpenChange:i2,title:a2,label:c2,description:l2,role:u2="dialog",initialFocus:f2,dismissOnBackdrop:p2=true,headerStart:_2,headerTools:v2,footer:b2,children:x2,className:S2,host:C2}){let w2=d(null),T2=fe(r2,i2),E2=`core-overlay-${s().replace(/:/g,"")}`,D2=`${E2}-title`,O2=`${E2}-description`;if(o(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=(f2?e3.querySelector(f2):null)??N(e3)[0];t3?t3.focus({preventScroll:true}):e3.focus({preventScroll:true})},[n2,f2]),o(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=t4=>{t4.target===e3&&T2()};return e3.addEventListener(V,t3),()=>e3.removeEventListener(V,t3)},[n2,T2]),!n2)return null;let k2=c2??(typeof a2=="string"?a2:"dialog"),A2=g(m,{children:[h("div",{className:"core-overlay-scrim","data-overlay-scrim":"","aria-hidden":"true",onClick:()=>p2&&T2()}),h("div",{ref:w2,id:E2,className:y("core-overlay",S2),"data-overlay":t2??(e2==="dialog"?"dialog":"sheet"),"data-placement":de[e2],role:u2==="alertdialog"?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":D2,"aria-describedby":l2?O2:void 0,tabIndex:-1,children:g("div",{className:"core-modal__surface",children:[g("header",{className:"core-modal__header",children:[_2,h("h2",{id:D2,className:"core-modal__title",children:a2}),h("div",{className:"core-modal__tools",children:v2}),h("button",{type:"button",className:"core-modal__close","aria-label":`Close ${k2}`,onClick:T2,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),g("div",{className:"core-modal__body",children:[l2?h("p",{id:O2,className:"core-modal__description",children:l2}):null,x2]}),b2?h("footer",{className:"core-modal__footer",children:b2}):null]})},"root")]}),j2=C2.mount??(typeof document>"u"?null:document.body);return C2.portal&&j2?h(m,{children:C2.portal(A2,j2)}):A2}function me({variant:e2,open:t2,onClose:n2,onOpenChange:r2,title:i2,label:a2,description:c2,role:l2="dialog",initialFocus:u2,dismissOnBackdrop:f2=true,headerStart:p2,headerTools:m2,footer:_2,children:v2,className:b2}){let x2=d(null),S2=d(null),C2=fe(n2,r2),w2=s(),T2=s();o(()=>{let e3=x2.current;if(!e3||!t2)return;let n3=document.activeElement;e3.showModal();let r3=le(),i3=(u2?e3.querySelector(u2):null)??N(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),C2()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),r3(),e3.open&&e3.close();let t3=document.activeElement;(!t3||t3===document.body)&&n3?.isConnected&&n3.focus({preventScroll:true})}},[t2,u2]);let E2=a2??(typeof i2=="string"?i2:"dialog");return h("dialog",{ref:x2,className:y("core-modal",b2),"data-variant":e2,role:l2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":w2,"aria-describedby":c2?T2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t3=N(e3.currentTarget),n3=t3[0],r3=t3[t3.length-1];if(!n3||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n3||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n3.focus())},onPointerDown:e3=>{S2.current=e3.target},onClick:e3=>{f2&&e3.target===e3.currentTarget&&S2.current===e3.currentTarget&&C2()},children:t2&&g("div",{className:"core-modal__surface",children:[g("header",{className:"core-modal__header",children:[p2,h("h2",{id:w2,className:"core-modal__title",children:i2}),h("div",{className:"core-modal__tools",children:m2}),h("button",{type:"button",className:"core-modal__close","aria-label":`Close ${E2}`,onClick:C2,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),g("div",{className:"core-modal__body",children:[c2?h("p",{id:T2,className:"core-modal__description",children:c2}):null,v2]}),_2?h("footer",{className:"core-modal__footer",children:_2}):null]})})}function he({side:e2="bottom",back:t2,...n2}){return e2==="auto"?h(J,{back:t2,...n2}):h(ge,{side:e2,back:t2,...n2})}function J({back:e2,...t2}){let n2=ne()==="mobile";return h(ge,{side:n2?"bottom":"center",back:e2,...t2})}function ge({side:e2,back:t2,...n2}){let r2=t2?h("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${t2.label}`,onClick:t2.onBack,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return h(ue,{variant:e2==="end"?"sheet-end":e2==="center"?"dialog":"sheet-bottom",kind:"sheet",headerStart:r2,...n2})}var _e='[role="menuitem"], [role="menuitemcheckbox"]',ve=600,ye=e2=>"type"in e2;function be({items:e2,label:t2,onChoose:n2,onTab:r2,className:i2}){let a2=d(null),o2=d({text:"",at:0}),s2=()=>[...a2.current?.querySelectorAll(_e)??[]];return h("div",{ref:a2,role:"menu","aria-label":t2,className:y("core-menu",i2),onKeyDown:e3=>{let t3=s2(),n3=t3.indexOf(document.activeElement),i3=n4=>{e3.preventDefault(),t3[(n4+t3.length)%t3.length]?.focus({preventScroll:true})};if(e3.key==="ArrowDown")i3(n3+1);else if(e3.key==="ArrowUp")i3(n3<0?-1:n3-1);else if(e3.key==="Home")i3(0);else if(e3.key==="End")i3(-1);else if(e3.key==="Tab")r2();else if(e3.key.length===1&&!e3.ctrlKey&&!e3.metaKey&&!e3.altKey&&e3.key!==" "){let r3=Date.now();o2.current.text=r3-o2.current.at>ve?e3.key.toLowerCase():o2.current.text+e3.key.toLowerCase(),o2.current.at=r3;let i4=o2.current.text,a3=[...t3.slice(n3+1),...t3.slice(0,n3+1)],s3=[...i4].every(e4=>e4===i4[0]),c2=a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4))??(s3?a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4[0]??"")):void 0);c2&&(e3.preventDefault(),c2.focus({preventScroll:true}))}},children:e2.map(e3=>{if(ye(e3))return h("div",{role:"separator",className:"core-menu__separator"},e3.id);let t3=typeof e3.checked=="boolean"&&!e3.href,r3={role:t3?"menuitemcheckbox":"menuitem","aria-checked":t3?e3.checked:void 0,tabIndex:-1,className:"core-menu__item","data-tone":e3.tone,"aria-disabled":e3.disabled||void 0,onClick:t4=>{if(e3.disabled)return t4.preventDefault();n2(e3)}},i3=g(m,{children:[e3.icon?h("span",{className:"core-menu__icon","aria-hidden":"true",children:e3.icon}):null,h("span",{className:"core-menu__label",children:e3.label})]});return e3.href&&!e3.disabled?h("a",{...r3,href:e3.href,children:i3},e3.id):h("button",{...r3,type:"button",children:i3},e3.id)})})}function xe({trigger:e2,items:n2,label:r2,placement:i2="bottom-start",presentation:a2="auto",defaultOpen:o2=false,onOpenChange:s2,className:c2}){let l2=ne()==="mobile",u2=a2==="sheet"||a2==="auto"&&l2,[d2,p2]=R(void 0,o2,s2),[_2,v2]=f("first"),y2=h(be,{items:n2,label:r2,onChoose:e3=>{e3.onSelect?.(),p2(false)},onTab:()=>p2(false),className:c2}),b2=e3=>{(e3.key==="ArrowDown"||e3.key==="ArrowUp")&&(e3.preventDefault(),v2(e3.key==="ArrowUp"?"last":"first"),p2(true))};if(u2){let n3=e2.props;return g(m,{children:[t(e2,{"aria-haspopup":"menu","aria-expanded":d2,onClick:e3=>{n3.onClick?.(e3),v2("first"),p2(true)},onKeyDown:e3=>{b2(e3),n3.onKeyDown?.(e3)}}),h(he,{open:d2,onClose:()=>p2(false),title:r2,initialFocus:_e,className:"core-menu-sheet",children:y2})]})}return h(oe,{trigger:e2,label:r2,placement:i2,open:d2,onOpenChange:p2,popupRole:"menu",initialFocus:e3=>{let t2=e3.querySelectorAll(_e);return(_2==="last"?t2[t2.length-1]:t2[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var Se=new Set;function Ce(e2,t2){Se.has(e2)||(Se.add(e2),typeof console<"u"&&console.warn(t2))}var we={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},Te=1,Ee=Symbol.for("peripheries.toast.v1"),De=["neutral","info","success","warning","danger"],Oe=globalThis;function ke(){let e2=Oe[Ee];if(e2===void 0){let e3={version:Te,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return Oe[Ee]=e3,e3}return e2.version!==Te||!e2.listeners||!e2.handlers?(Ce("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${Te}. Toasts from this copy are ignored.`),null):e2}function Ae(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var je=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function Me(e2){let t2=ke();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return Ce("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return Ce("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?je(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<we.windowMs);if(i2.length>=we.burst)return Ce(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${we.burst} toasts in ${we.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=De.includes(e2.tone)?e2.tone:"neutral",o2=je(e2.title.trim(),we.title),s2=typeof e2.description=="string"&&e2.description.trim()?je(e2.description.trim(),we.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:je(e2.action.label.trim(),we.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:we.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>we.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>we.visible;)d2=d2.slice(1)}return Ae(t2,d2),l2}function Ne(e2){let t2=ke();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&Ae(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function Pe(e2){let t2=ke()?.handlers.get(e2);return t2?.(),!!t2}var Fe={toasts:[],actions:[]},Ie=e2=>{let t2=ke();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},Le=()=>ke()?.snapshot??Fe;function Re(){let e2=ke();if(!e2)return null;if(e2.regionClaim!==null)return Ce("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),Ae(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),Ae(e2,e2.snapshot.toasts))}}}function ze(){return{toast:Me,dismiss:Ne}}function Be({toast:e2,actionAvailable:t2=false,onAction:n2,onDismiss:r2,className:i2,...a2}){return g("div",{...a2,className:y("core-toast",i2),"data-tone":e2.tone,children:[g("div",{className:"core-toast__text",children:[h("p",{className:"core-toast__title",children:e2.title}),e2.description?h("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&t2?h("button",{type:"button",className:"core-toast__action",onClick:n2,children:e2.action.label}):null,h("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:r2,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function Ve({item:e2,actionAvailable:t2}){let[n2,r2]=f(false);return o(()=>{if(e2.duration===0||n2)return;let t3=setTimeout(()=>Ne(e2.id),e2.duration);return()=>clearTimeout(t3)},[e2.id,e2.duration,e2.revision,n2]),h("div",{className:"core-toast-slot",onPointerEnter:()=>r2(true),onPointerLeave:()=>r2(false),onFocus:()=>r2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||r2(false)},children:h(Be,{toast:e2,actionAvailable:t2,onAction:()=>{e2.action&&Pe(e2.action.id),Ne(e2.id)},onDismiss:()=>Ne(e2.id)})})}function He({className:e2,actions:t2}){let[n2,r2]=f(false),i2=d(null),a2=d(t2);a2.current=t2;let s2=Object.keys(t2??{}).sort().join("\n"),c2=d(null),l2=d(false),{toasts:u2,actions:m2}=p(Ie,Le,Le);o(()=>{let e3=Re();return i2.current=e3,r2(e3!==null),()=>{e3?.release(),i2.current=null}},[]),o(()=>{i2.current?.setActions(Object.fromEntries((s2?s2.split("\n"):[]).map(e3=>[e3,()=>a2.current?.[e3]?.()])))},[s2,n2]);let _2=u2[u2.length-1],v2=_2?`${_2.id}:${_2.revision}`:"";if(o(()=>{let e3=c2.current;e3&&(l2.current&&e3.hidePopover(),l2.current=v2!=="",l2.current&&e3.showPopover())},[v2,n2]),!n2)return null;let b2=e3=>u2.filter(e3).map(e4=>h(Ve,{item:e4,actionAvailable:!!e4.action&&m2.includes(e4.action.id)},e4.id));return g("div",{ref:c2,popover:"manual",role:"region","aria-label":"Notifications",className:y("core-toast-region",e2),children:[h("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:b2(e3=>e3.tone!=="danger")}),h("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:b2(e3=>e3.tone==="danger")})]})}function Ue({role:e2="dialog",dismissOnBackdrop:t2,...n2}){return h(ue,{variant:"dialog",role:e2,dismissOnBackdrop:t2??e2!=="alertdialog",...n2})}function We({size:e2,className:t2,style:n2}){return h("span",{"aria-hidden":true,className:y("core-spacer",t2),style:x({"--core-spacer-size":b(e2)},n2)})}function Ge({gap:e2,align:t2="stretch",justify:n2="start",className:r2,style:i2,children:a2,...o2}){return h(E,{...o2,className:y("core-stack",r2),"data-align":t2,"data-justify":n2,style:x({"--core-stack-gap":b(e2)},i2),children:a2})}var Ke=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),qe=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Je({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=f(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&Ke(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!Ke(e2)&&!qe(e2)}}function Ye({title:e2,titleLevel:t2,meta:n2,leading:r2,value:i2,trailing:a2,badge:o2,detail:s2,actions:c2,selected:l2,href:u2,navigate:d2,onClick:f2,as:p2="div",className:m2,..._2}){let b2=Je({href:u2,navigate:d2,onClick:f2}),x2=p2,S2=u2?h("a",{className:"core-list-row__title core-list-row__link",href:u2,onClick:b2.onClick,"aria-current":l2?"true":void 0,...b2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):h("span",{className:"core-list-row__title",children:e2}),C2=typeof t2=="number"&&Number.isInteger(t2)&&t2>=2&&t2<=6?t2:void 0,w2=C2?`h${C2}`:void 0,T2=w2?h(w2,{className:"core-list-row__heading",children:S2}):S2;return g(x2,{...v(_2),className:y("core-list-row",m2),"data-selected":l2?"":void 0,"aria-current":l2&&!u2?"true":void 0,children:[r2!=null&&h("div",{className:"core-list-row__leading",children:r2}),g("div",{className:"core-list-row__main",children:[o2==null?T2:g("div",{className:"core-list-row__head",children:[T2,h("span",{className:"core-list-row__badge",children:o2})]}),n2!=null&&h("span",{className:"core-list-row__meta",children:n2}),s2!=null&&h("div",{className:"core-list-row__detail",children:s2})]}),i2!=null&&h("div",{className:"core-list-row__value",children:i2}),a2!=null&&h("div",{className:"core-list-row__trailing",children:a2}),c2!=null&&h("div",{className:"core-list-row__actions",children:c2})]})}function Xe({header:e2,children:t2,measure:n2="page",className:r2,...i2}){return h("div",{...v(i2),className:y("core-page-frame",r2),"data-measure":n2,children:g("div",{className:"core-page-frame__column",children:[e2!=null&&h("header",{className:"core-page-frame__header",children:e2}),t2]})})}var Ze=["neutral","strong","accent","info","success","warning","danger"],Qe=()=>typeof process>"u"||false;function $e(e2,t2="neutral"){return typeof e2=="string"&&Ze.includes(e2)?e2:(typeof e2=="string"&&e2&&Qe()&&Ce(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Ze.join(", ")}); using "${t2}".`),t2)}var et=["subtle","on-dark","inherit"];function tt(e2,t2){return typeof e2=="string"&&(et.includes(e2)||Ze.includes(e2))?e2:t2}function nt(e2){return{"data-tone":e2,toned:!et.includes(e2)}}function rt({children:e2,as:t2="span",tone:n2,tabular:r2=false,className:i2,style:a2}){let{toned:o2,...s2}=nt(tt(n2,"subtle"));return h(t2,{className:y("core-eyebrow",o2&&"core-toned",i2),...s2,"data-tabular":r2?"true":void 0,style:a2,children:e2})}var it=6,at=100,ot=e2=>(Array.isArray(e2)?e2:[]).map(e3=>typeof e3=="string"?e3.replace(/\s+/g," ").trim():"").filter(Boolean).map(e3=>e3.length>at?`${e3.slice(0,99)}…`:e3).slice(0,it);function st({title:e2,level:t2=2,eyebrow:n2,meta:r2,intro:i2,actions:a2,className:o2,...s2}){let c2=t2===1?"h1":"h2",l2=ot(r2);return g("header",{...v(s2),className:y("core-page-head",o2),children:[n2&&h(rt,{as:"p",children:n2}),g("div",{className:"core-page-head__row",children:[h(c2,{className:"core-page-head__title","data-page-title":t2===1?void 0:"",children:e2}),a2!=null&&h("div",{className:"core-page-head__actions",children:a2})]}),l2.length>0&&h("p",{className:"core-page-head__meta",children:l2.map((e3,t3)=>h("span",{children:e3},`${t3}-${e3}`))}),i2!=null&&h("p",{className:"core-page-head__intro",children:i2})]})}var ct=Symbol.for("peripheries.viewer.context.v1"),lt=20,ut=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,dt=Object.freeze({audience:"client",roles:Object.freeze([])});function ft(e2){if(!e2||typeof e2!="object")return dt;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&ut.test(e3)&&e3.length<=40))].sort().slice(0,lt);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var pt=globalThis,mt=pt[ct]??=n(dt);function ht({value:e2,children:t2}){return h(mt.Provider,{value:ft(e2),children:t2})}function gt(){return a(mt)}var _t=e2=>e2.audience==="staff",vt=(e2,t2)=>e2.roles.includes(t2);function yt(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function bt(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var xt=["accepted","tentative","declined"],St=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),Ct=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2}),wt=e2=>{try{return new Intl.DateTimeFormat("en",{timeZone:e2}).resolvedOptions().timeZone}catch{return}};function Tt(e2,t2,n2,r2){let i2=e2.tzid?wt(e2.tzid):void 0,a2=wt(r2);return!i2||!a2||i2===a2?"":new Intl.DateTimeFormat(n2,{hour:"numeric",timeZoneName:"short",timeZone:r2}).formatToParts(t2).find(e3=>e3.type==="timeZoneName")?.value??""}function Et(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=St(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${St(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=St(t2,n2).format(r2),a2=Ct(t2,n2).format(r2),o2=Tt(e2,r2,t2,n2),s2=o2?` ${o2}`:"";if(!e2.endsAt)return`${i2} · ${a2}${s2}`;let c2=new Date(e2.endsAt);return Number.isNaN(c2.getTime())||c2.getTime()===r2.getTime()?`${i2} · ${a2}${s2}`:`${i2} · ${a2} – ${Ct(t2,n2).format(c2)}${s2}`}var Dt=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function Ot(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function kt(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function At(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?bt(e2.errors)||"Some details are missing or not valid.":bt(e2.errors)||"Something went wrong. Try again."}function jt(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function Mt(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function Nt(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[jt(e2.startsAt,t2)]:[]}var Pt=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var Ft="This can’t be done from here yet.";function It(e2){let[t2,n2]=f(null),[r2,a2]=f(""),o2=d(false),s2=typeof e2=="function";return{run:i(async(t3,r3)=>{if(typeof e2!="function"||o2.current)return{ok:false};o2.current=true,n2(t3),a2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(a2(At(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return a2("Something went wrong. Try again."),{ok:false}}finally{o2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:s2,clearMessage:()=>a2("")}}function Lt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var Rt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function zt(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:Rt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:Rt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:Rt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?Rt.changed:Rt.released}}function Bt(e2){let{release:t2,canRelease:n2=true,onIntent:r2,className:i2,style:a2}=e2,o2=s(),c2=_t(gt()),{run:l2,busy:u2,message:d2,available:f2}=It(r2);if(!c2)return null;let{words:p2,mark:m2}=zt(t2),_2=e2.busy===true||u2==="release",v2=Lt(e2.versionsHref),b2=Lt(e2.viewAsHref),x2=t2?.state==="staff_only",S2=n2!==false&&f2&&!x2,C2=_2?"Releasing…":t2?.state==="withdrawn"?"Release again":t2?.state==="released"&&t2.hasChanges===true?"Release changes":"Release",w2=[];(v2||f2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(b2||f2)&&w2.push({id:"view-as",label:"View as client",href:b2,action:"view_as_client"}),f2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void l2(e3.action)}}));return g("div",{className:y("core-page-staff-tools",i2),style:a2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":t2?.state==="released"?"released":"unreleased","aria-busy":_2||void 0,children:[g("div",{className:"core-page-staff-tools__bar",children:[g("span",{className:"core-page-staff-tools__pill",role:"status",children:[h("span",{className:"core-page-staff-tools__mark","data-mark":m2,"aria-hidden":"true"}),p2]}),g("div",{className:"core-page-staff-tools__actions",children:[S2?h("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:_2,"aria-describedby":`${o2}-note`,onClick:()=>void l2("release"),children:C2}):null,w2.map(e3=>e3.href?h("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):h("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void l2(e3.action),children:e3.label},e3.id)),T2.length>0?h(xe,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:h("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),h("span",{id:`${o2}-note`,className:"core-page-staff-tools__sr",children:S2?t2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),d2?h("p",{className:"core-page-staff-tools__message",role:"alert",children:d2}):null]})}function Vt({label:e2,actions:t2,children:n2,rail:r2=false,anchor:i2,className:a2,...o2}){return h("section",{...v(o2),id:i2,"aria-label":e2,className:y("core-rule-section",a2),"data-rail":r2||void 0,children:g("div",{className:"core-rule-section__grid",children:[g("div",{className:"core-rule-section__head",children:[e2&&h(rt,{as:"p",children:e2}),t2!=null&&h("div",{className:"core-rule-section__actions",children:t2})]}),h("div",{className:"core-rule-section__body",children:n2})]})})}function Ht({label:e2,children:t2,arrow:n2=true,className:r2,href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2,...u2}){let d2=Je({href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2}),f2=g(m,{children:[h("span",{className:"core-underlined-action__label",children:t2??e2}),n2&&h("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),p2={...v(u2),className:y("core-underlined-action",r2)};return i2?h("a",{...p2,href:i2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:f2}):h("button",{...p2,type:"button",onClick:d2.onClick,disabled:d2.busy,children:f2})}var Ut=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Wt({name:e2,initials:t2,src:n2,alt:r2,size:i2="md",tone:a2,title:o2,className:s2,...c2}){let[l2,u2]=f(false),d2=o2??r2??e2??"";return h("span",{...v(c2),className:y("core-avatar",a2!==void 0&&"core-toned",s2),"data-size":i2,"data-tone":a2===void 0?void 0:$e(a2),role:"img","aria-label":d2||void 0,children:n2&&!l2?h("img",{src:n2,alt:"",onError:()=>u2(true)}):h("span",{"aria-hidden":"true",children:t2??Ut(e2)})})}function Gt({code:e2,children:t2,block:n2=false,className:r2,...i2}){let a2=t2??e2;return n2?h("pre",{...v(i2),className:y("core-code",r2),"data-block":"",children:h("code",{children:a2})}):h("code",{...v(i2),className:y("core-code",r2),children:a2})}var Kt={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function qt({text:e2,children:t2,level:n2=2,size:r2,anchor:i2,className:a2,...o2}){let s2=Math.min(6,Math.max(1,Math.round(n2))),c2=`h${s2}`;return h(c2,{...v(o2),id:i2,className:y("core-heading",a2),"data-size":r2??Kt[s2],children:t2??e2})}var Jt={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Yt({text:e2,children:t2,as:n2="span",size:r2="md",weight:i2="normal",tone:a2="default",align:o2="start",truncate:s2=false,lines:c2,className:l2,...u2}){let d2=n2,f2=c2&&c2>0?Math.min(6,Math.round(c2)):void 0;return h(d2,{...v(u2),className:y("core-text",l2),"data-role":Jt[r2]??"body","data-weight":i2,"data-tone":a2,"data-align":o2,"data-truncate":s2||void 0,"data-lines":f2,children:t2??e2})}function Xt({label:e2,hint:t2,helperText:n2,error:r2,required:i2,optional:a2,htmlFor:o2,id:c2,hintId:l2,errorId:u2,as:d2="div",children:f2,className:p2,style:m2}){let _2=t2??n2,v2=o2??c2,b2=s().replace(/:/g,""),x2=l2??(_2?`${v2??b2}-hint`:void 0),S2=u2??(r2?`${v2??b2}-error`:void 0),C2=d2,w2=d2==="fieldset"?"legend":"label";return g(C2,{className:y("core-field",p2),style:m2,"data-invalid":r2?"":void 0,children:[e2&&g(w2,{className:"core-field__label",...w2==="label"&&v2?{htmlFor:v2}:{},children:[e2,i2&&g("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]}),a2&&!i2&&h("span",{className:"core-field__optional",children:" (optional)"})]}),_2&&h("p",{className:"core-field__hint",id:x2,children:_2}),f2,r2&&h("p",{className:"core-field__error",id:S2,role:"alert",children:r2})]})}function Zt(e2,t2,n2){let r2=s(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function Qt(e2){let t2={};for(let[n2,r2]of Object.entries(e2))(n2==="title"||n2==="autoFocus"||n2.startsWith("aria-")||n2.startsWith("data-"))&&(t2[n2]=r2);return t2}function $t(e2,t2){return{"aria-describedby":[t2["aria-describedby"],e2.aria["aria-describedby"]].filter(Boolean).join(" ")||void 0,"aria-invalid":e2.aria["aria-invalid"]??t2["aria-invalid"]}}function en(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function tn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,children:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,onBlur:m2,onFocus:_2,className:v2,wrapperClassName:b2,style:x2,ref:S2,...C2}){let w2=Zt(i2,c2,l2),T2=Qt(C2),[E2,D2]=f(t2??false),O2=e2??E2,k2=en(n2,r2);return h(Xt,{className:y("core-checkbox",b2),style:x2,hint:c2,error:l2,hintId:w2.hintId,errorId:w2.errorId,children:g("label",{className:"core-choices__option","data-disabled":d2?"":void 0,children:[h("input",{...T2,ref:S2,id:w2.control,type:"checkbox",className:v2,name:a2,checked:O2,required:u2,"aria-required":u2||void 0,disabled:d2,"aria-readonly":p2||void 0,onChange:t3=>{p2||(e2===void 0&&D2(t3.target.checked),k2(t3.target.checked))},onBlur:m2,onFocus:_2,...$t(w2,T2)}),g("span",{children:[s2??o2,u2&&h("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function nn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,orientation:m2="vertical",min:_2,max:v2,className:b2,style:x2,ref:S2}){let C2=[_2===void 0?"":`at least ${_2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[c2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=Zt(a2,w2,l2),[E2,D2]=f(n2??[]),O2=t2??E2,k2=en(r2,i2),A2=v2!==void 0&&O2.length>=v2;return h(Xt,{as:"fieldset",className:y("core-choices",b2),style:x2,label:s2,hint:w2,error:l2,required:u2,hintId:T2.hintId,errorId:T2.errorId,children:h("div",{className:"core-choices__list","data-orientation":m2,role:"group",...T2.aria,children:e2.map((n3,r3)=>{let i3=O2.includes(n3.value);return g("label",{className:"core-choices__option","data-disabled":n3.disabled||d2?"":void 0,children:[h("input",{ref:r3===0?S2:void 0,id:r3===0?T2.control:void 0,type:"checkbox",name:o2,value:n3.value,checked:i3,disabled:n3.disabled||d2||!i3&&A2||p2&&!i3,"aria-readonly":p2||void 0,onChange:()=>{if(p2)return;let r4=e2.map(e3=>e3.value).filter(e3=>e3===n3.value?!i3:O2.includes(e3));t2===void 0&&D2(r4),k2(r4)}}),h("span",{children:n3.label})]},n3.value)})})})}function rn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:p2,max:m2,fromLabel:_2="From",toLabel:v2="To",className:b2,style:x2,ref:S2}){let C2=Zt(i2,s2,c2),[w2,T2]=f(t2??{from:null,to:null}),E2=e2??w2,D2=en(n2,r2),O2=(t3,n3)=>{if(d2)return;let r3={...E2,[t3]:n3===""?null:n3};e2===void 0&&T2(r3),D2(r3)},k2={disabled:u2,readOnly:d2,required:l2,"aria-required":l2||void 0,className:"core-input",...C2.aria};return h(Xt,{as:"fieldset",className:y("core-date-range",b2),style:x2,label:o2,hint:s2,error:c2,required:l2,hintId:C2.hintId,errorId:C2.errorId,children:g("div",{className:"core-date-range__row",children:[g("label",{className:"core-date-range__part",children:[h("span",{className:"core-date-range__label",children:_2}),h("input",{ref:S2,id:C2.control,type:"date",name:a2?`${a2}.from`:void 0,value:E2.from??"",min:p2,max:E2.to??m2,onChange:e3=>O2("from",e3.target.value),...k2})]}),g("label",{className:"core-date-range__part",children:[h("span",{className:"core-date-range__label",children:v2}),h("input",{type:"date",name:a2?`${a2}.to`:void 0,value:E2.to??"",min:E2.from??p2,max:m2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function an(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function on({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:p2,upload:_2,accept:v2,hash:b2=false,className:x2,style:S2,ref:C2}){let w2=Zt(i2,s2,c2),[T2,E2]=f(t2??null),D2=e2===void 0?T2:e2,O2=en(n2,r2),[k2,A2]=f({busy:false,dragging:false}),j2=d(null),M2=t3=>{e2===void 0&&E2(t3),O2(t3)},N2=async e3=>{if(e3&&_2&&!p2&&!u2){A2({busy:true,dragging:false});try{let t3=await _2(e3,{hash:b2});"error"in t3?A2({busy:false,failed:t3.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t3))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e3=>{e3.preventDefault(),N2(e3.dataTransfer.files?.[0])},F2=c2??k2.failed;return h(Xt,{className:y("core-file-field",x2),style:S2,label:o2,hint:s2,error:F2,required:l2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:g("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e3=>{p2||u2||!_2||(e3.preventDefault(),k2.dragging||A2(e4=>({...e4,dragging:true})))},onDragLeave:()=>A2(e3=>({...e3,dragging:false})),onDrop:P2,children:[D2?g("div",{className:"core-file-field__file",children:[h("span",{className:"core-file-field__name",children:D2.file.name}),h("span",{className:"core-file-field__size",children:an(D2.file.size)}),!p2&&!u2&&h("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?h("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):g(m,{children:[h("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:u2||p2||!_2,"aria-required":l2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),h("span",{className:"core-file-field__drop",children:"or drop it here"})]}),h("input",{ref:j2,type:"file",name:a2,accept:v2,hidden:true,tabIndex:-1,onChange:e3=>void N2(e3.target.files?.[0])})]})})}function sn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,orientation:m2="vertical",className:_2,wrapperClassName:v2,style:b2,ref:x2,...S2}){let C2=Zt(a2,c2,l2),w2=Qt(S2),[T2,E2]=f(n2??null),D2=t2===void 0?T2:t2,O2=en(r2,i2),k2=o2??C2.control;return h(Xt,{as:"fieldset",className:y("core-choices",v2),style:b2,label:s2,hint:c2,error:l2,required:u2,hintId:C2.hintId,errorId:C2.errorId,children:h("div",{...w2,className:y("core-choices__list",_2),"data-orientation":m2,role:"radiogroup","aria-required":u2||void 0,...$t(C2,w2),children:e2.map((e3,n3)=>g("label",{className:"core-choices__option","data-disabled":e3.disabled||d2?"":void 0,children:[h("input",{ref:n3===0?x2:void 0,id:n3===0?C2.control:void 0,type:"radio",name:k2,value:e3.value,checked:D2===e3.value,disabled:e3.disabled||d2||p2&&D2!==e3.value,onChange:()=>{p2||(t2===void 0&&E2(e3.value),O2(e3.value))}}),h("span",{children:e3.label})]},e3.value))})})}var cn=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function ln({type:e2="text",value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:p2,readOnly:m2,placeholder:_2,inputMode:v2,autoComplete:b2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,onFocus:k2,className:A2,wrapperClassName:j2,style:M2,ref:N2,...P2}){let F2=Zt(a2,l2,u2),I2=Qt(P2),[L2,R2]=f(n2),z2=t2===void 0?L2:t2,B2=en(r2,i2),V2=e3=>e3==null?"":String(e3),[ee2,H2]=f(V2(z2));o(()=>{e2==="number"&&cn(ee2)!==(z2??null)&&H2(V2(z2))},[z2]);let U2=e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},W2=h("input",{...I2,ref:N2,id:F2.control,name:s2,type:e2==="number"?"text":e2,className:y("core-input core-text-field__input",A2),value:e2==="number"?ee2:V2(z2),onChange:n3=>{let r3=n3.target.value,i3=e2==="number"?cn(r3):r3;e2==="number"&&H2(r3),t2===void 0&&R2(i3),B2(i3)},onKeyDown:U2,onBlur:O2,onFocus:k2,placeholder:_2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:b2,min:x2,max:S2,step:C2,required:d2,"aria-required":d2||void 0,disabled:p2,readOnly:m2,...$t(F2,I2)}),G2=w2||T2?g("div",{className:"core-text-field__affixed",children:[w2&&h("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),W2,T2&&h("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):W2;return h(Xt,{className:y("core-text-field",j2),style:M2,label:c2,hint:l2,error:u2,required:d2,htmlFor:F2.control,hintId:F2.hintId,errorId:F2.errorId,children:G2})}function un({value:e2,defaultValue:t2,onChange:n2,setValue:r2,label:i2="Search",onSearch:a2,onClear:o2,size:s2="md",className:c2,wrapperClassName:l2,...u2}){let[d2,p2]=f(t2??""),m2=e2??d2,_2=t3=>{e2===void 0&&p2(t3),n2?.(t3),r2?.(t3)};return g("div",{className:y("core-search-field",l2),"data-filled":m2?"":void 0,"data-size":s2,children:[h(ln,{...u2,label:i2,value:m2,onChange:e3=>_2(typeof e3=="string"?e3:""),onEnter:()=>a2?.(m2),type:"search",inputMode:"search",className:c2,wrapperClassName:"core-search-field__field"}),g("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[h("circle",{cx:"11",cy:"11",r:"6.5"}),h("path",{d:"M16 16l4 4"})]}),m2&&!u2.disabled&&!u2.readOnly&&h("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>{_2(""),o2?.()},children:h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function dn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,placeholder:m2="Choose…",onBlur:_2,onFocus:v2,className:b2,wrapperClassName:x2,style:S2,ref:C2,...w2}){let T2=Zt(a2,c2,l2),E2=Qt(w2),[D2,O2]=f(n2??null),k2=t2===void 0?D2:t2,A2=en(r2,i2);return h(Xt,{className:y("core-select",x2),style:S2,label:s2,hint:c2,error:l2,required:u2,htmlFor:T2.control,hintId:T2.hintId,errorId:T2.errorId,children:g("select",{...E2,ref:C2,id:T2.control,name:o2,className:y("core-input core-select__input",b2),value:k2??"",onChange:e3=>{let n3=e3.target.value===""?null:e3.target.value;t2===void 0&&O2(n3),A2(n3)},required:u2,"aria-required":u2||void 0,disabled:d2||p2,"aria-readonly":p2||void 0,onBlur:_2,onFocus:v2,...$t(T2,E2),children:[h("option",{value:"",children:m2}),e2.map(e3=>h("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function fn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:p2=0,max:m2=100,step:_2=1,format:v2=String,onBlur:b2,onFocus:x2,className:S2,wrapperClassName:C2,style:w2,ref:T2,...E2}){let D2=Zt(i2,s2,c2),O2=Qt(E2),[k2,A2]=f(t2??p2),j2=e2??k2,M2=en(n2,r2);return h(Xt,{className:y("core-slider",C2),style:w2,label:o2,hint:s2,error:c2,required:l2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:g("div",{className:"core-slider__row",children:[h("input",{...O2,ref:T2,id:D2.control,name:a2,type:"range",className:y("core-slider__input",S2),min:p2,max:m2,step:_2,value:j2,disabled:u2,"aria-readonly":d2||void 0,"aria-valuetext":v2(j2),onChange:t3=>{if(d2)return;let n3=Number(t3.target.value);e2===void 0&&A2(n3),M2(n3)},onBlur:b2,onFocus:x2,...$t(D2,O2)}),h("output",{className:"core-slider__value",htmlFor:D2.control,children:v2(j2)})]})})}function pn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,disabled:l2,readOnly:u2,onBlur:d2,onFocus:p2,className:m2,wrapperClassName:_2,style:v2,ref:b2,...x2}){let S2=Zt(i2,s2,c2),C2=Qt(x2),[w2,T2]=f(t2??false),E2=e2??w2,D2=en(n2,r2);return g("div",{className:y("core-switch",_2),style:v2,children:[g("button",{...C2,ref:b2,id:S2.control,name:a2,type:"button",role:"switch","aria-checked":E2,"aria-readonly":u2||void 0,disabled:l2,className:y("core-switch__control",m2),onClick:()=>{u2||(e2===void 0&&T2(!E2),D2(!E2))},onBlur:d2,onFocus:p2,...$t(S2,C2),children:[h("span",{className:"core-switch__track","aria-hidden":"true",children:h("span",{className:"core-switch__thumb"})}),h("span",{className:"core-switch__label",children:o2})]}),s2&&h("p",{className:"core-field__hint",id:S2.hintId,children:s2}),c2&&h("p",{className:"core-field__error",id:S2.errorId,role:"alert",children:c2})]})}function mn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:l2,required:u2,disabled:p2,readOnly:m2,placeholder:_2,rows:v2=3,autoGrow:b2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,onFocus:w2,className:T2,wrapperClassName:E2,style:D2,ref:O2,...k2}){let A2=Zt(i2,s2,l2),j2=Qt(k2),[M2,N2]=f(t2??""),P2=e2??M2,F2=en(n2,r2),I2=d(null);return c(()=>{let e3=I2.current;b2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[P2,b2]),g(Xt,{className:y("core-text-area",E2),style:D2,label:o2,hint:s2,error:l2,required:u2,htmlFor:A2.control,hintId:A2.hintId,errorId:A2.errorId,children:[h("textarea",{...j2,ref:e3=>{I2.current=e3,typeof O2=="function"?O2(e3):O2&&(O2.current=e3)},id:A2.control,name:a2,className:y("core-input core-text-area__input",T2),rows:v2,value:P2,onChange:t3=>{e2===void 0&&N2(t3.target.value),F2(t3.target.value)},onKeyDown:S2,onBlur:C2,onFocus:w2,placeholder:_2,maxLength:x2,required:u2,"aria-required":u2||void 0,disabled:p2,readOnly:m2,...$t(A2,j2)}),x2!==void 0&&g("span",{className:"core-field__hint","aria-live":"polite",children:[P2.length," / ",x2]})]})}function hn({label:e2,children:t2,tone:n2,variant:r2="soft",className:i2,...a2}){return h("span",{...v(a2),className:y("core-badge","core-toned",i2),"data-tone":$e(n2),"data-variant":r2,children:t2??e2})}function gn({message:e2,title:t2,action:n2,className:r2,...i2}){return g("div",{...v(i2),className:y("core-empty-state",r2),role:"status",children:[t2&&h("p",{className:"core-empty-state__title",children:t2}),h("p",{className:"core-empty-state__message",children:e2}),n2!=null&&h("div",{className:"core-empty-state__action",children:n2})]})}var _n={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function vn({title:e2,message:t2,children:n2,tone:r2,action:i2,onDismiss:a2,className:o2,...s2}){let c2=$e(r2,"info"),l2=c2==="warning"||c2==="danger";return g("div",{...v(s2),role:l2?"alert":"status",className:y("core-notice","core-toned",o2),"data-tone":c2,children:[h("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:_n[c2]??_n.info})}),g("div",{className:"core-notice__body",children:[e2&&h("p",{className:"core-notice__title",children:e2}),h("div",{className:"core-notice__message",children:n2??t2})]}),i2&&h("div",{className:"core-notice__action",children:i2}),a2&&h("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:a2,children:h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function yn({value:e2,max:t2=100,label:n2,showValue:r2=false,tone:i2,size:a2="md",className:o2,style:s2,...c2}){let l2=typeof e2=="number"&&Number.isFinite(e2)&&t2>0,u2=l2?Math.max(0,Math.min(100,e2/t2*100)):0;return g("div",{...v(c2),className:y("core-progress","core-toned",o2),"data-tone":$e(i2,"accent"),"data-size":a2,style:s2,children:[(n2||r2&&l2)&&g("div",{className:"core-progress__head",children:[n2&&h("span",{className:"core-progress__label",children:n2}),r2&&l2&&g("span",{className:"core-progress__value",children:[Math.round(u2),"%"]})]}),h("div",{className:"core-progress__track",role:"progressbar","aria-label":n2,"aria-valuemin":0,"aria-valuemax":l2?t2:void 0,"aria-valuenow":l2?e2:void 0,"data-indeterminate":l2?void 0:"",style:x({"--core-progress-fill":`${u2}%`}),children:h("div",{className:"core-progress__fill"})})]})}function bn({shape:e2="text",lines:t2=3,width:n2,height:r2,className:i2,style:a2,...o2}){let s2=x({"--core-skeleton-w":b(n2),"--core-skeleton-h":b(r2)},a2);if(e2!=="text")return h("span",{...v(o2),"aria-hidden":"true",className:y("core-skeleton",i2),"data-shape":e2,style:s2});let c2=Math.max(1,Math.min(12,Math.round(t2)));return h("span",{...v(o2),"aria-hidden":"true",className:y("core-skeleton-lines",i2),style:s2,children:Array.from({length:c2},(e3,t3)=>h("span",{className:"core-skeleton","data-shape":"line","data-last":t3===c2-1&&c2>1?"":void 0},t3))})}function xn({label:e2="Loading",size:t2="md",className:n2,...r2}){return h("span",{...v(r2),role:"status","aria-label":e2,className:y("core-spinner",n2),"data-size":t2})}function Sn({content:e2,text:t2,children:n2,side:r2="top",className:i2,...a2}){let[c2,l2]=f(false),u2=s();return o(()=>{if(!c2)return;let e3=e4=>{e4.key==="Escape"&&l2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[c2]),g("span",{...v(a2),className:y("core-tooltip",i2),"aria-describedby":u2,onMouseEnter:()=>l2(true),onMouseLeave:()=>l2(false),onFocus:()=>l2(true),onBlur:()=>l2(false),children:[n2,h("span",{id:u2,role:"tooltip",className:"core-tooltip__bubble","data-side":r2,"data-open":c2?"":void 0,children:e2??t2})]})}function Cn({children:n2,className:i2,style:a2,...o2}){let s2=e.toArray(n2),c2=s2.length===1?s2[0]:null;if(!r(c2))return null;let l2=c2.props??{},u2={...o2,...l2},d2=[i2,l2.className].filter(Boolean).join(" ");d2&&(u2.className=d2),(a2||l2.style)&&(u2.style={...a2,...l2.style});for(let e2 of Object.keys(o2)){let t2=o2[e2],n3=l2[e2];/^on[A-Z]/.test(e2)&&typeof t2=="function"&&typeof n3=="function"&&(u2[e2]=e3=>{t2(e3)!==false&&n3(e3)})}return t(c2,u2)}function wn({children:e2,label:t2,variant:n2="primary",size:r2="md",tone:i2="neutral",iconLeft:a2,iconRight:o2,loading:s2=false,disabled:c2=false,type:l2="button",fullWidth:u2=false,asChild:d2=false,className:f2,href:p2,action:_2,input:b2,actions:x2,navigate:S2,onClick:C2,...w2}){let T2=Je({href:p2,action:_2,input:b2,actions:x2,navigate:S2,onClick:C2}),E2=s2||T2.busy,D2={...v(w2),className:y("core-button",f2),"data-variant":n2,"data-size":r2,"data-tone":i2,"data-full":u2||void 0,"data-busy":E2||void 0},O2=g(m,{children:[E2?h("span",{className:"core-button__spinner","aria-hidden":"true"}):a2,h("span",{className:"core-button__label",children:e2??t2}),o2]});if(d2){let t3=c2||E2,n3=e3=>t3?(e3.preventDefault(),false):T2.onClick(e3);return h(Cn,{...D2,"aria-disabled":t3||void 0,"aria-busy":E2||void 0,onClick:n3,children:e2})}return p2&&!c2?h("a",{...D2,href:p2,onClick:T2.onClick,"aria-busy":E2||void 0,...T2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:O2}):h("button",{...D2,type:l2,disabled:c2||E2,"aria-busy":E2||void 0,onClick:T2.onClick,children:O2})}function Tn({children:e2,label:t2,variant:n2="prompt",size:r2="md",selected:i2,onToggle:a2,iconLeft:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,..._2}){let b2=i2!==void 0||a2!==void 0,x2=Je({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2??(a2?()=>a2(!i2):void 0)});return l2&&!s2&&!b2?g("a",{...v(_2),className:y("core-chip",c2),"data-variant":n2,"data-size":r2,href:l2,onClick:x2.onClick,...x2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[o2,h("span",{className:"core-chip__label",children:e2??t2})]}):g("button",{...v(_2),type:"button",className:y("core-chip",c2),"data-variant":n2,"data-size":r2,"aria-pressed":b2?!!i2:void 0,disabled:s2||x2.busy,onClick:x2.onClick,children:[o2,h("span",{className:"core-chip__label",children:e2??t2})]})}function En({icon:e2,children:t2,label:n2,size:r2="md",variant:i2="ghost",pressed:a2,disabled:o2=false,className:s2,href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2,...m2}){let g2=Je({href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2}),_2={...v(m2),className:y("core-icon-button",s2),"data-size":r2,"data-variant":i2,"aria-label":n2,title:n2},b2=h("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??t2});return c2&&!o2?h("a",{..._2,href:c2,onClick:g2.onClick,...g2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:b2}):h("button",{..._2,type:"button","aria-pressed":a2,disabled:o2||g2.busy,onClick:g2.onClick,children:b2})}function Dn({href:e2,children:t2,label:n2,variant:r2="default","aria-current":i2,className:a2,navigate:o2,onClick:s2,...c2}){let l2=Je({href:e2,navigate:o2,onClick:s2});return Ke(e2)||qe(e2)||/^(https?:|mailto:)/i.test(e2)?g("a",{...v(c2),className:y("core-link",a2),"data-variant":r2,"aria-current":i2,href:e2,onClick:l2.onClick,...l2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[t2??n2,l2.external&&g(m,{children:[h("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M7 17L17 7M8 7h9v9"})}),h("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):h("span",{className:y("core-link",a2),children:t2??n2})}function On(e2){let{param:t2="kind",keep:n2,label:r2="Filter",onChange:i2,className:a2,style:o2}=e2,s2=(Array.isArray(e2.options)?e2.options:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!=="");if(s2.length===0)return null;let c2=typeof e2.selected=="string"&&s2.some(t3=>t3.id===e2.selected)?e2.selected:s2[0].id;return h("form",{className:"core-filter-chips-form",method:"get",action:"",onSubmit:e3=>{if(!i2)return;e3.preventDefault();let t3=e3.nativeEvent.submitter;t3?.value&&i2(t3.value)},children:g("div",{className:y("core-filter-chips",a2),style:o2,role:"group","aria-label":r2,children:[Object.entries(n2??{}).map(([e3,t3])=>h("input",{type:"hidden",name:e3,value:t3},e3)),s2.map(e3=>h("button",{type:"submit",name:t2,value:e3.id,className:"core-chip","data-variant":"toggle","data-size":"sm","aria-pressed":e3.id===c2,children:h("span",{className:"core-chip__label",children:e3.label})},e3.id))]})})}function kn({options:e2,value:t2,defaultValue:n2,onChange:r2,label:i2,fullWidth:a2=false,size:o2="md",className:c2,setValue:l2,...u2}){let[p2,m2]=f(n2??e2[0]?.value),g2=t2??p2,_2=s(),b2=d([]),x2=e3=>{t2===void 0&&m2(e3),r2?.(e3),l2?.(e3)},S2=e2.map((e3,t3)=>e3.disabled?-1:t3).filter(e3=>e3>=0),C2=(t3,n3)=>{let r3=t3.key==="ArrowRight"||t3.key==="ArrowDown"?1:t3.key==="ArrowLeft"||t3.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t3.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];b2.current[a3]?.focus(),x2(e2[a3].value)};return h("div",{...v(u2),role:"radiogroup","aria-label":i2,className:y("core-segmented",c2),"data-full":a2||void 0,"data-size":o2,children:e2.map((e3,t3)=>{let n3=e3.value===g2;return h("button",{ref:e4=>{b2.current[t3]=e4},type:"button",role:"radio",name:_2,"aria-checked":n3,tabIndex:n3||g2===void 0&&t3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,t3),children:e3.label},e3.value)})})}function An({items:e2=[],children:t2,numbered:n2=false,single:r2=false,rules:i2="subtle",value:a2,onValueChange:c2,className:l2,...u2}){let f2=s(),p2=d(null),m2=n2?"ol":"ul",_2=(e3,t3)=>e3.id??String(t3),b2=a2!==void 0,x2=b2?new Set(a2):void 0,S2=()=>{x2&&p2.current&&p2.current.querySelectorAll("details[data-item]").forEach(e3=>{let t3=x2.has(e3.dataset.item);e3.open!==t3&&(e3.open=t3)})};o(S2);let C2=()=>{if(!p2.current)return;let t3=[...p2.current.querySelectorAll("details[data-item]")].filter(e3=>e3.open).map(e3=>e3.dataset.item),n3=b2?e2.map(_2).filter(e3=>x2.has(e3)):void 0;n3&&n3.length===t3.length&&n3.every((e3,n4)=>e3===t3[n4])||(c2?.(t3),b2&&queueMicrotask(()=>requestAnimationFrame(S2)))};return g("div",{...v(u2),ref:p2,className:y("core-accordion",l2),"data-rules":i2,children:[e2.length>0&&h(m2,{className:"core-accordion__list","data-numbered":n2||void 0,children:e2.map((e3,t3)=>h("li",{className:"core-accordion__item",children:g("details",{className:"core-disclosure",name:r2?f2:void 0,open:b2?void 0:e3.open||void 0,...b2||c2?{"data-item":_2(e3,t3),onToggle:C2}:{},children:[g("summary",{className:"core-disclosure__summary",children:[n2&&h("span",{className:"core-accordion__number",children:t3+1}),e3.question]}),h("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??t3))}),t2]})}function jn({media:e2,header:t2,body:n2,footer:r2,children:i2,tone:a2="plain",className:o2,...s2}){return g("article",{...v(s2),className:y("core-card",o2),"data-tone":a2,children:[e2!=null&&h("div",{className:"core-card__media",children:e2}),t2!=null&&h("header",{className:"core-card__header",children:t2}),(n2!=null||i2!=null)&&g("div",{className:"core-card__body",children:[n2,i2]}),r2!=null&&h("footer",{className:"core-card__footer",children:r2})]})}var Mn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Nn({start:e2,end:t2,children:n2,ratio:r2="1:1",gap:i2,stackBelow:a2="compact",className:o2,...s2}){return g("div",{...v(s2),className:y("core-columns",o2),"data-stack":a2,children:[g("div",{className:"core-columns__grid",style:x({"--core-columns-template":Mn[r2]??Mn["1:1"],"--core-columns-gap":b(i2)}),children:[h("div",{className:"core-columns__start",children:e2}),h("div",{className:"core-columns__end",children:t2})]}),n2]})}var Pn=Nn;function Fn({summary:e2,content:t2,children:n2,open:r2=false,onToggle:i2,className:a2,...o2}){return g("details",{...v(o2),className:y("core-disclosure",a2),open:r2||void 0,onToggle:i2?e3=>i2(e3.currentTarget.open):void 0,children:[h("summary",{className:"core-disclosure__summary",children:e2}),g("div",{className:"core-disclosure__content",children:[t2,n2]})]})}function In({items:t2,children:n2,min:r2,columns:i2,gap:a2,className:o2,style:s2,...c2}){let l2=[...e.toArray(t2),...e.toArray(n2)];return h("div",{...v(c2),className:y("core-grid",o2),"data-capped":i2&&i2>0?"":void 0,style:x({"--core-grid-min":b(r2),"--core-grid-gap":b(a2),"--core-grid-cols":i2&&i2>0?String(Math.round(i2)):void 0},s2),children:l2})}function Ln({item:t2,each:n2,as:r2,layout:i2="stack",gap:a2,min:o2,empty:s2,className:c2,style:l2,...u2}){let d2=e.toArray(t2);return d2.length?h("div",{...v(u2),className:y("core-repeat",c2),"data-layout":i2,style:x({"--core-repeat-gap":b(a2),"--core-repeat-min":b(o2)},l2),children:d2}):s2?h("p",{className:"core-repeat__empty",children:s2}):null}var Rn=["page-x-of-y","page-number","page-count"],zn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Bn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Vn=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Hn=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:Bn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:zn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Vn,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Vn,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...zn,eyebrow:{...zn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],Un=new Map;function Wn(e2){Un.set(e2.id,e2)}for(let e2 of Hn)Wn(e2);function Gn(){return[...Un.keys()].sort()}function Kn(e2){let t2=Un.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${Gn().join(", ")}`);if(!t2.extends)return t2;let n2=Un.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function qn(){let e2={};for(let t2 of Gn())try{e2[t2]=Kn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Jn=Object.freeze(qn()),Yn="workbook";function Xn(e2,t2){try{return Kn(e2)}catch{return Ce(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(Ce("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Yn}". If this document is an instrument, its numbering and depth are being dropped.`),Xn(Yn,t2)):Xn(e2,t2)}var Zn=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),Qn=["full","muted","subtle","border","accent","accentText","sunken"],$n=["structural","hairline","head","row"],er=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],tr=3,nr="initial";function rr(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??nr,"--doc-rail-width":e2.rail.width??nr,"--doc-rail-gutter":e2.rail.gutter??nr,"--doc-floor":`${e2.floorPx}px`};for(let n2 of Qn)t2[`--doc-ink-${Zn(n2)}`]=e2.ink[n2];for(let n2 of $n)t2[`--doc-rule-${n2}`]=e2.rules[n2]??nr;for(let n2 of er){let r2=e2.type[n2],i2=`--doc-type-${Zn(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=tr;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??nr;return t2}var ir=(e2,t2)=>`${e2} {
1
+ import{Children as e,Fragment as t,cloneElement as n,createContext as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";var v=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function y(e2){let t2={};for(let n2 in e2)v.has(n2)||(t2[n2]=e2[n2]);return t2}var b=(...e2)=>e2.filter(Boolean).join(" ")||void 0,x=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function S(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}var C=Symbol.for("peripheries.embed.context.v1"),w=globalThis,T=w[C]??=r(false);function E(){return o(T)}function D({as:e2,className:t2,children:n2,...r2}){return g(e2??"div",{className:b("core-box",t2),...y(r2),children:n2})}function O({minHeight:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-center",t2),style:S({"--core-center-min-height":x(e2)},n2),children:r2})}function k({name:e2,className:t2,style:n2,children:r2,...i2}){return g(D,{...i2,className:b("core-container",t2),style:S({"--core-container-name":e2},n2),children:r2})}function A({orientation:e2="horizontal",weight:t2="subtle",spacing:n2,className:r2,style:i2,ref:a2,...o2}){let s2={className:b("core-divider",r2),"data-weight":t2,"data-orientation":e2,style:S({"--core-divider-spacing":x(n2)},i2)};return e2==="vertical"?g("span",{role:"separator","aria-orientation":"vertical",...s2}):g("hr",{ref:a2,...y(o2),...s2})}function j({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-hide","data-when":e2,children:t2})}function M({gap:e2,align:t2="center",justify:n2="start",wrap:r2=true,stackWhen:i2,className:a2,style:o2,children:s2,...c2}){return g(D,{...c2,className:b("core-inline",a2),"data-align":t2,"data-justify":n2,"data-wrap":r2?"true":"false","data-stack-when":i2,style:S({"--core-inline-gap":x(e2)},o2),children:s2})}var N=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function P(e2){return[...e2.querySelectorAll(N)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var F=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,I=2;function L({label:t2,snap:n2="start",children:r2,className:i2,...o2}){let c2=f(null),[l2,u2]=p({prev:false,next:false}),[d2,m2]=p(false),h2=a(()=>{let e2=c2.current;if(!e2)return;let t3=e2.scrollLeft>I,n3=e2.scrollWidth-e2.clientWidth-e2.scrollLeft>I;u2(e3=>e3.prev===t3&&e3.next===n3?e3:{prev:t3,next:n3}),m2(e2.scrollWidth>e2.clientWidth&&P(e2).length===0)},[]);s(()=>{let e2=c2.current;if(!e2)return;h2();let t3=new ResizeObserver(h2);t3.observe(e2);for(let n3 of Array.from(e2.children))t3.observe(n3);return()=>t3.disconnect()},[h2,r2]);let v2=e2=>{let t3=c2.current;t3&&t3.scrollBy({left:e2*t3.clientWidth*.8,behavior:F()?"auto":"smooth"})};return _("div",{...y(o2),className:b("core-rail",i2),"data-snap":n2,"data-prev":l2.prev?"":void 0,"data-next":l2.next?"":void 0,children:[g("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${t2} back`,hidden:!l2.prev,onClick:()=>v2(-1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M10 3 5 8l5 5"})})}),g("ul",{ref:c2,role:"list","aria-label":t2,className:"core-rail__track",tabIndex:d2?0:void 0,onScroll:h2,children:e.toArray(r2).map((e2,t3)=>g("li",{className:"core-rail__item",children:e2},t3))}),g("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${t2} forward`,hidden:!l2.next,onClick:()=>v2(1),children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"m6 3 5 5-5 5"})})})]})}function R({when:e2,children:t2,as:n2="span"}){return g(n2,{className:"core-show","data-when":e2,children:t2})}function z(e2,t2,n2){let[r2,i2]=p(t2),o2=e2!==void 0,s2=o2?e2:r2,c2=f(n2);return c2.current=n2,[s2,a(e3=>{o2||i2(e3),c2.current?.(e3)},[o2])]}function B(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function ee(e2){let[t2,n2]=p(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return s(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var V="core-overlay-dismiss",H=Symbol.for("peripheries.overlay.host.v1"),U=globalThis,W=U[H]??=r(null);function G(e2){let t2=e2&&typeof e2=="object"?e2:{},n2=typeof HTMLElement<"u"&&t2.mount instanceof HTMLElement?t2.mount:void 0,r2=typeof t2.portal=="function"?t2.portal:void 0;return{format:t2.format==="desktop"?"desktop":"mobile",...n2?{mount:n2}:{},...r2?{portal:r2}:{}}}function K({value:e2,children:t2}){return g(W.Provider,{value:G(e2),children:t2})}function te(){return o(W)}var ne="(max-width: 640px)";function re(){let e2=te(),t2=ee(ne);return e2?e2.format:t2?"mobile":"desktop"}var ie=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function q({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:ie(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:ie(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function ae(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var oe=4;function se({trigger:e2,label:t2,placement:r2="bottom-start",open:i2,defaultOpen:a2=false,onOpenChange:o2,popupRole:u2="dialog",initialFocus:d2,onTriggerKeyDown:m2,children:v2,className:y2}){let[x2,S2]=z(i2,a2,o2),C2=c(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=f(null),E2=f(null),[D2]=p(ae),O2=f(x2);O2.current=x2;let k2=f("closed");l(()=>{let e3=T2.current;if(e3){if(x2&&k2.current==="closed")k2.current="open",e3.showPopover();else if(!x2&&k2.current==="open"){k2.current="closed";let t3=document.activeElement;(!t3||t3===document.body||e3.contains(t3))&&E2.current?.focus({preventScroll:true}),e3.hidePopover()}}},[x2]),s(()=>{let e3=T2.current;if(!e3)return;let t3=t4=>{let n3=t4.newState;if(k2.current=n3==="open"?"open":"closed",n3==="open"&&!O2.current&&S2(true),n3==="closed"&&O2.current){S2(false);let t5=document.activeElement;(!t5||t5===document.body||e3.contains(t5))&&E2.current?.focus({preventScroll:true})}},n2=t4=>{if(t4.newState!=="open"||d2===false)return;let n3=(typeof d2=="function"?d2(e3):d2?e3.querySelector(d2):null)??P(e3)[0];n3?n3.focus({preventScroll:true}):(e3.tabIndex=-1,e3.focus({preventScroll:true}))};return e3.addEventListener("beforetoggle",t3),e3.addEventListener("toggle",n2),()=>{e3.removeEventListener("beforetoggle",t3),e3.removeEventListener("toggle",n2)}},[S2,d2]),l(()=>{let e3=T2.current,t3=E2.current;if(D2||!x2||!e3||!t3)return;let n2=()=>{let n3=q({anchor:t3.getBoundingClientRect(),size:{width:e3.offsetWidth,height:e3.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:r2,gap:oe});e3.style.setProperty("--core-popover-x",`${n3.x}px`),e3.style.setProperty("--core-popover-y",`${n3.y}px`),e3.dataset.placement=n3.placement,e3.dataset.placed=""};n2();let i3=new ResizeObserver(n2);return i3.observe(e3),window.addEventListener("resize",n2),window.addEventListener("scroll",n2,true),()=>{delete e3.dataset.placed,i3.disconnect(),window.removeEventListener("resize",n2),window.removeEventListener("scroll",n2,true)}},[D2,x2,r2]);let A2=()=>S2(false),j2=e2.props,M2={ref:B(E2,j2.ref),popoverTarget:C2,"aria-haspopup":u2,"aria-expanded":x2,"aria-controls":C2,className:b(j2.className,"core-popover-anchor"),style:{...j2.style,"--core-popover-anchor":w2},onKeyDown:e3=>{m2?.(e3),j2.onKeyDown?.(e3)}};return _(h,{children:[n(e2,M2),g("div",{ref:T2,id:C2,popover:"auto",role:u2==="menu"?void 0:u2,"aria-label":u2==="menu"?void 0:t2,className:b("core-popover",y2),"data-placement":r2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e3=>{let t3=e3.relatedTarget;t3&&!e3.currentTarget.contains(t3)&&t3!==E2.current&&A2()},children:x2?typeof v2=="function"?v2({close:A2}):v2:null})]})}var ce=Symbol.for("peripheries.overlay.scrollLock.v1"),le=globalThis;function ue(){if(typeof document>"u")return()=>{};let e2=le[ce]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function de(e2){let t2=te();return t2?g(me,{...e2,host:t2}):g(he,{...e2})}var fe={dialog:"center","sheet-bottom":"bottom","sheet-end":"end"};function pe(e2,t2){let n2=f({onClose:e2,onOpenChange:t2});return n2.current={onClose:e2,onOpenChange:t2},f(()=>{n2.current.onOpenChange?.(false),n2.current.onClose?.()}).current}function me({variant:e2,kind:t2,open:n2,onClose:r2,onOpenChange:i2,title:a2,label:o2,description:l2,role:u2="dialog",initialFocus:d2,dismissOnBackdrop:p2=true,headerStart:m2,headerTools:v2,footer:y2,children:x2,className:S2,host:C2}){let w2=f(null),T2=pe(r2,i2),E2=`core-overlay-${c().replace(/:/g,"")}`,D2=`${E2}-title`,O2=`${E2}-description`;if(s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=(d2?e3.querySelector(d2):null)??P(e3)[0];t3?t3.focus({preventScroll:true}):e3.focus({preventScroll:true})},[n2,d2]),s(()=>{let e3=w2.current;if(!e3||!n2)return;let t3=t4=>{t4.target===e3&&T2()};return e3.addEventListener(V,t3),()=>e3.removeEventListener(V,t3)},[n2,T2]),!n2)return null;let k2=o2??(typeof a2=="string"?a2:"dialog"),A2=_(h,{children:[g("div",{className:"core-overlay-scrim","data-overlay-scrim":"","aria-hidden":"true",onClick:()=>p2&&T2()}),g("div",{ref:w2,id:E2,className:b("core-overlay",S2),"data-overlay":t2??(e2==="dialog"?"dialog":"sheet"),"data-placement":fe[e2],role:u2==="alertdialog"?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":D2,"aria-describedby":l2?O2:void 0,tabIndex:-1,children:_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[m2,g("h2",{id:D2,className:"core-modal__title",children:a2}),g("div",{className:"core-modal__tools",children:v2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${k2}`,onClick:T2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[l2?g("p",{id:O2,className:"core-modal__description",children:l2}):null,x2]}),y2?g("footer",{className:"core-modal__footer",children:y2}):null]})},"root")]}),j2=C2.mount??(typeof document>"u"?null:document.body);return C2.portal&&j2?g(h,{children:C2.portal(A2,j2)}):A2}function he({variant:e2,open:t2,onClose:n2,onOpenChange:r2,title:i2,label:a2,description:o2,role:l2="dialog",initialFocus:u2,dismissOnBackdrop:d2=true,headerStart:p2,headerTools:m2,footer:h2,children:v2,className:y2}){let x2=f(null),S2=f(null),C2=pe(n2,r2),w2=c(),T2=c();s(()=>{let e3=x2.current;if(!e3||!t2)return;let n3=document.activeElement;e3.showModal();let r3=ue(),i3=(u2?e3.querySelector(u2):null)??P(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),C2()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),r3(),e3.open&&e3.close();let t3=document.activeElement;(!t3||t3===document.body)&&n3?.isConnected&&n3.focus({preventScroll:true})}},[t2,u2]);let E2=a2??(typeof i2=="string"?i2:"dialog");return g("dialog",{ref:x2,className:b("core-modal",y2),"data-variant":e2,role:l2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":w2,"aria-describedby":o2?T2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t3=P(e3.currentTarget),n3=t3[0],r3=t3[t3.length-1];if(!n3||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n3||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n3.focus())},onPointerDown:e3=>{S2.current=e3.target},onClick:e3=>{d2&&e3.target===e3.currentTarget&&S2.current===e3.currentTarget&&C2()},children:t2&&_("div",{className:"core-modal__surface",children:[_("header",{className:"core-modal__header",children:[p2,g("h2",{id:w2,className:"core-modal__title",children:i2}),g("div",{className:"core-modal__tools",children:m2}),g("button",{type:"button",className:"core-modal__close","aria-label":`Close ${E2}`,onClick:C2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),_("div",{className:"core-modal__body",children:[o2?g("p",{id:T2,className:"core-modal__description",children:o2}):null,v2]}),h2?g("footer",{className:"core-modal__footer",children:h2}):null]})})}function J({side:e2="bottom",back:t2,...n2}){return e2==="auto"?g(ge,{back:t2,...n2}):g(_e,{side:e2,back:t2,...n2})}function ge({back:e2,...t2}){let n2=re()==="mobile";return g(_e,{side:n2?"bottom":"center",back:e2,...t2})}function _e({side:e2,back:t2,...n2}){let r2=t2?g("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${t2.label}`,onClick:t2.onBack,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return g(de,{variant:e2==="end"?"sheet-end":e2==="center"?"dialog":"sheet-bottom",kind:"sheet",headerStart:r2,...n2})}var ve='[role="menuitem"], [role="menuitemcheckbox"]',ye=600,be=e2=>"type"in e2;function xe({items:e2,label:t2,onChoose:n2,onTab:r2,className:i2}){let a2=f(null),o2=f({text:"",at:0}),s2=()=>[...a2.current?.querySelectorAll(ve)??[]];return g("div",{ref:a2,role:"menu","aria-label":t2,className:b("core-menu",i2),onKeyDown:e3=>{let t3=s2(),n3=t3.indexOf(document.activeElement),i3=n4=>{e3.preventDefault(),t3[(n4+t3.length)%t3.length]?.focus({preventScroll:true})};if(e3.key==="ArrowDown")i3(n3+1);else if(e3.key==="ArrowUp")i3(n3<0?-1:n3-1);else if(e3.key==="Home")i3(0);else if(e3.key==="End")i3(-1);else if(e3.key==="Tab")r2();else if(e3.key.length===1&&!e3.ctrlKey&&!e3.metaKey&&!e3.altKey&&e3.key!==" "){let r3=Date.now();o2.current.text=r3-o2.current.at>ye?e3.key.toLowerCase():o2.current.text+e3.key.toLowerCase(),o2.current.at=r3;let i4=o2.current.text,a3=[...t3.slice(n3+1),...t3.slice(0,n3+1)],s3=[...i4].every(e4=>e4===i4[0]),c2=a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4))??(s3?a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4[0]??"")):void 0);c2&&(e3.preventDefault(),c2.focus({preventScroll:true}))}},children:e2.map(e3=>{if(be(e3))return g("div",{role:"separator",className:"core-menu__separator"},e3.id);let t3=typeof e3.checked=="boolean"&&!e3.href,r3={role:t3?"menuitemcheckbox":"menuitem","aria-checked":t3?e3.checked:void 0,tabIndex:-1,className:"core-menu__item","data-tone":e3.tone,"aria-disabled":e3.disabled||void 0,onClick:t4=>{if(e3.disabled)return t4.preventDefault();n2(e3)}},i3=_(h,{children:[e3.icon?g("span",{className:"core-menu__icon","aria-hidden":"true",children:e3.icon}):null,g("span",{className:"core-menu__label",children:e3.label})]});return e3.href&&!e3.disabled?g("a",{...r3,href:e3.href,children:i3},e3.id):g("button",{...r3,type:"button",children:i3},e3.id)})})}function Se({trigger:e2,items:t2,label:r2,placement:i2="bottom-start",presentation:a2="auto",defaultOpen:o2=false,onOpenChange:s2,className:c2}){let l2=re()==="mobile",u2=a2==="sheet"||a2==="auto"&&l2,[d2,f2]=z(void 0,o2,s2),[m2,v2]=p("first"),y2=g(xe,{items:t2,label:r2,onChoose:e3=>{e3.onSelect?.(),f2(false)},onTab:()=>f2(false),className:c2}),b2=e3=>{(e3.key==="ArrowDown"||e3.key==="ArrowUp")&&(e3.preventDefault(),v2(e3.key==="ArrowUp"?"last":"first"),f2(true))};if(u2){let t3=e2.props;return _(h,{children:[n(e2,{"aria-haspopup":"menu","aria-expanded":d2,onClick:e3=>{t3.onClick?.(e3),v2("first"),f2(true)},onKeyDown:e3=>{b2(e3),t3.onKeyDown?.(e3)}}),g(J,{open:d2,onClose:()=>f2(false),title:r2,initialFocus:ve,className:"core-menu-sheet",children:y2})]})}return g(se,{trigger:e2,label:r2,placement:i2,open:d2,onOpenChange:f2,popupRole:"menu",initialFocus:e3=>{let t3=e3.querySelectorAll(ve);return(m2==="last"?t3[t3.length-1]:t3[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var Ce=new Set;function we(e2,t2){Ce.has(e2)||(Ce.add(e2),typeof console<"u"&&console.warn(t2))}var Te={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},Ee=1,De=Symbol.for("peripheries.toast.v1"),Oe=["neutral","info","success","warning","danger"],ke=globalThis;function Ae(){let e2=ke[De];if(e2===void 0){let e3={version:Ee,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return ke[De]=e3,e3}return e2.version!==Ee||!e2.listeners||!e2.handlers?(we("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${Ee}. Toasts from this copy are ignored.`),null):e2}function je(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var Me=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function Ne(e2){let t2=Ae();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return we("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return we("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?Me(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<Te.windowMs);if(i2.length>=Te.burst)return we(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${Te.burst} toasts in ${Te.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=Oe.includes(e2.tone)?e2.tone:"neutral",o2=Me(e2.title.trim(),Te.title),s2=typeof e2.description=="string"&&e2.description.trim()?Me(e2.description.trim(),Te.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:Me(e2.action.label.trim(),Te.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:Te.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>Te.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>Te.visible;)d2=d2.slice(1)}return je(t2,d2),l2}function Pe(e2){let t2=Ae();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&je(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function Fe(e2){let t2=Ae()?.handlers.get(e2);return t2?.(),!!t2}var Ie={toasts:[],actions:[]},Le=e2=>{let t2=Ae();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},Re=()=>Ae()?.snapshot??Ie;function ze(){let e2=Ae();if(!e2)return null;if(e2.regionClaim!==null)return we("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),je(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),je(e2,e2.snapshot.toasts))}}}function Be(){return{toast:Ne,dismiss:Pe}}function Ve({toast:e2,actionAvailable:t2=false,onAction:n2,onDismiss:r2,className:i2,...a2}){return _("div",{...a2,className:b("core-toast",i2),"data-tone":e2.tone,children:[_("div",{className:"core-toast__text",children:[g("p",{className:"core-toast__title",children:e2.title}),e2.description?g("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&t2?g("button",{type:"button",className:"core-toast__action",onClick:n2,children:e2.action.label}):null,g("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:r2,children:g("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:g("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function He({item:e2,actionAvailable:t2}){let[n2,r2]=p(false);return s(()=>{if(e2.duration===0||n2)return;let t3=setTimeout(()=>Pe(e2.id),e2.duration);return()=>clearTimeout(t3)},[e2.id,e2.duration,e2.revision,n2]),g("div",{className:"core-toast-slot",onPointerEnter:()=>r2(true),onPointerLeave:()=>r2(false),onFocus:()=>r2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||r2(false)},children:g(Ve,{toast:e2,actionAvailable:t2,onAction:()=>{e2.action&&Fe(e2.action.id),Pe(e2.id)},onDismiss:()=>Pe(e2.id)})})}function Ue({className:e2,actions:t2}){let[n2,r2]=p(false),i2=f(null),a2=f(t2);a2.current=t2;let o2=Object.keys(t2??{}).sort().join("\n"),c2=f(null),l2=f(false),{toasts:u2,actions:d2}=m(Le,Re,Re);s(()=>{let e3=ze();return i2.current=e3,r2(e3!==null),()=>{e3?.release(),i2.current=null}},[]),s(()=>{i2.current?.setActions(Object.fromEntries((o2?o2.split("\n"):[]).map(e3=>[e3,()=>a2.current?.[e3]?.()])))},[o2,n2]);let h2=u2[u2.length-1],v2=h2?`${h2.id}:${h2.revision}`:"";if(s(()=>{let e3=c2.current;e3&&(l2.current&&e3.hidePopover(),l2.current=v2!=="",l2.current&&e3.showPopover())},[v2,n2]),!n2)return null;let y2=e3=>u2.filter(e3).map(e4=>g(He,{item:e4,actionAvailable:!!e4.action&&d2.includes(e4.action.id)},e4.id));return _("div",{ref:c2,popover:"manual",role:"region","aria-label":"Notifications",className:b("core-toast-region",e2),children:[g("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:y2(e3=>e3.tone!=="danger")}),g("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:y2(e3=>e3.tone==="danger")})]})}function We({role:e2="dialog",dismissOnBackdrop:t2,...n2}){return g(de,{variant:"dialog",role:e2,dismissOnBackdrop:t2??e2!=="alertdialog",...n2})}function Ge({size:e2,className:t2,style:n2}){return g("span",{"aria-hidden":true,className:b("core-spacer",t2),style:S({"--core-spacer-size":x(e2)},n2)})}function Ke({gap:e2,align:t2="stretch",justify:n2="start",className:r2,style:i2,children:a2,...o2}){return g(D,{...o2,className:b("core-stack",r2),"data-align":t2,"data-justify":n2,style:S({"--core-stack-gap":x(e2)},i2),children:a2})}var qe=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),Je=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Ye({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=p(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&qe(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!qe(e2)&&!Je(e2)}}function Xe({title:e2,titleLevel:t2,meta:n2,leading:r2,value:i2,trailing:a2,badge:o2,detail:s2,actions:c2,selected:l2,href:u2,navigate:d2,onClick:f2,as:p2="div",className:m2,...h2}){let v2=Ye({href:u2,navigate:d2,onClick:f2}),x2=p2,S2=u2?g("a",{className:"core-list-row__title core-list-row__link",href:u2,onClick:v2.onClick,"aria-current":l2?"true":void 0,...v2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):g("span",{className:"core-list-row__title",children:e2}),C2=typeof t2=="number"&&Number.isInteger(t2)&&t2>=2&&t2<=6?t2:void 0,w2=C2?`h${C2}`:void 0,T2=w2?g(w2,{className:"core-list-row__heading",children:S2}):S2;return _(x2,{...y(h2),className:b("core-list-row",m2),"data-selected":l2?"":void 0,"aria-current":l2&&!u2?"true":void 0,children:[r2!=null&&g("div",{className:"core-list-row__leading",children:r2}),_("div",{className:"core-list-row__main",children:[o2==null?T2:_("div",{className:"core-list-row__head",children:[T2,g("span",{className:"core-list-row__badge",children:o2})]}),n2!=null&&g("span",{className:"core-list-row__meta",children:n2}),s2!=null&&g("div",{className:"core-list-row__detail",children:s2})]}),i2!=null&&g("div",{className:"core-list-row__value",children:i2}),a2!=null&&g("div",{className:"core-list-row__trailing",children:a2}),c2!=null&&g("div",{className:"core-list-row__actions",children:c2})]})}function Ze({header:e2,children:t2,measure:n2="page",className:r2,...i2}){return g("div",{...y(i2),className:b("core-page-frame",r2),"data-measure":n2,children:_("div",{className:"core-page-frame__column",children:[e2!=null&&g("header",{className:"core-page-frame__header",children:e2}),t2]})})}var Qe=["neutral","strong","accent","info","success","warning","danger"],$e=()=>typeof process>"u"||false;function et(e2,t2="neutral"){return typeof e2=="string"&&Qe.includes(e2)?e2:(typeof e2=="string"&&e2&&$e()&&we(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Qe.join(", ")}); using "${t2}".`),t2)}var tt=["subtle","on-dark","inherit"];function nt(e2,t2){return typeof e2=="string"&&(tt.includes(e2)||Qe.includes(e2))?e2:t2}function rt(e2){return{"data-tone":e2,toned:!tt.includes(e2)}}function it({children:e2,as:t2="span",tone:n2,tabular:r2=false,className:i2,style:a2}){let{toned:o2,...s2}=rt(nt(n2,"subtle"));return g(t2,{className:b("core-eyebrow",o2&&"core-toned",i2),...s2,"data-tabular":r2?"true":void 0,style:a2,children:e2})}var at=6,ot=100,st=e2=>(Array.isArray(e2)?e2:[]).map(e3=>typeof e3=="string"?e3.replace(/\s+/g," ").trim():"").filter(Boolean).map(e3=>e3.length>ot?`${e3.slice(0,99)}…`:e3).slice(0,at);function ct({title:e2,level:t2=2,eyebrow:n2,meta:r2,intro:i2,actions:a2,className:o2,...s2}){let c2=t2===1?"h1":"h2",l2=st(r2);return _("header",{...y(s2),className:b("core-page-head",o2),children:[n2&&g(it,{as:"p",children:n2}),_("div",{className:"core-page-head__row",children:[g(c2,{className:"core-page-head__title","data-page-title":t2===1?void 0:"",children:e2}),a2!=null&&g("div",{className:"core-page-head__actions",children:a2})]}),l2.length>0&&g("p",{className:"core-page-head__meta",children:l2.map((e3,t3)=>g("span",{children:e3},`${t3}-${e3}`))}),i2!=null&&g("p",{className:"core-page-head__intro",children:i2})]})}var lt=Symbol.for("peripheries.viewer.context.v1"),ut=20,dt=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,ft=Object.freeze({audience:"client",roles:Object.freeze([])});function pt(e2){if(!e2||typeof e2!="object")return ft;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&dt.test(e3)&&e3.length<=40))].sort().slice(0,ut);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var mt=globalThis,ht=mt[lt]??=r(ft);function gt({value:e2,children:t2}){return g(ht.Provider,{value:pt(e2),children:t2})}function _t(){return o(ht)}var vt=e2=>e2.audience==="staff",yt=(e2,t2)=>e2.roles.includes(t2);function bt(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function xt(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var St=["accepted","tentative","declined"],Ct=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),wt=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2}),Tt=e2=>{try{return new Intl.DateTimeFormat("en",{timeZone:e2}).resolvedOptions().timeZone}catch{return}};function Et(e2,t2,n2,r2){let i2=e2.tzid?Tt(e2.tzid):void 0,a2=Tt(r2);return!i2||!a2||i2===a2?"":new Intl.DateTimeFormat(n2,{hour:"numeric",timeZoneName:"short",timeZone:r2}).formatToParts(t2).find(e3=>e3.type==="timeZoneName")?.value??""}function Dt(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=Ct(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${Ct(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=Ct(t2,n2).format(r2),a2=wt(t2,n2).format(r2),o2=Et(e2,r2,t2,n2),s2=o2?` ${o2}`:"";if(!e2.endsAt)return`${i2} · ${a2}${s2}`;let c2=new Date(e2.endsAt);return Number.isNaN(c2.getTime())||c2.getTime()===r2.getTime()?`${i2} · ${a2}${s2}`:`${i2} · ${a2} – ${wt(t2,n2).format(c2)}${s2}`}var Ot=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function kt(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function At(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function jt(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?xt(e2.errors)||"Some details are missing or not valid.":xt(e2.errors)||"Something went wrong. Try again."}function Mt(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function Nt(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function Pt(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[Mt(e2.startsAt,t2)]:[]}var Ft=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var It="This can’t be done from here yet.";function Lt(e2){let[t2,n2]=p(null),[r2,i2]=p(""),o2=f(false),s2=typeof e2=="function";return{run:a(async(t3,r3)=>{if(typeof e2!="function"||o2.current)return{ok:false};o2.current=true,n2(t3),i2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(i2(jt(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return i2("Something went wrong. Try again."),{ok:false}}finally{o2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:s2,clearMessage:()=>i2("")}}function Rt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var zt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function Bt(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:zt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:zt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:zt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?zt.changed:zt.released}}function Vt(e2){let{release:t2,canRelease:n2=true,onIntent:r2,className:i2,style:a2}=e2,o2=c(),s2=vt(_t()),{run:l2,busy:u2,message:d2,available:f2}=Lt(r2);if(!s2)return null;let{words:p2,mark:m2}=Bt(t2),h2=e2.busy===true||u2==="release",v2=Rt(e2.versionsHref),y2=Rt(e2.viewAsHref),x2=t2?.state==="staff_only",S2=n2!==false&&f2&&!x2,C2=h2?"Releasing…":t2?.state==="withdrawn"?"Release again":t2?.state==="released"&&t2.hasChanges===true?"Release changes":"Release",w2=[];(v2||f2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(y2||f2)&&w2.push({id:"view-as",label:"View as client",href:y2,action:"view_as_client"}),f2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void l2(e3.action)}}));return _("div",{className:b("core-page-staff-tools",i2),style:a2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":t2?.state==="released"?"released":"unreleased","aria-busy":h2||void 0,children:[_("div",{className:"core-page-staff-tools__bar",children:[_("span",{className:"core-page-staff-tools__pill",role:"status",children:[g("span",{className:"core-page-staff-tools__mark","data-mark":m2,"aria-hidden":"true"}),p2]}),_("div",{className:"core-page-staff-tools__actions",children:[S2?g("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:h2,"aria-describedby":`${o2}-note`,onClick:()=>void l2("release"),children:C2}):null,w2.map(e3=>e3.href?g("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void l2(e3.action),children:e3.label},e3.id)),T2.length>0?g(Se,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:g("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),g("span",{id:`${o2}-note`,className:"core-page-staff-tools__sr",children:S2?t2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),d2?g("p",{className:"core-page-staff-tools__message",role:"alert",children:d2}):null]})}function Ht({label:e2,actions:t2,children:n2,rail:r2=false,anchor:i2,className:a2,...o2}){return g("section",{...y(o2),id:i2,"aria-label":e2,className:b("core-rule-section",a2),"data-rail":r2||void 0,children:_("div",{className:"core-rule-section__grid",children:[_("div",{className:"core-rule-section__head",children:[e2&&g(it,{as:"p",children:e2}),t2!=null&&g("div",{className:"core-rule-section__actions",children:t2})]}),g("div",{className:"core-rule-section__body",children:n2})]})})}function Ut({label:e2,children:t2,arrow:n2=true,className:r2,href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2,...u2}){let d2=Ye({href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2}),f2=_(h,{children:[g("span",{className:"core-underlined-action__label",children:t2??e2}),n2&&g("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),p2={...y(u2),className:b("core-underlined-action",r2)};return i2?g("a",{...p2,href:i2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:f2}):g("button",{...p2,type:"button",onClick:d2.onClick,disabled:d2.busy,children:f2})}var Wt=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Gt({name:e2,initials:t2,src:n2,alt:r2,size:i2="md",tone:a2,title:o2,className:s2,...c2}){let[l2,u2]=p(false),d2=o2??r2??e2??"";return g("span",{...y(c2),className:b("core-avatar",a2!==void 0&&"core-toned",s2),"data-size":i2,"data-tone":a2===void 0?void 0:et(a2),role:"img","aria-label":d2||void 0,children:n2&&!l2?g("img",{src:n2,alt:"",onError:()=>u2(true)}):g("span",{"aria-hidden":"true",children:t2??Wt(e2)})})}function Kt({code:e2,children:t2,block:n2=false,className:r2,...i2}){let a2=t2??e2;return n2?g("pre",{...y(i2),className:b("core-code",r2),"data-block":"",children:g("code",{children:a2})}):g("code",{...y(i2),className:b("core-code",r2),children:a2})}var qt={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Jt({text:e2,children:t2,level:n2=2,size:r2,anchor:i2,className:a2,...o2}){let s2=Math.min(6,Math.max(1,Math.round(n2))),c2=`h${s2}`;return g(c2,{...y(o2),id:i2,className:b("core-heading",a2),"data-size":r2??qt[s2],children:t2??e2})}var Yt={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Xt({text:e2,children:t2,as:n2="span",size:r2="md",weight:i2="normal",tone:a2="default",align:o2="start",truncate:s2=false,lines:c2,className:l2,...u2}){let d2=n2,f2=c2&&c2>0?Math.min(6,Math.round(c2)):void 0;return g(d2,{...y(u2),className:b("core-text",l2),"data-role":Yt[r2]??"body","data-weight":i2,"data-tone":a2,"data-align":o2,"data-truncate":s2||void 0,"data-lines":f2,children:t2??e2})}function Zt({label:e2,hint:t2,helperText:n2,error:r2,required:i2,optional:a2,htmlFor:o2,id:s2,hintId:l2,errorId:u2,as:d2="div",children:f2,className:p2,style:m2}){let h2=t2??n2,v2=o2??s2,y2=c().replace(/:/g,""),x2=l2??(h2?`${v2??y2}-hint`:void 0),S2=u2??(r2?`${v2??y2}-error`:void 0),C2=d2,w2=d2==="fieldset"?"legend":"label";return _(C2,{className:b("core-field",p2),style:m2,"data-invalid":r2?"":void 0,children:[e2&&_(w2,{className:"core-field__label",...w2==="label"&&v2?{htmlFor:v2}:{},children:[e2,i2&&_("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]}),a2&&!i2&&g("span",{className:"core-field__optional",children:" (optional)"})]}),h2&&g("p",{className:"core-field__hint",id:x2,children:h2}),f2,r2&&g("p",{className:"core-field__error",id:S2,role:"alert",children:r2})]})}function Qt(e2,t2,n2){let r2=c(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function $t(e2){let t2={};for(let[n2,r2]of Object.entries(e2))(n2==="title"||n2==="autoFocus"||n2.startsWith("aria-")||n2.startsWith("data-"))&&(t2[n2]=r2);return t2}function en(e2,t2){return{"aria-describedby":[t2["aria-describedby"],e2.aria["aria-describedby"]].filter(Boolean).join(" ")||void 0,"aria-invalid":e2.aria["aria-invalid"]??t2["aria-invalid"]}}function tn(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function nn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,children:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,onBlur:m2,onFocus:h2,className:v2,wrapperClassName:y2,style:x2,ref:S2,...C2}){let w2=Qt(i2,c2,l2),T2=$t(C2),[E2,D2]=p(t2??false),O2=e2??E2,k2=tn(n2,r2);return g(Zt,{className:b("core-checkbox",y2),style:x2,hint:c2,error:l2,hintId:w2.hintId,errorId:w2.errorId,children:_("label",{className:"core-choices__option","data-disabled":d2?"":void 0,children:[g("input",{...T2,ref:S2,id:w2.control,type:"checkbox",className:v2,name:a2,checked:O2,required:u2,"aria-required":u2||void 0,disabled:d2,"aria-readonly":f2||void 0,onChange:t3=>{f2||(e2===void 0&&D2(t3.target.checked),k2(t3.target.checked))},onBlur:m2,onFocus:h2,...en(w2,T2)}),_("span",{children:[s2??o2,u2&&g("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function rn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",min:h2,max:v2,className:y2,style:x2,ref:S2}){let C2=[h2===void 0?"":`at least ${h2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[c2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=Qt(a2,w2,l2),[E2,D2]=p(n2??[]),O2=t2??E2,k2=tn(r2,i2),A2=v2!==void 0&&O2.length>=v2;return g(Zt,{as:"fieldset",className:b("core-choices",y2),style:x2,label:s2,hint:w2,error:l2,required:u2,hintId:T2.hintId,errorId:T2.errorId,children:g("div",{className:"core-choices__list","data-orientation":m2,role:"group",...T2.aria,children:e2.map((n3,r3)=>{let i3=O2.includes(n3.value);return _("label",{className:"core-choices__option","data-disabled":n3.disabled||d2?"":void 0,children:[g("input",{ref:r3===0?S2:void 0,id:r3===0?T2.control:void 0,type:"checkbox",name:o2,value:n3.value,checked:i3,disabled:n3.disabled||d2||!i3&&A2||f2&&!i3,"aria-readonly":f2||void 0,onChange:()=>{if(f2)return;let r4=e2.map(e3=>e3.value).filter(e3=>e3===n3.value?!i3:O2.includes(e3));t2===void 0&&D2(r4),k2(r4)}}),g("span",{children:n3.label})]},n3.value)})})})}function an({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2,max:m2,fromLabel:h2="From",toLabel:v2="To",className:y2,style:x2,ref:S2}){let C2=Qt(i2,s2,c2),[w2,T2]=p(t2??{from:null,to:null}),E2=e2??w2,D2=tn(n2,r2),O2=(t3,n3)=>{if(d2)return;let r3={...E2,[t3]:n3===""?null:n3};e2===void 0&&T2(r3),D2(r3)},k2={disabled:u2,readOnly:d2,required:l2,"aria-required":l2||void 0,className:"core-input",...C2.aria};return g(Zt,{as:"fieldset",className:b("core-date-range",y2),style:x2,label:o2,hint:s2,error:c2,required:l2,hintId:C2.hintId,errorId:C2.errorId,children:_("div",{className:"core-date-range__row",children:[_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:h2}),g("input",{ref:S2,id:C2.control,type:"date",name:a2?`${a2}.from`:void 0,value:E2.from??"",min:f2,max:E2.to??m2,onChange:e3=>O2("from",e3.target.value),...k2})]}),_("label",{className:"core-date-range__part",children:[g("span",{className:"core-date-range__label",children:v2}),g("input",{type:"date",name:a2?`${a2}.to`:void 0,value:E2.to??"",min:E2.from??f2,max:m2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function on(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function sn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,upload:m2,accept:v2,hash:y2=false,className:x2,style:S2,ref:C2}){let w2=Qt(i2,s2,c2),[T2,E2]=p(t2??null),D2=e2===void 0?T2:e2,O2=tn(n2,r2),[k2,A2]=p({busy:false,dragging:false}),j2=f(null),M2=t3=>{e2===void 0&&E2(t3),O2(t3)},N2=async e3=>{if(e3&&m2&&!d2&&!u2){A2({busy:true,dragging:false});try{let t3=await m2(e3,{hash:y2});"error"in t3?A2({busy:false,failed:t3.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t3))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e3=>{e3.preventDefault(),N2(e3.dataTransfer.files?.[0])},F2=c2??k2.failed;return g(Zt,{className:b("core-file-field",x2),style:S2,label:o2,hint:s2,error:F2,required:l2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:_("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e3=>{d2||u2||!m2||(e3.preventDefault(),k2.dragging||A2(e4=>({...e4,dragging:true})))},onDragLeave:()=>A2(e3=>({...e3,dragging:false})),onDrop:P2,children:[D2?_("div",{className:"core-file-field__file",children:[g("span",{className:"core-file-field__name",children:D2.file.name}),g("span",{className:"core-file-field__size",children:on(D2.file.size)}),!d2&&!u2&&g("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?g("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):_(h,{children:[g("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:u2||d2||!m2,"aria-required":l2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),g("span",{className:"core-file-field__drop",children:"or drop it here"})]}),g("input",{ref:j2,type:"file",name:a2,accept:v2,hidden:true,tabIndex:-1,onChange:e3=>void N2(e3.target.files?.[0])})]})})}function cn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,orientation:m2="vertical",className:h2,wrapperClassName:v2,style:y2,ref:x2,...S2}){let C2=Qt(a2,c2,l2),w2=$t(S2),[T2,E2]=p(n2??null),D2=t2===void 0?T2:t2,O2=tn(r2,i2),k2=o2??C2.control;return g(Zt,{as:"fieldset",className:b("core-choices",v2),style:y2,label:s2,hint:c2,error:l2,required:u2,hintId:C2.hintId,errorId:C2.errorId,children:g("div",{...w2,className:b("core-choices__list",h2),"data-orientation":m2,role:"radiogroup","aria-required":u2||void 0,...en(C2,w2),children:e2.map((e3,n3)=>_("label",{className:"core-choices__option","data-disabled":e3.disabled||d2?"":void 0,children:[g("input",{ref:n3===0?x2:void 0,id:n3===0?C2.control:void 0,type:"radio",name:k2,value:e3.value,checked:D2===e3.value,disabled:e3.disabled||d2||f2&&D2!==e3.value,onChange:()=>{f2||(t2===void 0&&E2(e3.value),O2(e3.value))}}),g("span",{children:e3.label})]},e3.value))})})}var ln=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function un({type:e2="text",value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:m2,placeholder:h2,inputMode:v2,autoComplete:y2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,onFocus:k2,className:A2,wrapperClassName:j2,style:M2,ref:N2,...P2}){let F2=Qt(a2,l2,u2),I2=$t(P2),[L2,R2]=p(n2),z2=t2===void 0?L2:t2,B2=tn(r2,i2),ee2=e3=>e3==null?"":String(e3),[V2,H2]=p(ee2(z2));s(()=>{e2==="number"&&ln(V2)!==(z2??null)&&H2(ee2(z2))},[z2]);let U2=e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},W2=g("input",{...I2,ref:N2,id:F2.control,name:o2,type:e2==="number"?"text":e2,className:b("core-input core-text-field__input",A2),value:e2==="number"?V2:ee2(z2),onChange:n3=>{let r3=n3.target.value,i3=e2==="number"?ln(r3):r3;e2==="number"&&H2(r3),t2===void 0&&R2(i3),B2(i3)},onKeyDown:U2,onBlur:O2,onFocus:k2,placeholder:h2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:y2,min:x2,max:S2,step:C2,required:d2,"aria-required":d2||void 0,disabled:f2,readOnly:m2,...en(F2,I2)}),G2=w2||T2?_("div",{className:"core-text-field__affixed",children:[w2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),W2,T2&&g("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):W2;return g(Zt,{className:b("core-text-field",j2),style:M2,label:c2,hint:l2,error:u2,required:d2,htmlFor:F2.control,hintId:F2.hintId,errorId:F2.errorId,children:G2})}function dn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,label:i2="Search",onSearch:a2,onClear:o2,size:s2="md",className:c2,wrapperClassName:l2,...u2}){let[d2,f2]=p(t2??""),m2=e2??d2,h2=t3=>{e2===void 0&&f2(t3),n2?.(t3),r2?.(t3)};return _("div",{className:b("core-search-field",l2),"data-filled":m2?"":void 0,"data-size":s2,children:[g(un,{...u2,label:i2,value:m2,onChange:e3=>h2(typeof e3=="string"?e3:""),onEnter:()=>a2?.(m2),type:"search",inputMode:"search",className:c2,wrapperClassName:"core-search-field__field"}),_("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[g("circle",{cx:"11",cy:"11",r:"6.5"}),g("path",{d:"M16 16l4 4"})]}),m2&&!u2.disabled&&!u2.readOnly&&g("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>{h2(""),o2?.()},children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function fn({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:f2,placeholder:m2="Choose…",onBlur:h2,onFocus:v2,className:y2,wrapperClassName:x2,style:S2,ref:C2,...w2}){let T2=Qt(a2,c2,l2),E2=$t(w2),[D2,O2]=p(n2??null),k2=t2===void 0?D2:t2,A2=tn(r2,i2);return g(Zt,{className:b("core-select",x2),style:S2,label:s2,hint:c2,error:l2,required:u2,htmlFor:T2.control,hintId:T2.hintId,errorId:T2.errorId,children:_("select",{...E2,ref:C2,id:T2.control,name:o2,className:b("core-input core-select__input",y2),value:k2??"",onChange:e3=>{let n3=e3.target.value===""?null:e3.target.value;t2===void 0&&O2(n3),A2(n3)},required:u2,"aria-required":u2||void 0,disabled:d2||f2,"aria-readonly":f2||void 0,onBlur:h2,onFocus:v2,...en(T2,E2),children:[g("option",{value:"",children:m2}),e2.map(e3=>g("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function pn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:f2=0,max:m2=100,step:h2=1,format:v2=String,onBlur:y2,onFocus:x2,className:S2,wrapperClassName:C2,style:w2,ref:T2,...E2}){let D2=Qt(i2,s2,c2),O2=$t(E2),[k2,A2]=p(t2??f2),j2=e2??k2,M2=tn(n2,r2);return g(Zt,{className:b("core-slider",C2),style:w2,label:o2,hint:s2,error:c2,required:l2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:_("div",{className:"core-slider__row",children:[g("input",{...O2,ref:T2,id:D2.control,name:a2,type:"range",className:b("core-slider__input",S2),min:f2,max:m2,step:h2,value:j2,disabled:u2,"aria-readonly":d2||void 0,"aria-valuetext":v2(j2),onChange:t3=>{if(d2)return;let n3=Number(t3.target.value);e2===void 0&&A2(n3),M2(n3)},onBlur:y2,onFocus:x2,...en(D2,O2)}),g("output",{className:"core-slider__value",htmlFor:D2.control,children:v2(j2)})]})})}function mn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,disabled:l2,readOnly:u2,onBlur:d2,onFocus:f2,className:m2,wrapperClassName:h2,style:v2,ref:y2,...x2}){let S2=Qt(i2,s2,c2),C2=$t(x2),[w2,T2]=p(t2??false),E2=e2??w2,D2=tn(n2,r2);return _("div",{className:b("core-switch",h2),style:v2,children:[_("button",{...C2,ref:y2,id:S2.control,name:a2,type:"button",role:"switch","aria-checked":E2,"aria-readonly":u2||void 0,disabled:l2,className:b("core-switch__control",m2),onClick:()=>{u2||(e2===void 0&&T2(!E2),D2(!E2))},onBlur:d2,onFocus:f2,...en(S2,C2),children:[g("span",{className:"core-switch__track","aria-hidden":"true",children:g("span",{className:"core-switch__thumb"})}),g("span",{className:"core-switch__label",children:o2})]}),s2&&g("p",{className:"core-field__hint",id:S2.hintId,children:s2}),c2&&g("p",{className:"core-field__error",id:S2.errorId,role:"alert",children:c2})]})}function hn({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:u2,disabled:d2,readOnly:m2,placeholder:h2,rows:v2=3,autoGrow:y2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,onFocus:w2,className:T2,wrapperClassName:E2,style:D2,ref:O2,...k2}){let A2=Qt(i2,s2,c2),j2=$t(k2),[M2,N2]=p(t2??""),P2=e2??M2,F2=tn(n2,r2),I2=f(null);return l(()=>{let e3=I2.current;y2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[P2,y2]),_(Zt,{className:b("core-text-area",E2),style:D2,label:o2,hint:s2,error:c2,required:u2,htmlFor:A2.control,hintId:A2.hintId,errorId:A2.errorId,children:[g("textarea",{...j2,ref:e3=>{I2.current=e3,typeof O2=="function"?O2(e3):O2&&(O2.current=e3)},id:A2.control,name:a2,className:b("core-input core-text-area__input",T2),rows:v2,value:P2,onChange:t3=>{e2===void 0&&N2(t3.target.value),F2(t3.target.value)},onKeyDown:S2,onBlur:C2,onFocus:w2,placeholder:h2,maxLength:x2,required:u2,"aria-required":u2||void 0,disabled:d2,readOnly:m2,...en(A2,j2)}),x2!==void 0&&_("span",{className:"core-field__hint","aria-live":"polite",children:[P2.length," / ",x2]})]})}function gn({label:e2,children:t2,tone:n2,variant:r2="soft",className:i2,...a2}){return g("span",{...y(a2),className:b("core-badge","core-toned",i2),"data-tone":et(n2),"data-variant":r2,children:t2??e2})}function _n({message:e2,title:t2,action:n2,className:r2,...i2}){return _("div",{...y(i2),className:b("core-empty-state",r2),role:"status",children:[t2&&g("p",{className:"core-empty-state__title",children:t2}),g("p",{className:"core-empty-state__message",children:e2}),n2!=null&&g("div",{className:"core-empty-state__action",children:n2})]})}var vn={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function yn({title:e2,message:t2,children:n2,tone:r2,action:i2,onDismiss:a2,className:o2,...s2}){let c2=et(r2,"info"),l2=c2==="warning"||c2==="danger";return _("div",{...y(s2),role:l2?"alert":"status",className:b("core-notice","core-toned",o2),"data-tone":c2,children:[g("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:vn[c2]??vn.info})}),_("div",{className:"core-notice__body",children:[e2&&g("p",{className:"core-notice__title",children:e2}),g("div",{className:"core-notice__message",children:n2??t2})]}),i2&&g("div",{className:"core-notice__action",children:i2}),a2&&g("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:a2,children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function bn({value:e2,max:t2=100,label:n2,showValue:r2=false,tone:i2,size:a2="md",className:o2,style:s2,...c2}){let l2=typeof e2=="number"&&Number.isFinite(e2)&&t2>0,u2=l2?Math.max(0,Math.min(100,e2/t2*100)):0;return _("div",{...y(c2),className:b("core-progress","core-toned",o2),"data-tone":et(i2,"accent"),"data-size":a2,style:s2,children:[(n2||r2&&l2)&&_("div",{className:"core-progress__head",children:[n2&&g("span",{className:"core-progress__label",children:n2}),r2&&l2&&_("span",{className:"core-progress__value",children:[Math.round(u2),"%"]})]}),g("div",{className:"core-progress__track",role:"progressbar","aria-label":n2,"aria-valuemin":0,"aria-valuemax":l2?t2:void 0,"aria-valuenow":l2?e2:void 0,"data-indeterminate":l2?void 0:"",style:S({"--core-progress-fill":`${u2}%`}),children:g("div",{className:"core-progress__fill"})})]})}function xn({shape:e2="text",lines:t2=3,width:n2,height:r2,className:i2,style:a2,...o2}){let s2=S({"--core-skeleton-w":x(n2),"--core-skeleton-h":x(r2)},a2);if(e2!=="text")return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton",i2),"data-shape":e2,style:s2});let c2=Math.max(1,Math.min(12,Math.round(t2)));return g("span",{...y(o2),"aria-hidden":"true",className:b("core-skeleton-lines",i2),style:s2,children:Array.from({length:c2},(e3,t3)=>g("span",{className:"core-skeleton","data-shape":"line","data-last":t3===c2-1&&c2>1?"":void 0},t3))})}function Sn({label:e2="Loading",size:t2="md",className:n2,...r2}){return g("span",{...y(r2),role:"status","aria-label":e2,className:b("core-spinner",n2),"data-size":t2})}function Cn({content:e2,text:t2,children:n2,side:r2="top",className:i2,...a2}){let[o2,l2]=p(false),u2=c();return s(()=>{if(!o2)return;let e3=e4=>{e4.key==="Escape"&&l2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[o2]),_("span",{...y(a2),className:b("core-tooltip",i2),"aria-describedby":u2,onMouseEnter:()=>l2(true),onMouseLeave:()=>l2(false),onFocus:()=>l2(true),onBlur:()=>l2(false),children:[n2,g("span",{id:u2,role:"tooltip",className:"core-tooltip__bubble","data-side":r2,"data-open":o2?"":void 0,children:e2??t2})]})}function wn({children:t2,className:r2,style:a2,...o2}){let s2=e.toArray(t2),c2=s2.length===1?s2[0]:null;if(!i(c2))return null;let l2=c2.props??{},u2={...o2,...l2},d2=[r2,l2.className].filter(Boolean).join(" ");d2&&(u2.className=d2),(a2||l2.style)&&(u2.style={...a2,...l2.style});for(let e2 of Object.keys(o2)){let t3=o2[e2],n2=l2[e2];/^on[A-Z]/.test(e2)&&typeof t3=="function"&&typeof n2=="function"&&(u2[e2]=e3=>{t3(e3)!==false&&n2(e3)})}return n(c2,u2)}function Tn({children:e2,label:t2,variant:n2="primary",size:r2="md",tone:i2="neutral",iconLeft:a2,iconRight:o2,loading:s2=false,disabled:c2=false,type:l2="button",fullWidth:u2=false,asChild:d2=false,className:f2,href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2,...w2}){let T2=Ye({href:p2,action:m2,input:v2,actions:x2,navigate:S2,onClick:C2}),E2=s2||T2.busy,D2={...y(w2),className:b("core-button",f2),"data-variant":n2,"data-size":r2,"data-tone":i2,"data-full":u2||void 0,"data-busy":E2||void 0},O2=_(h,{children:[E2?g("span",{className:"core-button__spinner","aria-hidden":"true"}):a2,g("span",{className:"core-button__label",children:e2??t2}),o2]});if(d2){let t3=c2||E2,n3=e3=>t3?(e3.preventDefault(),false):T2.onClick(e3);return g(wn,{...D2,"aria-disabled":t3||void 0,"aria-busy":E2||void 0,onClick:n3,children:e2})}return p2&&!c2?g("a",{...D2,href:p2,onClick:T2.onClick,"aria-busy":E2||void 0,...T2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:O2}):g("button",{...D2,type:l2,disabled:c2||E2,"aria-busy":E2||void 0,onClick:T2.onClick,children:O2})}function En({children:e2,label:t2,variant:n2="prompt",size:r2="md",selected:i2,onToggle:a2,iconLeft:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,...h2}){let v2=i2!==void 0||a2!==void 0,x2=Ye({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2??(a2?()=>a2(!i2):void 0)});return l2&&!s2&&!v2?_("a",{...y(h2),className:b("core-chip",c2),"data-variant":n2,"data-size":r2,href:l2,onClick:x2.onClick,...x2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]}):_("button",{...y(h2),type:"button",className:b("core-chip",c2),"data-variant":n2,"data-size":r2,"aria-pressed":v2?!!i2:void 0,disabled:s2||x2.busy,onClick:x2.onClick,children:[o2,g("span",{className:"core-chip__label",children:e2??t2})]})}function Dn({icon:e2,children:t2,label:n2,size:r2="md",variant:i2="ghost",pressed:a2,disabled:o2=false,className:s2,href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2,...m2}){let h2=Ye({href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2}),_2={...y(m2),className:b("core-icon-button",s2),"data-size":r2,"data-variant":i2,"aria-label":n2,title:n2},v2=g("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??t2});return c2&&!o2?g("a",{..._2,href:c2,onClick:h2.onClick,...h2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:v2}):g("button",{..._2,type:"button","aria-pressed":a2,disabled:o2||h2.busy,onClick:h2.onClick,children:v2})}function On({href:e2,children:t2,label:n2,variant:r2="default","aria-current":i2,className:a2,navigate:o2,onClick:s2,...c2}){let l2=Ye({href:e2,navigate:o2,onClick:s2});return qe(e2)||Je(e2)||/^(https?:|mailto:)/i.test(e2)?_("a",{...y(c2),className:b("core-link",a2),"data-variant":r2,"aria-current":i2,href:e2,onClick:l2.onClick,...l2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[t2??n2,l2.external&&_(h,{children:[g("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:g("path",{d:"M7 17L17 7M8 7h9v9"})}),g("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):g("span",{className:b("core-link",a2),children:t2??n2})}function kn(e2){let{param:t2="kind",keep:n2,label:r2="Filter",onChange:i2,className:a2,style:o2}=e2,s2=(Array.isArray(e2.options)?e2.options:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!=="");if(s2.length===0)return null;let c2=typeof e2.selected=="string"&&s2.some(t3=>t3.id===e2.selected)?e2.selected:s2[0].id;return g("form",{className:"core-filter-chips-form",method:"get",action:"",onSubmit:e3=>{if(!i2)return;e3.preventDefault();let t3=e3.nativeEvent.submitter;t3?.value&&i2(t3.value)},children:_("div",{className:b("core-filter-chips",a2),style:o2,role:"group","aria-label":r2,children:[Object.entries(n2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),s2.map(e3=>g("button",{type:"submit",name:t2,value:e3.id,className:"core-chip","data-variant":"toggle","data-size":"sm","aria-pressed":e3.id===c2,children:g("span",{className:"core-chip__label",children:e3.label})},e3.id))]})})}function An({options:e2,value:t2,defaultValue:n2,onChange:r2,label:i2,fullWidth:a2=false,size:o2="md",className:s2,setValue:l2,...u2}){let[d2,m2]=p(n2??e2[0]?.value),h2=t2??d2,_2=c(),v2=f([]),x2=e3=>{t2===void 0&&m2(e3),r2?.(e3),l2?.(e3)},S2=e2.map((e3,t3)=>e3.disabled?-1:t3).filter(e3=>e3>=0),C2=(t3,n3)=>{let r3=t3.key==="ArrowRight"||t3.key==="ArrowDown"?1:t3.key==="ArrowLeft"||t3.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t3.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];v2.current[a3]?.focus(),x2(e2[a3].value)};return g("div",{...y(u2),role:"radiogroup","aria-label":i2,className:b("core-segmented",s2),"data-full":a2||void 0,"data-size":o2,children:e2.map((e3,t3)=>{let n3=e3.value===h2;return g("button",{ref:e4=>{v2.current[t3]=e4},type:"button",role:"radio",name:_2,"aria-checked":n3,tabIndex:n3||h2===void 0&&t3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,t3),children:e3.label},e3.value)})})}function jn({items:e2=[],children:t2,numbered:n2=false,single:r2=false,rules:i2="subtle",value:a2,onValueChange:o2,className:l2,...u2}){let d2=c(),p2=f(null),m2=n2?"ol":"ul",h2=(e3,t3)=>e3.id??String(t3),v2=a2!==void 0,x2=v2?new Set(a2):void 0,S2=()=>{x2&&p2.current&&p2.current.querySelectorAll("details[data-item]").forEach(e3=>{let t3=x2.has(e3.dataset.item);e3.open!==t3&&(e3.open=t3)})};s(S2);let C2=()=>{if(!p2.current)return;let t3=[...p2.current.querySelectorAll("details[data-item]")].filter(e3=>e3.open).map(e3=>e3.dataset.item),n3=v2?e2.map(h2).filter(e3=>x2.has(e3)):void 0;n3&&n3.length===t3.length&&n3.every((e3,n4)=>e3===t3[n4])||(o2?.(t3),v2&&queueMicrotask(()=>requestAnimationFrame(S2)))};return _("div",{...y(u2),ref:p2,className:b("core-accordion",l2),"data-rules":i2,children:[e2.length>0&&g(m2,{className:"core-accordion__list","data-numbered":n2||void 0,children:e2.map((e3,t3)=>g("li",{className:"core-accordion__item",children:_("details",{className:"core-disclosure",name:r2?d2:void 0,open:v2?void 0:e3.open||void 0,...v2||o2?{"data-item":h2(e3,t3),onToggle:C2}:{},children:[_("summary",{className:"core-disclosure__summary",children:[n2&&g("span",{className:"core-accordion__number",children:t3+1}),e3.question]}),g("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??t3))}),t2]})}function Mn({media:e2,header:t2,body:n2,footer:r2,children:i2,tone:a2="plain",className:o2,...s2}){return _("article",{...y(s2),className:b("core-card",o2),"data-tone":a2,children:[e2!=null&&g("div",{className:"core-card__media",children:e2}),t2!=null&&g("header",{className:"core-card__header",children:t2}),(n2!=null||i2!=null)&&_("div",{className:"core-card__body",children:[n2,i2]}),r2!=null&&g("footer",{className:"core-card__footer",children:r2})]})}var Nn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Pn({start:e2,end:t2,children:n2,ratio:r2="1:1",gap:i2,stackBelow:a2="compact",className:o2,...s2}){return _("div",{...y(s2),className:b("core-columns",o2),"data-stack":a2,children:[_("div",{className:"core-columns__grid",style:S({"--core-columns-template":Nn[r2]??Nn["1:1"],"--core-columns-gap":x(i2)}),children:[g("div",{className:"core-columns__start",children:e2}),g("div",{className:"core-columns__end",children:t2})]}),n2]})}var Fn=Pn;function In({summary:e2,content:t2,children:n2,open:r2=false,onToggle:i2,className:a2,...o2}){return _("details",{...y(o2),className:b("core-disclosure",a2),open:r2||void 0,onToggle:i2?e3=>i2(e3.currentTarget.open):void 0,children:[g("summary",{className:"core-disclosure__summary",children:e2}),_("div",{className:"core-disclosure__content",children:[t2,n2]})]})}function Ln({items:t2,children:n2,min:r2,columns:i2,gap:a2,className:o2,style:s2,...c2}){let l2=[...e.toArray(t2),...e.toArray(n2)];return g("div",{...y(c2),className:b("core-grid",o2),"data-capped":i2&&i2>0?"":void 0,style:S({"--core-grid-min":x(r2),"--core-grid-gap":x(a2),"--core-grid-cols":i2&&i2>0?String(Math.round(i2)):void 0},s2),children:l2})}function Rn({item:t2,each:n2,as:r2,layout:i2="stack",gap:a2,min:o2,empty:s2,className:c2,style:l2,...u2}){let d2=e.toArray(t2);return d2.length?g("div",{...y(u2),className:b("core-repeat",c2),"data-layout":i2,style:S({"--core-repeat-gap":x(a2),"--core-repeat-min":x(o2)},l2),children:d2}):s2?g("p",{className:"core-repeat__empty",children:s2}):null}var zn=["page-x-of-y","page-number","page-count"],Bn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Vn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Hn=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Un=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:Vn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Bn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Hn,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Hn,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Bn,eyebrow:{...Bn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],Wn=new Map;function Gn(e2){Wn.set(e2.id,e2)}for(let e2 of Un)Gn(e2);function Kn(){return[...Wn.keys()].sort()}function qn(e2){let t2=Wn.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${Kn().join(", ")}`);if(!t2.extends)return t2;let n2=Wn.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function Jn(){let e2={};for(let t2 of Kn())try{e2[t2]=qn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Yn=Object.freeze(Jn()),Xn="workbook";function Zn(e2,t2){try{return qn(e2)}catch{return we(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(we("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Xn}". If this document is an instrument, its numbering and depth are being dropped.`),Zn(Xn,t2)):Zn(e2,t2)}var Qn=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),$n=["full","muted","subtle","border","accent","accentText","sunken"],er=["structural","hairline","head","row"],tr=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],nr=3,rr="initial";function ir(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??rr,"--doc-rail-width":e2.rail.width??rr,"--doc-rail-gutter":e2.rail.gutter??rr,"--doc-floor":`${e2.floorPx}px`};for(let n2 of $n)t2[`--doc-ink-${Qn(n2)}`]=e2.ink[n2];for(let n2 of er)t2[`--doc-rule-${n2}`]=e2.rules[n2]??rr;for(let n2 of tr){let r2=e2.type[n2],i2=`--doc-type-${Qn(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=nr;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??rr;return t2}var ar=(e2,t2)=>`${e2} {
2
2
  ${Object.entries(t2).map(([e3,t3])=>` ${e3}: ${t3};`).join("\n")}
3
- }`;function ar(e2,t2){return e2.map(e3=>ir(e3.id===t2?`:root,
4
- [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,rr(e3))).join("\n\n")}var or=["prose","clause","definitions","table","notice","figure","execution"],sr=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,cr="[a-z0-9][a-z0-9_-]*",lr=RegExp(`^(?:(${cr}):)?(${cr}(?:\\.${cr})*)(?:#(${cr}))?$`);RegExp(`^${cr}$`);function ur(e2,t2){let n2=e2.trim(),r2=lr.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function dr(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function fr(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(sr.source,"g"))){let i2=ur(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function pr(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},mr=e2=>e2?.fills===false?{"data-fills":"none"}:{},hr={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function gr({children:e2,tone:t2="note",title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Aside"),c2=s2?.fills===false;return g("aside",{role:"note",className:y("core-aside",a2),"data-tone":t2,...Q(i2?.id??r2),...mr(s2),style:o2,children:[c2?null:h("span",{className:"core-aside__icon","aria-hidden":true,children:hr[t2]}),g("div",{className:"core-aside__body",children:[n2&&h("div",{className:"core-aside__title",children:n2}),h("div",{className:"core-aside__text",children:e2})]})]})}function _r({children:e2,profileId:t2,profile:n2,full:r2=false,className:i2,style:a2}){return n2||Z(t2,"Prose"),h("div",{className:y("core-prose",i2),"data-full":r2?"":void 0,...Q(n2?.id??t2),style:a2,children:e2})}function vr({children:e2,citation:t2,className:n2,style:r2}){return g("figure",{className:y("core-quote",n2),style:r2,children:[h("blockquote",{className:"core-quote__body",children:e2}),t2&&g("figcaption",{className:"core-quote__citation",children:["— ",t2]})]})}function yr({term:e2,description:t2,pairs:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"Definition");let s2=n2??(e2===void 0?[]:[{term:e2,description:t2}]);return h("dl",{className:y("core-definition",a2),...Q(i2?.id??r2),style:o2,children:s2.map((e3,t3)=>g("div",{className:"core-definition__item",children:[h("dt",{className:"core-definition__term",children:e3.term}),h("dd",{className:"core-definition__description",children:e3.description})]},t3))})}var br="katex";function xr(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var Sr=e2=>import(e2),Cr;function wr(){return Cr??=xr(br)?Sr(br).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),Cr}function Tr({children:e2="",mode:t2="inline",className:n2}){let r2=d(null),[i2,a2]=f(null),[s2,c2]=f(null),l2=`${t2}:${e2}`;return o(()=>{let e3=true;return wr().then(t3=>{e3&&t3&&a2(()=>t3)}),()=>{e3=false}},[]),o(()=>{if(i2&&r2.current&&s2!==l2)try{i2.render(e2,r2.current,{displayMode:t2==="block",throwOnError:false})}catch{c2(l2)}},[i2,e2,t2,l2,s2]),!i2||s2===l2?h("span",{className:y("core-math",n2),"data-mode":t2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):h("span",{ref:r2,className:y("core-math",n2),"data-mode":t2})}function Er(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var Dr=n(null);function Or(){return a(Dr)}function kr({children:e2}){let[t2,n2]=u(Er,{footnotes:[]}),r2=d(0),a2=i(e3=>{r2.current+=1;let t3=r2.current;return n2({type:"register",entry:{...e3,number:t3}}),t3},[]),o2=i(e3=>n2({type:"unregister",id:e3}),[]),s2=l(()=>({state:t2,registerFootnote:a2,unregisterFootnote:o2}),[t2,a2,o2]);return h(Dr.Provider,{value:s2,children:e2})}function Ar({children:e2}){let t2=s(),n2=Or(),[r2,i2]=f(null);return o(()=>{if(!n2)return;let r3=n2.registerFootnote({id:t2,content:e2});return i2(r3),()=>n2.unregisterFootnote(t2)},[t2]),n2?r2===null?null:h("sup",{id:`core-footnote-ref-${r2}`,className:"core-footnote",children:g("a",{href:`#core-footnote-${r2}`,className:"core-footnote__link",children:["[",r2,"]"]})}):g("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function jr({children:e2,caption:t2,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Figure"),g("figure",{className:y("core-figure",i2),...Q(r2?.id??n2),style:a2,children:[h("div",{className:"core-figure__body",children:e2}),t2&&h("figcaption",{className:"core-figure__caption",children:t2})]})}function Mr({className:e2}){return h("div",{className:y("core-page-break",e2),"aria-hidden":true})}function Nr({children:e2,as:t2="div",profileId:n2,profile:r2,tone:i2="subtle",className:a2,style:o2}){return r2||Z(n2,"DocumentLabel"),h(t2,{className:y("core-document-label",a2),"data-tone":i2,...Q(r2?.id??n2),style:o2,children:e2})}var Pr=["one","two","three","four","five","six","seven","eight","nine","ten"];function Fr(e2){if(e2.length!==1)return null;let t2=e2[0],n2=Pr[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function Ir(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Lr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function Rr(e2,t2){return e2?.[t2]??t2}function zr({target:e2,form:t2,sectionReferences:n2,sectionNumbers:r2,sectionTitles:i2,sectionAnchors:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??Z(o2,"Reference"),d2=ur(e2),f2=n2?.[e2],p2=f2?.openable===false,m2=d2!==null&&d2.doc===void 0,g2=d2?dr(d2.unit):e2,_2=f2?.number??(m2&&d2.element===void 0?r2?.[g2]:void 0),v2=f2?.title??(m2&&d2.element===void 0?i2?.[g2]:void 0),b2=null;if(d2?.element!==void 0){let e3=f2?.element;b2=e3?Lr(f2.number,e3.shape,u2?.depth.numbering)[e3.index]??null:null}else _2&&(b2=Ir(_2));let x2=t2==="full"||d2?.doc!==void 0&&t2!=="title",S2;S2=p2?null:t2==="title"?v2??b2:x2&&b2&&v2&&d2?.element===void 0?`${b2} (${v2})`:b2??v2??null;let C2=S2!==null,w2=C2?f2?f2.href:`#${Rr(a2,g2)}`:void 0,T2={className:y("core-reference",c2),"data-target":e2,"data-unresolved":C2||p2?void 0:"","data-closed":p2?"":void 0,...Q(s2?.id??o2),style:l2};return w2?h("a",{href:w2,...T2,children:S2}):h("span",{...T2,children:S2??e2})}function Br({columns:e2,rows:t2,caption:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"DocumentTable"),e2.length===0?null:g("div",{className:y("core-document-table",a2),...Q(i2?.id??r2),style:o2,children:[n2===void 0?null:h("div",{className:"core-document-table__caption",children:n2}),g("table",{className:"core-document-table__table",children:[h("thead",{children:h("tr",{children:e2.map((e3,t3)=>h("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},t3))})}),h("tbody",{children:t2.map((t3,n3)=>h("tr",{children:e2.map((e3,n4)=>h("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:t3[n4]??null},n4))},n3))})]})]})}var Vr={locale:"en-CA",currency:"CAD"},Hr=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Ur=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function Wr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Hr(t2.locale)?t2.locale:Vr.locale,currency:Ur(t2.currency)?t2.currency.toUpperCase():Vr.currency}}var Gr=new Map;function Kr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Gr.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},Gr.set(t2,n2)}return n2}function qr(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Jr(e2.value):void 0),r2=Yr(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Jr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Yr(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??Vr,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=Kr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var Xr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Zr({items:e2,profileId:t2,profile:n2,markerWidth:r2=44,secondaryWidth:i2=190,missingLabel:a2="Not answered yet",baseProps:o2,className:s2,style:c2}){if(n2||Z(t2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let l2=Wr(o2),u2=e3=>Xr(e3)?qr(e3,l2):e3;return h("div",{className:y("core-row-list",s2),...Q(n2?.id??t2),style:x({"--core-row-list-marker-width":b(r2),"--core-row-list-secondary-width":b(i2)},c2),children:e2.map((e3,t3)=>g("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&h("div",{className:"core-row-list__marker",children:u2(e3.marker)}),h("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&h("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?a2:u2(e3.secondary)})]},t3))})}var Qr=190;function $r({items:e2,profileId:t2,profile:n2,missingLabel:r2="Not answered yet",answerWidth:i2=190,className:a2,style:o2}){let s2=e2.map(e3=>{let t3=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t3?e3.answer:void 0,missing:!t3}});return h("div",{className:y("core-answer-rows",a2),...Q(n2?.id??t2),style:o2,children:h(Zr,{items:s2,profileId:t2,profile:n2,secondaryWidth:i2,missingLabel:r2})})}var ei=40;function ti({bars:e2,target:t2,targetLabel:n2,max:r2,profileId:i2,profile:a2,baseProps:o2,className:s2,style:c2}){let l2=Wr(o2),u2=a2??Z(i2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=r2??Math.max(...d2,t2??0);if(!Number.isFinite(f2)||f2<=0)return Ce("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let p2=t2!==void 0&&t2>0&&t2<=f2?t2/f2*100:void 0;return g("figure",{className:y("core-comparison-bars",s2),...Q(a2?.id??i2),...mr(u2),style:c2,children:[e2.map(e3=>{let t3=Math.max(0,Math.min(100,e3.value/f2*100));return g("div",{className:"core-comparison-bars__bar",style:x({"--core-comparison-bars-value":`${t3}%`}),children:[h("div",{className:"core-comparison-bars__label",children:e3.label}),g("div",{className:"core-comparison-bars__track",style:x({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[h("div",{className:"core-comparison-bars__fill"}),h("span",{className:"core-comparison-bars__value","data-placement":t3>ei?"inside":"outside",children:qr(e3.display,l2)}),p2!==void 0&&h("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),t2!==void 0&&n2&&h("figcaption",{className:"core-comparison-bars__target-label",children:n2})]})}var ni=3,ri=5;function ii({items:e2,profileId:t2,profile:n2,checkboxes:r2=true,className:i2,style:a2}){return n2||Z(t2,"NextSteps"),e2.length===0?null:((e2.length<ni||e2.length>ri)&&Ce(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),h("ol",{className:y("core-next-steps",i2),...Q(n2?.id??t2),style:a2,children:e2.map((e3,t3)=>g("li",{className:"core-next-steps__step",children:[h("span",{className:"core-next-steps__marker",children:e3.marker??String(t3+1).padStart(2,"0")}),r2&&h("span",{className:"core-next-steps__box","aria-hidden":"true"}),h("span",{className:"core-next-steps__body",children:e3.body})]},t3))}))}var ai=38;function oi({title:e2="Notes",lines:t2=4,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Notes"),t2<1?null:g("section",{className:y("core-notes",i2),...Q(r2?.id??n2),style:a2,children:[h("div",{className:"core-notes__title",children:e2}),h("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:t2},(e3,t3)=>h("div",{className:"core-notes__line"},t3))})]})}var si="You left this section open, so it is not covered here.";function ci({wouldTell:e2,openingLine:t2=si,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"SkippedSection"),g("div",{className:y("core-skipped-section",i2),...Q(r2?.id??n2),style:a2,children:[h("span",{className:"core-skipped-section__standard",children:t2})," ",h("span",{className:"core-skipped-section__would-tell",children:e2})]})}var li="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function ui({advisor:e2,title:t2="Talk it through",invitation:n2=li,profileId:r2,profile:i2,className:a2,style:o2}){if(i2||Z(r2,"TalkItThrough"),!e2?.name?.trim())return Ce("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let s2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return s2.length===0&&Ce("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),g("section",{className:y("core-talk-it-through",a2),...Q(i2?.id??r2),style:o2,children:[h("h3",{className:"core-talk-it-through__title",children:t2}),h("p",{className:"core-talk-it-through__invitation",children:n2}),g("div",{className:"core-talk-it-through__advisor",children:[h("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&h("div",{className:"core-talk-it-through__role",children:e2.role}),s2.length>0&&h("div",{className:"core-talk-it-through__contact",children:s2.map(e3=>h("span",{children:e3},e3))})]})]})}var di=38;function fi({question:e2,answer:t2,lines:n2=1,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"WriteInField");let s2=typeof t2=="string"&&t2.trim().length>0,c2=Math.max(1,n2);return g("div",{className:y("core-write-in-field",a2),"data-answered":s2?"":void 0,...Q(i2?.id??r2),style:o2,children:[e2&&h("div",{className:"core-write-in-field__question",children:e2}),s2?h("div",{className:"core-write-in-field__answer",children:t2}):Array.from({length:c2},(e3,t3)=>h("div",{className:"core-write-in-field__line","aria-hidden":"true"},t3))]})}function pi({mark:e2,identity:t2,codes:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"Masthead"),e2===void 0&&t2===void 0&&n2===void 0?null:g("header",{className:y("core-masthead",a2),"data-page-region":"page-header",...Q(i2?.id??r2),style:o2,children:[e2!==void 0&&h("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),t2!==void 0&&h("div",{className:"core-masthead__identity","data-slot":"identity",children:t2}),n2!==void 0&&h("div",{className:"core-masthead__codes","data-slot":"codes",children:n2})]})}var mi=4;function hi({fields:e2,profileId:t2,profile:n2,className:r2,style:i2}){let a2=(n2??Z(t2,"MetaRail"))?.rail.placement??"strip";return a2==="none"||e2.length===0?null:(a2!=="column"&&e2.length>mi&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${mi}. Rendering all of them — check the layout.`),h("div",{className:y("core-meta-rail",r2),"data-placement":a2,...Q(n2?.id??t2),style:i2,children:e2.map(e3=>g("div",{className:"core-meta-rail__field",children:[h("div",{className:"core-meta-rail__label",children:e3.label}),h("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var gi={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function _i({left:e2,centre:t2,right:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"RunningFooter");let s2=[["left",e2],["centre",t2],["right",n2]].filter(([,e3])=>e3!=null);return s2.length===0?null:h("footer",{className:y("core-running-footer",a2),"data-page-region":"page-footer",...Q(i2?.id??r2),style:o2,children:s2.map(([e3,t3])=>h("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":gi[e3],children:t3},e3))})}function vi({children:e2,rail:t2,profileId:n2,profile:r2,className:i2,style:a2}){let o2=r2??Z(n2,"DocumentShell"),s2=o2?.rail.placement==="column"&&t2!==void 0;return h(kr,{children:g("div",{className:y("core-document-shell",i2),...Q(o2?.id??n2),"data-has-rail":s2?"":void 0,style:a2,children:[h("div",{className:"core-document-shell__body",children:e2}),s2&&g(m,{children:[h("div",{className:"core-document-shell__gutter","aria-hidden":true}),h("aside",{className:"core-document-shell__rail",children:t2})]})]})})}function yi(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function bi({entries:e2,depth:t2,title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Contents"),c2=s2?.depth.max??Infinity,l2=e2??[],u2=t2===void 0?l2:l2.filter(e3=>e3.level<t2);if(u2.length===0)return null;let d2=s2?.depth.numbering??"none",f2=u2.some(e3=>e3.page!==void 0);return g("nav",{"aria-label":"Table of contents",className:y("core-contents",a2),...Q(i2?.id??r2),style:o2,children:[n2&&h("div",{className:"core-contents__title",children:n2}),h("ol",{className:"core-contents__list",children:u2.map(e3=>{let t3=d2==="none"?null:yi(e3.ordinal,e3.level);return g("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=c2?"":void 0,style:x({"--core-contents-level":String(e3.level)}),children:[t3&&h("span",{className:"core-contents__ordinal",children:t3}),h("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),f2&&h("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function xi({s:e2,dated:t2}){return g("div",{className:"core-execution-block__signature",children:[g("div",{className:"core-execution-block__lines",children:[h("div",{className:"core-execution-block__line","data-line":"sign"}),t2?h("div",{className:"core-execution-block__line","data-line":"date"}):null]}),g("div",{className:"core-execution-block__captions",children:[g("div",{className:"core-execution-block__party",children:[e2.role?h("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?h("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?h("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),t2?h("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function Si({attestation:e2,label:t2,signatories:n2,columns:r2=1,note:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"ExecutionBlock");let l2=Array.isArray(n2)?n2:[];return g("section",{className:y("core-execution-block",s2),...Q(o2?.id??a2),style:c2,children:[t2?h("div",{className:"core-execution-block__label",children:t2}):null,e2?h("div",{className:"core-execution-block__attestation",children:e2}):null,h("div",{className:"core-execution-block__signatories","data-columns":r2,children:l2.map((e3,t3)=>h(xi,{s:e3,dated:e3.dated===true},t3))}),i2?h("div",{className:"core-execution-block__note",children:i2}):null]})}function Ci({kind:e2}){return g("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[h("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function wi({blocks:e2,profileId:t2,sectionNumbers:n2,sectionAnchors:r2,sectionTitles:i2,sectionReferences:a2,sectionOrdinal:o2,className:s2,style:c2}){let l2=Z(t2,"DocumentBlocks");if(e2.length===0)return null;let u2=Lr(o2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),l2?.depth.numbering),d2=0,f2=(e3,o3)=>pr(e3)?fr(e3).map((e4,s3)=>e4.kind==="text"?e4.text:h(zr,{target:e4.key,form:e4.form,sectionReferences:a2,sectionNumbers:n2,sectionTitles:i2,sectionAnchors:r2,profileId:t2},`${o3}-ref-${s3}`)):e3,p2=e2.some(e3=>e3.kind==="execution");return h("div",{className:y("core-document-blocks",s2),"data-pinned":p2?"execution":void 0,...Q(t2),style:c2,children:e2.map((e3,n3)=>{let r3=`${e3.kind}-${n3}`;switch(e3.kind){case"prose":return h(_r,{profileId:t2,full:e3.full,children:f2(e3.text,r3)},r3);case"clause":return h(Zr,{profileId:t2,items:e3.items.map((e4,t3)=>({marker:u2[d2++],primary:f2(e4.text,`${r3}-${t3}`),secondary:e4.note?f2(e4.note,`${r3}-${t3}-n`):void 0,missing:e4.missing}))},r3);case"definitions":return h(yr,{profileId:t2,pairs:e3.pairs.map((e4,t3)=>({term:e4.term,description:f2(e4.description,`${r3}-${t3}`)}))},r3);case"table":return h(Br,{profileId:t2,caption:e3.caption?f2(e3.caption,`${r3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t3)=>e4.map((e5,n4)=>f2(e5,`${r3}-${t3}-${n4}`)))},r3);case"notice":return h(gr,{profileId:t2,tone:e3.tone,title:e3.title,children:f2(e3.text,r3)},r3);case"figure":return h(jr,{profileId:t2,caption:f2(e3.caption,r3),children:e3.placeholder??null},r3);case"execution":return h(Si,{profileId:t2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},r3);default:return h(Ci,{kind:String(e3.kind)},r3)}})})}var Ti=["h2","h3","h4","h5","h6"];function Ei({sectionId:e2,title:t2,level:n2=0,ordinal:r2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionLevels:c2,continued:l2=false,continuedCount:u2,children:d2,blocks:f2,profileId:p2,profile:m2,className:_2,style:v2}){let b2=m2??Z(p2,"DocumentSection"),S2=i2?.[e2],C2=c2?.[e2],w2=S2??r2,T2=C2===void 0?n2:Math.max(0,C2-1),E2=T2>=(b2?.depth.max??Infinity),D2=Math.min(T2,(b2?.depth.indent.length??1)-1)+1,O2=b2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?Fr(w2):null,A2=Ti[Math.min(T2,Ti.length-1)],j2=Rr(a2,e2),M2=`${j2}-doc-heading`;return g("section",{id:j2,className:y("core-document-section",_2),"data-level":T2,"data-ordinal-source":w2?S2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(m2?.id??p2),style:x({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&h("div",{className:"core-document-section__article",children:k2}),g(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&h("span",{className:"core-document-section__ordinal",children:w2.join(".")}),t2,l2&&h("span",{className:"core-document-section__continued",children:"continued"})]}),l2&&u2&&h("div",{className:"core-document-section__count",children:`Items ${u2.from} to ${u2.to} of ${u2.of}`}),h("div",{className:"core-document-section__body",children:d2??(f2?h(wi,{blocks:f2,profileId:p2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionOrdinal:O2?w2:void 0}):null)})]})}var Di={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},Oi=["md","lg","xl"],ki=5;function Ai(e2){let t2=Oi.indexOf(e2);return t2>0?Oi[t2-1]:e2}var ji=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Mi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Ni({value:e2,label:t2,size:n2="lg",tone:r2,progress:i2,progressLabel:a2,autoStepDown:o2=true,baseProps:s2,className:c2,style:l2}){let u2=ji(e2)?qr(e2,Wr(s2)):e2,d2=typeof u2=="string"||typeof u2=="number"?String(u2).length:0,f2=o2&&d2>ki?Ai(n2):n2,p2=tt(r2,"strong"),{toned:m2,..._2}=nt(p2),v2=i2==null?null:Mi(i2);return g("div",{className:y("core-stat",m2&&"core-toned",c2),..._2,"data-size":f2,style:l2,children:[h("div",{className:"core-stat__value",children:u2}),t2!=null&&h(rt,{className:"core-stat__label",tone:p2==="on-dark"||p2==="inherit"?p2:"subtle",children:t2}),v2!==null&&h("div",{className:"core-stat__progress",role:"progressbar","aria-label":a2??(typeof t2=="string"?t2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:x({"--core-stat-progress":`${v2}%`}),children:h("div",{className:"core-stat__progress-fill"})})]})}function Pi({children:e2,minColumnWidth:t2=200,maxColumns:n2=4,gap:r2=32,className:i2,style:a2}){return h("div",{className:y("core-stat-group",i2),style:x({"--core-stat-group-min":`${t2}px`,"--core-stat-group-max":String(Math.max(1,n2)),"--core-stat-group-gap":`${r2}px`},a2),children:e2})}var Fi={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Ii({direction:e2="up",delay:t2=0,duration:n2=.5,threshold:r2=.15,once:i2=true,className:a2,style:s2,children:c2}){let l2=d(null),[u2,p2]=f(false);o(()=>{let e3=l2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){p2(true);return}let t3=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(p2(true),i2&&t3.disconnect()):i2||p2(false))},{threshold:Math.min(1,Math.max(0,r2))});return t3.observe(e3),()=>t3.disconnect()},[i2,r2]);let[m2,g2]=Fi[e2];return h("div",{ref:l2,className:y("core-reveal",a2),"data-revealed":u2?"true":"false",style:x({"--core-reveal-x":`${m2}px`,"--core-reveal-y":`${g2}px`,"--core-reveal-duration":`${n2}s`,"--core-reveal-delay":`${t2}s`},s2),children:c2})}function Li({eyebrow:e2,title:t2,description:n2,trailing:r2,level:i2=2,revealDelay:a2=0,className:o2,style:s2}){let c2=i2===3,l2=c2?"h3":"h2";return h(Ii,{direction:"up",delay:a2,className:y("core-section-header",o2),style:s2,children:g("div",{className:"core-section-header__inner","data-described":n2?"true":void 0,"data-level":c2?"3":void 0,children:[g("div",{className:"core-section-header__text",children:[e2?h(rt,{className:"core-section-header__eyebrow",children:e2}):null,h(l2,{className:"core-section-header__title",children:t2}),n2?h("p",{className:"core-section-header__description",children:n2}):null]}),r2!=null&&r2!==""?h("div",{className:"core-section-header__trailing",children:r2}):null]})})}function Ri({tone:e2,label:t2,headline:n2,children:r2,trailing:i2,className:a2,style:o2}){let s2=$e(e2,"accent"),c2=i2!=null&&i2!=="";return g("div",{className:y("core-highlight-box","core-toned",a2),"data-tone":s2,style:o2,children:[g("div",{className:"core-highlight-box__text",children:[t2?h("div",{className:"core-highlight-box__label",children:t2}):null,n2?h("div",{className:"core-highlight-box__headline",children:n2}):null,r2!=null&&r2!==""?h("div",{className:"core-highlight-box__body",children:r2}):null]}),c2?h("div",{className:"core-highlight-box__trailing",children:i2}):null]})}var zi=60,Bi=400,Vi=12,Hi=(e2,t2)=>{if(typeof e2!="string")return"";let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2},Ui=e2=>typeof e2=="string"&&/^\/(?![/\\])[^\s\u0000-\u001f]*$/.test(e2)?e2:null,Wi=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>0?Math.round(e2):void 0;function Gi({name:e2,description:t2,takes:n2,sketch:r2,className:i2,style:a2}){let o2=Hi(e2,zi);if(!o2)return null;let s2=Hi(t2,Bi),c2=(Array.isArray(n2)?n2:[]).map(e3=>({name:Hi(e3?.name,zi),type:Hi(e3?.type,60),note:Hi(e3?.note,160)})).filter(e3=>e3.name).slice(0,Vi),l2=Ui(r2?.src),u2=Wi(r2?.w),d2=Wi(r2?.h);return g("section",{className:y("core-proposed-component",i2),style:a2,"aria-label":`Proposed component: ${o2}`,children:[h("p",{className:"core-proposed-component__mark",children:"Proposed"}),h("h3",{className:"core-proposed-component__name",children:o2}),s2?h("p",{className:"core-proposed-component__description",children:s2}):null,l2?h("img",{className:"core-proposed-component__sketch",src:l2,alt:Hi(r2?.alt,160),loading:"lazy",...u2&&d2?{width:u2,height:d2}:{}}):null,c2.length?g("div",{className:"core-proposed-component__takes",children:[h("p",{className:"core-proposed-component__heading",children:"Would take"}),h("ul",{children:c2.map(e3=>g("li",{children:[h("code",{children:e3.name}),e3.type?h("span",{className:"core-proposed-component__type",children:e3.type}):null,e3.note?h("span",{className:"core-proposed-component__note",children:e3.note}):null]},e3.name))})]}):null]})}function Ki({label:e2,children:t2,className:n2,style:r2}){return g("div",{className:y("core-disclaimer-block",n2),style:r2,children:[e2?g(m,{children:[h("strong",{className:"core-disclaimer-block__label",children:e2})," "]}):null,t2]})}function qi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Ji({label:e2,value:t2,fillPercent:n2,subtitle:r2,tone:i2,baseProps:a2,className:o2,style:s2}){let c2=Wr(a2),l2=qi(n2);return g("div",{className:y("core-stat-strip","core-toned",o2),"data-tone":$e(i2,"info"),style:x({"--core-stat-strip-fill":`${l2}%`},s2),children:[g("div",{className:"core-stat-strip__row",children:[h("span",{className:"core-stat-strip__label",children:e2}),h("span",{className:"core-stat-strip__value",children:qr(t2,c2)})]}),h("div",{className:"core-stat-strip__track",children:h("div",{className:"core-stat-strip__fill"})}),r2?h("div",{className:"core-stat-strip__subtitle",children:qr(r2,c2)}):null]})}function Yi({text:e2,tone:t2,locale:n2,className:r2}){return h("span",{className:y("core-value-badge","core-toned",r2),"data-tone":$e(t2),children:qr(e2,n2)})}var Xi=8,Zi={good:"success",warn:"warning",critical:"danger"};function Qi(e2,t2,n2){let r2={series:String(n2%Xi+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%Xi+1)};let o2=Zi[i2];return o2?{tone:o2}:Ze.includes(i2)?{tone:i2}:(Ce("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function $i(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function ea(e2){let{number:t2,title:n2,description:r2,badgeText:i2,badgeTone:a2,bars:o2,tone:s2,isSelected:c2=false,className:l2,style:u2}=e2,d2=Wr(e2.baseProps),f2=Array.isArray(o2)?o2:[],p2=$i(t2);return g("div",{className:y("core-option-card",l2),"data-selected":c2?"true":void 0,"data-described":r2?"true":void 0,style:u2,children:[g("div",{className:"core-option-card__head",children:[p2?h("div",{className:"core-option-card__number","data-kind":p2.kind,children:p2.text}):h("span",{}),i2!=null&&i2!==""?h(Yi,{text:i2,tone:$e(a2),locale:d2}):null]}),n2?h("div",{className:"core-option-card__title",children:n2}):null,r2?h("p",{className:"core-option-card__description",children:r2}):null,f2.map((e3,t3)=>{let n3=Qi(e3.tone,s2,t3),r3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),i3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:$e(e3.valueTone);return g("div",{className:"core-option-card__bar",children:[g("div",{className:"core-option-card__bar-head",children:[h("span",{className:"core-option-card__bar-label",children:e3.label}),h("span",{className:y("core-option-card__bar-value",i3&&"core-toned"),"data-tone":i3,children:qr(e3.value,d2)})]}),h("div",{className:"core-option-card__track",children:h("div",{className:y("core-option-card__fill","tone"in n3&&"core-toned"),"data-tone":"tone"in n3?n3.tone:void 0,"data-series":"series"in n3?n3.series:void 0,style:x({"--core-option-card-fill":`${r3}%`})})})]},t3)})]})}function ta(e2){let{title:t2,subtitle:n2,rows:r2,className:i2,style:a2}=e2,o2=Wr(e2.baseProps),s2=e2.tone??"info",c2=s2==="none",l2=Array.isArray(r2)?r2:[];return g("div",{className:y("core-profile-card",!c2&&"core-toned",i2),"data-tone":c2?void 0:$e(s2,"info"),"data-marker":c2?"none":void 0,style:a2,children:[g("div",{className:"core-profile-card__head",children:[h("div",{className:"core-profile-card__title",children:t2}),n2?h("div",{className:"core-profile-card__subtitle",children:n2}):null]}),l2.map((e3,t3)=>g("div",{className:"core-profile-card__row",children:[h("span",{className:"core-profile-card__label",children:e3.label}),g("div",{className:"core-profile-card__end",children:[h("span",{className:"core-profile-card__value",children:qr(e3.value,o2)}),e3.badge?h(Yi,{text:e3.badge.text,tone:$e(e3.badge.tone),locale:o2}):null]})]},t3))]})}function na(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var ra={up:"▲",down:"▼",flat:"—"},ia={up:"success",down:"danger",flat:void 0},aa=e2=>e2!=null&&e2!=="";function oa(e2){let{columns:t2=4,gap:n2="tight",minColumnWidth:r2,className:i2,style:a2}=e2,o2=Wr(e2.baseProps),s2=Array.isArray(e2.cards)?e2.cards:[],c2=Math.max(1,Math.min(6,Math.round(Number(t2))||4));return h("div",{className:y("core-kpi-card-grid",i2),"data-gap":n2==="normal"?"normal":"tight",style:x({"--core-kpi-card-grid-columns":String(c2),"--core-kpi-card-grid-min":typeof r2=="number"&&r2>0?`${r2}px`:void 0},a2),children:s2.map((e3,t3)=>{let{subtitle:n3,badge:r3}=e3,i3=aa(e3.tone)?$e(e3.tone):void 0,a3=aa(e3.delta)?na(e3.delta):void 0,s3=a3?ia[a3]:void 0;return h(Ii,{direction:"up",className:"core-kpi-card-grid__item",children:g("div",{className:y("core-kpi-card-grid__card",i3&&"core-toned"),"data-tone":i3,children:[g("div",{className:"core-kpi-card-grid__head",children:[h("div",{className:"core-kpi-card-grid__label",children:e3.label}),r3&&aa(r3.text)?h(Yi,{text:r3.text,tone:$e(r3.tone),locale:o2}):null]}),h("div",{className:"core-kpi-card-grid__value",children:qr(e3.value,o2)}),a3?g("div",{className:y("core-kpi-card-grid__delta",s3&&"core-toned"),"data-tone":s3,"data-direction":a3,children:[h("span",{"aria-hidden":"true",children:ra[a3]})," ",qr(e3.delta,o2)]}):null,aa(n3)?h("div",{className:"core-kpi-card-grid__subtitle",children:qr(n3,o2)}):null]})},t3)})})}function sa(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return $e(e2)}var ca=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),la=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!r(e2)&&"value"in e2&&!("format"in e2));function ua(e2){return la(e2)?e2:{value:e2}}var da=/^\d{4}-\d{2}-\d{2}$/,fa=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function pa(e2,t2,n2){if(!fa.test(e2))return e2;let r2=da.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function ma(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var ha=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),ga={fraction:"fraction-percent"};function _a(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=ga[t3]??(ha.has(t3)?t3:void 0);return qr(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&ha.has(t2)?Yr(t2,e2,{locale:r2}):String(e2)}function va(e2,t2,n2,i2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?pa(e2,t2,i2.locale):typeof e2=="string"?qr(ma(e2),i2):ca(e2)?qr(e2,i2):typeof e2=="number"?_a(e2,t2,n2,i2):r(e2)?e2:null}function ya({title:e2,subtitle:t2,columns:n2,rows:r2,baseProps:i2,className:a2,style:o2}){let c2=Wr(i2),l2=`${s()}-title`,u2=Array.isArray(n2)?n2:[],d2=Array.isArray(r2)?r2:[],f2=e3=>u2[e3]?.align??(e3===0?"left":"right");return h(Ii,{direction:"up",children:g("div",{className:y("core-data-table",a2),style:o2,children:[e2||t2?g("div",{className:"core-data-table__head",children:[e2?h("div",{id:l2,className:"core-data-table__title",children:e2}):null,t2?h("div",{className:"core-data-table__subtitle",children:t2}):null]}):null,h("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?l2:void 0,tabIndex:0,children:g("table",{className:"core-data-table__table",children:[h("thead",{children:h("tr",{children:u2.map((e3,t3)=>g("th",{scope:"col",className:"core-data-table__col","data-align":f2(t3),style:x({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?h("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},t3))})}),h("tbody",{children:d2.map((e3,t3)=>{let{highlighted:n3,total:r3}=e3,i3=e3.cells,a3=Array.isArray(i3)?i3:i3&&typeof i3=="object"?u2.map(e4=>i3[e4.key]):[];return h("tr",{className:"core-data-table__row","data-highlighted":n3?"true":void 0,"data-total":r3?"true":void 0,children:a3.map((t4,n4)=>{let r4=ua(t4),i4=sa(r4.tone),a4={className:y("core-data-table__cell",i4&&"core-toned"),"data-align":f2(n4),"data-tone":i4};return n4===0?h("th",{scope:"row",...a4,children:va(r4.value,u2[n4]?.format,e3.unit,c2)},n4):h("td",{...a4,children:va(r4.value,u2[n4]?.format,e3.unit,c2)},n4)})},t3)})})]})})]})})}function ba(e2){let{event:t2,href:n2,locale:r2,timeZone:i2,size:a2,className:o2,style:s2}=e2,c2=t2&&typeof t2=="object"?t2:{name:""},l2=Et(c2,r2,i2),u2=c2.status&&c2.status!=="confirmed"?c2.status:void 0,d2=g(m,{children:[g("div",{className:"core-event-card__top",children:[c2.typeName?h("span",{className:"core-event-card__type",children:c2.typeName}):null,u2?h("span",{className:"core-event-card__status","data-status":u2,children:u2}):null]}),h("div",{className:"core-event-card__name",children:c2.name}),l2?h("div",{className:"core-event-card__when",children:l2}):null,c2.location?h("div",{className:"core-event-card__where",children:c2.location}):null]});return h("div",{className:y("core-event-card",o2),"data-kind":c2.kind,"data-status":c2.status,"data-size":a2==="compact"?"compact":void 0,style:s2,children:n2?h("a",{className:"core-event-card__link",href:n2,children:d2}):d2})}var xa={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function Sa(e2){let{actions:t2,className:n2,style:r2}=e2,[i2,a2]=f(e2.response),[o2,s2]=f(false),[c2,l2]=f(""),u2=t2?.respond,d2=async e3=>{if(!u2||o2)return;s2(true),l2("");let t3=await u2({response:e3});s2(false),t3.success?a2(e3):l2(At(t3))};return g("div",{className:y("core-event-respond",n2),style:r2,children:[h("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:xt.map(e3=>h("button",{type:"button",className:"core-event-respond__choice","aria-pressed":i2===e3,disabled:!u2||o2,onClick:()=>void d2(e3),children:xa[e3]},e3))}),c2?h("p",{className:"core-event-respond__message",role:"alert",children:c2}):null]})}function Ca(e2){let{event:t2,actions:n2,viewerResponse:r2,locale:i2,timeZone:a2,className:o2,style:s2}=e2,c2=[["Edit",e2.editHref],["Reschedule",e2.rescheduleHref],["Add note",e2.noteHref],["Cancel the event",e2.cancelHref]].filter(e3=>typeof e3[1]=="string"&&e3[1]!==""),l2=t2&&typeof t2=="object"?t2:{name:""},u2=Array.isArray(e2.notes)?e2.notes:[],d2=Array.isArray(e2.participants)?e2.participants:[],f2=Et(l2,i2,a2);return g("article",{className:y("core-event-detail",o2),"data-status":l2.status,style:s2,children:[g("header",{className:"core-event-detail__head",children:[l2.typeName?h("div",{className:"core-event-detail__type",children:l2.typeName}):null,h("h2",{className:"core-event-detail__name",children:l2.name}),f2?h("div",{className:"core-event-detail__meta",children:f2}):null,l2.location?h("div",{className:"core-event-detail__meta",children:l2.location}):null,l2.status&&l2.status!=="confirmed"?h("div",{className:"core-event-detail__status",children:l2.status}):null]}),c2.length>0?h("div",{className:"core-event-detail__manage",role:"group","aria-label":"Change this event",children:c2.map(([e3,t3])=>h("a",{className:"core-event-detail__action",href:t3,children:e3},e3))}):null,r2===void 0?null:h(Sa,{response:r2,actions:n2,className:"core-event-detail__respond"}),d2.length?g("section",{className:"core-event-detail__section","aria-label":"Participants",children:[h("h3",{className:"core-event-detail__heading",children:"Participants"}),h("ul",{className:"core-event-detail__list",children:d2.map((e3,t3)=>g("li",{className:"core-event-detail__person",children:[h("span",{children:e3.name}),h("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},t3))})]}):null,u2.length?g("section",{className:"core-event-detail__section","aria-label":"Notes",children:[h("h3",{className:"core-event-detail__heading",children:"Notes"}),u2.map((e3,t3)=>g("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?h("div",{className:"core-event-detail__badge",children:"Staff only"}):null,h("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?h("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(i2,{timeZone:a2}):void 0].filter(Boolean).join(" · ")}):null]},t3))]}):null]})}var wa=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function Ta(e2){let{orgId:t2,projectId:n2,actions:r2,onDone:i2,canWriteStaffNotes:a2,className:o2,style:c2}=e2,u2=Array.isArray(e2.types)?e2.types:[],d2=s(),[p2,m2]=f(e2.defaultTypeId??u2[0]?.id??""),_2=u2.find(e3=>e3.id===p2),v2=_2?.kind==="scheduled",[b2,x2]=f(""),[S2,C2]=f(kt()),[w2,T2]=f(""),[E2,D2]=f(""),[O2,k2]=f({}),[A2,j2]=f(""),[M2,N2]=f(!!a2),[P2,F2]=f(false),[I2,L2]=f(""),R2=l(()=>wa(_2),[_2]);if(!u2.length)return h("p",{className:y("core-event-log","core-event-log__empty",o2),style:c2,children:"There's nothing you can log here."});let z2=async o3=>{if(o3.preventDefault(),!r2?.logEvent||P2||!_2)return;F2(true),L2("");let s2=Ot(S2),c3={event_type_id:_2.id,org_id:t2,name:b2.trim()||_2.name,starts_at:s2,tzid:Dt(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};n2&&(c3.project_id=n2),v2&&w2&&(c3.ends_at=Ot(w2)),E2.trim()&&(c3.location=E2.trim());let l2=A2.trim()?[{body:A2.trim(),audience:a2&&M2?"staff":"shared"}]:void 0,u3=await r2.logEvent(l2?{event:c3,notes:l2}:{event:c3});F2(false),u3.success?(x2(""),j2(""),k2({}),i2?.(u3)):L2(At(u3))},B2=(e3,t3)=>k2(n3=>({...n3,[e3]:t3}));return g("form",{className:y("core-event-log",o2),style:c2,onSubmit:e3=>void z2(e3),children:[g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Type"}),h("select",{value:p2,onChange:e3=>{m2(e3.target.value),k2({})},children:u2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Title"}),h("input",{value:b2,onChange:e3=>x2(e3.target.value),placeholder:_2?.name})]}),g("div",{className:"core-event-log__row",children:[g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),h("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Ends"}),h("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Where"}),h("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,t3,n3])=>{let r3=t3.title??e3;if(t3.enum)return g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:r3}),g("select",{required:n3,value:String(O2[e3]??""),onChange:t4=>B2(e3,t4.target.value||void 0),children:[h("option",{value:"",children:"—"}),t3.enum.map(e4=>h("option",{value:e4,children:e4},e4))]})]},e3);if(t3.type==="boolean")return g("label",{className:"core-event-log__check",children:[h("input",{type:"checkbox",checked:!!O2[e3],onChange:t4=>B2(e3,t4.target.checked)}),h("span",{children:r3})]},e3);let i3=t3.type==="number"||t3.type==="integer";return g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:r3}),h("input",{type:i3?"number":"text",step:t3.type==="integer"?1:"any",required:n3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t4=>B2(e3,t4.target.value===""?void 0:i3?Number(t4.target.value):t4.target.value)})]},e3)}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Note"}),h("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),a2&&A2.trim()?g("label",{className:"core-event-log__check",children:[h("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),h("span",{children:"Staff only: the client won't see this note"})]}):null,I2?h("p",{id:`${d2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,h("div",{className:"core-event-log__actions",children:h("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!r2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Ea=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Da(e2){let t2=T(),{view:n2="week",weekParam:r2="week",linkParams:i2,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,label:l2="Schedule",className:u2,style:d2}=e2,f2=e3=>`?${i2?new URLSearchParams({...i2,[r2]:e3}).toString():`${r2}=${e3}`}`,p2=Array.isArray(e2.occurrences)?e2.occurrences:[],m2=jt(new Date,s2),_2=Mt(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:m2),v2=Array.from({length:7},(e3,t3)=>Y(_2,t3)),b2=new Map(v2.map(e3=>[e3,[]]));for(let e3 of p2)for(let t3 of Nt(e3,s2))b2.get(t3)?.push(e3);for(let e3 of b2.values())e3.sort((e4,t3)=>+!e4.startOn-!t3.startOn||(e4.startsAt??"").localeCompare(t3.startsAt??""));let x2=n2==="agenda"?v2.filter(e3=>b2.get(e3).length):v2;return g("section",{className:y("core-event-schedule",u2),"data-view":n2,style:d2,"aria-label":l2,children:[g("div",{className:"core-event-schedule__nav",children:[t2?null:h("a",{className:"core-event-schedule__step",href:f2(Y(_2,-7)),"aria-label":"Previous week",children:"‹"}),h("span",{className:"core-event-schedule__range",children:`${Ea(v2[0],o2)} – ${Ea(v2[6],o2)}`}),t2?null:h("a",{className:"core-event-schedule__step",href:f2(Y(_2,7)),"aria-label":"Next week",children:"›"})]}),x2.length===0?h("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,h("ol",{className:"core-event-schedule__days",children:x2.map(e3=>{let t3=b2.get(e3);return g("li",{className:"core-event-schedule__day","data-today":e3===m2||void 0,children:[h("h3",{className:"core-event-schedule__date",children:Ea(e3,o2)}),t3.length?h("ul",{className:"core-event-schedule__events",children:t3.map((e4,t4)=>h("li",{children:yt(e4,c2,{href:Pt(a2,e4.id),locale:o2,timeZone:s2})??h(ba,{event:e4,href:Pt(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??t4}-${e4.startsAt??e4.startOn??t4}`))}):h("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var Oa=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function ka(e2){let{eventHref:t2="?panel=event:{id}",emptyText:n2="No activity yet.",locale:r2,timeZone:i2,renderComponent:a2,className:o2,style:s2}=e2,c2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t3)=>new Date(t3.at).getTime()-new Date(e3.at).getTime()),l2=[];for(let e3 of c2){let t3=jt(e3.at,i2),n3=l2[l2.length-1];n3&&n3[0]===t3?n3[1].push(e3):l2.push([t3,[e3]])}let u2=new Intl.DateTimeFormat(r2,{hour:"numeric",minute:"2-digit",timeZone:i2});return g("section",{className:y("core-event-timeline",o2),style:s2,"aria-label":"Activity",children:[l2.length===0?h("p",{className:"core-event-timeline__empty",children:n2}):null,l2.map(([e3,n3])=>g("section",{className:"core-event-timeline__day",children:[h("h3",{className:"core-event-timeline__date",children:Oa(e3,r2)}),h("ol",{className:"core-event-timeline__items",children:n3.map((e4,n4)=>g("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[g("div",{className:"core-event-timeline__line",children:[h("time",{className:"core-event-timeline__time",dateTime:e4.at,children:u2.format(new Date(e4.at))}),e4.summary?h("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?h("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?yt(e4.event,a2,{href:Pt(t2,e4.event.id),locale:r2,timeZone:i2})??h(ba,{event:e4.event,href:Pt(t2,e4.event.id),locale:r2,timeZone:i2}):null]},e4.id??`${e4.at}-${n4}`))})]},e3))]})}var Aa=1440;function ja(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ma(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(ja(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Na=e2=>e2.busyOnly===true;function Pa(e2,t2){if(!e2.startsAt)return null;let n2=Ma(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Ma(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function Fa(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){Nt(r3).includes(t2)&&i2.push(r3);continue}let e3=Pa(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?Aa:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Na(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),Aa),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function Ia(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,Aa)}}function La(e2,t2=1){let n2=Y(Mt(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function Ra(e2,t2,n2){return t2.filter(t3=>Fa(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var za=["circle","square","triangle","diamond","plus","hexagon"],Ba={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},Va=e2=>za[(Math.max(1,Math.floor(e2))-1)%za.length],Ha=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function Ua({series:e2,className:t2}){let n2=Ha(e2);return h("svg",{className:t2?`core-series-glyph ${t2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":n2,"data-shape":Va(n2),children:h("path",{d:Ba[Va(n2)]})})}var Wa=44,Ga=28,Ka=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function qa(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=f(()=>Date.now());return o(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function Ja(e2){let{label:t2="Schedule",startHour:n2=7,endHour:r2=19,hourHeight:i2=64,eventHref:a2="?panel=event:{id}",locale:s2,timeZone:c2,className:l2,style:u2}=e2,p2=(Array.isArray(e2.columns)?e2.columns:[]).filter(e3=>e3&&typeof e3.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e3.date)),_2=qa(e2.now),v2=d(null),[b2,S2]=f(false);o(()=>{let e3=v2.current;if(!e3)return;let t3=()=>S2(e3.scrollWidth>e3.clientWidth+1);t3();let n3=new ResizeObserver(t3);return n3.observe(e3),()=>n3.disconnect()},[p2.length]);let C2=Ma(_2,c2),w2=Math.ceil(Wa/Math.max(i2,24)*60),T2=p2.map(e3=>Fa(Array.isArray(e3.events)?e3.events:[],e3.date,{timeZone:c2,minMinutes:w2})),E2=T2.map(e3=>Math.max(Wa,Ga*Math.max(1,...e3.blocks.map(e4=>e4.cols)))),{fromMin:D2,toMin:O2}=Ia(T2,n2,r2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e3,t3)=>D2+t3*60),j2=new Intl.DateTimeFormat(s2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(s2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e3=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e3,Aa-1)))),P2=e3=>e3.continuesBefore?e3.continuesAfter?"All day":`Until ${N2(e3.endMin)}`:e3.continuesAfter?`From ${N2(e3.startMin)}`:`${N2(e3.startMin)} – ${N2(e3.endMin)}`;return g("div",{ref:v2,className:y("core-hour-grid",l2),role:"group","aria-label":t2,tabIndex:b2?0:void 0,style:x({"--core-hour-grid-cols":String(p2.length),"--core-hour-grid-tracks":E2.map(e3=>`minmax(${e3}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e3,t3)=>e3+t3,0)}px`,"--core-hour-grid-hour":`${i2}px`,"--core-hour-grid-hours":String(k2/60)},u2),children:[g("div",{className:"core-hour-grid__head",children:[h("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),p2.map(e3=>{let t3=C2?.date===e3.date,n3=g(m,{children:[h("span",{className:"core-hour-grid__label",children:e3.label}),e3.sublabel?h("span",{className:"core-hour-grid__sublabel",children:e3.sublabel}):null]}),r3=Lt(e3.href);return r3?h("a",{className:"core-hour-grid__day",href:r3,"data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id):h("div",{className:"core-hour-grid__day","data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id)})]}),T2.some(e3=>e3.allDay.length)?g("div",{className:"core-hour-grid__allday",children:[h("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e3,t3)=>h("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${p2[t3].label}`,children:e3.allDay.map((e4,t4)=>{let n3=Ya(e4)?void 0:Lt(Pt(a2,e4.id));return h("li",{className:"core-hour-grid__chip","data-busy":Ya(e4)||void 0,children:Ya(e4)?h("span",{className:"core-hour-grid__sr",children:"Busy all day"}):n3?h("a",{href:n3,children:e4.name}):e4.name},`${e4.id??t4}`)})},p2[t3].id))]}):null,g("div",{className:"core-hour-grid__body",children:[h("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e3,t3)=>h("span",{className:"core-hour-grid__tick",style:{top:Ka(e3,D2,k2)},"data-first":t3===0||void 0,children:t3===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e3/60)))},e3))}),T2.map((e3,t3)=>{let n3=p2[t3],r3=C2?.date===n3.date;return g("section",{className:"core-hour-grid__col","aria-label":n3.label,"data-today":r3||void 0,children:[h("ol",{className:"core-hour-grid__events",children:e3.blocks.map((e4,t4)=>{let n4=e4.event,r4={"--core-hour-grid-top":Ka(e4.startMin,D2,k2),"--core-hour-grid-height":`${((e4.shownEndMin-e4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(e4.col/e4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/e4.cols).toFixed(3)}%`};if(e4.busyOnly)return h("li",{className:"core-hour-grid__block","data-busy":"",style:x(r4),children:h("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(e4)}`})},t4);let i3=Lt(Pt(a2,n4.id)),o2=e4.endMin-e4.startMin,s3=o2<45?"short":o2<90?"medium":"long",c3=g(m,{children:[e4.overlaps?h("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,g("span",{className:"core-hour-grid__name",children:[typeof n4.series=="number"?h(Ua,{series:n4.series,className:"core-hour-grid__series"}):null,n4.name]}),h("span",{className:"core-hour-grid__time",children:P2(e4)}),s3==="long"&&n4.typeName?h("span",{className:"core-hour-grid__type",children:n4.typeName}):null]}),l3={className:"core-hour-grid__event","data-kind":n4.kind,"data-status":n4.status,"data-size":s3,"data-overlaps":e4.overlaps||void 0};return h("li",{className:"core-hour-grid__block","data-before":e4.continuesBefore||void 0,"data-after":e4.continuesAfter||void 0,style:x(r4),children:i3?h("a",{...l3,href:i3,children:c3}):h("div",{...l3,children:c3})},`${n4.id??"e"}-${t4}`)})}),r3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?h("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:Ka(C2.minutes,D2,k2)}}):null]},n3.id)})]})]})}var Ya=e2=>e2.busyOnly===true,$=/^\d{4}-\d{2}-\d{2}$/,Xa=/^\d{2}:\d{2}$/,Za=(e2,t2)=>!e2||!$.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),Qa=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function $a(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function eo(e2,t2){if(!$.test(e2)||!Xa.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function to(e2,t2){let n2=$a(new Date(t2).toISOString(),e2);if(!n2)return 0;let[r2,i2,a2]=n2.date.split("-").map(Number),[o2,s2]=n2.time.split(":").map(Number);return Math.round((Date.UTC(r2,i2-1,a2,o2,s2)-Math.floor(t2/6e4)*6e4)/6e4)}function no(e2,t2,n2){if($.test(e2)&&Xa.test(t2)){if(!n2)return eo(e2,t2);try{let[r2,i2,a2]=e2.split("-").map(Number),[o2,s2]=t2.split(":").map(Number),c2=Date.UTC(r2,i2-1,a2,o2,s2),l2=c2;for(let e3=0;e3<4;e3++){let e4=c2-to(n2,l2)*6e4;if(e4===l2)break;l2=e4}let u2=to(n2,l2),d2=u2<0?"-":"+",f2=Math.abs(u2);return`${e2}T${t2}:00${d2}${String(Math.floor(f2/60)).padStart(2,"0")}:${String(f2%60).padStart(2,"0")}`}catch{return eo(e2,t2)}}}function ro(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var io=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function ao({days:e2,param:t2="date",viewParam:n2="view",keep:r2,locale:i2,className:a2,style:o2}){let s2=T(),c2=[...new Set(e2.filter(e3=>$.test(e3)))].sort();if(c2.length===0)return null;let l2=c2.length===1,u2=l2?`Events overlap on ${Za(c2[0],i2)}.`:`Events overlap on ${c2.length} days.`;return h("div",{className:y("core-overlap-notice",a2),style:o2,children:h(vn,{tone:"warning",message:u2,action:s2?void 0:g("span",{className:"core-overlap-notice__links",children:[l2?null:h("span",{className:"core-overlap-notice__lead",children:"Review:"}),c2.map(e3=>h("a",{className:"core-overlap-notice__review",href:io(e3,t2,n2,r2),"aria-label":`Review ${Za(e3,i2)}`,children:l2?"Review":Za(e3,i2)},e3))]})})})}function oo(e2){let{param:t2="type",cancelledParam:n2="cancelled",keep:r2,label:i2="Show",onChange:a2,className:o2,style:c2}=e2,l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),u2=s(),d2=l2.map(e3=>e3.id),f2=Array.isArray(e2.selected)?e2.selected:d2,p2=e2.showCancelled===true;if(l2.length===0)return null;let m2=e3=>{let r3=new FormData(e3);return{selected:r3.getAll(t2).map(String),showCancelled:r3.has(n2)}};return g("form",{className:y("core-calendar-filters",o2),style:c2,method:"get",action:"",onChange:e3=>{a2?a2(m2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>a2&&e3.preventDefault(),children:[Object.entries(r2??{}).map(([e3,t3])=>h("input",{type:"hidden",name:e3,value:t3},e3)),g("fieldset",{className:"core-calendar-filters__set",children:[h("legend",{className:"core-calendar-filters__legend",children:i2}),l2.map((e3,n3)=>g("label",{className:"core-calendar-filters__option",children:[h("input",{type:"checkbox",name:t2,value:e3.id,defaultChecked:f2.includes(e3.id)}),h(Ua,{series:Ha(e3.series??n3+1)}),h("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),g("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[h("input",{type:"checkbox",name:n2,value:"1",defaultChecked:p2}),h("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),h("button",{type:"submit",className:"core-calendar-filters__apply",id:`${u2}-apply`,children:"Apply"})]})}var so=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,co=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function lo({month:e2,date:t2,highlight:n2="week",occurrences:r2,weekStartsOn:i2=1,param:a2="date",monthParam:o2="month",keep:s2,locale:c2,timeZone:l2,now:u2,className:p2,style:m2}){let _2=T(),v2=_2?"span":"a",b2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),x2=Ma(Number.isFinite(b2)?b2:Date.now(),l2)?.date??"1970-01-01",S2=t2&&/^\d{4}-\d{2}-\d{2}$/.test(t2)?t2:x2,C2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:S2.slice(0,7),w2=`${C2}-01`,E2=La(w2,i2)[0],D2=Array.from({length:42},(e3,t3)=>Y(E2,t3)),O2=Array.from({length:6},(e3,t3)=>D2.slice(t3*7,t3*7+7)),k2=n2==="week"?new Set(La(S2,i2)):new Set([S2]),A2=Array.isArray(r2)?r2:[],j2=new Map(D2.map(e3=>{let t3=Fa(A2,e3,{timeZone:l2,minMinutes:0});return[e3,t3.blocks.length+t3.allDay.length]})),M2=(e3,t3)=>new Intl.DateTimeFormat(c2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),N2=M2({month:"long",year:"numeric"},w2),P2=O2[0].map(e3=>({short:M2({weekday:"narrow"},e3),long:M2({weekday:"long"},e3)})),F2=D2.includes(S2)?S2:D2.includes(x2)?x2:w2,[I2,L2]=f(null),R2=I2&&D2.includes(I2)?I2:F2,z2=d(null),B2=e3=>{D2.includes(e3)&&(L2(e3),z2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return g("div",{className:y("core-mini-month",p2),style:m2,children:[g("div",{className:"core-mini-month__head",children:[_2?null:h("a",{className:"core-mini-month__step","data-step":"prev",href:so(s2,o2,co(C2,-1)),"aria-label":"Previous month",children:"‹"}),h("div",{className:"core-mini-month__title",id:`mm-${C2}`,"aria-live":"polite",children:N2}),_2?null:h("a",{className:"core-mini-month__step","data-step":"next",href:so(s2,o2,co(C2,1)),"aria-label":"Next month",children:"›"})]}),g("div",{ref:z2,role:"grid","aria-labelledby":`mm-${C2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t3=e3.target.closest("[data-date]")?.dataset.date;if(!t3)return;let n3=O2.find(e4=>e4.includes(t3)),r3={ArrowLeft:Y(t3,-1),ArrowRight:Y(t3,1),ArrowUp:Y(t3,-7),ArrowDown:Y(t3,7),Home:n3[0],End:n3[6]};r3[e3.key]?(e3.preventDefault(),B2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),z2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[h("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:P2.map((e3,t3)=>h("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},t3))}),O2.map(e3=>h("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let t3=j2.get(e4)??0,n3=`${M2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===x2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`;return h("span",{role:"gridcell","aria-selected":e4===S2,className:"core-mini-month__cell","data-range":k2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==C2||void 0,children:g(v2,{className:"core-mini-month__day",href:_2?void 0:so(s2,a2,e4),"data-date":e4,"data-today":e4===x2||void 0,"data-selected":e4===S2||void 0,"aria-current":e4===S2?"date":void 0,"aria-label":_2?void 0:n3,tabIndex:_2?void 0:e4===R2?0:-1,onFocus:()=>L2(e4),children:[_2?h("span",{className:"core-mini-month__sr",children:n3}):null,h("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),h("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":t3>0||void 0})]})},e4)})},e3[0]))]})]})}var uo=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function fo({date:e2,occurrences:t2,weekStartsOn:n2=1,param:r2="date",steps:i2=true,keep:a2,locale:o2,timeZone:s2,now:c2,className:l2,style:u2}){let d2=T(),f2=d2?"span":"a",p2=c2===void 0?Date.now():typeof c2=="number"?c2:new Date(c2).getTime(),m2=Ma(Number.isFinite(p2)?p2:Date.now(),s2)?.date??"1970-01-01",_2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,v2=La(_2,n2),b2=Array.isArray(t2)?t2:[],x2=new Intl.DateTimeFormat(o2,{weekday:"short",timeZone:"UTC"}),S2=new Intl.DateTimeFormat(o2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),C2=e3=>new Date(`${e3}T00:00:00Z`),w2=(e3,t3)=>`${S2.format(C2(e3))}${e3===m2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`,E2=new Map(v2.map(e3=>{let t3=Fa(b2,e3,{timeZone:s2});return[e3,t3.blocks.length+t3.allDay.length]}));return h("nav",{className:y("core-week-strip",l2),style:u2,"aria-label":"Week",children:g("div",{className:"core-week-strip__frame",children:[i2&&!d2?h("a",{className:"core-week-strip__step",href:uo(r2,Y(_2,-7),a2),"aria-label":"Previous week",children:"‹"}):null,h("ol",{className:"core-week-strip__days",children:v2.map(e3=>{let t3=E2.get(e3)??0;return h("li",{children:g(f2,{className:"core-week-strip__day",href:d2?void 0:uo(r2,e3,a2),"aria-current":e3===_2?"date":void 0,"aria-label":d2?void 0:w2(e3,t3),"data-selected":e3===_2||void 0,"data-today":e3===m2||void 0,children:[d2?h("span",{className:"core-week-strip__sr",children:w2(e3,t3)}):null,h("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:x2.format(C2(e3))}),h("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),h("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":t3>0||void 0})]})},e3)})}),i2&&!d2?h("a",{className:"core-week-strip__step",href:uo(r2,Y(_2,7),a2),"aria-label":"Next week",children:"›"}):null]})})}var po=[["day","Day"],["week","Week"],["agenda","Agenda"]];function mo(e2){let t2=T(),{weekStartsOn:n2=1,viewParam:r2="view",dateParam:i2="date",eventHref:a2,newEventHref:o2,summary:s2,notice:c2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,className:p2,style:_2}=e2,v2=e2.view==="day"||e2.view==="agenda"?e2.view:"week",b2=Array.isArray(e2.occurrences)?e2.occurrences:[],x2=e2.now===void 0?Date.now():typeof e2.now=="number"?e2.now:new Date(e2.now).getTime(),S2=Ma(Number.isFinite(x2)?x2:Date.now(),f2)?.date??"1970-01-01",C2=e2.date&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)?e2.date:S2,w2=(e3,t3)=>`?${new URLSearchParams({[r2]:e3,[i2]:t3}).toString()}`,E2=v2==="day"?1:7,D2=Lt(o2),O2=(e3,t3)=>new Intl.DateTimeFormat(d2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),k2=La(C2,n2),A2=v2==="day"?O2({weekday:"long",month:"long",day:"numeric"},C2):`${O2({month:"short",day:"numeric"},k2[0])} – ${O2({month:"short",day:"numeric",year:"numeric"},k2[6])}`,j2=(t3,n3)=>h(Ja,{columns:t3,label:n3,eventHref:a2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,now:e2.now}),M2=e3=>({id:e3,date:e3,label:`${O2({weekday:"short"},e3)} ${Number(e3.slice(8))}`,sublabel:e3===S2?"Today":void 0,events:b2}),N2=k2.map(e3=>({...M2(e3),href:t2?void 0:w2("day",e3)}));return g("section",{className:y("core-calendar","core-calendar-view",p2),style:_2,"aria-label":"Schedule","data-view":v2,children:[g("header",{className:"core-calendar__head",children:[h("h2",{className:"core-calendar__title",children:A2}),t2?null:g("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[v2==="agenda"?null:h("a",{className:"core-calendar__step",href:w2(v2,Y(C2,-E2)),"aria-label":v2==="day"?"Previous day":"Previous week",children:"‹"}),h("a",{className:"core-calendar__today",href:w2(v2,S2),"aria-current":C2===S2||k2.includes(S2)?"date":void 0,children:"Today"}),v2==="agenda"?null:h("a",{className:"core-calendar__step",href:w2(v2,Y(C2,E2)),"aria-label":v2==="day"?"Next day":"Next week",children:"›"})]}),t2?null:h("nav",{className:"core-calendar__views","aria-label":"View",children:po.map(([e3,t3])=>h("a",{className:"core-calendar__view",href:w2(e3,C2),"aria-current":e3===v2?"page":void 0,children:t3},e3))}),D2?h("a",{className:"core-calendar__new",href:D2,children:"New event"}):null]}),s2?h("p",{className:"core-calendar__summary",children:s2}):null,c2?h("div",{className:"core-calendar__notice",children:c2}):null,v2==="day"?j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2)):null,v2==="week"?g(m,{children:[h("div",{className:"core-calendar__wide",children:j2(N2,`Week of ${O2({month:"long",day:"numeric"},k2[0])}`)}),g("div",{className:"core-calendar__narrow",children:[h(fo,{date:C2,occurrences:b2,weekStartsOn:n2,param:i2,steps:false,keep:{[r2]:"week"},locale:d2,timeZone:f2,now:e2.now}),j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2))]})]}):null,v2==="agenda"?h(Da,{label:"Agenda",occurrences:b2,view:"agenda",weekOf:C2,weekParam:i2,linkParams:{[r2]:"agenda"},eventHref:a2,locale:d2,timeZone:f2}):null]})}var ho=new Set(["field","select","expand"]),go=(e2,t2)=>{let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2};function _o(e2,t2){if(typeof e2!="function"||!ho.has(t2.kind)||typeof t2.name!="string")return;let n2=go(t2.name,80);if(n2==="")return;let r2=t2.value,i2=typeof r2=="string"?go(r2,200):typeof r2=="boolean"||typeof r2=="number"&&Number.isFinite(r2)?r2:void 0;try{e2(i2===void 0?{kind:t2.kind,name:n2}:{kind:t2.kind,name:n2,value:i2})}catch{}}var vo=["private","team","client"];function yo(e2){let t2=Array.isArray(e2?.audiences)?e2.audiences:[];return vo.filter(e3=>t2.includes(e3))}function bo(e2,t2){if(t2.length!==0)return t2.includes(e2)?e2:t2.includes("team")?"team":t2[0]}function xo(e2,t2="team"){let[n2,r2]=f(t2);return{value:bo(n2,e2),setValue:r2}}function So(e2,t2){if(e2==="private")return"Only me and the people I add";if(e2==="team")return"My team";let n2=X(t2);return n2?`My team and ${n2}`:"My team and the client"}function Co(e2){return e2==="client"?" The client can see it.":e2==="private"?" Only you and the people you add can see it.":""}function wo({id:e2,audiences:t2,value:n2,onChange:r2,subjectName:i2,disabled:a2}){return t2.length===0||!n2?null:t2.length===1?g("p",{className:"core-intent-card__audience-fixed","data-audience":n2,children:[h("span",{className:"core-intent-card__label",children:"Who can see it"})," ",So(n2,i2)]}):g("fieldset",{className:"core-intent-card__audience",disabled:a2,children:[h("legend",{className:"core-intent-card__label",children:"Who can see it"}),t2.map(t3=>g("label",{className:"core-intent-card__audience-row",children:[h("input",{type:"radio",name:`${e2}-audience`,value:t3,checked:n2===t3,onChange:()=>r2(t3)}),h("span",{children:So(t3,i2)})]},t3))]})}var To=50,Eo=["project","process","run","node","event"],Do=e2=>typeof e2=="string"&&e2.trim()!=="",Oo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Do(e3.name)).slice(0,To),ko=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Do(e3.name)).slice(0,To),Ao=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&Eo.includes(e3.kind)&&typeof e3.id=="string"&&Do(e3.label)).slice(0,To);function jo(e2){let t2=Oo(e2.people),n2=ko(e2.assignees),r2=Ao(e2.linkCandidates),[i2,a2]=f(new Set((Array.isArray(e2.attendeeIds)?e2.attendeeIds:[]).filter(e3=>typeof e3=="string"))),[o2,s2]=f(typeof e2.assigneeId=="string"&&n2.some(t3=>t3.id===e2.assigneeId)?e2.assigneeId:""),[c2,l2]=f(()=>Ao(e2.links).slice(0,10)),u2=t2.filter(e3=>i2.has(e3.id)),d2=n2.find(e3=>e3.id===o2),p2=r2.length>0?c2:[];return{people:t2,assignees:n2,candidates:r2,guests:i2,setGuests:a2,assigneeId:o2,setAssigneeId:s2,links:p2,setLinks:l2,picked:u2,assignee:d2,write(e3){u2.length&&(e3.attendeeIds=u2.map(e4=>e4.id)),d2&&(e3.assigneeId=d2.id),p2.length&&(e3.links=p2.slice(0,10).map(e4=>({kind:e4.kind,id:e4.id})))}}}function Mo({extras:e2,disabled:t2}){let n2=s(),{people:r2,assignees:i2,candidates:a2,guests:o2,setGuests:c2,assigneeId:l2,setAssigneeId:u2,links:d2,setLinks:f2}=e2,p2=a2.filter(e3=>!d2.some(t3=>t3.kind===e3.kind&&t3.id===e3.id));return g(m,{children:[r2.length>0?g("fieldset",{className:"core-intent-card__people",disabled:t2,children:[h("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),r2.map(e3=>g("label",{className:"core-intent-card__person",children:[h("input",{type:"checkbox",checked:o2.has(e3.id),onChange:t3=>c2(n3=>t3.target.checked?new Set([...n3,e3.id]):new Set([...n3].filter(t4=>t4!==e3.id)))}),h("span",{className:"core-intent-card__person-name",children:e3.name}),e3.role?h("span",{className:"core-intent-card__person-role",children:X(e3.role)}):null]},e3.id))]}):null,i2.length>0?h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),g("select",{value:l2,disabled:t2,onChange:e3=>u2(e3.target.value),children:[h("option",{value:"",children:"No one"}),i2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))]})]})}):null,a2.length>0?g("fieldset",{className:"core-intent-card__links",disabled:t2,children:[h("legend",{className:"core-intent-card__label",children:"Linked to (optional)"}),d2.length>0?h("ul",{className:"core-intent-card__chips",children:d2.map(e3=>g("li",{className:"core-intent-card__chip",children:[h("span",{className:"core-intent-card__chip-label",children:e3.label}),h("button",{type:"button",className:"core-intent-card__chip-remove","aria-label":`Remove link: ${e3.label}`,onClick:()=>f2(t3=>t3.filter(t4=>t4.kind!==e3.kind||t4.id!==e3.id)),children:h("span",{"aria-hidden":"true",children:"×"})})]},`${e3.kind}:${e3.id}`))}):null,p2.length>0&&d2.length<10?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",id:`${n2}-add`,children:"Add a link"}),g("select",{"aria-labelledby":`${n2}-add`,value:"",onChange:e3=>{let t3=p2.find(t4=>`${t4.kind}:${t4.id}`===e3.target.value);t3&&f2(e4=>[...e4,t3])},children:[h("option",{value:"",children:"Choose…"}),p2.map(e3=>h("option",{value:`${e3.kind}:${e3.id}`,children:e3.label},`${e3.kind}:${e3.id}`))]})]}):null]}):null]})}var No=[5,10,15,20,30,45,60,90],Po={line:300,note:2e3},Fo=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"";function Io(e2){if(!e2)return kt();let t2=new Date(e2);return Number.isNaN(t2.getTime())?kt():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function Lo(e2){let{canWriteStaffNotes:t2=false,onIntent:n2,className:r2,style:i2}=e2,a2=X(e2.subjectName),c2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],l2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},u2=s(),{run:p2,busy:m2,message:_2,available:v2}=It(n2),[b2,x2]=f(c2.find(e3=>e3.id===l2.typeId)?.id??c2[0]?.id??""),S2=yo(c2.find(e3=>e3.id===b2)),C2=xo(S2),[w2,T2]=f(Io(l2.startsAt)),[E2,D2]=f(typeof l2.durationMin=="number"&&l2.durationMin>0?String(Math.round(l2.durationMin)):""),O2=jo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:l2.attendeeIds}),[k2,A2]=f(Fo(l2.outcome,Po.line)),[j2,M2]=f(Fo(l2.followUp,Po.line)),[N2,P2]=f(Fo(l2.note,Po.note)),[F2,I2]=f(t2),[L2,R2]=f(null),z2=d(null);o(()=>{L2&&z2.current?.focus({preventScroll:true})},[L2]);let B2=L2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(B2){let e3=Lt(B2.href);return g("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:y("core-intent-card","core-log-card",r2),style:i2,"data-state":"logged",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:["Logged",a2?` · ${a2}`:""]}),h("p",{className:"core-intent-card__title",children:B2.name??"Logged"})]}),e3?h("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(c2.length===0)return h("p",{className:y("core-intent-card","core-log-card","core-log-card__empty",r2),style:i2,children:"There’s nothing you can log here."});let V2=c2.find(e3=>e3.id===b2),ee2=v2&&m2===null,H2=v2&&!!a2&&!!V2&&!!w2,U2=v2?a2?"":"Choose who this is about before logging.":Ft,W2=async e3=>{if(e3.preventDefault(),!H2||m2!==null||!V2)return;let n3={typeId:V2.id,startsAt:Ot(w2),tzid:Dt()};C2.value&&(n3.audience=C2.value),E2&&(n3.durationMin=Number(E2)),O2.write(n3),k2.trim()&&(n3.outcome=k2.trim()),j2.trim()&&(n3.followUp=j2.trim()),N2.trim()&&(n3.note=N2.trim(),n3.staffOnly=t2&&F2);let{ok:r3,result:i3}=await p2("log_event",n3);r3&&R2({name:V2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},G2=!ee2;return g("form",{className:y("core-intent-card","core-log-card",r2),style:i2,"data-state":v2?"editing":"display",onSubmit:e3=>void W2(e3),"aria-busy":m2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{className:"core-intent-card__eyebrow",children:"Log"}),h("p",{className:"core-intent-card__title",children:a2??"Who is this about?"})]}),g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:b2,disabled:G2,onChange:e3=>x2(e3.target.value),children:c2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"When"}),h("input",{type:"datetime-local",required:true,value:w2,readOnly:G2,onChange:e3=>T2(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"How long"}),g("select",{value:E2,disabled:G2,onChange:e3=>D2(e3.target.value),children:[h("option",{value:"",children:"—"}),[...new Set([...No,...E2?[Number(E2)]:[]])].sort((e3,t3)=>e3-t3).map(e3=>h("option",{value:e3,children:`${e3} min`},e3))]})]})}),h(Mo,{extras:O2,disabled:G2}),h(wo,{id:u2,audiences:S2,value:C2.value,onChange:C2.setValue,subjectName:a2,disabled:G2}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Outcome"}),h("input",{value:k2,maxLength:Po.line,readOnly:G2,onChange:e3=>A2(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Follow-up"}),h("input",{value:j2,maxLength:Po.line,readOnly:G2,onChange:e3=>M2(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Note"}),h("textarea",{rows:Math.min(10,Math.max(2,N2.split("\n").length+Math.floor(N2.length/40))),maxLength:Po.note,value:N2,readOnly:G2,onChange:e3=>P2(e3.target.value)})]}),t2&&N2.trim()?g("label",{className:"core-log-card__check",children:[h("input",{type:"checkbox",checked:F2,disabled:G2,onChange:e3=>I2(e3.target.checked)}),h("span",{children:"Staff only: the client won’t see this note"})]}):null,_2?h("p",{id:`${u2}-message`,className:"core-intent-card__message",role:"alert",children:_2}):null,h("p",{className:"core-intent-card__does",id:`${u2}-does`,children:H2?`Log saves this to ${a2}’s file.`:U2}),h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!H2||m2!==null,"aria-describedby":`${u2}-does`,children:m2==="log_event"?"Logging…":"Log"})})]})}var Ro=250,zo=500,Bo=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function Vo({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:a2="",onValueChange:c2,onSelect:u2,orientation:p2="vertical",debounceMs:m2=150,minChars:h2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=s(),C2=`${S2}-list`,[w2,T2]=f(a2),E2=r2??w2,[D2,O2]=f(y2),[k2,A2]=f(y2),[j2,M2]=f([]),[N2,P2]=f("idle"),[F2,I2]=f(null),[L2,R2]=f(""),z2=d(0),B2=d({onValueChange:c2,onSelect:u2,loadOptions:n2});B2.current={onValueChange:c2,onSelect:u2,loadOptions:n2};let V2=l(()=>n2?j2:(t2??[]).filter(e3=>Bo(e3,E2)),[n2,j2,t2,E2]),ee2=!!n2,H2=E2.trim().length>=h2,U2=H2?V2:[];o(()=>{if(!ee2||!D2)return;if(!H2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},m2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,H2,ee2,m2]);let W2=ee2?N2:!D2||!H2?"idle":U2.length?"ready":"empty";o(()=>{F2!==null&&!U2.some(e3=>e3.id===F2)&&I2(null)},[U2,F2]),o(()=>{if(!k2||W2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=W2==="loading"?"Loading results":W2==="error"?x2.split("{query}").join(e3):W2==="empty"?b2.split("{query}").join(e3):`${U2.length} ${U2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),W2==="loading"?zo:Ro);return()=>clearTimeout(n3)},[W2,U2.length,k2,E2,b2,x2]);let G2=i(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),K2=i(()=>{A2(false),I2(null)},[]),te2=i(e3=>{e3.disabled||(_2&&G2(e3.label),B2.current.onSelect?.(e3),g2&&K2())},[_2,G2,g2,K2]),ne2=e3=>`${S2}-opt-${e3.id}`,re2=k2&&U2.length>0,ie2=re2?U2.find(e3=>e3.id===F2):void 0,q2=e3=>{if(U2.length===0)return;let t3=U2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:U2,status:W2,statusText:L2,open:re2,activeId:F2,close:K2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":re2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":ie2?ne2(ie2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),G2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=p2==="horizontal"?"ArrowRight":"ArrowDown",n3=p2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?q2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&re2&&ie2?(e3.preventDefault(),q2(e3.key===t3?1:-1)):e3.key==="Enter"&&ie2?(e3.preventDefault(),te2(ie2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),K2()):e3.key==="Tab"&&K2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>K2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":p2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:ne2(e3),role:"option","aria-selected":e3.id===ie2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===ie2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>te2(e3)}),query:E2}}function Ho({text:e2,match:t2}){let n2=t2?e2.toLowerCase().indexOf(t2.trim().toLowerCase()):-1;if(n2<0||!t2.trim())return h(m,{children:e2});let r2=n2+t2.trim().length;return g(m,{children:[e2.slice(0,n2),h("mark",{className:"core-combobox__match",children:e2.slice(n2,r2)}),e2.slice(r2)]})}function Uo({placeholder:e2,emptyText:t2="No results",errorText:n2="Could not load results",renderOption:r2,className:i2,style:a2,...c2}){let l2=Vo({...c2,emptyText:t2,errorText:n2}),u2=l2.query.trim().slice(0,60),f2=d(null),p2=c2.orientation==="horizontal",_2=s(),v2=[];for(let e3 of l2.options){let t3=p2?void 0:e3.group,n3=v2[v2.length-1];n3&&n3.group===t3?n3.options.push(e3):v2.push({group:t3,options:[e3]})}o(()=>{l2.activeId!==null&&f2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[l2.activeId]);let b2=l2.status==="empty"?t2.split("{query}").join(u2):l2.status==="error"?n2.split("{query}").join(u2):l2.status==="loading"?"Loading…":null;return g("div",{className:y("core-combobox",i2),style:a2,"data-orientation":c2.orientation??"vertical","data-status":l2.status,children:[h("input",{...l2.inputProps,type:"text",className:"core-combobox__input",placeholder:e2}),h("ul",{ref:f2,...l2.listboxProps,className:"core-combobox__list",hidden:!l2.open,children:v2.map((e3,t3)=>{let n3=e3.options.map(e4=>h("li",{...l2.getOptionProps(e4),className:"core-combobox__option",children:r2?r2(e4,l2.query):g(m,{children:[h("span",{className:"core-combobox__label",children:h(Ho,{text:e4.label,match:e4.highlight??l2.query})}),e4.description?h("span",{className:"core-combobox__description",children:e4.description}):null]})},e4.id));return e3.group?g("li",{role:"presentation",className:"core-combobox__section",children:[h("span",{id:`${_2}-${t3}`,className:"core-combobox__heading",children:e3.group}),h("ul",{role:"group","aria-labelledby":`${_2}-${t3}`,className:"core-combobox__group",children:n3})]},`g${t3}`):n3})}),b2&&!l2.open?h("p",{className:"core-combobox__note","data-status":l2.status,"aria-hidden":"true",children:b2}):null,h("span",{...l2.statusProps,className:"core-combobox__status",children:l2.statusText})]})}var Wo=["saved","assigned","event","archived","discarded","unavailable"],Go=6e3;function Ko(e2){let{locale:t2,timeZone:n2,searchTargets:r2,onIntent:i2,className:a2,style:c2}=e2,l2=e2.note&&typeof e2.note=="object"&&(e2.note.state==="unavailable"||typeof e2.note.body=="string")?e2.note:null,u2=s(),{run:p2,busy:_2,message:v2,available:b2}=It(i2),[x2,S2]=f(null),C2=l2?.state&&Wo.includes(l2.state)?l2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=f(false),D2=d(null),O2=d(null),k2=d(null);o(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),o(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=f(false),[M2,N2]=f(false),P2=d(null);o(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=f(void 0),[L2,R2]=f(false),z2=d(null);if(o(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!l2)return null;if(C2==="unavailable")return h("div",{role:"group","aria-label":"Note",className:y("core-intent-card","core-quick-note-card","core-note-card",a2),style:c2,"data-state":"unavailable",children:h("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,V2=l2.createdAt&&!Number.isNaN(new Date(l2.createdAt).getTime())?new Intl.DateTimeFormat(t2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:n2}).format(new Date(l2.createdAt)):"",ee2=Lt(l2.eventHref),H2=_2===null,U2=async e3=>{let{ok:t3}=await p2("assign",{targetId:e3.id,...A2?{keepPrivate:true}:{},...e3.data&&typeof e3.data=="object"&&"kind"in e3.data?{targetKind:e3.data.kind}:{}});t3&&(I2(e3.label),S2("assigned"),R2(false))},W2=async()=>{let{ok:e3}=await p2("make_event");e3&&S2("started")},G2=()=>{let e3=async()=>{O2.current=null,D2.current=null;let{ok:e4}=await p2("archive");E2(false),e4&&S2("archived")};O2.current=()=>void e3(),D2.current=setTimeout(()=>void e3(),Go),E2(true)},K2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},te2=async()=>{let{ok:e3}=await p2("discard");N2(false),e3&&S2("discarded")},ne2=async()=>{let{ok:e3}=await p2("ask_instead");e3&&S2("asked")},re2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??l2.assignedToName?` to ${F2??l2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return g("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:y("core-intent-card","core-quick-note-card","core-note-card",a2),style:c2,"data-state":T2?"archived":w2,"aria-busy":_2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:re2}),h("p",{className:"core-note-card__body",children:l2.body}),g("span",{className:"core-note-card__private",children:["Private",V2?` · saved ${V2}`:""]})]}),w2==="event"&&ee2?h("a",{className:"core-note-card__go",href:ee2,children:"Go to event"}):null,v2?h("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?h("div",{className:"core-intent-card__actions",children:h("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:K2,children:"Undo"})}):null,B2?g(m,{children:[L2&&r2?g("div",{className:"core-note-card__picker",children:[h(Uo,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:r2,onSelect:e3=>void U2(e3),defaultOpen:false}),g("label",{className:"core-note-card__private-check",children:[h("input",{type:"checkbox",checked:A2,disabled:!H2,onChange:e3=>j2(e3.target.checked)}),h("span",{children:"Keep this note private"})]})]}):null,h("p",{className:"core-intent-card__does",id:`${u2}-does`,children:(e3=>b2?e3:Ft)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!b2||!r2||!H2,"aria-expanded":L2,"aria-describedby":`${u2}-does`,onClick:()=>R2(e3=>!e3),children:"Assign"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>void W2(),children:"Make event"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${u2}-does`,onClick:G2,children:"Archive"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?g("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[h("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!H2,onClick:()=>void te2(),children:_2==="discard"?"Discarding…":"Yes, discard"}),h("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!H2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,h("button",{type:"button",className:"core-note-card__instead",disabled:!b2||!H2,onClick:()=>void ne2(),children:"Ask the assistant instead"})]}):null]})}var qo=[15,30,45,60,90],Jo=30,Yo=200,Xo=3,Zo=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function Qo(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.subjectName),l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""&&e3.kind!=="record"),u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},p2=s(),{run:_2,busy:v2,message:b2,available:x2}=It(r2),S2=$a(u2.startsAt,n2),[C2,w2]=f(l2.find(e3=>e3.id===u2.typeId)?.id??l2[0]?.id??""),[T2,E2]=f((typeof u2.title=="string"?u2.title:"").slice(0,Yo)),D2=n2??Dt(),O2=!(typeof u2.startOn=="string"&&$.test(u2.startOn))&&!S2,[k2,A2]=f(typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:S2?.date??ro(D2)),[j2,M2]=f(S2?.time??""),[N2,P2]=f(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):Jo)),F2=jo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:u2.attendeeIds}),I2=yo(l2.find(e3=>e3.id===C2)),L2=xo(I2),[R2,z2]=f(false),[B2,V2]=f(null),ee2=d(null),H2=d(null),U2=d(false);o(()=>{if(U2.current)return;if(O2){A2(ro(D2));return}if(!u2.startsAt)return;let e3=$a(u2.startsAt,n2);e3&&(A2(e3.date),M2(e3.time))},[u2.startsAt,n2,O2,D2]),o(()=>{R2&&H2.current?.focus({preventScroll:true})},[R2]),o(()=>{B2&&ee2.current?.focus({preventScroll:true})},[B2]);let W2=B2??(e2.booked&&typeof e2.booked=="object"?e2.booked:null);if(W2){let e3=Lt(W2.href);return g("section",{ref:ee2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card",i2),style:a2,"data-state":"booked",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Booked",c2?` · ${c2}`:""]}),h("p",{className:"core-intent-card__title",children:W2.name??"Booked"}),W2.when?h("span",{className:"core-book-event-card__when",children:W2.when}):null]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}if(l2.length===0)return h("p",{className:y("core-intent-card","core-book-event-card","core-book-event-card__empty",i2),style:a2,children:"There’s nothing you can book here."});let G2=l2.find(e3=>e3.id===C2),K2=x2&&v2===null,te2=x2&&!!c2&&!!G2&&$.test(k2),ne2=x2?c2?k2?"":"Choose a day to book.":"Choose whose file this goes in first.":Ft,re2=$.test(k2)&&/^\d{2}:\d{2}$/.test(j2),ie2=re2?no(k2,j2,D2):void 0,q2=Number(N2),ae2=ie2?new Date(ie2).getTime()<Date.now():$.test(k2)?k2<new Intl.DateTimeFormat("en-CA").format(new Date):false,oe2=[...new Set([...qo,...Number.isInteger(q2)&&q2>0?[q2]:[]])].sort((e3,t3)=>e3-t3),se2=F2.picked,ce2=`${Za(k2,t2)}${re2?`, ${Qa(j2,t2)}`:""}`,le2=re2?` (${Zo(q2||Jo)})`:" (all day)",ue2=se2.length?` With ${se2.slice(0,Xo).map(e3=>e3.name).join(", ")}${se2.length>Xo?` and ${se2.length-Xo} more`:""}.`:"",de2=F2.assignee,fe2=`Book this? It goes on the schedule for ${ce2}${le2}.${ue2}${de2?` Assigned to ${de2.name}.`:""}${Co(L2.value)}${e2.invitesSent===true&&se2.length?" They are invited.":""}`,pe2=async()=>{if(!te2||v2!==null||!G2)return;let e3={typeId:G2.id};T2.trim()&&(e3.title=T2.trim()),e3.tzid=D2,ie2?(e3.startsAt=ie2,e3.durationMin=q2>0?q2:Jo):e3.startOn=k2,L2.value&&(e3.audience=L2.value),F2.write(e3);let{ok:t3,result:n3}=await _2("book_event",e3);z2(false),t3&&V2({name:T2.trim()||G2.name,when:ce2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},me2=e3=>{e3.preventDefault(),te2&&v2===null&&z2(true)},he2=e3=>t3=>{U2.current=true,e3(t3)};return g("form",{tabIndex:-1,ref:ee2,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card",i2),style:a2,"data-state":R2?"confirming":"proposed",onSubmit:me2,"aria-busy":v2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",c2?` · ${c2}`:""]})}),g("div",{className:"core-intent-card__row",children:[l2.length>1?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:C2,disabled:!K2||R2,onChange:e3=>w2(e3.target.value),children:l2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}):null,g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Title (optional)"}),h("input",{value:T2,maxLength:Yo,readOnly:!K2||R2,placeholder:G2?.name,onChange:e3=>E2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Day"}),h("input",{type:"date",value:k2,required:true,readOnly:!K2||R2,onChange:e3=>he2(A2)(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Time (optional)"}),h("input",{type:"time",value:k2?j2:"",readOnly:!K2||R2,disabled:!k2,onChange:e3=>he2(M2)(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"How long"}),h("select",{value:N2,disabled:!K2||R2||!re2,onChange:e3=>P2(e3.target.value),children:oe2.map(e3=>h("option",{value:e3,children:Zo(e3)},e3))})]})}),h(Mo,{extras:F2,disabled:!K2||R2}),h(wo,{id:p2,audiences:I2,value:L2.value,onChange:L2.setValue,subjectName:c2,disabled:!K2||R2}),ae2&&!R2?h("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,R2?g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,role:"group","aria-label":"Confirm booking",children:fe2}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void pe2(),children:v2==="book_event"?"Booking…":"Yes, book"}),h("button",{ref:H2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>z2(false),children:"Cancel"})]},"confirm-actions")]}):g(m,{children:[ne2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:ne2}):null,h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!te2||v2!==null,"aria-describedby":ne2?`${p2}-does`:void 0,children:"Book"})},"book-actions")]})]})}var $o=[15,30,45,60,90],es=30,ts=200,ns=200,rs=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`,is={title:"title",name:"title",startsAt:"when",startOn:"when",date:"when",time:"when",durationMin:"duration",assigneeId:"assignee",location:"location",audience:"audience"};function as(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.subjectName),l2=e2.current&&typeof e2.current=="object"?e2.current:{},u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},p2=s(),{run:_2,busy:v2,message:b2,available:x2}=It(r2),S2=n2??l2.tzid??Dt(),C2=$a(l2.startsAt,S2),w2=C2?.date??(typeof l2.startOn=="string"&&$.test(l2.startOn)?l2.startOn:""),T2=C2?.time??"",E2=typeof l2.durationMin=="number"&&l2.durationMin>0?Math.round(l2.durationMin):es,D2=(typeof l2.name=="string"?l2.name:"").slice(0,ts),O2=(Array.isArray(e2.assignees)?e2.assignees:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"),k2=l2.assigneeId?O2.find(e3=>e3.id===l2.assigneeId)?.id??"":O2.find(e3=>e3.name===l2.assigneeName)?.id??"",A2=$a(u2.startsAt,S2),j2=typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:void 0,[M2,N2]=f(typeof u2.title=="string"?u2.title.slice(0,ts):D2),[P2,F2]=f(A2?.date??j2??w2),[I2,L2]=f(A2?A2.time:j2?"":T2),R2=(typeof l2.location=="string"?l2.location:"").slice(0,ns),[z2,B2]=f(typeof u2.location=="string"?u2.location.slice(0,ns):R2),[V2,ee2]=f(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):E2)),H2=jo({assignees:O2,assigneeId:typeof u2.assigneeId=="string"?u2.assigneeId:k2}),U2=yo((Array.isArray(e2.types)?e2.types:[]).find(e3=>e3&&typeof e3=="object"&&(e3.id===l2.typeId||!l2.typeId&&e3.name===l2.typeName))),W2=xo(U2,U2.includes(l2.audience)?l2.audience:"team"),[G2,K2]=f(false),[te2,ne2]=f(null),re2=d(null),ie2=d(null);o(()=>{G2&&ie2.current?.focus({preventScroll:true})},[G2]),o(()=>{te2&&re2.current?.focus({preventScroll:true})},[te2]);let q2=te2??(e2.updated&&typeof e2.updated=="object"?{kind:"updated",...e2.updated}:e2.cancelled&&typeof e2.cancelled=="object"?{kind:"cancelled",...e2.cancelled}:e2.assigned&&typeof e2.assigned=="object"?{kind:"assigned",...e2.assigned}:l2.status==="cancelled"?{kind:"cancelled",name:l2.name}:null);if(q2){let e3=q2.kind==="updated"?Lt(q2.href):void 0;return g("section",{ref:re2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":q2.kind,children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:[q2.kind==="updated"?"Updated":q2.kind==="assigned"?"Assigned to you":"Cancelled",c2?` · ${c2}`:""]}),h("p",{className:y("core-intent-card__title",q2.kind==="cancelled"&&"core-edit-event-card__struck"),children:q2.name??l2.name??"Done"})]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let ae2=!(x2&&v2===null)||G2,oe2=$.test(P2)&&/^\d{2}:\d{2}$/.test(I2),se2=Number(V2),ce2=[...new Set([...$o,...Number.isInteger(se2)&&se2>0?[se2]:[],E2])].sort((e3,t3)=>e3-t3),le2=new Set((Array.isArray(e2.changed)?e2.changed:[]).map(e3=>is[e3]).filter(Boolean)),ue2=P2!==w2||I2!==T2,de2=oe2&&se2!==E2,fe2=H2.assigneeId!==k2,pe2=W2.value!==void 0&&W2.value!==(U2.includes(l2.audience)?l2.audience:"team"),me2=M2.trim()!==D2.trim(),he2=z2.trim()!==R2.trim(),J2={title:me2||le2.has("title"),when:ue2||le2.has("when"),duration:de2||le2.has("duration"),location:he2||le2.has("location"),assignee:fe2||le2.has("assignee"),audience:pe2||le2.has("audience")},ge2=me2||ue2||de2||he2||fe2||pe2,_e2=x2&&!!$.test(P2)&&M2.trim()!==""&&ge2,ve2=x2?M2.trim()?$.test(P2)?ge2?"":"Change something to save it.":"Choose a day.":"The event needs a title.":Ft,ye2=w2?`${Za(w2,t2)}${T2?`, ${Qa(T2,t2)}`:" (all day)"}`:"No time set",be2=(e3,t3,n3)=>J2[e3]?g("span",{className:"core-edit-event-card__was",id:n3,children:[h("span",{className:"core-edit-event-card__was-label",children:"Was"})," ",t3]}):null,xe2=e3=>y("core-intent-card__field",J2[e3]&&"core-edit-event-card__changed"),Se2=async()=>{if(!_e2||v2!==null)return;let e3={};me2&&(e3.title=M2.trim()),ue2&&(S2!==l2.tzid&&(e3.tzid=S2),oe2?e3.startsAt=no(P2,I2,S2):e3.startOn=P2),de2&&(e3.durationMin=se2>0?se2:es),he2&&(e3.location=z2.trim()),fe2&&(e3.assigneeId=H2.assigneeId===""?null:H2.assigneeId),pe2&&W2.value&&(e3.audience=W2.value);let{ok:t3,result:n3}=await _2("update_event",e3);t3&&ne2({kind:"updated",name:M2.trim()||D2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},Ce2=!l2.assigneeId&&!l2.assigneeName,we2=async()=>{if(v2!==null)return;let{ok:e3}=await _2("assign_self");e3&&ne2({kind:"assigned",name:D2})},Te2=async()=>{if(v2!==null)return;let{ok:e3}=await _2("cancel_event");K2(false),e3&&ne2({kind:"cancelled",name:D2})};return g("form",{tabIndex:-1,ref:re2,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":G2?"cancelling":"editing",onSubmit:e3=>{e3.preventDefault(),_e2&&v2===null&&Se2()},"aria-busy":v2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Change a meeting",c2?` · ${c2}`:""]})}),g("div",{className:"core-intent-card__row",children:[l2.typeName?g("div",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("span",{className:"core-edit-event-card__fixed",children:l2.typeName})]}):null,g("div",{className:xe2("title"),"data-changed":J2.title?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-title`,children:"Title"}),h("input",{id:`${p2}-title`,value:M2,maxLength:ts,readOnly:ae2,placeholder:l2.typeName,"aria-describedby":J2.title?`${p2}-title-was`:void 0,onChange:e3=>N2(e3.target.value)}),be2("title",D2||"No title",`${p2}-title-was`)]})]}),g("div",{className:"core-intent-card__row",children:[g("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-day`,children:"Day"}),h("input",{id:`${p2}-day`,type:"date",value:P2,required:true,readOnly:ae2,"aria-describedby":J2.when?`${p2}-when-was`:void 0,onChange:e3=>F2(e3.target.value)}),be2("when",ye2,`${p2}-when-was`)]}),g("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-time`,children:"Time (optional)"}),h("input",{id:`${p2}-time`,type:"time",value:P2?I2:"",readOnly:ae2,disabled:!P2,"aria-describedby":J2.when?`${p2}-when-was`:void 0,onChange:e3=>L2(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("div",{className:xe2("duration"),"data-changed":J2.duration?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-length`,children:"How long"}),h("select",{id:`${p2}-length`,value:V2,disabled:ae2||!oe2,"aria-describedby":J2.duration?`${p2}-duration-was`:void 0,onChange:e3=>ee2(e3.target.value),children:ce2.map(e3=>h("option",{value:e3,children:rs(e3)},e3))}),be2("duration",T2?rs(E2):"All day",`${p2}-duration-was`)]})}),h("div",{className:"core-intent-card__row",children:g("div",{className:xe2("location"),"data-changed":J2.location?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-location`,children:"Location (optional)"}),h("input",{id:`${p2}-location`,value:z2,maxLength:ns,readOnly:ae2,"aria-describedby":J2.location?`${p2}-location-was`:void 0,onChange:e3=>B2(e3.target.value)}),be2("location",R2||"No location",`${p2}-location-was`)]})}),g("div",{className:y(J2.assignee&&"core-edit-event-card__changed-block"),"data-changed":J2.assignee?"":void 0,children:[h(Mo,{extras:H2,disabled:ae2}),be2("assignee",l2.assigneeName??"No one")]}),g("div",{className:y(J2.audience&&"core-edit-event-card__changed-block"),"data-changed":J2.audience?"":void 0,children:[h(wo,{id:p2,audiences:U2,value:W2.value,onChange:W2.setValue,subjectName:c2,disabled:ae2}),be2("audience",l2.audience?So(l2.audience,c2):"")]}),b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,G2?g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,role:"group","aria-label":"Confirm cancelling",children:"Cancel this event? It can’t be undone from here."}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void Te2(),children:v2==="cancel_event"?"Cancelling…":"Yes, cancel the event"}),h("button",{ref:ie2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>K2(false),children:"Keep it"})]},"cancel-actions")]}):g(m,{children:[ve2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:ve2}):null,g("div",{className:"core-intent-card__actions",children:[h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!_e2||v2!==null,"aria-describedby":ve2?`${p2}-does`:void 0,children:v2==="update_event"?"Saving…":"Save changes"}),Ce2?h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>void we2(),children:v2==="assign_self"?"Assigning…":"Assign to me"}):null,h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>K2(true),children:"Cancel the event"})]},"save-actions")]})]})}var os=4e3;function ss(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=X(e2.eventName),a2=X(e2.subjectName),c2=s(),{run:l2,busy:u2,message:p2,available:m2}=It(t2),[_2,v2]=f((typeof e2.body=="string"?e2.body:"").slice(0,os)),[b2,x2]=f(false),[S2,C2]=f(null),w2=d(null);o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=S2??(e2.noted&&typeof e2.noted=="object"?e2.noted:null);if(T2){let e3=Lt(T2.href);return g("section",{ref:w2,tabIndex:-1,"aria-labelledby":`${c2}-status`,className:y("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"noted",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${c2}-status`,className:"core-intent-card__eyebrow",children:["Noted",i2?` · ${i2}`:""]}),h("p",{className:"core-intent-card__title",children:T2.name??i2??"Noted"})]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let E2=m2&&u2===null,D2=m2&&!!i2&&_2.trim()!=="",O2=m2?i2?_2.trim()===""?"Write the note first.":"":"Choose the event first.":Ft,k2=async()=>{if(!D2||u2!==null)return;let e3={body:_2.trim()};b2&&(e3.audience="client");let{ok:t3,result:n3}=await l2("add_note",e3);t3&&C2({name:i2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})};return g("form",{tabIndex:-1,ref:w2,"aria-labelledby":`${c2}-status`,className:y("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"proposed",onSubmit:e3=>{e3.preventDefault(),k2()},"aria-busy":u2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${c2}-status`,className:"core-intent-card__eyebrow",children:["Add a note",i2?` · ${i2}`:""]})}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Note"}),h("textarea",{value:_2,rows:4,maxLength:os,readOnly:!E2,onChange:e3=>v2(e3.target.value)})]}),a2?g("label",{className:"core-intent-card__person",children:[h("input",{type:"checkbox",checked:b2,disabled:!E2,onChange:e3=>x2(e3.target.checked)}),g("span",{className:"core-intent-card__person-name",children:["Share with ",a2]})]}):null,h("p",{className:"core-intent-card__does",id:`${c2}-does`,children:O2||(b2?`${a2} will see this note.`:"Only staff will see this note.")}),p2?h("p",{className:"core-intent-card__message",role:"alert",children:p2}):null,h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!D2||u2!==null,"aria-describedby":`${c2}-does`,children:u2==="add_note"?"Adding…":"Add note"})},"note-actions")]})}var cs=["proposed","created","done"],ls=200;function us(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""),l2=X(e2.subjectName),u2=e2.task&&typeof e2.task=="object"&&typeof e2.task.title=="string"?e2.task:null,p2=s(),{run:_2,busy:v2,message:b2,available:x2}=It(r2),[S2,C2]=f((u2?.title??"").slice(0,ls)),w2=$a(u2?.dueAt,n2),T2=n2??Dt(),E2=!(u2?.dueOn&&$.test(u2.dueOn))&&!w2,[D2,O2]=f(u2?.dueOn&&$.test(u2.dueOn)?u2.dueOn:w2?.date??ro(T2)),[k2,A2]=f(w2?.time??""),j2=d(false);o(()=>{if(j2.current)return;if(E2){O2(ro(T2));return}if(!u2?.dueAt)return;let e3=$a(u2.dueAt,n2);e3&&(u2.dueOn&&$.test(u2.dueOn)||O2(e3.date),A2(e3.time))},[u2?.dueAt,u2?.dueOn,n2,E2,T2]);let M2=jo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links}),[N2,P2]=f(c2.find(e3=>e3.id===u2?.typeId)?.id??c2[0]?.id??""),F2=yo(c2.find(e3=>e3.id===N2)),I2=xo(F2),[L2,R2]=f(null),z2=u2?.state&&cs.includes(u2.state)?u2.state:"proposed",B2=L2&&cs.indexOf(L2)>cs.indexOf(z2)?L2:z2,V2=d(null),ee2=d(null),[H2,U2]=f(false);if(o(()=>{H2&&ee2.current?.focus({preventScroll:true})},[H2]),o(()=>{L2&&V2.current?.focus({preventScroll:true})},[L2]),!u2)return null;let W2=B2==="proposed"&&x2&&v2===null,G2=x2&&!!l2&&S2.trim()!=="",K2=async e3=>{if(e3.preventDefault(),!G2||v2!==null)return;let t3=D2||ro(T2),n3=k2?no(t3,k2,T2):void 0,r3={title:S2.trim(),...c2.length>0&&N2?{typeId:N2}:{},dueOn:t3,...n3?{dueAt:n3}:{},...I2.value?{audience:I2.value}:{},tzid:T2};M2.write(r3);let{ok:i3}=await _2("log_event",r3);i3&&R2("created")},te2=async()=>{let{ok:e3}=await _2("complete");U2(false),e3&&R2("done")},ne2=B2==="proposed"?{date:D2||ro(T2),time:k2}:{date:u2.dueOn&&$.test(u2.dueOn)?u2.dueOn:$a(u2.dueAt,n2)?.date??"",time:$a(u2.dueAt,n2)?.time??""},re2=[ne2.date===ro(T2)?"today":Za(ne2.date,t2),ne2.date&&ne2.time?Qa(ne2.time,t2):""].filter(Boolean).join(", "),ie2=B2==="proposed"?"Task · suggested":B2==="done"?"Task · done":"Task",q2=B2==="proposed"?G2?`Create task adds this to ${l2}’s tasks.`:x2?l2?"":"Choose whose file this goes in first.":Ft:B2==="created"?H2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return g("form",{ref:V2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-task-card",i2),style:a2,"data-state":B2,onSubmit:e3=>void K2(e3),"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:[ie2,l2?` · ${l2}`:""]}),B2==="proposed"&&c2.length>1?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:N2,disabled:!W2,onChange:e3=>P2(e3.target.value),children:c2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}):null,B2==="proposed"?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"What needs doing"}),h("input",{value:S2,maxLength:ls,readOnly:!W2,onChange:e3=>C2(e3.target.value),required:true})]}):h("p",{className:"core-intent-card__title core-task-card__title","data-done":B2==="done"?"":void 0,children:u2.title})]}),B2==="proposed"?g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Due"}),h("input",{type:"date",value:D2,readOnly:!W2,onChange:e3=>(j2.current=true,O2(e3.target.value))})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Time (optional)"}),h("input",{type:"time",value:D2?k2:"",readOnly:!W2,disabled:!D2,onChange:e3=>(j2.current=true,A2(e3.target.value))})]})]}):null,B2==="proposed"?h(Mo,{extras:M2,disabled:!W2}):null,B2==="proposed"?h(wo,{id:p2,audiences:F2,value:I2.value,onChange:I2.setValue,subjectName:l2,disabled:!W2}):null,h("p",{className:"core-task-card__meta",children:[re2?`Due ${re2}`:"",u2.assigneeName?`For ${u2.assigneeName}`:""].filter(Boolean).join(" · ")||(B2==="proposed"?"":"No due date")}),b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,q2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:q2}):null,B2==="done"?null:h("div",{className:"core-intent-card__actions",children:B2==="proposed"?h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!G2||v2!==null,"aria-describedby":`${p2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):H2?g(m,{children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void te2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),h("button",{ref:ee2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>U2(false),children:"Cancel"})]}):h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${p2}-does`,onClick:()=>U2(true),children:"Mark done"})})]})}function ds(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.scopeName),l2=s(),{run:u2,busy:p2,message:_2,available:v2}=It(r2),[b2,x2]=f(null),S2=d(null);if(o(()=>{b2&&S2.current?.focus({preventScroll:true})},[b2]),!c2)return null;let C2=e2.pointer&&typeof e2.pointer=="object"?e2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e3=typeof C2.at=="string"?new Date(C2.at):null;w2=e3&&!Number.isNaN(e3.getTime())?`Conversation · ${new Intl.DateTimeFormat(t2,{month:"short",day:"numeric",timeZone:n2}).format(e3)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=p2===null,E2=async e3=>{let{ok:t3}=await u2(e3);t3&&x2(e3==="dismiss"?"dismissed":"continued")},D2=b2==="continued"?"Picked up":b2==="dismissed"?"Dismissed":"Pick up where you left off";return g("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:y("core-intent-card","core-handover-card",i2),style:a2,"data-state":b2??(v2?"offered":"display"),"aria-busy":p2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:D2}),h("p",{className:"core-intent-card__title",children:c2}),w2?h("span",{className:"core-handover-card__where",children:w2}):null]}),_2?h("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,b2?null:g(m,{children:[h("p",{className:"core-intent-card__does",id:`${l2}-does`,children:v2?`Continue opens your earlier conversation about ${c2}. Dismiss hides this.`:Ft}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("handover_continue"),children:p2==="handover_continue"?"Opening…":"Continue"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var fs=12,ps=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function ms(e2){let{typicalTime:t2,typicalCost:n2,costCap:r2,onIntent:i2,className:a2,style:c2}=e2,l2=X(e2.processName),u2=X(e2.subjectName),p2=s(),{run:_2,busy:v2,message:b2,available:x2}=It(i2),[S2,C2]=f(false),w2=d(null);if(o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!l2)return null;let T2=ps(e2.description),E2=(Array.isArray(e2.needs)?e2.needs:[]).filter(e3=>e3&&typeof e3=="object"&&ps(e3.label)).slice(0,fs),D2=[t2&&`Typical time: ${ps(t2,60)}`,n2&&`Typical cost: ${ps(n2,60)}`,r2&&`Cost cap: ${ps(r2,60)}`].filter(Boolean).join(" · "),O2=e2.running&&typeof e2.running=="object"?e2.running:null,k2=Lt(O2?.href),A2=x2&&!!u2,j2=x2?u2?"":"Choose who this is for before starting.":Ft,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e3}=await _2("start_process");e3&&C2(true)};return g("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-start-process-card",a2),style:c2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:M2}),h("p",{className:"core-intent-card__title",children:l2}),u2?g("span",{className:"core-start-process-card__for",children:["For ",u2]}):null]}),T2?h("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?g("div",{className:"core-start-process-card__needs",children:[h("span",{className:"core-start-process-card__label",children:"What it needs"}),h("ul",{children:E2.map((e3,t3)=>g("li",{"data-have":e3.have===true?"":void 0,children:[h("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),h("span",{children:ps(e3.label)}),h("span",{className:"core-start-process-card__have",children:e3.have===true?"Have":"Needed"})]},t3))})]}):null,D2?h("p",{className:"core-start-process-card__meta",children:D2}):null,b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,S2?h("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?h("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:A2?`Start begins ${l2} for ${u2}. Nothing is shared with ${u2} until you choose to share it.`:j2}),h("div",{className:"core-intent-card__actions",children:h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${p2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var hs=12,gs=8,_s=600;function vs(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=s(),{run:a2,busy:c2,message:l2,available:u2}=It(t2),[p2,_2]=f({}),[v2,b2]=f({}),[x2,S2]=f(null),C2=d(null),w2=d(false);o(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[p2]);let T2=new Set,E2=(Array.isArray(e2.parts)?e2.parts:[]).filter(e3=>!e3||typeof e3!="object"||typeof e3.id!="string"||typeof e3.text!="string"||!e3.text.trim()||T2.has(e3.id)?false:(T2.add(e3.id),true)).slice(0,hs);if(E2.length===0)return null;let D2=e3=>(Array.isArray(e3.matches)?e3.matches:[]).filter(e4=>e4&&typeof e4.id=="string"&&X(e4.name)&&(e4.kind==="client"||e4.kind==="project")).slice(0,gs),O2=e3=>p2[e3.id]??(e3.state==="assigned"||e3.state==="dropped"?{state:e3.state,name:X(e3.assignedToName)}:null),k2=E2.filter(e3=>!O2(e3)),A2=k2.length===0,j2=async(e3,t3)=>{S2(e3.id);let{ok:n3}=await a2("confirm_part",{partId:e3.id,targetId:t3.id,targetKind:t3.kind});n3&&(w2.current=true,_2(n4=>({...n4,[e3.id]:{state:"assigned",name:X(t3.name)}})))},M2=async e3=>{S2(e3.id);let{ok:t3}=await a2("drop_part",{partId:e3.id});t3&&(w2.current=true,_2(t4=>({...t4,[e3.id]:{state:"dropped"}})))},N2=c2===null;return g("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${i2}-status`,className:y("core-intent-card","core-note-split-card",n2),style:r2,"data-state":A2?"sorted":u2?"open":"display","aria-busy":c2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${i2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),h("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),h("ol",{className:"core-note-split-card__parts",children:E2.map((e3,t3)=>{let n3=O2(e3),r3=D2(e3),a3=v2[e3.id]??(r3.length===1?r3[0].id:""),o2=r3.find(e4=>e4.id===a3),s2=e3.text.length>_s?`${e3.text.slice(0,599)}…`:e3.text,d2=`Part ${t3+1}`;return g("li",{className:"core-note-split-card__part","data-state":n3?.state??"open",children:[h("span",{className:"core-note-split-card__label",children:d2}),h("p",{className:"core-note-split-card__text",children:s2}),n3?h("p",{className:"core-note-split-card__result",children:n3.state==="dropped"?"Dropped":`Assigned${n3.name?` to ${n3.name}`:""}`}):g(m,{children:[r3.length===0?h("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):r3.length===1?g("p",{className:"core-note-split-card__hint",children:["Looks like ",h("strong",{children:X(r3[0].name)}),r3[0].detail?` · ${X(r3[0].detail)}`:"",". Confirm it, or drop the part."]}):g("fieldset",{className:"core-note-split-card__choices",disabled:!u2||!N2,children:[g("legend",{className:"core-note-split-card__hint",children:[r3.length," match: choose who this is for."]}),r3.map(t4=>g("label",{className:"core-note-split-card__choice",children:[h("input",{type:"radio",name:`${i2}-${e3.id}`,value:t4.id,checked:a3===t4.id,onChange:()=>b2(n4=>({...n4,[e3.id]:t4.id}))}),g("span",{children:[h("span",{className:"core-note-split-card__name",children:X(t4.name)}),h("span",{className:"core-note-split-card__detail",children:[t4.kind==="project"?"Project":"Client",X(t4.detail)].filter(Boolean).join(" · ")})]})]},t4.id))]}),x2===e3.id&&l2?h("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,g("div",{className:"core-intent-card__actions",children:[r3.length>0?h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!u2||!N2||!o2,"aria-label":`Confirm ${d2}${o2?` for ${X(o2.name)}`:""}`,onClick:()=>o2&&void j2(e3,o2),children:c2==="confirm_part"&&x2===e3.id?"Confirming…":"Confirm"}):null,h("button",{type:"button",className:"core-intent-card__button",disabled:!u2||!N2,"aria-label":`Drop ${d2}`,onClick:()=>void M2(e3),children:"Drop"})]})]})]},e3.id)})}),A2?null:h("p",{className:"core-intent-card__does",children:u2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":Ft})]})}var ys=20;function bs(e2){let{onIntent:t2,onCancel:n2,className:r2,style:i2}=e2,a2=e2.mode==="withdraw"?"withdraw":"share",c2=X(e2.clientName),l2=s(),{run:u2,busy:p2,message:_2,available:v2}=It(t2),[b2,x2]=f(false),[S2,C2]=f(false),w2=d(null);o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&typeof e3=="object"&&X(e3.name)).slice(0,ys);if(T2.length===0)return null;let E2=a2==="share",D2=v2&&!!c2&&(!E2||b2),O2=v2?c2?E2&&!b2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":Ft,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||p2!==null)return;let{ok:e3}=await u2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e3&&C2(true)};return g("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:y("core-intent-card","core-share-approval-card",r2),style:i2,"data-state":S2?"done":v2?"asking":"display","data-mode":a2,"aria-busy":p2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:A2}),h("p",{className:"core-intent-card__title",children:c2?E2?`Share with ${c2}`:`Stop sharing with ${c2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),h("ul",{className:"core-share-approval-card__items",children:T2.map((e3,t3)=>g("li",{children:[h("span",{className:"core-share-approval-card__name",children:X(e3.name)}),X(e3.projectName)?h("span",{className:"core-share-approval-card__project",children:X(e3.projectName)}):null]},t3))}),_2?h("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,S2?h("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${c2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${c2}.`}):g(m,{children:[h("p",{className:"core-intent-card__does",id:`${l2}-does`,children:c2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${c2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${c2}’s portal.`:O2}),E2?g("label",{className:"core-share-approval-card__review",children:[h("input",{type:"checkbox",checked:b2,disabled:!v2||p2!==null,onChange:e3=>x2(e3.target.checked)}),h("span",{children:"I’ve reviewed this"})]}):null,O2&&c2?h("p",{className:"core-share-approval-card__reason",id:`${l2}-reason`,children:O2}):null,g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||p2!==null,"aria-describedby":`${l2}-does`,onClick:()=>void j2(),children:p2===null?k2:"Saving…"}),typeof n2=="function"?h("button",{type:"button",className:"core-intent-card__button",disabled:p2!==null,onClick:n2,children:"Not now"}):null]})]})]})}var xs={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},Ss=["save_as_note","make_follow_up"];function Cs(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=Array.isArray(e2.actions)?Ss.filter(t3=>e2.actions.includes(t3)):Ss,a2=s(),{run:o2,busy:c2,message:l2,available:u2}=It(t2),[d2,p2]=f(new Set);if(i2.length===0)return null;let m2=async e3=>{let{ok:t3}=await o2(e3);t3&&p2(t4=>new Set(t4).add(e3))};return g("div",{role:"group","aria-label":"Suggested actions",className:y("core-suggested-actions",n2),style:r2,"aria-busy":c2!==null||void 0,children:[h("div",{className:"core-suggested-actions__row",children:i2.map(e3=>{let t3=d2.has(e3);return h("button",{type:"button",className:"core-suggested-actions__chip","data-done":t3||void 0,disabled:!u2||c2!==null||t3,"aria-describedby":u2?void 0:`${a2}-does`,onClick:()=>void m2(e3),children:t3?xs[e3].done:c2===e3?xs[e3].busy:xs[e3].label},e3)})}),l2?h("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,u2?null:h("p",{id:`${a2}-does`,className:"core-suggested-actions__does",children:Ft})]})}var ws=new Set(["http:","https:","mailto:","tel:"]);function Ts(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function Es(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=Ts(e2.trim());return t2===null||ws.has(t2)?e2.trim():(Ce(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function Ds(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=Ts(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(Ce(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var Os=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&Es(e2.href)!==null;function ks(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Os)}function As({action:e2,className:t2}){let n2=Es(e2.href);if(n2===null)return null;let r2=e2.variant==="secondary"?"secondary":"primary";return h("a",{className:y("core-public-action",t2),"data-variant":r2,href:n2,children:e2.label})}function js({actions:e2,className:t2}){return e2.length?h("div",{className:y("core-public-actions",t2),children:e2.map((e3,t3)=>h(As,{action:e3},`${e3.href}-${t3}`))}):null}function Ms(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=Ds(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Ns({eyebrow:e2,title:t2,intro:n2,actions:r2,media:i2,align:a2,className:o2,style:s2}){let c2=Ms(i2),l2=a2==="center";return g("section",{className:y("core-hero",o2),"data-align":l2?"center":"start","data-media":c2?"yes":"no",style:s2,children:[g("div",{className:"core-hero__text",children:[e2?h("p",{className:"core-hero__eyebrow",children:e2}):null,h("h1",{className:"core-hero__title",children:t2}),n2?h("p",{className:"core-hero__intro",children:n2}):null,h(js,{actions:ks(r2).slice(0,2),className:"core-hero__actions"})]}),c2?h("div",{className:"core-hero__media",children:h("img",{src:c2.src,alt:c2.alt,loading:"eager",decoding:"async"})}):null]})}function Ps({text:e2,src:t2,href:n2,size:r2,className:i2,style:a2}){let o2=r2==="sm"||r2==="lg"?r2:"md",s2=Ds(t2),c2=Es(n2),l2=s2?h("img",{className:"core-logo-mark__img",src:s2,alt:e2}):h("span",{className:"core-logo-mark__text",children:e2});return c2?h("a",{className:y("core-logo-mark",i2),"data-size":o2,href:c2,style:a2,children:l2}):h("span",{className:y("core-logo-mark",i2),"data-size":o2,style:a2,children:l2})}var Fs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&Es(e3.href)!==null).map(e3=>({label:e3.label,href:Es(e3.href)}));function Is({logo:e2,links:t2,signIn:n2,className:r2,style:i2}){let a2=Fs(t2).slice(0,5),o2=n2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...n2??{}};return g("header",{className:y("core-public-header",r2),style:i2,children:[e2?h(Ps,{...e2}):h("span",{}),a2.length?g("nav",{className:"core-public-header__nav","aria-label":"Main",children:[h("ul",{className:"core-public-header__links",children:a2.map(e3=>h("li",{children:h("a",{href:e3.href,children:e3.label})},e3.href))}),g("details",{className:"core-public-header__menu",children:[h("summary",{children:"Menu"}),h("ul",{children:a2.map(e3=>h("li",{children:h("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,o2?h(As,{action:o2,className:"core-public-header__sign-in"}):null]})}var Ls=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Fs(e3.links)}));function Rs({logo:e2,groups:t2,legal:n2,className:r2,style:i2}){let a2=Ls(t2).slice(0,4);return g("footer",{className:y("core-public-footer",r2),style:i2,children:[g("div",{className:"core-public-footer__top",children:[e2?h(Ps,{size:"sm",...e2}):null,a2.length?h("div",{className:"core-public-footer__groups",children:a2.map(e3=>g("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[h("p",{className:"core-public-footer__title",children:e3.title}),h("ul",{children:e3.links.map(e4=>h("li",{children:h("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),n2?h("p",{className:"core-public-footer__legal",children:n2}):null]})}var zs=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function Bs({src:e2,alt:t2,decorative:n2,ratio:r2,caption:i2,priority:a2,className:o2,style:s2}){let c2=Ds(e2);if(c2===null)return null;!n2&&!t2&&Ce(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let l2=r2&&zs.test(r2)?{aspectRatio:r2.replace(/\s/g,"")}:void 0;return g("figure",{className:y("core-image",o2),style:s2,children:[h("div",{className:"core-image__frame","data-ratio":l2?"set":"auto",style:l2,children:h("img",{src:c2,alt:n2?"":t2??"",loading:a2?"eager":"lazy",decoding:"async"})}),i2?h("figcaption",{className:"core-image__caption",children:i2}):null]})}var Vs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function Hs({title:e2,intro:t2,items:n2,columns:r2,className:i2,style:a2}){let o2=Vs(n2);if(!o2.length)return null;let s2=r2===2||r2===4?r2:3;return g("section",{className:y("core-feature-grid",i2),"data-columns":s2,style:a2,children:[e2||t2?g("div",{className:"core-feature-grid__head",children:[e2?h("h2",{className:"core-feature-grid__title",children:e2}):null,t2?h("p",{className:"core-feature-grid__intro",children:t2}):null]}):null,h("ul",{className:"core-feature-grid__items",children:o2.map((e3,t3)=>g("li",{className:"core-feature-grid__item",children:[e3.icon?h("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,h("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?h("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${t3}`))})]})}var Us=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Ws=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function Gs({title:e2,intro:t2,members:n2,className:r2,style:i2}){let a2=Us(n2);return a2.length?g("section",{className:y("core-team-grid",r2),style:i2,children:[e2||t2?g("div",{className:"core-team-grid__head",children:[e2?h("h2",{className:"core-team-grid__title",children:e2}):null,t2?h("p",{className:"core-team-grid__intro",children:t2}):null]}):null,h("ul",{className:"core-team-grid__members",children:a2.map((e3,t3)=>{let n3=Ms(e3.photo);return g("li",{className:"core-team-grid__member",children:[h("div",{className:"core-team-grid__photo",children:n3?h("img",{src:n3.src,alt:n3.alt||e3.name,loading:"lazy",decoding:"async"}):h("span",{"aria-hidden":"true",children:Ws(e3.name)})}),h("p",{className:"core-team-grid__name",children:e3.name}),e3.role?h("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?h("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${t3}`)})})]}):null}function Ks({quote:e2,name:t2,role:n2,photo:r2,className:i2,style:a2}){if(typeof e2!="string"||!e2)return null;let o2=Ms(r2);return g("figure",{className:y("core-testimonial",i2),style:a2,children:[h("blockquote",{className:"core-testimonial__quote",children:h("p",{children:e2})}),g("figcaption",{className:"core-testimonial__by",children:[o2?h("img",{className:"core-testimonial__photo",src:o2.src,alt:o2.alt||t2,loading:"lazy",decoding:"async"}):null,g("span",{children:[h("span",{className:"core-testimonial__name",children:t2}),n2?h("span",{className:"core-testimonial__role",children:n2}):null]})]})]})}function qs({title:e2,text:t2,actions:n2,tone:r2,className:i2,style:a2}){let o2=r2==="strong"||r2==="neutral"?r2:"accent";return g("section",{className:y("core-cta-band",i2),"data-tone":o2,style:a2,children:[g("div",{className:"core-cta-band__text",children:[h("h2",{className:"core-cta-band__title",children:e2}),t2?h("p",{className:"core-cta-band__body",children:t2}):null]}),h(js,{actions:ks(n2).slice(0,2)})]})}function Js({title:e2,intro:t2,askPhone:n2,consent:r2,submitLabel:i2,thanks:a2,actions:o2,className:c2,style:l2}){let u2=s(),[d2,p2]=f({name:"",email:"",phone:"",message:"",consent:false,website:""}),[m2,_2]=f(false),[v2,b2]=f(false),[x2,S2]=f(""),C2=o2?.submitRequest,w2=e3=>t3=>p2(n3=>({...n3,[e3]:t3.target.type==="checkbox"?!!t3.target.checked:t3.target.value}));return v2?h("section",{className:y("core-contact-form",c2),style:l2,children:h("p",{className:"core-contact-form__thanks",role:"status",children:a2||"Thanks. We'll be in touch within one business day."})}):g("section",{className:y("core-contact-form",c2),style:l2,children:[e2?h("h2",{className:"core-contact-form__title",children:e2}):null,t2?h("p",{className:"core-contact-form__intro",children:t2}):null,g("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!m2){if(!d2.consent){S2("Please tick the box to agree to be contacted.");return}_2(true),S2("");try{let e4=await C2({name:d2.name.trim(),email:d2.email.trim(),...n2&&d2.phone.trim()?{phone:d2.phone.trim()}:{},...d2.message.trim()?{message:d2.message.trim()}:{},consent:d2.consent,website:d2.website});e4.success?b2(true):S2(At(e4))}catch{S2("Something went wrong. Try again.")}finally{_2(false)}}},children:[g("div",{className:"core-contact-form__row",children:[g("label",{className:"core-contact-form__field",children:[h("span",{children:"Name"}),h("input",{name:"name",autoComplete:"name",required:true,value:d2.name,onChange:w2("name")})]}),g("label",{className:"core-contact-form__field",children:[h("span",{children:"Email"}),h("input",{name:"email",type:"email",autoComplete:"email",required:true,value:d2.email,onChange:w2("email")})]})]}),n2?g("label",{className:"core-contact-form__field",children:[h("span",{children:"Phone (optional)"}),h("input",{name:"phone",type:"tel",autoComplete:"tel",value:d2.phone,onChange:w2("phone")})]}):null,g("label",{className:"core-contact-form__field",children:[h("span",{children:"Message (optional)"}),h("textarea",{name:"message",rows:4,value:d2.message,onChange:w2("message")})]}),g("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[h("label",{htmlFor:`${u2}-website`,children:"Website"}),h("input",{id:`${u2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:d2.website,onChange:w2("website")})]}),g("label",{className:"core-contact-form__check",children:[h("input",{type:"checkbox",name:"consent",checked:d2.consent,onChange:w2("consent")}),h("span",{children:r2||"I agree to be contacted about my request."})]}),x2?h("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:h("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),h("div",{className:"core-contact-form__actions",children:h("button",{type:"submit",className:"core-contact-form__submit",disabled:m2||!C2,children:m2?"Sending…":i2||"Send"})})]})]})}function Ys({length:e2=6,label:t2,value:n2,onChange:r2,onComplete:i2,error:a2,disabled:o2,autoFocus:c2,name:l2="code",className:u2,style:d2}){let p2=s(),m2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[_2,v2]=f(""),b2=(n2??_2).replace(/\D/g,"").slice(0,m2),x2=e3=>{let t3=e3.target.value.replace(/\D/g,"").slice(0,m2);n2===void 0&&v2(t3),r2?.(t3),t3.length===m2&&b2.length!==m2&&i2?.(t3)};return g("div",{className:y("core-code-field",u2),style:{...d2,"--core-code-field-n":m2},children:[h("label",{className:"core-code-field__label",htmlFor:p2,children:t2||"Code"}),g("div",{className:"core-code-field__boxes","data-error":a2?"yes":"no",children:[h("input",{id:p2,className:"core-code-field__input",name:l2,value:b2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${m2}}`,maxLength:m2,disabled:o2,autoFocus:c2,"aria-invalid":a2?true:void 0,"aria-describedby":a2?`${p2}-error`:void 0}),h("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:m2},(e3,t3)=>h("span",{className:"core-code-field__cell","data-filled":t3<b2.length?"yes":"no","data-caret":t3===Math.min(b2.length,m2-1)?"yes":"no",children:b2[t3]??""},t3))})]}),a2?h("p",{id:`${p2}-error`,className:"core-code-field__error",role:"alert",children:a2}):null]})}export{Qr as ANSWER_COLUMN_PX,An as Accordion,As as ActionLink,js as ActionRow,$r as AnswerRows,gr as Aside,Wt as Avatar,or as BLOCK_KINDS,Di as BLOCK_SCHEMAS,hn as Badge,Qo as BookEventCard,E as Box,wn as Button,oo as CalendarFilters,mo as CalendarView,jn as Card,D as Center,tn as Checkbox,nn as CheckboxGroup,Tn as Chip,Gt as Code,Ys as CodeField,Nn as Columns,Uo as Combobox,ti as ComparisonBars,Js as ContactForm,O as Container,bi as Contents,qs as CtaBand,Aa as DAY_MINUTES,Vr as DEFAULT_DISPLAY_LOCALE,Yn as DEFAULT_PROFILE_ID,dt as DEFAULT_VIEWER,ya as DataTable,rn as DateRange,yr as Definition,Ue as Dialog,Ki as DisclaimerBlock,Fn as Disclosure,k as Divider,wi as DocumentBlocks,Nr as DocumentLabel,Ei as DocumentSection,vi as DocumentShell,Br as DocumentTable,as as EditEventCard,w as EmbedContext,gn as EmptyState,ba as EventCard,Ca as EventDetail,Ta as EventLogForm,ss as EventNoteCard,Sa as EventRespond,Da as EventSchedule,ka as EventTimeline,Si as ExecutionBlock,rt as Eyebrow,Hs as FeatureGrid,jr as Figure,on as FileField,On as FilterChips,Ar as Footnote,Xt as FormField,In as Grid,ds as HandoverCard,qt as Heading,Ns as Hero,A as Hide,Ri as HighlightBox,Ho as Highlighted,Ja as HourGrid,En as IconButton,Bs as Image,j as Inline,oa as KpiCardGrid,Dn as Link,Ye as ListRow,Lo as LogCard,Ps as LogoMark,pi as Masthead,Tr as Math,xe as Menu,hi as MetaRail,lo as MiniMonth,Ft as NOT_AVAILABLE,ii as NextSteps,vs as NoteSplitCard,oi as Notes,vn as Notice,V as OVERLAY_DISMISS_EVENT,ea as OptionCard,ao as OverlapNotice,G as OverlayHost,Rn as PAGINATOR_BINDINGS,Mr as PageBreak,Xe as PageFrame,st as PageHead,Bt as PageStaffTools,oe as Popover,ta as ProfileCard,yn as Progress,Gi as ProposedComponent,_r as Prose,Rs as PublicFooter,Is as PublicHeader,Ko as QuickNoteCard,vr as Quote,sn as RadioGroup,I as Rail,zr as Reference,Ln as Repeat,Zr as RowList,Vt as RuleSection,_i as RunningFooter,za as SERIES_SHAPES,un as SearchField,Li as SectionHeader,kn as SegmentedControl,dn as Select,Ua as SeriesGlyph,bs as ShareApprovalCard,he as Sheet,L as Show,bn as Skeleton,ci as SkippedSection,fn as Slider,We as Spacer,xn as Spinner,Pn as Split,Ge as Stack,ms as StartProcessCard,Ni as Stat,Pi as StatGroup,Ji as StatStrip,Cs as SuggestedActions,pn as Switch,Ze as TONES,ui as TalkItThrough,us as TaskCard,Gs as TeamGrid,Ks as Testimonial,Yt as Text,mn as TextArea,ln as TextField,Be as Toast,He as ToastRegion,Sn as Tooltip,Ht as UnderlinedAction,ht as ViewerProvider,di as WRITE_HEIGHT_PX,ai as WRITE_LINE_HEIGHT_PX,fo as WeekStrip,fi as WriteInField,ks as actionsOf,y as cx,Ne as dismissToast,Wr as displayLocale,Jn as documentProfiles,Et as eventWhen,an as fileSize,Yr as formatValue,vt as hasRole,Pt as hrefFrom,Ms as imageOf,Ut as initialsOf,tt as inkToneOf,_o as interact,Na as isBusyOnly,_t as isStaff,Fa as layoutDay,b as length,eo as localWithOffset,ft as normalizeViewer,Ra as overlapDays,ar as profileCss,Gn as profileIds,rr as profileTokens,Wn as registerProfile,qr as renderFormatted,Kn as resolveProfile,qn as resolvedProfiles,Lt as sameOriginPath,Ha as seriesNumber,Va as seriesShape,cn as toNumber,Me as toast,$e as toneOf,yt as typeCard,Vo as useCombobox,T as useEmbedded,It as useIntent,ne as useOverlayFormat,K as useOverlayHost,ze as useToast,gt as useViewer,x as vars,Ia as visibleRange,Ma as wallOf,La as weekDates};
3
+ }`;function or(e2,t2){return e2.map(e3=>ar(e3.id===t2?`:root,
4
+ [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,ir(e3))).join("\n\n")}var sr=["prose","clause","definitions","table","notice","figure","execution"],cr=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,lr="[a-z0-9][a-z0-9_-]*",ur=RegExp(`^(?:(${lr}):)?(${lr}(?:\\.${lr})*)(?:#(${lr}))?$`);RegExp(`^${lr}$`);function dr(e2,t2){let n2=e2.trim(),r2=ur.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function fr(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function pr(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(cr.source,"g"))){let i2=dr(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function mr(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},hr=e2=>e2?.fills===false?{"data-fills":"none"}:{},gr={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function _r({children:e2,tone:t2="note",title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Aside"),c2=s2?.fills===false;return _("aside",{role:"note",className:b("core-aside",a2),"data-tone":t2,...Q(i2?.id??r2),...hr(s2),style:o2,children:[c2?null:g("span",{className:"core-aside__icon","aria-hidden":true,children:gr[t2]}),_("div",{className:"core-aside__body",children:[n2&&g("div",{className:"core-aside__title",children:n2}),g("div",{className:"core-aside__text",children:e2})]})]})}function vr({children:e2,profileId:t2,profile:n2,full:r2=false,className:i2,style:a2}){return n2||Z(t2,"Prose"),g("div",{className:b("core-prose",i2),"data-full":r2?"":void 0,...Q(n2?.id??t2),style:a2,children:e2})}function yr({children:e2,citation:t2,className:n2,style:r2}){return _("figure",{className:b("core-quote",n2),style:r2,children:[g("blockquote",{className:"core-quote__body",children:e2}),t2&&_("figcaption",{className:"core-quote__citation",children:["— ",t2]})]})}function br({term:e2,description:t2,pairs:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"Definition");let s2=n2??(e2===void 0?[]:[{term:e2,description:t2}]);return g("dl",{className:b("core-definition",a2),...Q(i2?.id??r2),style:o2,children:s2.map((e3,t3)=>_("div",{className:"core-definition__item",children:[g("dt",{className:"core-definition__term",children:e3.term}),g("dd",{className:"core-definition__description",children:e3.description})]},t3))})}var xr="katex";function Sr(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var Cr=e2=>import(e2),wr;function Tr(){return wr??=Sr(xr)?Cr(xr).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),wr}function Er({children:e2="",mode:t2="inline",className:n2}){let r2=f(null),[i2,a2]=p(null),[o2,c2]=p(null),l2=`${t2}:${e2}`;return s(()=>{let e3=true;return Tr().then(t3=>{e3&&t3&&a2(()=>t3)}),()=>{e3=false}},[]),s(()=>{if(i2&&r2.current&&o2!==l2)try{i2.render(e2,r2.current,{displayMode:t2==="block",throwOnError:false})}catch{c2(l2)}},[i2,e2,t2,l2,o2]),!i2||o2===l2?g("span",{className:b("core-math",n2),"data-mode":t2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):g("span",{ref:r2,className:b("core-math",n2),"data-mode":t2})}function Dr(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var Or=r(null);function kr(){return o(Or)}function Ar({children:e2}){let[t2,n2]=d(Dr,{footnotes:[]}),r2=f(0),i2=a(e3=>{r2.current+=1;let t3=r2.current;return n2({type:"register",entry:{...e3,number:t3}}),t3},[]),o2=a(e3=>n2({type:"unregister",id:e3}),[]),s2=u(()=>({state:t2,registerFootnote:i2,unregisterFootnote:o2}),[t2,i2,o2]);return g(Or.Provider,{value:s2,children:e2})}function jr({children:e2}){let t2=c(),n2=kr(),[r2,i2]=p(null);return s(()=>{if(!n2)return;let r3=n2.registerFootnote({id:t2,content:e2});return i2(r3),()=>n2.unregisterFootnote(t2)},[t2]),n2?r2===null?null:g("sup",{id:`core-footnote-ref-${r2}`,className:"core-footnote",children:_("a",{href:`#core-footnote-${r2}`,className:"core-footnote__link",children:["[",r2,"]"]})}):_("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function Mr({children:e2,caption:t2,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Figure"),_("figure",{className:b("core-figure",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-figure__body",children:e2}),t2&&g("figcaption",{className:"core-figure__caption",children:t2})]})}function Nr({className:e2}){return g("div",{className:b("core-page-break",e2),"aria-hidden":true})}function Pr({children:e2,as:t2="div",profileId:n2,profile:r2,tone:i2="subtle",className:a2,style:o2}){return r2||Z(n2,"DocumentLabel"),g(t2,{className:b("core-document-label",a2),"data-tone":i2,...Q(r2?.id??n2),style:o2,children:e2})}var Fr=["one","two","three","four","five","six","seven","eight","nine","ten"];function Ir(e2){if(e2.length!==1)return null;let t2=e2[0],n2=Fr[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function Lr(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Rr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function zr(e2,t2){return e2?.[t2]??t2}function Br({target:e2,form:t2,sectionReferences:n2,sectionNumbers:r2,sectionTitles:i2,sectionAnchors:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??Z(o2,"Reference"),d2=dr(e2),f2=n2?.[e2],p2=f2?.openable===false,m2=d2!==null&&d2.doc===void 0,h2=d2?fr(d2.unit):e2,_2=f2?.number??(m2&&d2.element===void 0?r2?.[h2]:void 0),v2=f2?.title??(m2&&d2.element===void 0?i2?.[h2]:void 0),y2=null;if(d2?.element!==void 0){let e3=f2?.element;y2=e3?Rr(f2.number,e3.shape,u2?.depth.numbering)[e3.index]??null:null}else _2&&(y2=Lr(_2));let x2=t2==="full"||d2?.doc!==void 0&&t2!=="title",S2;S2=p2?null:t2==="title"?v2??y2:x2&&y2&&v2&&d2?.element===void 0?`${y2} (${v2})`:y2??v2??null;let C2=S2!==null,w2=C2?f2?f2.href:`#${zr(a2,h2)}`:void 0,T2={className:b("core-reference",c2),"data-target":e2,"data-unresolved":C2||p2?void 0:"","data-closed":p2?"":void 0,...Q(s2?.id??o2),style:l2};return w2?g("a",{href:w2,...T2,children:S2}):g("span",{...T2,children:S2??e2})}function Vr({columns:e2,rows:t2,caption:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"DocumentTable"),e2.length===0?null:_("div",{className:b("core-document-table",a2),...Q(i2?.id??r2),style:o2,children:[n2===void 0?null:g("div",{className:"core-document-table__caption",children:n2}),_("table",{className:"core-document-table__table",children:[g("thead",{children:g("tr",{children:e2.map((e3,t3)=>g("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},t3))})}),g("tbody",{children:t2.map((t3,n3)=>g("tr",{children:e2.map((e3,n4)=>g("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:t3[n4]??null},n4))},n3))})]})]})}var Hr={locale:"en-CA",currency:"CAD"},Ur=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Wr=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function Gr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Ur(t2.locale)?t2.locale:Hr.locale,currency:Wr(t2.currency)?t2.currency.toUpperCase():Hr.currency}}var Kr=new Map;function qr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Kr.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},Kr.set(t2,n2)}return n2}function Jr(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Yr(e2.value):void 0),r2=Xr(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Yr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Xr(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??Hr,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=qr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var Zr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Qr({items:e2,profileId:t2,profile:n2,markerWidth:r2=44,secondaryWidth:i2=190,missingLabel:a2="Not answered yet",baseProps:o2,className:s2,style:c2}){if(n2||Z(t2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let l2=Gr(o2),u2=e3=>Zr(e3)?Jr(e3,l2):e3;return g("div",{className:b("core-row-list",s2),...Q(n2?.id??t2),style:S({"--core-row-list-marker-width":x(r2),"--core-row-list-secondary-width":x(i2)},c2),children:e2.map((e3,t3)=>_("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&g("div",{className:"core-row-list__marker",children:u2(e3.marker)}),g("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&g("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?a2:u2(e3.secondary)})]},t3))})}var $r=190;function ei({items:e2,profileId:t2,profile:n2,missingLabel:r2="Not answered yet",answerWidth:i2=190,className:a2,style:o2}){let s2=e2.map(e3=>{let t3=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t3?e3.answer:void 0,missing:!t3}});return g("div",{className:b("core-answer-rows",a2),...Q(n2?.id??t2),style:o2,children:g(Qr,{items:s2,profileId:t2,profile:n2,secondaryWidth:i2,missingLabel:r2})})}var ti=40;function ni({bars:e2,target:t2,targetLabel:n2,max:r2,profileId:i2,profile:a2,baseProps:o2,className:s2,style:c2}){let l2=Gr(o2),u2=a2??Z(i2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=r2??Math.max(...d2,t2??0);if(!Number.isFinite(f2)||f2<=0)return we("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let p2=t2!==void 0&&t2>0&&t2<=f2?t2/f2*100:void 0;return _("figure",{className:b("core-comparison-bars",s2),...Q(a2?.id??i2),...hr(u2),style:c2,children:[e2.map(e3=>{let t3=Math.max(0,Math.min(100,e3.value/f2*100));return _("div",{className:"core-comparison-bars__bar",style:S({"--core-comparison-bars-value":`${t3}%`}),children:[g("div",{className:"core-comparison-bars__label",children:e3.label}),_("div",{className:"core-comparison-bars__track",style:S({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[g("div",{className:"core-comparison-bars__fill"}),g("span",{className:"core-comparison-bars__value","data-placement":t3>ti?"inside":"outside",children:Jr(e3.display,l2)}),p2!==void 0&&g("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),t2!==void 0&&n2&&g("figcaption",{className:"core-comparison-bars__target-label",children:n2})]})}var ri=3,ii=5;function ai({items:e2,profileId:t2,profile:n2,checkboxes:r2=true,className:i2,style:a2}){return n2||Z(t2,"NextSteps"),e2.length===0?null:((e2.length<ri||e2.length>ii)&&we(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),g("ol",{className:b("core-next-steps",i2),...Q(n2?.id??t2),style:a2,children:e2.map((e3,t3)=>_("li",{className:"core-next-steps__step",children:[g("span",{className:"core-next-steps__marker",children:e3.marker??String(t3+1).padStart(2,"0")}),r2&&g("span",{className:"core-next-steps__box","aria-hidden":"true"}),g("span",{className:"core-next-steps__body",children:e3.body})]},t3))}))}var oi=38;function si({title:e2="Notes",lines:t2=4,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Notes"),t2<1?null:_("section",{className:b("core-notes",i2),...Q(r2?.id??n2),style:a2,children:[g("div",{className:"core-notes__title",children:e2}),g("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:t2},(e3,t3)=>g("div",{className:"core-notes__line"},t3))})]})}var ci="You left this section open, so it is not covered here.";function li({wouldTell:e2,openingLine:t2=ci,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"SkippedSection"),_("div",{className:b("core-skipped-section",i2),...Q(r2?.id??n2),style:a2,children:[g("span",{className:"core-skipped-section__standard",children:t2})," ",g("span",{className:"core-skipped-section__would-tell",children:e2})]})}var ui="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function di({advisor:e2,title:t2="Talk it through",invitation:n2=ui,profileId:r2,profile:i2,className:a2,style:o2}){if(i2||Z(r2,"TalkItThrough"),!e2?.name?.trim())return we("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let s2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return s2.length===0&&we("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),_("section",{className:b("core-talk-it-through",a2),...Q(i2?.id??r2),style:o2,children:[g("h3",{className:"core-talk-it-through__title",children:t2}),g("p",{className:"core-talk-it-through__invitation",children:n2}),_("div",{className:"core-talk-it-through__advisor",children:[g("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&g("div",{className:"core-talk-it-through__role",children:e2.role}),s2.length>0&&g("div",{className:"core-talk-it-through__contact",children:s2.map(e3=>g("span",{children:e3},e3))})]})]})}var fi=38;function pi({question:e2,answer:t2,lines:n2=1,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"WriteInField");let s2=typeof t2=="string"&&t2.trim().length>0,c2=Math.max(1,n2);return _("div",{className:b("core-write-in-field",a2),"data-answered":s2?"":void 0,...Q(i2?.id??r2),style:o2,children:[e2&&g("div",{className:"core-write-in-field__question",children:e2}),s2?g("div",{className:"core-write-in-field__answer",children:t2}):Array.from({length:c2},(e3,t3)=>g("div",{className:"core-write-in-field__line","aria-hidden":"true"},t3))]})}function mi({mark:e2,identity:t2,codes:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"Masthead"),e2===void 0&&t2===void 0&&n2===void 0?null:_("header",{className:b("core-masthead",a2),"data-page-region":"page-header",...Q(i2?.id??r2),style:o2,children:[e2!==void 0&&g("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),t2!==void 0&&g("div",{className:"core-masthead__identity","data-slot":"identity",children:t2}),n2!==void 0&&g("div",{className:"core-masthead__codes","data-slot":"codes",children:n2})]})}var hi=4;function gi({fields:e2,profileId:t2,profile:n2,className:r2,style:i2}){let a2=(n2??Z(t2,"MetaRail"))?.rail.placement??"strip";return a2==="none"||e2.length===0?null:(a2!=="column"&&e2.length>hi&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${hi}. Rendering all of them — check the layout.`),g("div",{className:b("core-meta-rail",r2),"data-placement":a2,...Q(n2?.id??t2),style:i2,children:e2.map(e3=>_("div",{className:"core-meta-rail__field",children:[g("div",{className:"core-meta-rail__label",children:e3.label}),g("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var _i={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function vi({left:e2,centre:t2,right:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"RunningFooter");let s2=[["left",e2],["centre",t2],["right",n2]].filter(([,e3])=>e3!=null);return s2.length===0?null:g("footer",{className:b("core-running-footer",a2),"data-page-region":"page-footer",...Q(i2?.id??r2),style:o2,children:s2.map(([e3,t3])=>g("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":_i[e3],children:t3},e3))})}function yi({children:e2,rail:t2,profileId:n2,profile:r2,className:i2,style:a2}){let o2=r2??Z(n2,"DocumentShell"),s2=o2?.rail.placement==="column"&&t2!==void 0;return g(Ar,{children:_("div",{className:b("core-document-shell",i2),...Q(o2?.id??n2),"data-has-rail":s2?"":void 0,style:a2,children:[g("div",{className:"core-document-shell__body",children:e2}),s2&&_(h,{children:[g("div",{className:"core-document-shell__gutter","aria-hidden":true}),g("aside",{className:"core-document-shell__rail",children:t2})]})]})})}function bi(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function xi({entries:e2,depth:t2,title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Contents"),c2=s2?.depth.max??Infinity,l2=e2??[],u2=t2===void 0?l2:l2.filter(e3=>e3.level<t2);if(u2.length===0)return null;let d2=s2?.depth.numbering??"none",f2=u2.some(e3=>e3.page!==void 0);return _("nav",{"aria-label":"Table of contents",className:b("core-contents",a2),...Q(i2?.id??r2),style:o2,children:[n2&&g("div",{className:"core-contents__title",children:n2}),g("ol",{className:"core-contents__list",children:u2.map(e3=>{let t3=d2==="none"?null:bi(e3.ordinal,e3.level);return _("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=c2?"":void 0,style:S({"--core-contents-level":String(e3.level)}),children:[t3&&g("span",{className:"core-contents__ordinal",children:t3}),g("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),f2&&g("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function Si({s:e2,dated:t2}){return _("div",{className:"core-execution-block__signature",children:[_("div",{className:"core-execution-block__lines",children:[g("div",{className:"core-execution-block__line","data-line":"sign"}),t2?g("div",{className:"core-execution-block__line","data-line":"date"}):null]}),_("div",{className:"core-execution-block__captions",children:[_("div",{className:"core-execution-block__party",children:[e2.role?g("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?g("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?g("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),t2?g("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function Ci({attestation:e2,label:t2,signatories:n2,columns:r2=1,note:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"ExecutionBlock");let l2=Array.isArray(n2)?n2:[];return _("section",{className:b("core-execution-block",s2),...Q(o2?.id??a2),style:c2,children:[t2?g("div",{className:"core-execution-block__label",children:t2}):null,e2?g("div",{className:"core-execution-block__attestation",children:e2}):null,g("div",{className:"core-execution-block__signatories","data-columns":r2,children:l2.map((e3,t3)=>g(Si,{s:e3,dated:e3.dated===true},t3))}),i2?g("div",{className:"core-execution-block__note",children:i2}):null]})}function wi({kind:e2}){return _("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[g("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function Ti({blocks:e2,profileId:t2,sectionNumbers:n2,sectionAnchors:r2,sectionTitles:i2,sectionReferences:a2,sectionOrdinal:o2,className:s2,style:c2}){let l2=Z(t2,"DocumentBlocks");if(e2.length===0)return null;let u2=Rr(o2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),l2?.depth.numbering),d2=0,f2=(e3,o3)=>mr(e3)?pr(e3).map((e4,s3)=>e4.kind==="text"?e4.text:g(Br,{target:e4.key,form:e4.form,sectionReferences:a2,sectionNumbers:n2,sectionTitles:i2,sectionAnchors:r2,profileId:t2},`${o3}-ref-${s3}`)):e3,p2=e2.some(e3=>e3.kind==="execution");return g("div",{className:b("core-document-blocks",s2),"data-pinned":p2?"execution":void 0,...Q(t2),style:c2,children:e2.map((e3,n3)=>{let r3=`${e3.kind}-${n3}`;switch(e3.kind){case"prose":return g(vr,{profileId:t2,full:e3.full,children:f2(e3.text,r3)},r3);case"clause":return g(Qr,{profileId:t2,items:e3.items.map((e4,t3)=>({marker:u2[d2++],primary:f2(e4.text,`${r3}-${t3}`),secondary:e4.note?f2(e4.note,`${r3}-${t3}-n`):void 0,missing:e4.missing}))},r3);case"definitions":return g(br,{profileId:t2,pairs:e3.pairs.map((e4,t3)=>({term:e4.term,description:f2(e4.description,`${r3}-${t3}`)}))},r3);case"table":return g(Vr,{profileId:t2,caption:e3.caption?f2(e3.caption,`${r3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t3)=>e4.map((e5,n4)=>f2(e5,`${r3}-${t3}-${n4}`)))},r3);case"notice":return g(_r,{profileId:t2,tone:e3.tone,title:e3.title,children:f2(e3.text,r3)},r3);case"figure":return g(Mr,{profileId:t2,caption:f2(e3.caption,r3),children:e3.placeholder??null},r3);case"execution":return g(Ci,{profileId:t2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},r3);default:return g(wi,{kind:String(e3.kind)},r3)}})})}var Ei=["h2","h3","h4","h5","h6"];function Di({sectionId:e2,title:t2,level:n2=0,ordinal:r2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionLevels:c2,continued:l2=false,continuedCount:u2,children:d2,blocks:f2,profileId:p2,profile:m2,className:h2,style:v2}){let y2=m2??Z(p2,"DocumentSection"),x2=i2?.[e2],C2=c2?.[e2],w2=x2??r2,T2=C2===void 0?n2:Math.max(0,C2-1),E2=T2>=(y2?.depth.max??Infinity),D2=Math.min(T2,(y2?.depth.indent.length??1)-1)+1,O2=y2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?Ir(w2):null,A2=Ei[Math.min(T2,Ei.length-1)],j2=zr(a2,e2),M2=`${j2}-doc-heading`;return _("section",{id:j2,className:b("core-document-section",h2),"data-level":T2,"data-ordinal-source":w2?x2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(m2?.id??p2),style:S({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&g("div",{className:"core-document-section__article",children:k2}),_(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&g("span",{className:"core-document-section__ordinal",children:w2.join(".")}),t2,l2&&g("span",{className:"core-document-section__continued",children:"continued"})]}),l2&&u2&&g("div",{className:"core-document-section__count",children:`Items ${u2.from} to ${u2.to} of ${u2.of}`}),g("div",{className:"core-document-section__body",children:d2??(f2?g(Ti,{blocks:f2,profileId:p2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionOrdinal:O2?w2:void 0}):null)})]})}var Oi={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},ki=["md","lg","xl"],Ai=5;function ji(e2){let t2=ki.indexOf(e2);return t2>0?ki[t2-1]:e2}var Mi=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Ni(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Pi({value:e2,label:t2,size:n2="lg",tone:r2,progress:i2,progressLabel:a2,autoStepDown:o2=true,baseProps:s2,className:c2,style:l2}){let u2=Mi(e2)?Jr(e2,Gr(s2)):e2,d2=typeof u2=="string"||typeof u2=="number"?String(u2).length:0,f2=o2&&d2>Ai?ji(n2):n2,p2=nt(r2,"strong"),{toned:m2,...h2}=rt(p2),v2=i2==null?null:Ni(i2);return _("div",{className:b("core-stat",m2&&"core-toned",c2),...h2,"data-size":f2,style:l2,children:[g("div",{className:"core-stat__value",children:u2}),t2!=null&&g(it,{className:"core-stat__label",tone:p2==="on-dark"||p2==="inherit"?p2:"subtle",children:t2}),v2!==null&&g("div",{className:"core-stat__progress",role:"progressbar","aria-label":a2??(typeof t2=="string"?t2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:S({"--core-stat-progress":`${v2}%`}),children:g("div",{className:"core-stat__progress-fill"})})]})}function Fi({children:e2,minColumnWidth:t2=200,maxColumns:n2=4,gap:r2=32,className:i2,style:a2}){return g("div",{className:b("core-stat-group",i2),style:S({"--core-stat-group-min":`${t2}px`,"--core-stat-group-max":String(Math.max(1,n2)),"--core-stat-group-gap":`${r2}px`},a2),children:e2})}var Ii={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Li({direction:e2="up",delay:t2=0,duration:n2=.5,threshold:r2=.15,once:i2=true,className:a2,style:o2,children:c2}){let l2=f(null),[u2,d2]=p(false);s(()=>{let e3=l2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){d2(true);return}let t3=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(d2(true),i2&&t3.disconnect()):i2||d2(false))},{threshold:Math.min(1,Math.max(0,r2))});return t3.observe(e3),()=>t3.disconnect()},[i2,r2]);let[m2,h2]=Ii[e2];return g("div",{ref:l2,className:b("core-reveal",a2),"data-revealed":u2?"true":"false",style:S({"--core-reveal-x":`${m2}px`,"--core-reveal-y":`${h2}px`,"--core-reveal-duration":`${n2}s`,"--core-reveal-delay":`${t2}s`},o2),children:c2})}function Ri({eyebrow:e2,title:t2,description:n2,trailing:r2,level:i2=2,revealDelay:a2=0,className:o2,style:s2}){let c2=i2===3,l2=c2?"h3":"h2";return g(Li,{direction:"up",delay:a2,className:b("core-section-header",o2),style:s2,children:_("div",{className:"core-section-header__inner","data-described":n2?"true":void 0,"data-level":c2?"3":void 0,children:[_("div",{className:"core-section-header__text",children:[e2?g(it,{className:"core-section-header__eyebrow",children:e2}):null,g(l2,{className:"core-section-header__title",children:t2}),n2?g("p",{className:"core-section-header__description",children:n2}):null]}),r2!=null&&r2!==""?g("div",{className:"core-section-header__trailing",children:r2}):null]})})}function zi({tone:e2,label:t2,headline:n2,children:r2,trailing:i2,className:a2,style:o2}){let s2=et(e2,"accent"),c2=i2!=null&&i2!=="";return _("div",{className:b("core-highlight-box","core-toned",a2),"data-tone":s2,style:o2,children:[_("div",{className:"core-highlight-box__text",children:[t2?g("div",{className:"core-highlight-box__label",children:t2}):null,n2?g("div",{className:"core-highlight-box__headline",children:n2}):null,r2!=null&&r2!==""?g("div",{className:"core-highlight-box__body",children:r2}):null]}),c2?g("div",{className:"core-highlight-box__trailing",children:i2}):null]})}var Bi=60,Vi=400,Hi=12,Ui=(e2,t2)=>{if(typeof e2!="string")return"";let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2},Wi=e2=>typeof e2=="string"&&/^\/(?![/\\])[^\s\u0000-\u001f]*$/.test(e2)?e2:null,Gi=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>0?Math.round(e2):void 0;function Ki({name:e2,description:t2,takes:n2,sketch:r2,className:i2,style:a2}){let o2=Ui(e2,Bi);if(!o2)return null;let s2=Ui(t2,Vi),c2=(Array.isArray(n2)?n2:[]).map(e3=>({name:Ui(e3?.name,Bi),type:Ui(e3?.type,60),note:Ui(e3?.note,160)})).filter(e3=>e3.name).slice(0,Hi),l2=Wi(r2?.src),u2=Gi(r2?.w),d2=Gi(r2?.h);return _("section",{className:b("core-proposed-component",i2),style:a2,"aria-label":`Proposed component: ${o2}`,children:[g("p",{className:"core-proposed-component__mark",children:"Proposed"}),g("h3",{className:"core-proposed-component__name",children:o2}),s2?g("p",{className:"core-proposed-component__description",children:s2}):null,l2?g("img",{className:"core-proposed-component__sketch",src:l2,alt:Ui(r2?.alt,160),loading:"lazy",...u2&&d2?{width:u2,height:d2}:{}}):null,c2.length?_("div",{className:"core-proposed-component__takes",children:[g("p",{className:"core-proposed-component__heading",children:"Would take"}),g("ul",{children:c2.map(e3=>_("li",{children:[g("code",{children:e3.name}),e3.type?g("span",{className:"core-proposed-component__type",children:e3.type}):null,e3.note?g("span",{className:"core-proposed-component__note",children:e3.note}):null]},e3.name))})]}):null]})}function qi({label:e2,children:t2,className:n2,style:r2}){return _("div",{className:b("core-disclaimer-block",n2),style:r2,children:[e2?_(h,{children:[g("strong",{className:"core-disclaimer-block__label",children:e2})," "]}):null,t2]})}function Ji(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Yi({label:e2,value:t2,fillPercent:n2,subtitle:r2,tone:i2,baseProps:a2,className:o2,style:s2}){let c2=Gr(a2),l2=Ji(n2);return _("div",{className:b("core-stat-strip","core-toned",o2),"data-tone":et(i2,"info"),style:S({"--core-stat-strip-fill":`${l2}%`},s2),children:[_("div",{className:"core-stat-strip__row",children:[g("span",{className:"core-stat-strip__label",children:e2}),g("span",{className:"core-stat-strip__value",children:Jr(t2,c2)})]}),g("div",{className:"core-stat-strip__track",children:g("div",{className:"core-stat-strip__fill"})}),r2?g("div",{className:"core-stat-strip__subtitle",children:Jr(r2,c2)}):null]})}function Xi({text:e2,tone:t2,locale:n2,className:r2}){return g("span",{className:b("core-value-badge","core-toned",r2),"data-tone":et(t2),children:Jr(e2,n2)})}var Zi=8,Qi={good:"success",warn:"warning",critical:"danger"};function $i(e2,t2,n2){let r2={series:String(n2%Zi+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%Zi+1)};let o2=Qi[i2];return o2?{tone:o2}:Qe.includes(i2)?{tone:i2}:(we("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function ea(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function ta(e2){let{number:t2,title:n2,description:r2,badgeText:i2,badgeTone:a2,bars:o2,tone:s2,isSelected:c2=false,className:l2,style:u2}=e2,d2=Gr(e2.baseProps),f2=Array.isArray(o2)?o2:[],p2=ea(t2);return _("div",{className:b("core-option-card",l2),"data-selected":c2?"true":void 0,"data-described":r2?"true":void 0,style:u2,children:[_("div",{className:"core-option-card__head",children:[p2?g("div",{className:"core-option-card__number","data-kind":p2.kind,children:p2.text}):g("span",{}),i2!=null&&i2!==""?g(Xi,{text:i2,tone:et(a2),locale:d2}):null]}),n2?g("div",{className:"core-option-card__title",children:n2}):null,r2?g("p",{className:"core-option-card__description",children:r2}):null,f2.map((e3,t3)=>{let n3=$i(e3.tone,s2,t3),r3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),i3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:et(e3.valueTone);return _("div",{className:"core-option-card__bar",children:[_("div",{className:"core-option-card__bar-head",children:[g("span",{className:"core-option-card__bar-label",children:e3.label}),g("span",{className:b("core-option-card__bar-value",i3&&"core-toned"),"data-tone":i3,children:Jr(e3.value,d2)})]}),g("div",{className:"core-option-card__track",children:g("div",{className:b("core-option-card__fill","tone"in n3&&"core-toned"),"data-tone":"tone"in n3?n3.tone:void 0,"data-series":"series"in n3?n3.series:void 0,style:S({"--core-option-card-fill":`${r3}%`})})})]},t3)})]})}function na(e2){let{title:t2,subtitle:n2,rows:r2,className:i2,style:a2}=e2,o2=Gr(e2.baseProps),s2=e2.tone??"info",c2=s2==="none",l2=Array.isArray(r2)?r2:[];return _("div",{className:b("core-profile-card",!c2&&"core-toned",i2),"data-tone":c2?void 0:et(s2,"info"),"data-marker":c2?"none":void 0,style:a2,children:[_("div",{className:"core-profile-card__head",children:[g("div",{className:"core-profile-card__title",children:t2}),n2?g("div",{className:"core-profile-card__subtitle",children:n2}):null]}),l2.map((e3,t3)=>_("div",{className:"core-profile-card__row",children:[g("span",{className:"core-profile-card__label",children:e3.label}),_("div",{className:"core-profile-card__end",children:[g("span",{className:"core-profile-card__value",children:Jr(e3.value,o2)}),e3.badge?g(Xi,{text:e3.badge.text,tone:et(e3.badge.tone),locale:o2}):null]})]},t3))]})}function ra(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var ia={up:"▲",down:"▼",flat:"—"},aa={up:"success",down:"danger",flat:void 0},oa=e2=>e2!=null&&e2!=="";function sa(e2){let{columns:t2=4,gap:n2="tight",minColumnWidth:r2,className:i2,style:a2}=e2,o2=Gr(e2.baseProps),s2=Array.isArray(e2.cards)?e2.cards:[],c2=Math.max(1,Math.min(6,Math.round(Number(t2))||4));return g("div",{className:b("core-kpi-card-grid",i2),"data-gap":n2==="normal"?"normal":"tight",style:S({"--core-kpi-card-grid-columns":String(c2),"--core-kpi-card-grid-min":typeof r2=="number"&&r2>0?`${r2}px`:void 0},a2),children:s2.map((e3,t3)=>{let{subtitle:n3,badge:r3}=e3,i3=oa(e3.tone)?et(e3.tone):void 0,a3=oa(e3.delta)?ra(e3.delta):void 0,s3=a3?aa[a3]:void 0;return g(Li,{direction:"up",className:"core-kpi-card-grid__item",children:_("div",{className:b("core-kpi-card-grid__card",i3&&"core-toned"),"data-tone":i3,children:[_("div",{className:"core-kpi-card-grid__head",children:[g("div",{className:"core-kpi-card-grid__label",children:e3.label}),r3&&oa(r3.text)?g(Xi,{text:r3.text,tone:et(r3.tone),locale:o2}):null]}),g("div",{className:"core-kpi-card-grid__value",children:Jr(e3.value,o2)}),a3?_("div",{className:b("core-kpi-card-grid__delta",s3&&"core-toned"),"data-tone":s3,"data-direction":a3,children:[g("span",{"aria-hidden":"true",children:ia[a3]})," ",Jr(e3.delta,o2)]}):null,oa(n3)?g("div",{className:"core-kpi-card-grid__subtitle",children:Jr(n3,o2)}):null]})},t3)})})}var ca=new Set(["http:","https:","mailto:","tel:"]);function la(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function ua(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=la(e2.trim());return t2===null||ca.has(t2)?e2.trim():(we(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function da(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=la(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(we(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var fa=["title","meta","badge","value"];function pa(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return et(e2)}var ma=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),ha=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!i(e2)&&"value"in e2&&!("format"in e2));function ga(e2){return ha(e2)?e2:{value:e2}}var _a=/^\d{4}-\d{2}-\d{2}$/,va=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function ya(e2,t2,n2){if(!va.test(e2))return e2;let r2=_a.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function ba(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var xa=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),Sa={fraction:"fraction-percent"};function Ca(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=Sa[t3]??(xa.has(t3)?t3:void 0);return Jr(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&xa.has(t2)?Xr(t2,e2,{locale:r2}):String(e2)}function wa(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?ya(e2,t2,r2.locale):typeof e2=="string"?Jr(ba(e2),r2):ma(e2)?Jr(e2,r2):typeof e2=="number"?Ca(e2,t2,n2,r2):i(e2)?e2:null}function Ta({title:e2,subtitle:t2,columns:n2,rows:r2,baseProps:i2,rowHeadingLevel:a2,actionsWidth:o2,className:s2,style:l2}){let u2=Gr(i2),d2=`${c()}-title`,f2=Array.isArray(n2)?n2:[],p2=Array.isArray(r2)?r2:[],m2=e3=>f2[e3]?.align??(e3===0?"left":"right"),h2=e3=>{let t3=e3.cells;return Array.isArray(t3)?t3:t3&&typeof t3=="object"?f2.map(e4=>t3[e4.key]):[]},v2=e3=>e3&&fa.includes(e3.role)?e3.role:void 0;return f2.some(e3=>v2(e3))?g(Oa,{title:e2,subtitle:t2,titleId:d2,safeColumns:f2,safeRows:p2,loc:u2,rowHeadingLevel:a2,actionsWidth:o2,className:s2,style:l2,cellsOf:h2,roleOf:v2}):g(Li,{direction:"up",children:_("div",{className:b("core-data-table",s2),style:l2,children:[e2||t2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:d2,className:"core-data-table__title",children:e2}):null,t2?g("div",{className:"core-data-table__subtitle",children:t2}):null]}):null,g("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?d2:void 0,tabIndex:0,children:_("table",{className:"core-data-table__table",children:[g("thead",{children:g("tr",{children:f2.map((e3,t3)=>_("th",{scope:"col",className:"core-data-table__col","data-align":m2(t3),style:S({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?g("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},t3))})}),g("tbody",{children:p2.map((e3,t3)=>{let{highlighted:n3,total:r3}=e3,i3=h2(e3);return g("tr",{className:"core-data-table__row","data-highlighted":n3?"true":void 0,"data-total":r3?"true":void 0,children:i3.map((t4,n4)=>{let r4=ga(t4),i4=pa(r4.tone),a3={className:b("core-data-table__cell",i4&&"core-toned"),"data-align":m2(n4),"data-tone":i4};return n4===0?g("th",{scope:"row",...a3,children:wa(r4.value,f2[n4]?.format,e3.unit,u2)},n4):g("td",{...a3,children:wa(r4.value,f2[n4]?.format,e3.unit,u2)},n4)})},t3)})})]})})]})})}var Ea=e2=>e2!=null&&e2!==false&&e2!=="",Da=e2=>typeof e2=="number"&&Number.isInteger(e2)&&e2>=2&&e2<=6?e2:void 0;function Oa({title:e2,subtitle:n2,titleId:r2,safeColumns:i2,safeRows:a2,loc:o2,rowHeadingLevel:s2,actionsWidth:c2,className:l2,style:u2,cellsOf:d2,roleOf:f2}){let p2=i2.map(e3=>f2(e3)),m2=Math.max(0,p2.indexOf("title")),v2=p2.findIndex((e3,t2)=>e3==="badge"&&t2!==m2),y2=p2.findIndex((e3,t2)=>e3==="value"&&t2!==m2),x2=i2.map((e3,t2)=>t2).filter(e3=>e3!==m2&&e3!==v2&&e3!==y2),S2=i2.some(e3=>Ea(e3.header)),C2=e2?{"aria-labelledby":r2}:{"aria-label":"Data table"},w2=Da(s2),T2=a2.some(e3=>Ea(e3.actions)),E2=typeof c2=="number"&&c2>0?c2:6,D2=i2.reduce((e3,t2)=>e3+(typeof t2.width=="number"&&t2.width>0?t2.width:0),0)+(T2?E2:0),O2=i2.map(e3=>typeof e3.width=="number"&&e3.width>0?0:typeof e3.weight=="number"&&e3.weight>0?e3.weight:1),k2=O2.reduce((e3,t2)=>e3+t2,0)||1,A2=e3=>{let t2=i2[e3]?.width;if(typeof t2=="number"&&t2>0)return`${t2}rem`;let n3=(O2[e3]??1)/k2;return D2>0?`calc((100% - ${D2}rem) * ${n3.toFixed(4)})`:`${(n3*100).toFixed(3)}%`},j2=e3=>i2[e3]?.align??"left";return g(Li,{direction:"up",children:_("div",{className:b("core-data-table",l2),style:u2,"data-records":"",children:[e2||n2?_("div",{className:"core-data-table__head",children:[e2?g("div",{id:r2,className:"core-data-table__title",children:e2}):null,n2?g("div",{className:"core-data-table__subtitle",children:n2}):null]}):null,g("div",{className:"core-data-table__wide",children:_("table",{className:"core-data-table__table",...C2,children:[_("colgroup",{children:[i2.map((e3,t2)=>g("col",{style:{width:A2(t2)}},t2)),T2?g("col",{style:{width:`${E2}rem`}}):null]}),S2?g("thead",{children:_("tr",{children:[i2.map((e3,t2)=>g("th",{scope:"col",className:"core-data-table__col","data-align":j2(t2),children:e3.header},t2)),T2?g("th",{scope:"col",className:"core-data-table__col","data-align":"right",children:g("span",{className:"core-data-table__sr",children:"Actions"})}):null]})}):null,g("tbody",{children:a2.map((e3,t2)=>{let n3=d2(e3),r3=ua(e3.href);return _("tr",{className:"core-data-table__row","data-highlighted":e3.highlighted?"true":void 0,"data-total":e3.total?"true":void 0,children:[i2.map((t3,i3)=>{let a3=ga(n3[i3]),s3=pa(a3.tone),c3=wa(a3.value,t3.format,e3.unit,o2),l3={className:b("core-data-table__cell",s3&&"core-toned"),"data-align":j2(i3),"data-tone":s3};if(i3===m2){let t4=r3&&Ea(c3)?g("a",{className:"core-data-table__link",href:r3,children:c3}):c3;return g("th",{scope:"row","data-role":"title",...l3,children:Ea(e3.leading)?_("div",{className:"core-data-table__titlecell",children:[g("span",{className:"core-data-table__lead",children:e3.leading}),t4]}):t4},i3)}let u3=p2[i3]??"meta";return g("td",{"data-role":u3,title:(u3==="badge"||u3==="value")&&typeof a3.value=="string"&&typeof c3=="string"?c3:void 0,...l3,children:c3},i3)}),T2?g("td",{className:"core-data-table__cell","data-role":"actions","data-align":"right",children:Ea(e3.actions)?e3.actions:null}):null]},t2)})})]})}),g("ul",{className:"core-data-table__records",...C2,children:a2.map((e3,n3)=>{let r3=d2(e3),a3=t2=>t2<0?null:wa(ga(r3[t2]).value,i2[t2]?.format,e3.unit,o2),s3=x2.map(a3).filter(Ea);return g(Xe,{as:"li",title:a3(m2),titleLevel:w2,href:ua(e3.href)??void 0,leading:Ea(e3.leading)?e3.leading:void 0,actions:Ea(e3.actions)?e3.actions:void 0,badge:Ea(a3(v2))?g("span",{className:"core-data-table__badge-text",title:typeof ga(r3[v2]).value=="string"&&typeof a3(v2)=="string"?a3(v2):void 0,children:a3(v2)}):void 0,meta:s3.length?g(h,{children:s3.map((e4,n4)=>_(t,{children:[n4>0?" · ":null,e4]},n4))}):void 0,value:a3(y2)||void 0},n3)})})]})})}function ka(e2){let{event:t2,href:n2,locale:r2,timeZone:i2,size:a2,className:o2,style:s2}=e2,c2=t2&&typeof t2=="object"?t2:{name:""},l2=Dt(c2,r2,i2),u2=c2.status&&c2.status!=="confirmed"?c2.status:void 0,d2=_(h,{children:[_("div",{className:"core-event-card__top",children:[c2.typeName?g("span",{className:"core-event-card__type",children:c2.typeName}):null,u2?g("span",{className:"core-event-card__status","data-status":u2,children:u2}):null]}),g("div",{className:"core-event-card__name",children:c2.name}),l2?g("div",{className:"core-event-card__when",children:l2}):null,c2.location?g("div",{className:"core-event-card__where",children:c2.location}):null]});return g("div",{className:b("core-event-card",o2),"data-kind":c2.kind,"data-status":c2.status,"data-size":a2==="compact"?"compact":void 0,style:s2,children:n2?g("a",{className:"core-event-card__link",href:n2,children:d2}):d2})}var Aa={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function ja(e2){let{actions:t2,className:n2,style:r2}=e2,[i2,a2]=p(e2.response),[o2,s2]=p(false),[c2,l2]=p(""),u2=t2?.respond,d2=async e3=>{if(!u2||o2)return;s2(true),l2("");let t3=await u2({response:e3});s2(false),t3.success?a2(e3):l2(jt(t3))};return _("div",{className:b("core-event-respond",n2),style:r2,children:[g("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:St.map(e3=>g("button",{type:"button",className:"core-event-respond__choice","aria-pressed":i2===e3,disabled:!u2||o2,onClick:()=>void d2(e3),children:Aa[e3]},e3))}),c2?g("p",{className:"core-event-respond__message",role:"alert",children:c2}):null]})}function Ma(e2){let{event:t2,actions:n2,viewerResponse:r2,locale:i2,timeZone:a2,className:o2,style:s2}=e2,c2=[["Edit",e2.editHref],["Reschedule",e2.rescheduleHref],["Add note",e2.noteHref],["Cancel the event",e2.cancelHref]].filter(e3=>typeof e3[1]=="string"&&e3[1]!==""),l2=t2&&typeof t2=="object"?t2:{name:""},u2=Array.isArray(e2.notes)?e2.notes:[],d2=Array.isArray(e2.participants)?e2.participants:[],f2=Dt(l2,i2,a2);return _("article",{className:b("core-event-detail",o2),"data-status":l2.status,style:s2,children:[_("header",{className:"core-event-detail__head",children:[l2.typeName?g("div",{className:"core-event-detail__type",children:l2.typeName}):null,g("h2",{className:"core-event-detail__name",children:l2.name}),f2?g("div",{className:"core-event-detail__meta",children:f2}):null,l2.location?g("div",{className:"core-event-detail__meta",children:l2.location}):null,l2.status&&l2.status!=="confirmed"?g("div",{className:"core-event-detail__status",children:l2.status}):null]}),c2.length>0?g("div",{className:"core-event-detail__manage",role:"group","aria-label":"Change this event",children:c2.map(([e3,t3])=>g("a",{className:"core-event-detail__action",href:t3,children:e3},e3))}):null,r2===void 0?null:g(ja,{response:r2,actions:n2,className:"core-event-detail__respond"}),d2.length?_("section",{className:"core-event-detail__section","aria-label":"Participants",children:[g("h3",{className:"core-event-detail__heading",children:"Participants"}),g("ul",{className:"core-event-detail__list",children:d2.map((e3,t3)=>_("li",{className:"core-event-detail__person",children:[g("span",{children:e3.name}),g("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},t3))})]}):null,u2.length?_("section",{className:"core-event-detail__section","aria-label":"Notes",children:[g("h3",{className:"core-event-detail__heading",children:"Notes"}),u2.map((e3,t3)=>_("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?g("div",{className:"core-event-detail__badge",children:"Staff only"}):null,g("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?g("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(i2,{timeZone:a2}):void 0].filter(Boolean).join(" · ")}):null]},t3))]}):null]})}var Na=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function Pa(e2){let{orgId:t2,projectId:n2,actions:r2,onDone:i2,canWriteStaffNotes:a2,className:o2,style:s2}=e2,l2=Array.isArray(e2.types)?e2.types:[],d2=c(),[f2,m2]=p(e2.defaultTypeId??l2[0]?.id??""),h2=l2.find(e3=>e3.id===f2),v2=h2?.kind==="scheduled",[y2,x2]=p(""),[S2,C2]=p(At()),[w2,T2]=p(""),[E2,D2]=p(""),[O2,k2]=p({}),[A2,j2]=p(""),[M2,N2]=p(!!a2),[P2,F2]=p(false),[I2,L2]=p(""),R2=u(()=>Na(h2),[h2]);if(!l2.length)return g("p",{className:b("core-event-log","core-event-log__empty",o2),style:s2,children:"There's nothing you can log here."});let z2=async o3=>{if(o3.preventDefault(),!r2?.logEvent||P2||!h2)return;F2(true),L2("");let s3=kt(S2),c2={event_type_id:h2.id,org_id:t2,name:y2.trim()||h2.name,starts_at:s3,tzid:Ot(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};n2&&(c2.project_id=n2),v2&&w2&&(c2.ends_at=kt(w2)),E2.trim()&&(c2.location=E2.trim());let l3=A2.trim()?[{body:A2.trim(),audience:a2&&M2?"staff":"shared"}]:void 0,u2=await r2.logEvent(l3?{event:c2,notes:l3}:{event:c2});F2(false),u2.success?(x2(""),j2(""),k2({}),i2?.(u2)):L2(jt(u2))},B2=(e3,t3)=>k2(n3=>({...n3,[e3]:t3}));return _("form",{className:b("core-event-log",o2),style:s2,onSubmit:e3=>void z2(e3),children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Type"}),g("select",{value:f2,onChange:e3=>{m2(e3.target.value),k2({})},children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Title"}),g("input",{value:y2,onChange:e3=>x2(e3.target.value),placeholder:h2?.name})]}),_("div",{className:"core-event-log__row",children:[_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),g("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Ends"}),g("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Where"}),g("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,t3,n3])=>{let r3=t3.title??e3;if(t3.enum)return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),_("select",{required:n3,value:String(O2[e3]??""),onChange:t4=>B2(e3,t4.target.value||void 0),children:[g("option",{value:"",children:"—"}),t3.enum.map(e4=>g("option",{value:e4,children:e4},e4))]})]},e3);if(t3.type==="boolean")return _("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:!!O2[e3],onChange:t4=>B2(e3,t4.target.checked)}),g("span",{children:r3})]},e3);let i3=t3.type==="number"||t3.type==="integer";return _("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:r3}),g("input",{type:i3?"number":"text",step:t3.type==="integer"?1:"any",required:n3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t4=>B2(e3,t4.target.value===""?void 0:i3?Number(t4.target.value):t4.target.value)})]},e3)}),_("label",{className:"core-event-log__field",children:[g("span",{className:"core-event-log__label",children:"Note"}),g("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),a2&&A2.trim()?_("label",{className:"core-event-log__check",children:[g("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),g("span",{children:"Staff only: the client won't see this note"})]}):null,I2?g("p",{id:`${d2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,g("div",{className:"core-event-log__actions",children:g("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!r2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Fa=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ia(e2){let t2=E(),{view:n2="week",weekParam:r2="week",linkParams:i2,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,label:l2="Schedule",className:u2,style:d2}=e2,f2=e3=>`?${i2?new URLSearchParams({...i2,[r2]:e3}).toString():`${r2}=${e3}`}`,p2=Array.isArray(e2.occurrences)?e2.occurrences:[],m2=Mt(new Date,s2),h2=Nt(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:m2),v2=Array.from({length:7},(e3,t3)=>Y(h2,t3)),y2=new Map(v2.map(e3=>[e3,[]]));for(let e3 of p2)for(let t3 of Pt(e3,s2))y2.get(t3)?.push(e3);for(let e3 of y2.values())e3.sort((e4,t3)=>+!e4.startOn-!t3.startOn||(e4.startsAt??"").localeCompare(t3.startsAt??""));let x2=n2==="agenda"?v2.filter(e3=>y2.get(e3).length):v2;return _("section",{className:b("core-event-schedule",u2),"data-view":n2,style:d2,"aria-label":l2,children:[_("div",{className:"core-event-schedule__nav",children:[t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,-7)),"aria-label":"Previous week",children:"‹"}),g("span",{className:"core-event-schedule__range",children:`${Fa(v2[0],o2)} – ${Fa(v2[6],o2)}`}),t2?null:g("a",{className:"core-event-schedule__step",href:f2(Y(h2,7)),"aria-label":"Next week",children:"›"})]}),x2.length===0?g("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,g("ol",{className:"core-event-schedule__days",children:x2.map(e3=>{let t3=y2.get(e3);return _("li",{className:"core-event-schedule__day","data-today":e3===m2||void 0,children:[g("h3",{className:"core-event-schedule__date",children:Fa(e3,o2)}),t3.length?g("ul",{className:"core-event-schedule__events",children:t3.map((e4,t4)=>g("li",{children:bt(e4,c2,{href:Ft(a2,e4.id),locale:o2,timeZone:s2})??g(ka,{event:e4,href:Ft(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??t4}-${e4.startsAt??e4.startOn??t4}`))}):g("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var La=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ra(e2){let{eventHref:t2="?panel=event:{id}",emptyText:n2="No activity yet.",locale:r2,timeZone:i2,renderComponent:a2,className:o2,style:s2}=e2,c2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t3)=>new Date(t3.at).getTime()-new Date(e3.at).getTime()),l2=[];for(let e3 of c2){let t3=Mt(e3.at,i2),n3=l2[l2.length-1];n3&&n3[0]===t3?n3[1].push(e3):l2.push([t3,[e3]])}let u2=new Intl.DateTimeFormat(r2,{hour:"numeric",minute:"2-digit",timeZone:i2});return _("section",{className:b("core-event-timeline",o2),style:s2,"aria-label":"Activity",children:[l2.length===0?g("p",{className:"core-event-timeline__empty",children:n2}):null,l2.map(([e3,n3])=>_("section",{className:"core-event-timeline__day",children:[g("h3",{className:"core-event-timeline__date",children:La(e3,r2)}),g("ol",{className:"core-event-timeline__items",children:n3.map((e4,n4)=>_("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[_("div",{className:"core-event-timeline__line",children:[g("time",{className:"core-event-timeline__time",dateTime:e4.at,children:u2.format(new Date(e4.at))}),e4.summary?g("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?g("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?bt(e4.event,a2,{href:Ft(t2,e4.event.id),locale:r2,timeZone:i2})??g(ka,{event:e4.event,href:Ft(t2,e4.event.id),locale:r2,timeZone:i2}):null]},e4.id??`${e4.at}-${n4}`))})]},e3))]})}var za=1440;function Ba(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Va(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Ba(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Ha=e2=>e2.busyOnly===true;function Ua(e2,t2){if(!e2.startsAt)return null;let n2=Va(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Va(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function Wa(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){Pt(r3).includes(t2)&&i2.push(r3);continue}let e3=Ua(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?za:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Ha(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),za),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function Ga(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,za)}}function Ka(e2,t2=1){let n2=Y(Nt(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function qa(e2,t2,n2){return t2.filter(t3=>Wa(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var Ja=["circle","square","triangle","diamond","plus","hexagon"],Ya={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},Xa=e2=>Ja[(Math.max(1,Math.floor(e2))-1)%Ja.length],Za=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function Qa({series:e2,className:t2}){let n2=Za(e2);return g("svg",{className:t2?`core-series-glyph ${t2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":n2,"data-shape":Xa(n2),children:g("path",{d:Ya[Xa(n2)]})})}var $a=44,eo=28,to=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function no(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=p(()=>Date.now());return s(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function ro(e2){let{label:t2="Schedule",startHour:n2=7,endHour:r2=19,hourHeight:i2=64,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:c2,className:l2,style:u2}=e2,d2=(Array.isArray(e2.columns)?e2.columns:[]).filter(e3=>e3&&typeof e3.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e3.date)),m2=no(e2.now),v2=f(null),[y2,x2]=p(false);s(()=>{let e3=v2.current;if(!e3)return;let t3=()=>x2(e3.scrollWidth>e3.clientWidth+1);t3();let n3=new ResizeObserver(t3);return n3.observe(e3),()=>n3.disconnect()},[d2.length]);let C2=Va(m2,c2),w2=Math.ceil($a/Math.max(i2,24)*60),T2=d2.map(e3=>Wa(Array.isArray(e3.events)?e3.events:[],e3.date,{timeZone:c2,minMinutes:w2})),E2=T2.map(e3=>Math.max($a,eo*Math.max(1,...e3.blocks.map(e4=>e4.cols)))),{fromMin:D2,toMin:O2}=Ga(T2,n2,r2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e3,t3)=>D2+t3*60),j2=new Intl.DateTimeFormat(o2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(o2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e3=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e3,za-1)))),P2=e3=>e3.continuesBefore?e3.continuesAfter?"All day":`Until ${N2(e3.endMin)}`:e3.continuesAfter?`From ${N2(e3.startMin)}`:`${N2(e3.startMin)} – ${N2(e3.endMin)}`;return _("div",{ref:v2,className:b("core-hour-grid",l2),role:"group","aria-label":t2,tabIndex:y2?0:void 0,style:S({"--core-hour-grid-cols":String(d2.length),"--core-hour-grid-tracks":E2.map(e3=>`minmax(${e3}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e3,t3)=>e3+t3,0)}px`,"--core-hour-grid-hour":`${i2}px`,"--core-hour-grid-hours":String(k2/60)},u2),children:[_("div",{className:"core-hour-grid__head",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),d2.map(e3=>{let t3=C2?.date===e3.date,n3=_(h,{children:[g("span",{className:"core-hour-grid__label",children:e3.label}),e3.sublabel?g("span",{className:"core-hour-grid__sublabel",children:e3.sublabel}):null]}),r3=Rt(e3.href);return r3?g("a",{className:"core-hour-grid__day",href:r3,"data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id):g("div",{className:"core-hour-grid__day","data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id)})]}),T2.some(e3=>e3.allDay.length)?_("div",{className:"core-hour-grid__allday",children:[g("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e3,t3)=>g("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${d2[t3].label}`,children:e3.allDay.map((e4,t4)=>{let n3=io(e4)?void 0:Rt(Ft(a2,e4.id));return g("li",{className:"core-hour-grid__chip","data-busy":io(e4)||void 0,children:io(e4)?g("span",{className:"core-hour-grid__sr",children:"Busy all day"}):n3?g("a",{href:n3,children:e4.name}):e4.name},`${e4.id??t4}`)})},d2[t3].id))]}):null,_("div",{className:"core-hour-grid__body",children:[g("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e3,t3)=>g("span",{className:"core-hour-grid__tick",style:{top:to(e3,D2,k2)},"data-first":t3===0||void 0,children:t3===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e3/60)))},e3))}),T2.map((e3,t3)=>{let n3=d2[t3],r3=C2?.date===n3.date;return _("section",{className:"core-hour-grid__col","aria-label":n3.label,"data-today":r3||void 0,children:[g("ol",{className:"core-hour-grid__events",children:e3.blocks.map((e4,t4)=>{let n4=e4.event,r4={"--core-hour-grid-top":to(e4.startMin,D2,k2),"--core-hour-grid-height":`${((e4.shownEndMin-e4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(e4.col/e4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/e4.cols).toFixed(3)}%`};if(e4.busyOnly)return g("li",{className:"core-hour-grid__block","data-busy":"",style:S(r4),children:g("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(e4)}`})},t4);let i3=Rt(Ft(a2,n4.id)),o3=e4.endMin-e4.startMin,s2=o3<45?"short":o3<90?"medium":"long",c3=_(h,{children:[e4.overlaps?g("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,_("span",{className:"core-hour-grid__name",children:[typeof n4.series=="number"?g(Qa,{series:n4.series,className:"core-hour-grid__series"}):null,n4.name]}),g("span",{className:"core-hour-grid__time",children:P2(e4)}),s2==="long"&&n4.typeName?g("span",{className:"core-hour-grid__type",children:n4.typeName}):null]}),l3={className:"core-hour-grid__event","data-kind":n4.kind,"data-status":n4.status,"data-size":s2,"data-overlaps":e4.overlaps||void 0};return g("li",{className:"core-hour-grid__block","data-before":e4.continuesBefore||void 0,"data-after":e4.continuesAfter||void 0,style:S(r4),children:i3?g("a",{...l3,href:i3,children:c3}):g("div",{...l3,children:c3})},`${n4.id??"e"}-${t4}`)})}),r3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?g("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:to(C2.minutes,D2,k2)}}):null]},n3.id)})]})]})}var io=e2=>e2.busyOnly===true,$=/^\d{4}-\d{2}-\d{2}$/,ao=/^\d{2}:\d{2}$/,oo=(e2,t2)=>!e2||!$.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),so=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function co(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function lo(e2,t2){if(!$.test(e2)||!ao.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function uo(e2,t2){let n2=co(new Date(t2).toISOString(),e2);if(!n2)return 0;let[r2,i2,a2]=n2.date.split("-").map(Number),[o2,s2]=n2.time.split(":").map(Number);return Math.round((Date.UTC(r2,i2-1,a2,o2,s2)-Math.floor(t2/6e4)*6e4)/6e4)}function fo(e2,t2,n2){if($.test(e2)&&ao.test(t2)){if(!n2)return lo(e2,t2);try{let[r2,i2,a2]=e2.split("-").map(Number),[o2,s2]=t2.split(":").map(Number),c2=Date.UTC(r2,i2-1,a2,o2,s2),l2=c2;for(let e3=0;e3<4;e3++){let e4=c2-uo(n2,l2)*6e4;if(e4===l2)break;l2=e4}let u2=uo(n2,l2),d2=u2<0?"-":"+",f2=Math.abs(u2);return`${e2}T${t2}:00${d2}${String(Math.floor(f2/60)).padStart(2,"0")}:${String(f2%60).padStart(2,"0")}`}catch{return lo(e2,t2)}}}function po(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var mo=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function ho({days:e2,param:t2="date",viewParam:n2="view",keep:r2,locale:i2,className:a2,style:o2}){let s2=E(),c2=[...new Set(e2.filter(e3=>$.test(e3)))].sort();if(c2.length===0)return null;let l2=c2.length===1,u2=l2?`Events overlap on ${oo(c2[0],i2)}.`:`Events overlap on ${c2.length} days.`;return g("div",{className:b("core-overlap-notice",a2),style:o2,children:g(yn,{tone:"warning",message:u2,action:s2?void 0:_("span",{className:"core-overlap-notice__links",children:[l2?null:g("span",{className:"core-overlap-notice__lead",children:"Review:"}),c2.map(e3=>g("a",{className:"core-overlap-notice__review",href:mo(e3,t2,n2,r2),"aria-label":`Review ${oo(e3,i2)}`,children:l2?"Review":oo(e3,i2)},e3))]})})})}function go(e2){let{param:t2="type",cancelledParam:n2="cancelled",keep:r2,label:i2="Show",onChange:a2,className:o2,style:s2}=e2,l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),u2=c(),d2=l2.map(e3=>e3.id),f2=Array.isArray(e2.selected)?e2.selected:d2,p2=e2.showCancelled===true;if(l2.length===0)return null;let m2=e3=>{let r3=new FormData(e3);return{selected:r3.getAll(t2).map(String),showCancelled:r3.has(n2)}};return _("form",{className:b("core-calendar-filters",o2),style:s2,method:"get",action:"",onChange:e3=>{a2?a2(m2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>a2&&e3.preventDefault(),children:[Object.entries(r2??{}).map(([e3,t3])=>g("input",{type:"hidden",name:e3,value:t3},e3)),_("fieldset",{className:"core-calendar-filters__set",children:[g("legend",{className:"core-calendar-filters__legend",children:i2}),l2.map((e3,n3)=>_("label",{className:"core-calendar-filters__option",children:[g("input",{type:"checkbox",name:t2,value:e3.id,defaultChecked:f2.includes(e3.id)}),g(Qa,{series:Za(e3.series??n3+1)}),g("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),_("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[g("input",{type:"checkbox",name:n2,value:"1",defaultChecked:p2}),g("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),g("button",{type:"submit",className:"core-calendar-filters__apply",id:`${u2}-apply`,children:"Apply"})]})}var _o=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,vo=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function yo({month:e2,date:t2,highlight:n2="week",occurrences:r2,weekStartsOn:i2=1,param:a2="date",monthParam:o2="month",keep:s2,locale:c2,timeZone:l2,now:u2,className:d2,style:m2}){let h2=E(),v2=h2?"span":"a",y2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),x2=Va(Number.isFinite(y2)?y2:Date.now(),l2)?.date??"1970-01-01",S2=t2&&/^\d{4}-\d{2}-\d{2}$/.test(t2)?t2:x2,C2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:S2.slice(0,7),w2=`${C2}-01`,T2=Ka(w2,i2)[0],D2=Array.from({length:42},(e3,t3)=>Y(T2,t3)),O2=Array.from({length:6},(e3,t3)=>D2.slice(t3*7,t3*7+7)),k2=n2==="week"?new Set(Ka(S2,i2)):new Set([S2]),A2=Array.isArray(r2)?r2:[],j2=new Map(D2.map(e3=>{let t3=Wa(A2,e3,{timeZone:l2,minMinutes:0});return[e3,t3.blocks.length+t3.allDay.length]})),M2=(e3,t3)=>new Intl.DateTimeFormat(c2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),N2=M2({month:"long",year:"numeric"},w2),P2=O2[0].map(e3=>({short:M2({weekday:"narrow"},e3),long:M2({weekday:"long"},e3)})),F2=D2.includes(S2)?S2:D2.includes(x2)?x2:w2,[I2,L2]=p(null),R2=I2&&D2.includes(I2)?I2:F2,z2=f(null),B2=e3=>{D2.includes(e3)&&(L2(e3),z2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return _("div",{className:b("core-mini-month",d2),style:m2,children:[_("div",{className:"core-mini-month__head",children:[h2?null:g("a",{className:"core-mini-month__step","data-step":"prev",href:_o(s2,o2,vo(C2,-1)),"aria-label":"Previous month",children:"‹"}),g("div",{className:"core-mini-month__title",id:`mm-${C2}`,"aria-live":"polite",children:N2}),h2?null:g("a",{className:"core-mini-month__step","data-step":"next",href:_o(s2,o2,vo(C2,1)),"aria-label":"Next month",children:"›"})]}),_("div",{ref:z2,role:"grid","aria-labelledby":`mm-${C2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t3=e3.target.closest("[data-date]")?.dataset.date;if(!t3)return;let n3=O2.find(e4=>e4.includes(t3)),r3={ArrowLeft:Y(t3,-1),ArrowRight:Y(t3,1),ArrowUp:Y(t3,-7),ArrowDown:Y(t3,7),Home:n3[0],End:n3[6]};r3[e3.key]?(e3.preventDefault(),B2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),z2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[g("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:P2.map((e3,t3)=>g("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},t3))}),O2.map(e3=>g("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let t3=j2.get(e4)??0,n3=`${M2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===x2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`;return g("span",{role:"gridcell","aria-selected":e4===S2,className:"core-mini-month__cell","data-range":k2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==C2||void 0,children:_(v2,{className:"core-mini-month__day",href:h2?void 0:_o(s2,a2,e4),"data-date":e4,"data-today":e4===x2||void 0,"data-selected":e4===S2||void 0,"aria-current":e4===S2?"date":void 0,"aria-label":h2?void 0:n3,tabIndex:h2?void 0:e4===R2?0:-1,onFocus:()=>L2(e4),children:[h2?g("span",{className:"core-mini-month__sr",children:n3}):null,g("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),g("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":t3>0||void 0})]})},e4)})},e3[0]))]})]})}var bo=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function xo({date:e2,occurrences:t2,weekStartsOn:n2=1,param:r2="date",steps:i2=true,keep:a2,locale:o2,timeZone:s2,now:c2,className:l2,style:u2}){let d2=E(),f2=d2?"span":"a",p2=c2===void 0?Date.now():typeof c2=="number"?c2:new Date(c2).getTime(),m2=Va(Number.isFinite(p2)?p2:Date.now(),s2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,v2=Ka(h2,n2),y2=Array.isArray(t2)?t2:[],x2=new Intl.DateTimeFormat(o2,{weekday:"short",timeZone:"UTC"}),S2=new Intl.DateTimeFormat(o2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),C2=e3=>new Date(`${e3}T00:00:00Z`),w2=(e3,t3)=>`${S2.format(C2(e3))}${e3===m2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`,T2=new Map(v2.map(e3=>{let t3=Wa(y2,e3,{timeZone:s2});return[e3,t3.blocks.length+t3.allDay.length]}));return g("nav",{className:b("core-week-strip",l2),style:u2,"aria-label":"Week",children:_("div",{className:"core-week-strip__frame",children:[i2&&!d2?g("a",{className:"core-week-strip__step",href:bo(r2,Y(h2,-7),a2),"aria-label":"Previous week",children:"‹"}):null,g("ol",{className:"core-week-strip__days",children:v2.map(e3=>{let t3=T2.get(e3)??0;return g("li",{children:_(f2,{className:"core-week-strip__day",href:d2?void 0:bo(r2,e3,a2),"aria-current":e3===h2?"date":void 0,"aria-label":d2?void 0:w2(e3,t3),"data-selected":e3===h2||void 0,"data-today":e3===m2||void 0,children:[d2?g("span",{className:"core-week-strip__sr",children:w2(e3,t3)}):null,g("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:x2.format(C2(e3))}),g("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),g("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":t3>0||void 0})]})},e3)})}),i2&&!d2?g("a",{className:"core-week-strip__step",href:bo(r2,Y(h2,7),a2),"aria-label":"Next week",children:"›"}):null]})})}var So=[["day","Day"],["week","Week"],["agenda","Agenda"]];function Co(e2){let t2=E(),{weekStartsOn:n2=1,viewParam:r2="view",dateParam:i2="date",eventHref:a2,newEventHref:o2,summary:s2,notice:c2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,className:p2,style:m2}=e2,v2=e2.view==="day"||e2.view==="agenda"?e2.view:"week",y2=Array.isArray(e2.occurrences)?e2.occurrences:[],x2=e2.now===void 0?Date.now():typeof e2.now=="number"?e2.now:new Date(e2.now).getTime(),S2=Va(Number.isFinite(x2)?x2:Date.now(),f2)?.date??"1970-01-01",C2=e2.date&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)?e2.date:S2,w2=(e3,t3)=>`?${new URLSearchParams({[r2]:e3,[i2]:t3}).toString()}`,T2=v2==="day"?1:7,D2=Rt(o2),O2=(e3,t3)=>new Intl.DateTimeFormat(d2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),k2=Ka(C2,n2),A2=v2==="day"?O2({weekday:"long",month:"long",day:"numeric"},C2):`${O2({month:"short",day:"numeric"},k2[0])} – ${O2({month:"short",day:"numeric",year:"numeric"},k2[6])}`,j2=(t3,n3)=>g(ro,{columns:t3,label:n3,eventHref:a2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,now:e2.now}),M2=e3=>({id:e3,date:e3,label:`${O2({weekday:"short"},e3)} ${Number(e3.slice(8))}`,sublabel:e3===S2?"Today":void 0,events:y2}),N2=k2.map(e3=>({...M2(e3),href:t2?void 0:w2("day",e3)}));return _("section",{className:b("core-calendar","core-calendar-view",p2),style:m2,"aria-label":"Schedule","data-view":v2,children:[_("header",{className:"core-calendar__head",children:[g("h2",{className:"core-calendar__title",children:A2}),t2?null:_("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,-T2)),"aria-label":v2==="day"?"Previous day":"Previous week",children:"‹"}),g("a",{className:"core-calendar__today",href:w2(v2,S2),"aria-current":C2===S2||k2.includes(S2)?"date":void 0,children:"Today"}),v2==="agenda"?null:g("a",{className:"core-calendar__step",href:w2(v2,Y(C2,T2)),"aria-label":v2==="day"?"Next day":"Next week",children:"›"})]}),t2?null:g("nav",{className:"core-calendar__views","aria-label":"View",children:So.map(([e3,t3])=>g("a",{className:"core-calendar__view",href:w2(e3,C2),"aria-current":e3===v2?"page":void 0,children:t3},e3))}),D2?g("a",{className:"core-calendar__new",href:D2,children:"New event"}):null]}),s2?g("p",{className:"core-calendar__summary",children:s2}):null,c2?g("div",{className:"core-calendar__notice",children:c2}):null,v2==="day"?j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2)):null,v2==="week"?_(h,{children:[g("div",{className:"core-calendar__wide",children:j2(N2,`Week of ${O2({month:"long",day:"numeric"},k2[0])}`)}),_("div",{className:"core-calendar__narrow",children:[g(xo,{date:C2,occurrences:y2,weekStartsOn:n2,param:i2,steps:false,keep:{[r2]:"week"},locale:d2,timeZone:f2,now:e2.now}),j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2))]})]}):null,v2==="agenda"?g(Ia,{label:"Agenda",occurrences:y2,view:"agenda",weekOf:C2,weekParam:i2,linkParams:{[r2]:"agenda"},eventHref:a2,locale:d2,timeZone:f2}):null]})}var wo=new Set(["field","select","expand"]),To=(e2,t2)=>{let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2};function Eo(e2,t2){if(typeof e2!="function"||!wo.has(t2.kind)||typeof t2.name!="string")return;let n2=To(t2.name,80);if(n2==="")return;let r2=t2.value,i2=typeof r2=="string"?To(r2,200):typeof r2=="boolean"||typeof r2=="number"&&Number.isFinite(r2)?r2:void 0;try{e2(i2===void 0?{kind:t2.kind,name:n2}:{kind:t2.kind,name:n2,value:i2})}catch{}}var Do=["private","team","client"];function Oo(e2){let t2=Array.isArray(e2?.audiences)?e2.audiences:[];return Do.filter(e3=>t2.includes(e3))}function ko(e2,t2){if(t2.length!==0)return t2.includes(e2)?e2:t2.includes("team")?"team":t2[0]}function Ao(e2,t2="team"){let[n2,r2]=p(t2);return{value:ko(n2,e2),setValue:r2}}function jo(e2,t2){if(e2==="private")return"Only me and the people I add";if(e2==="team")return"My team";let n2=X(t2);return n2?`My team and ${n2}`:"My team and the client"}function Mo(e2){return e2==="client"?" The client can see it.":e2==="private"?" Only you and the people you add can see it.":""}function No({id:e2,audiences:t2,value:n2,onChange:r2,subjectName:i2,disabled:a2}){return t2.length===0||!n2?null:t2.length===1?_("p",{className:"core-intent-card__audience-fixed","data-audience":n2,children:[g("span",{className:"core-intent-card__label",children:"Who can see it"})," ",jo(n2,i2)]}):_("fieldset",{className:"core-intent-card__audience",disabled:a2,children:[g("legend",{className:"core-intent-card__label",children:"Who can see it"}),t2.map(t3=>_("label",{className:"core-intent-card__audience-row",children:[g("input",{type:"radio",name:`${e2}-audience`,value:t3,checked:n2===t3,onChange:()=>r2(t3)}),g("span",{children:jo(t3,i2)})]},t3))]})}var Po=50,Fo=["project","process","run","node","event"],Io=e2=>typeof e2=="string"&&e2.trim()!=="",Lo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Io(e3.name)).slice(0,Po),Ro=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&Io(e3.name)).slice(0,Po),zo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&Fo.includes(e3.kind)&&typeof e3.id=="string"&&Io(e3.label)).slice(0,Po);function Bo(e2){let t2=Lo(e2.people),n2=Ro(e2.assignees),r2=zo(e2.linkCandidates),[i2,a2]=p(new Set((Array.isArray(e2.attendeeIds)?e2.attendeeIds:[]).filter(e3=>typeof e3=="string"))),[o2,s2]=p(typeof e2.assigneeId=="string"&&n2.some(t3=>t3.id===e2.assigneeId)?e2.assigneeId:""),[c2,l2]=p(()=>zo(e2.links).slice(0,10)),u2=t2.filter(e3=>i2.has(e3.id)),d2=n2.find(e3=>e3.id===o2),f2=r2.length>0?c2:[];return{people:t2,assignees:n2,candidates:r2,guests:i2,setGuests:a2,assigneeId:o2,setAssigneeId:s2,links:f2,setLinks:l2,picked:u2,assignee:d2,write(e3){u2.length&&(e3.attendeeIds=u2.map(e4=>e4.id)),d2&&(e3.assigneeId=d2.id),f2.length&&(e3.links=f2.slice(0,10).map(e4=>({kind:e4.kind,id:e4.id})))}}}function Vo({extras:e2,disabled:t2}){let n2=c(),{people:r2,assignees:i2,candidates:a2,guests:o2,setGuests:s2,assigneeId:l2,setAssigneeId:u2,links:d2,setLinks:f2}=e2,p2=a2.filter(e3=>!d2.some(t3=>t3.kind===e3.kind&&t3.id===e3.id));return _(h,{children:[r2.length>0?_("fieldset",{className:"core-intent-card__people",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),r2.map(e3=>_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:o2.has(e3.id),onChange:t3=>s2(n3=>t3.target.checked?new Set([...n3,e3.id]):new Set([...n3].filter(t4=>t4!==e3.id)))}),g("span",{className:"core-intent-card__person-name",children:e3.name}),e3.role?g("span",{className:"core-intent-card__person-role",children:X(e3.role)}):null]},e3.id))]}):null,i2.length>0?g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),_("select",{value:l2,disabled:t2,onChange:e3=>u2(e3.target.value),children:[g("option",{value:"",children:"No one"}),i2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))]})]})}):null,a2.length>0?_("fieldset",{className:"core-intent-card__links",disabled:t2,children:[g("legend",{className:"core-intent-card__label",children:"Linked to (optional)"}),d2.length>0?g("ul",{className:"core-intent-card__chips",children:d2.map(e3=>_("li",{className:"core-intent-card__chip",children:[g("span",{className:"core-intent-card__chip-label",children:e3.label}),g("button",{type:"button",className:"core-intent-card__chip-remove","aria-label":`Remove link: ${e3.label}`,onClick:()=>f2(t3=>t3.filter(t4=>t4.kind!==e3.kind||t4.id!==e3.id)),children:g("span",{"aria-hidden":"true",children:"×"})})]},`${e3.kind}:${e3.id}`))}):null,p2.length>0&&d2.length<10?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",id:`${n2}-add`,children:"Add a link"}),_("select",{"aria-labelledby":`${n2}-add`,value:"",onChange:e3=>{let t3=p2.find(t4=>`${t4.kind}:${t4.id}`===e3.target.value);t3&&f2(e4=>[...e4,t3])},children:[g("option",{value:"",children:"Choose…"}),p2.map(e3=>g("option",{value:`${e3.kind}:${e3.id}`,children:e3.label},`${e3.kind}:${e3.id}`))]})]}):null]}):null]})}var Ho=[5,10,15,20,30,45,60,90],Uo={line:300,note:2e3},Wo=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"";function Go(e2){if(!e2)return At();let t2=new Date(e2);return Number.isNaN(t2.getTime())?At():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function Ko(e2){let{canWriteStaffNotes:t2=false,onIntent:n2,className:r2,style:i2}=e2,a2=X(e2.subjectName),o2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],l2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},u2=c(),{run:d2,busy:m2,message:h2,available:v2}=Lt(n2),[y2,x2]=p(o2.find(e3=>e3.id===l2.typeId)?.id??o2[0]?.id??""),S2=Oo(o2.find(e3=>e3.id===y2)),C2=Ao(S2),[w2,T2]=p(Go(l2.startsAt)),[E2,D2]=p(typeof l2.durationMin=="number"&&l2.durationMin>0?String(Math.round(l2.durationMin)):""),O2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:l2.attendeeIds}),[k2,A2]=p(Wo(l2.outcome,Uo.line)),[j2,M2]=p(Wo(l2.followUp,Uo.line)),[N2,P2]=p(Wo(l2.note,Uo.note)),[F2,I2]=p(t2),[L2,R2]=p(null),z2=f(null);s(()=>{L2&&z2.current?.focus({preventScroll:true})},[L2]);let B2=L2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(B2){let e3=Rt(B2.href);return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":"logged",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:["Logged",a2?` · ${a2}`:""]}),g("p",{className:"core-intent-card__title",children:B2.name??"Logged"})]}),e3?g("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(o2.length===0)return g("p",{className:b("core-intent-card","core-log-card","core-log-card__empty",r2),style:i2,children:"There’s nothing you can log here."});let ee2=o2.find(e3=>e3.id===y2),V2=v2&&m2===null,H2=v2&&!!a2&&!!ee2&&!!w2,U2=v2?a2?"":"Choose who this is about before logging.":It,W2=async e3=>{if(e3.preventDefault(),!H2||m2!==null||!ee2)return;let n3={typeId:ee2.id,startsAt:kt(w2),tzid:Ot()};C2.value&&(n3.audience=C2.value),E2&&(n3.durationMin=Number(E2)),O2.write(n3),k2.trim()&&(n3.outcome=k2.trim()),j2.trim()&&(n3.followUp=j2.trim()),N2.trim()&&(n3.note=N2.trim(),n3.staffOnly=t2&&F2);let{ok:r3,result:i3}=await d2("log_event",n3);r3&&R2({name:ee2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},G2=!V2;return _("form",{className:b("core-intent-card","core-log-card",r2),style:i2,"data-state":v2?"editing":"display",onSubmit:e3=>void W2(e3),"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{className:"core-intent-card__eyebrow",children:"Log"}),g("p",{className:"core-intent-card__title",children:a2??"Who is this about?"})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:y2,disabled:G2,onChange:e3=>x2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"When"}),g("input",{type:"datetime-local",required:true,value:w2,readOnly:G2,onChange:e3=>T2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),_("select",{value:E2,disabled:G2,onChange:e3=>D2(e3.target.value),children:[g("option",{value:"",children:"—"}),[...new Set([...Ho,...E2?[Number(E2)]:[]])].sort((e3,t3)=>e3-t3).map(e3=>g("option",{value:e3,children:`${e3} min`},e3))]})]})}),g(Vo,{extras:O2,disabled:G2}),g(No,{id:u2,audiences:S2,value:C2.value,onChange:C2.setValue,subjectName:a2,disabled:G2}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Outcome"}),g("input",{value:k2,maxLength:Uo.line,readOnly:G2,onChange:e3=>A2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Follow-up"}),g("input",{value:j2,maxLength:Uo.line,readOnly:G2,onChange:e3=>M2(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{rows:Math.min(10,Math.max(2,N2.split("\n").length+Math.floor(N2.length/40))),maxLength:Uo.note,value:N2,readOnly:G2,onChange:e3=>P2(e3.target.value)})]}),t2&&N2.trim()?_("label",{className:"core-log-card__check",children:[g("input",{type:"checkbox",checked:F2,disabled:G2,onChange:e3=>I2(e3.target.checked)}),g("span",{children:"Staff only: the client won’t see this note"})]}):null,h2?g("p",{id:`${u2}-message`,className:"core-intent-card__message",role:"alert",children:h2}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:H2?`Log saves this to ${a2}’s file.`:U2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!H2||m2!==null,"aria-describedby":`${u2}-does`,children:m2==="log_event"?"Logging…":"Log"})})]})}var qo=250,Jo=500,Yo=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function Xo({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:i2="",onValueChange:o2,onSelect:l2,orientation:d2="vertical",debounceMs:m2=150,minChars:h2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=c(),C2=`${S2}-list`,[w2,T2]=p(i2),E2=r2??w2,[D2,O2]=p(y2),[k2,A2]=p(y2),[j2,M2]=p([]),[N2,P2]=p("idle"),[F2,I2]=p(null),[L2,R2]=p(""),z2=f(0),B2=f({onValueChange:o2,onSelect:l2,loadOptions:n2});B2.current={onValueChange:o2,onSelect:l2,loadOptions:n2};let ee2=u(()=>n2?j2:(t2??[]).filter(e3=>Yo(e3,E2)),[n2,j2,t2,E2]),V2=!!n2,H2=E2.trim().length>=h2,U2=H2?ee2:[];s(()=>{if(!V2||!D2)return;if(!H2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},m2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,H2,V2,m2]);let W2=V2?N2:!D2||!H2?"idle":U2.length?"ready":"empty";s(()=>{F2!==null&&!U2.some(e3=>e3.id===F2)&&I2(null)},[U2,F2]),s(()=>{if(!k2||W2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=W2==="loading"?"Loading results":W2==="error"?x2.split("{query}").join(e3):W2==="empty"?b2.split("{query}").join(e3):`${U2.length} ${U2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),W2==="loading"?Jo:qo);return()=>clearTimeout(n3)},[W2,U2.length,k2,E2,b2,x2]);let G2=a(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),K2=a(()=>{A2(false),I2(null)},[]),te2=a(e3=>{e3.disabled||(_2&&G2(e3.label),B2.current.onSelect?.(e3),g2&&K2())},[_2,G2,g2,K2]),ne2=e3=>`${S2}-opt-${e3.id}`,re2=k2&&U2.length>0,ie2=re2?U2.find(e3=>e3.id===F2):void 0,q2=e3=>{if(U2.length===0)return;let t3=U2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:U2,status:W2,statusText:L2,open:re2,activeId:F2,close:K2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":re2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":ie2?ne2(ie2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),G2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=d2==="horizontal"?"ArrowRight":"ArrowDown",n3=d2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?q2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&re2&&ie2?(e3.preventDefault(),q2(e3.key===t3?1:-1)):e3.key==="Enter"&&ie2?(e3.preventDefault(),te2(ie2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),K2()):e3.key==="Tab"&&K2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>K2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":d2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:ne2(e3),role:"option","aria-selected":e3.id===ie2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===ie2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>te2(e3)}),query:E2}}function Zo({text:e2,match:t2}){let n2=t2?e2.toLowerCase().indexOf(t2.trim().toLowerCase()):-1;if(n2<0||!t2.trim())return g(h,{children:e2});let r2=n2+t2.trim().length;return _(h,{children:[e2.slice(0,n2),g("mark",{className:"core-combobox__match",children:e2.slice(n2,r2)}),e2.slice(r2)]})}function Qo({placeholder:e2,emptyText:t2="No results",errorText:n2="Could not load results",renderOption:r2,className:i2,style:a2,...o2}){let l2=Xo({...o2,emptyText:t2,errorText:n2}),u2=l2.query.trim().slice(0,60),d2=f(null),p2=o2.orientation==="horizontal",m2=c(),v2=[];for(let e3 of l2.options){let t3=p2?void 0:e3.group,n3=v2[v2.length-1];n3&&n3.group===t3?n3.options.push(e3):v2.push({group:t3,options:[e3]})}s(()=>{l2.activeId!==null&&d2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[l2.activeId]);let y2=l2.status==="empty"?t2.split("{query}").join(u2):l2.status==="error"?n2.split("{query}").join(u2):l2.status==="loading"?"Loading…":null;return _("div",{className:b("core-combobox",i2),style:a2,"data-orientation":o2.orientation??"vertical","data-status":l2.status,children:[g("input",{...l2.inputProps,type:"text",className:"core-combobox__input",placeholder:e2}),g("ul",{ref:d2,...l2.listboxProps,className:"core-combobox__list",hidden:!l2.open,children:v2.map((e3,t3)=>{let n3=e3.options.map(e4=>g("li",{...l2.getOptionProps(e4),className:"core-combobox__option",children:r2?r2(e4,l2.query):_(h,{children:[g("span",{className:"core-combobox__label",children:g(Zo,{text:e4.label,match:e4.highlight??l2.query})}),e4.description?g("span",{className:"core-combobox__description",children:e4.description}):null]})},e4.id));return e3.group?_("li",{role:"presentation",className:"core-combobox__section",children:[g("span",{id:`${m2}-${t3}`,className:"core-combobox__heading",children:e3.group}),g("ul",{role:"group","aria-labelledby":`${m2}-${t3}`,className:"core-combobox__group",children:n3})]},`g${t3}`):n3})}),y2&&!l2.open?g("p",{className:"core-combobox__note","data-status":l2.status,"aria-hidden":"true",children:y2}):null,g("span",{...l2.statusProps,className:"core-combobox__status",children:l2.statusText})]})}var $o=["saved","assigned","event","archived","discarded","unavailable"],es=6e3;function ts(e2){let{locale:t2,timeZone:n2,searchTargets:r2,onIntent:i2,className:a2,style:o2}=e2,l2=e2.note&&typeof e2.note=="object"&&(e2.note.state==="unavailable"||typeof e2.note.body=="string")?e2.note:null,u2=c(),{run:d2,busy:m2,message:v2,available:y2}=Lt(i2),[x2,S2]=p(null),C2=l2?.state&&$o.includes(l2.state)?l2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=p(false),D2=f(null),O2=f(null),k2=f(null);s(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),s(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=p(false),[M2,N2]=p(false),P2=f(null);s(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=p(void 0),[L2,R2]=p(false),z2=f(null);if(s(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!l2)return null;if(C2==="unavailable")return g("div",{role:"group","aria-label":"Note",className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":"unavailable",children:g("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=l2.createdAt&&!Number.isNaN(new Date(l2.createdAt).getTime())?new Intl.DateTimeFormat(t2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:n2}).format(new Date(l2.createdAt)):"",V2=Rt(l2.eventHref),H2=m2===null,U2=async e3=>{let{ok:t3}=await d2("assign",{targetId:e3.id,...A2?{keepPrivate:true}:{},...e3.data&&typeof e3.data=="object"&&"kind"in e3.data?{targetKind:e3.data.kind}:{}});t3&&(I2(e3.label),S2("assigned"),R2(false))},W2=async()=>{let{ok:e3}=await d2("make_event");e3&&S2("started")},G2=()=>{let e3=async()=>{O2.current=null,D2.current=null;let{ok:e4}=await d2("archive");E2(false),e4&&S2("archived")};O2.current=()=>void e3(),D2.current=setTimeout(()=>void e3(),es),E2(true)},K2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},te2=async()=>{let{ok:e3}=await d2("discard");N2(false),e3&&S2("discarded")},ne2=async()=>{let{ok:e3}=await d2("ask_instead");e3&&S2("asked")},re2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??l2.assignedToName?` to ${F2??l2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return _("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:b("core-intent-card","core-quick-note-card","core-note-card",a2),style:o2,"data-state":T2?"archived":w2,"aria-busy":m2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:re2}),g("p",{className:"core-note-card__body",children:l2.body}),_("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&V2?g("a",{className:"core-note-card__go",href:V2,children:"Go to event"}):null,v2?g("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?g("div",{className:"core-intent-card__actions",children:g("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:K2,children:"Undo"})}):null,B2?_(h,{children:[L2&&r2?_("div",{className:"core-note-card__picker",children:[g(Qo,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:r2,onSelect:e3=>void U2(e3),defaultOpen:false}),_("label",{className:"core-note-card__private-check",children:[g("input",{type:"checkbox",checked:A2,disabled:!H2,onChange:e3=>j2(e3.target.checked)}),g("span",{children:"Keep this note private"})]})]}):null,g("p",{className:"core-intent-card__does",id:`${u2}-does`,children:(e3=>y2?e3:It)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!y2||!r2||!H2,"aria-expanded":L2,"aria-describedby":`${u2}-does`,onClick:()=>R2(e3=>!e3),children:"Assign"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>void W2(),children:"Make event"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:G2,children:"Archive"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!y2||!H2,"aria-describedby":`${u2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?_("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[g("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!H2,onClick:()=>void te2(),children:m2==="discard"?"Discarding…":"Yes, discard"}),g("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!H2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,g("button",{type:"button",className:"core-note-card__instead",disabled:!y2||!H2,onClick:()=>void ne2(),children:"Ask the assistant instead"})]}):null]})}var ns=[15,30,45,60,90],rs=30,is=200,as=3,os=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function ss(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""&&e3.kind!=="record"),u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=co(u2.startsAt,n2),[C2,w2]=p(l2.find(e3=>e3.id===u2.typeId)?.id??l2[0]?.id??""),[T2,E2]=p((typeof u2.title=="string"?u2.title:"").slice(0,is)),D2=n2??Ot(),O2=!(typeof u2.startOn=="string"&&$.test(u2.startOn))&&!S2,[k2,A2]=p(typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:S2?.date??po(D2)),[j2,M2]=p(S2?.time??""),[N2,P2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):rs)),F2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:u2.attendeeIds}),I2=Oo(l2.find(e3=>e3.id===C2)),L2=Ao(I2),[R2,z2]=p(false),[B2,ee2]=p(null),V2=f(null),H2=f(null),U2=f(false);s(()=>{if(U2.current)return;if(O2){A2(po(D2));return}if(!u2.startsAt)return;let e3=co(u2.startsAt,n2);e3&&(A2(e3.date),M2(e3.time))},[u2.startsAt,n2,O2,D2]),s(()=>{R2&&H2.current?.focus({preventScroll:true})},[R2]),s(()=>{B2&&V2.current?.focus({preventScroll:true})},[B2]);let W2=B2??(e2.booked&&typeof e2.booked=="object"?e2.booked:null);if(W2){let e3=Rt(W2.href);return _("section",{ref:V2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":"booked",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Booked",o2?` · ${o2}`:""]}),g("p",{className:"core-intent-card__title",children:W2.name??"Booked"}),W2.when?g("span",{className:"core-book-event-card__when",children:W2.when}):null]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}if(l2.length===0)return g("p",{className:b("core-intent-card","core-book-event-card","core-book-event-card__empty",i2),style:a2,children:"There’s nothing you can book here."});let G2=l2.find(e3=>e3.id===C2),K2=x2&&v2===null,te2=x2&&!!o2&&!!G2&&$.test(k2),ne2=x2?o2?k2?"":"Choose a day to book.":"Choose whose file this goes in first.":It,re2=$.test(k2)&&/^\d{2}:\d{2}$/.test(j2),ie2=re2?fo(k2,j2,D2):void 0,q2=Number(N2),ae2=ie2?new Date(ie2).getTime()<Date.now():$.test(k2)?k2<new Intl.DateTimeFormat("en-CA").format(new Date):false,oe2=[...new Set([...ns,...Number.isInteger(q2)&&q2>0?[q2]:[]])].sort((e3,t3)=>e3-t3),se2=F2.picked,ce2=`${oo(k2,t2)}${re2?`, ${so(j2,t2)}`:""}`,le2=re2?` (${os(q2||rs)})`:" (all day)",ue2=se2.length?` With ${se2.slice(0,as).map(e3=>e3.name).join(", ")}${se2.length>as?` and ${se2.length-as} more`:""}.`:"",de2=F2.assignee,fe2=`Book this? It goes on the schedule for ${ce2}${le2}.${ue2}${de2?` Assigned to ${de2.name}.`:""}${Mo(L2.value)}${e2.invitesSent===true&&se2.length?" They are invited.":""}`,pe2=async()=>{if(!te2||v2!==null||!G2)return;let e3={typeId:G2.id};T2.trim()&&(e3.title=T2.trim()),e3.tzid=D2,ie2?(e3.startsAt=ie2,e3.durationMin=q2>0?q2:rs):e3.startOn=k2,L2.value&&(e3.audience=L2.value),F2.write(e3);let{ok:t3,result:n3}=await m2("book_event",e3);z2(false),t3&&ee2({name:T2.trim()||G2.name,when:ce2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},me2=e3=>{e3.preventDefault(),te2&&v2===null&&z2(true)},he2=e3=>t3=>{U2.current=true,e3(t3)};return _("form",{tabIndex:-1,ref:V2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card",i2),style:a2,"data-state":R2?"confirming":"proposed",onSubmit:me2,"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:C2,disabled:!K2||R2,onChange:e3=>w2(e3.target.value),children:l2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Title (optional)"}),g("input",{value:T2,maxLength:is,readOnly:!K2||R2,placeholder:G2?.name,onChange:e3=>E2(e3.target.value)})]})]}),_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Day"}),g("input",{type:"date",value:k2,required:true,readOnly:!K2||R2,onChange:e3=>he2(A2)(e3.target.value)})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:k2?j2:"",readOnly:!K2||R2,disabled:!k2,onChange:e3=>he2(M2)(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"How long"}),g("select",{value:N2,disabled:!K2||R2||!re2,onChange:e3=>P2(e3.target.value),children:oe2.map(e3=>g("option",{value:e3,children:os(e3)},e3))})]})}),g(Vo,{extras:F2,disabled:!K2||R2}),g(No,{id:d2,audiences:I2,value:L2.value,onChange:L2.setValue,subjectName:o2,disabled:!K2||R2}),ae2&&!R2?g("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,R2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm booking",children:fe2}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void pe2(),children:v2==="book_event"?"Booking…":"Yes, book"}),g("button",{ref:H2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>z2(false),children:"Cancel"})]},"confirm-actions")]}):_(h,{children:[ne2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:ne2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!te2||v2!==null,"aria-describedby":ne2?`${d2}-does`:void 0,children:"Book"})},"book-actions")]})]})}var cs=[15,30,45,60,90],ls=30,us=200,ds=200,fs=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`,ps={title:"title",name:"title",startsAt:"when",startOn:"when",date:"when",time:"when",durationMin:"duration",assigneeId:"assignee",location:"location",audience:"audience"};function ms(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.subjectName),l2=e2.current&&typeof e2.current=="object"?e2.current:{},u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),S2=n2??l2.tzid??Ot(),C2=co(l2.startsAt,S2),w2=C2?.date??(typeof l2.startOn=="string"&&$.test(l2.startOn)?l2.startOn:""),T2=C2?.time??"",E2=typeof l2.durationMin=="number"&&l2.durationMin>0?Math.round(l2.durationMin):ls,D2=(typeof l2.name=="string"?l2.name:"").slice(0,us),O2=(Array.isArray(e2.assignees)?e2.assignees:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"),k2=l2.assigneeId?O2.find(e3=>e3.id===l2.assigneeId)?.id??"":O2.find(e3=>e3.name===l2.assigneeName)?.id??"",A2=co(u2.startsAt,S2),j2=typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:void 0,[M2,N2]=p(typeof u2.title=="string"?u2.title.slice(0,us):D2),[P2,F2]=p(A2?.date??j2??w2),[I2,L2]=p(A2?A2.time:j2?"":T2),R2=(typeof l2.location=="string"?l2.location:"").slice(0,ds),[z2,B2]=p(typeof u2.location=="string"?u2.location.slice(0,ds):R2),[ee2,V2]=p(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):E2)),H2=Bo({assignees:O2,assigneeId:typeof u2.assigneeId=="string"?u2.assigneeId:k2}),U2=Oo((Array.isArray(e2.types)?e2.types:[]).find(e3=>e3&&typeof e3=="object"&&(e3.id===l2.typeId||!l2.typeId&&e3.name===l2.typeName))),W2=Ao(U2,U2.includes(l2.audience)?l2.audience:"team"),[G2,K2]=p(false),[te2,ne2]=p(null),re2=f(null),ie2=f(null);s(()=>{G2&&ie2.current?.focus({preventScroll:true})},[G2]),s(()=>{te2&&re2.current?.focus({preventScroll:true})},[te2]);let q2=te2??(e2.updated&&typeof e2.updated=="object"?{kind:"updated",...e2.updated}:e2.cancelled&&typeof e2.cancelled=="object"?{kind:"cancelled",...e2.cancelled}:e2.assigned&&typeof e2.assigned=="object"?{kind:"assigned",...e2.assigned}:l2.status==="cancelled"?{kind:"cancelled",name:l2.name}:null);if(q2){let e3=q2.kind==="updated"?Rt(q2.href):void 0;return _("section",{ref:re2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":q2.kind,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[q2.kind==="updated"?"Updated":q2.kind==="assigned"?"Assigned to you":"Cancelled",o2?` · ${o2}`:""]}),g("p",{className:b("core-intent-card__title",q2.kind==="cancelled"&&"core-edit-event-card__struck"),children:q2.name??l2.name??"Done"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let ae2=!(x2&&v2===null)||G2,oe2=$.test(P2)&&/^\d{2}:\d{2}$/.test(I2),se2=Number(ee2),ce2=[...new Set([...cs,...Number.isInteger(se2)&&se2>0?[se2]:[],E2])].sort((e3,t3)=>e3-t3),le2=new Set((Array.isArray(e2.changed)?e2.changed:[]).map(e3=>ps[e3]).filter(Boolean)),ue2=P2!==w2||I2!==T2,de2=oe2&&se2!==E2,fe2=H2.assigneeId!==k2,pe2=W2.value!==void 0&&W2.value!==(U2.includes(l2.audience)?l2.audience:"team"),me2=M2.trim()!==D2.trim(),he2=z2.trim()!==R2.trim(),J2={title:me2||le2.has("title"),when:ue2||le2.has("when"),duration:de2||le2.has("duration"),location:he2||le2.has("location"),assignee:fe2||le2.has("assignee"),audience:pe2||le2.has("audience")},ge2=me2||ue2||de2||he2||fe2||pe2,_e2=x2&&!!$.test(P2)&&M2.trim()!==""&&ge2,ve2=x2?M2.trim()?$.test(P2)?ge2?"":"Change something to save it.":"Choose a day.":"The event needs a title.":It,ye2=w2?`${oo(w2,t2)}${T2?`, ${so(T2,t2)}`:" (all day)"}`:"No time set",be2=(e3,t3,n3)=>J2[e3]?_("span",{className:"core-edit-event-card__was",id:n3,children:[g("span",{className:"core-edit-event-card__was-label",children:"Was"})," ",t3]}):null,xe2=e3=>b("core-intent-card__field",J2[e3]&&"core-edit-event-card__changed"),Se2=async()=>{if(!_e2||v2!==null)return;let e3={};me2&&(e3.title=M2.trim()),ue2&&(S2!==l2.tzid&&(e3.tzid=S2),oe2?e3.startsAt=fo(P2,I2,S2):e3.startOn=P2),de2&&(e3.durationMin=se2>0?se2:ls),he2&&(e3.location=z2.trim()),fe2&&(e3.assigneeId=H2.assigneeId===""?null:H2.assigneeId),pe2&&W2.value&&(e3.audience=W2.value);let{ok:t3,result:n3}=await m2("update_event",e3);t3&&ne2({kind:"updated",name:M2.trim()||D2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},Ce2=!l2.assigneeId&&!l2.assigneeName,we2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("assign_self");e3&&ne2({kind:"assigned",name:D2})},Te2=async()=>{if(v2!==null)return;let{ok:e3}=await m2("cancel_event");K2(false),e3&&ne2({kind:"cancelled",name:D2})};return _("form",{tabIndex:-1,ref:re2,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":G2?"cancelling":"editing",onSubmit:e3=>{e3.preventDefault(),_e2&&v2===null&&Se2()},"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:["Change a meeting",o2?` · ${o2}`:""]})}),_("div",{className:"core-intent-card__row",children:[l2.typeName?_("div",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("span",{className:"core-edit-event-card__fixed",children:l2.typeName})]}):null,_("div",{className:xe2("title"),"data-changed":J2.title?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-title`,children:"Title"}),g("input",{id:`${d2}-title`,value:M2,maxLength:us,readOnly:ae2,placeholder:l2.typeName,"aria-describedby":J2.title?`${d2}-title-was`:void 0,onChange:e3=>N2(e3.target.value)}),be2("title",D2||"No title",`${d2}-title-was`)]})]}),_("div",{className:"core-intent-card__row",children:[_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-day`,children:"Day"}),g("input",{id:`${d2}-day`,type:"date",value:P2,required:true,readOnly:ae2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>F2(e3.target.value)}),be2("when",ye2,`${d2}-when-was`)]}),_("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-time`,children:"Time (optional)"}),g("input",{id:`${d2}-time`,type:"time",value:P2?I2:"",readOnly:ae2,disabled:!P2,"aria-describedby":J2.when?`${d2}-when-was`:void 0,onChange:e3=>L2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("duration"),"data-changed":J2.duration?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-length`,children:"How long"}),g("select",{id:`${d2}-length`,value:ee2,disabled:ae2||!oe2,"aria-describedby":J2.duration?`${d2}-duration-was`:void 0,onChange:e3=>V2(e3.target.value),children:ce2.map(e3=>g("option",{value:e3,children:fs(e3)},e3))}),be2("duration",T2?fs(E2):"All day",`${d2}-duration-was`)]})}),g("div",{className:"core-intent-card__row",children:_("div",{className:xe2("location"),"data-changed":J2.location?"":void 0,children:[g("label",{className:"core-intent-card__label",htmlFor:`${d2}-location`,children:"Location (optional)"}),g("input",{id:`${d2}-location`,value:z2,maxLength:ds,readOnly:ae2,"aria-describedby":J2.location?`${d2}-location-was`:void 0,onChange:e3=>B2(e3.target.value)}),be2("location",R2||"No location",`${d2}-location-was`)]})}),_("div",{className:b(J2.assignee&&"core-edit-event-card__changed-block"),"data-changed":J2.assignee?"":void 0,children:[g(Vo,{extras:H2,disabled:ae2}),be2("assignee",l2.assigneeName??"No one")]}),_("div",{className:b(J2.audience&&"core-edit-event-card__changed-block"),"data-changed":J2.audience?"":void 0,children:[g(No,{id:d2,audiences:U2,value:W2.value,onChange:W2.setValue,subjectName:o2,disabled:ae2}),be2("audience",l2.audience?jo(l2.audience,o2):"")]}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,G2?_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,role:"group","aria-label":"Confirm cancelling",children:"Cancel this event? It can’t be undone from here."}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void Te2(),children:v2==="cancel_event"?"Cancelling…":"Yes, cancel the event"}),g("button",{ref:ie2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>K2(false),children:"Keep it"})]},"cancel-actions")]}):_(h,{children:[ve2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:ve2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!_e2||v2!==null,"aria-describedby":ve2?`${d2}-does`:void 0,children:v2==="update_event"?"Saving…":"Save changes"}),Ce2?g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>void we2(),children:v2==="assign_self"?"Assigning…":"Assign to me"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>K2(true),children:"Cancel the event"})]},"save-actions")]})]})}var hs=4e3;function gs(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=X(e2.eventName),a2=X(e2.subjectName),o2=c(),{run:l2,busy:u2,message:d2,available:m2}=Lt(t2),[h2,v2]=p((typeof e2.body=="string"?e2.body:"").slice(0,hs)),[y2,x2]=p(false),[S2,C2]=p(null),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=S2??(e2.noted&&typeof e2.noted=="object"?e2.noted:null);if(T2){let e3=Rt(T2.href);return _("section",{ref:w2,tabIndex:-1,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"noted",children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Noted",i2?` · ${i2}`:""]}),g("p",{className:"core-intent-card__title",children:T2.name??i2??"Noted"})]}),e3?g("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let E2=m2&&u2===null,D2=m2&&!!i2&&h2.trim()!=="",O2=m2?i2?h2.trim()===""?"Write the note first.":"":"Choose the event first.":It,k2=async()=>{if(!D2||u2!==null)return;let e3={body:h2.trim()};y2&&(e3.audience="client");let{ok:t3,result:n3}=await l2("add_note",e3);t3&&C2({name:i2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})};return _("form",{tabIndex:-1,ref:w2,"aria-labelledby":`${o2}-status`,className:b("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"proposed",onSubmit:e3=>{e3.preventDefault(),k2()},"aria-busy":u2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:_("span",{id:`${o2}-status`,className:"core-intent-card__eyebrow",children:["Add a note",i2?` · ${i2}`:""]})}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Note"}),g("textarea",{value:h2,rows:4,maxLength:hs,readOnly:!E2,onChange:e3=>v2(e3.target.value)})]}),a2?_("label",{className:"core-intent-card__person",children:[g("input",{type:"checkbox",checked:y2,disabled:!E2,onChange:e3=>x2(e3.target.checked)}),_("span",{className:"core-intent-card__person-name",children:["Share with ",a2]})]}):null,g("p",{className:"core-intent-card__does",id:`${o2}-does`,children:O2||(y2?`${a2} will see this note.`:"Only staff will see this note.")}),d2?g("p",{className:"core-intent-card__message",role:"alert",children:d2}):null,g("div",{className:"core-intent-card__actions",children:g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!D2||u2!==null,"aria-describedby":`${o2}-does`,children:u2==="add_note"?"Adding…":"Add note"})},"note-actions")]})}var _s=["proposed","created","done"],vs=200;function ys(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""),l2=X(e2.subjectName),u2=e2.task&&typeof e2.task=="object"&&typeof e2.task.title=="string"?e2.task:null,d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(r2),[S2,C2]=p((u2?.title??"").slice(0,vs)),w2=co(u2?.dueAt,n2),T2=n2??Ot(),E2=!(u2?.dueOn&&$.test(u2.dueOn))&&!w2,[D2,O2]=p(u2?.dueOn&&$.test(u2.dueOn)?u2.dueOn:w2?.date??po(T2)),[k2,A2]=p(w2?.time??""),j2=f(false);s(()=>{if(j2.current)return;if(E2){O2(po(T2));return}if(!u2?.dueAt)return;let e3=co(u2.dueAt,n2);e3&&(u2.dueOn&&$.test(u2.dueOn)||O2(e3.date),A2(e3.time))},[u2?.dueAt,u2?.dueOn,n2,E2,T2]);let M2=Bo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links}),[N2,P2]=p(o2.find(e3=>e3.id===u2?.typeId)?.id??o2[0]?.id??""),F2=Oo(o2.find(e3=>e3.id===N2)),I2=Ao(F2),[L2,R2]=p(null),z2=u2?.state&&_s.includes(u2.state)?u2.state:"proposed",B2=L2&&_s.indexOf(L2)>_s.indexOf(z2)?L2:z2,ee2=f(null),V2=f(null),[H2,U2]=p(false);if(s(()=>{H2&&V2.current?.focus({preventScroll:true})},[H2]),s(()=>{L2&&ee2.current?.focus({preventScroll:true})},[L2]),!u2)return null;let W2=B2==="proposed"&&x2&&v2===null,G2=x2&&!!l2&&S2.trim()!=="",K2=async e3=>{if(e3.preventDefault(),!G2||v2!==null)return;let t3=D2||po(T2),n3=k2?fo(t3,k2,T2):void 0,r3={title:S2.trim(),...o2.length>0&&N2?{typeId:N2}:{},dueOn:t3,...n3?{dueAt:n3}:{},...I2.value?{audience:I2.value}:{},tzid:T2};M2.write(r3);let{ok:i3}=await m2("log_event",r3);i3&&R2("created")},te2=async()=>{let{ok:e3}=await m2("complete");U2(false),e3&&R2("done")},ne2=B2==="proposed"?{date:D2||po(T2),time:k2}:{date:u2.dueOn&&$.test(u2.dueOn)?u2.dueOn:co(u2.dueAt,n2)?.date??"",time:co(u2.dueAt,n2)?.time??""},re2=[ne2.date===po(T2)?"today":oo(ne2.date,t2),ne2.date&&ne2.time?so(ne2.time,t2):""].filter(Boolean).join(", "),ie2=B2==="proposed"?"Task · suggested":B2==="done"?"Task · done":"Task",q2=B2==="proposed"?G2?`Create task adds this to ${l2}’s tasks.`:x2?l2?"":"Choose whose file this goes in first.":It:B2==="created"?H2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return _("form",{ref:ee2,tabIndex:-1,"aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-task-card",i2),style:a2,"data-state":B2,onSubmit:e3=>void K2(e3),"aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[_("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:[ie2,l2?` · ${l2}`:""]}),B2==="proposed"&&o2.length>1?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Type"}),g("select",{value:N2,disabled:!W2,onChange:e3=>P2(e3.target.value),children:o2.map(e3=>g("option",{value:e3.id,children:e3.name},e3.id))})]}):null,B2==="proposed"?_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"What needs doing"}),g("input",{value:S2,maxLength:vs,readOnly:!W2,onChange:e3=>C2(e3.target.value),required:true})]}):g("p",{className:"core-intent-card__title core-task-card__title","data-done":B2==="done"?"":void 0,children:u2.title})]}),B2==="proposed"?_("div",{className:"core-intent-card__row",children:[_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Due"}),g("input",{type:"date",value:D2,readOnly:!W2,onChange:e3=>(j2.current=true,O2(e3.target.value))})]}),_("label",{className:"core-intent-card__field",children:[g("span",{className:"core-intent-card__label",children:"Time (optional)"}),g("input",{type:"time",value:D2?k2:"",readOnly:!W2,disabled:!D2,onChange:e3=>(j2.current=true,A2(e3.target.value))})]})]}):null,B2==="proposed"?g(Vo,{extras:M2,disabled:!W2}):null,B2==="proposed"?g(No,{id:d2,audiences:F2,value:I2.value,onChange:I2.setValue,subjectName:l2,disabled:!W2}):null,g("p",{className:"core-task-card__meta",children:[re2?`Due ${re2}`:"",u2.assigneeName?`For ${u2.assigneeName}`:""].filter(Boolean).join(" · ")||(B2==="proposed"?"":"No due date")}),y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,q2?g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:q2}):null,B2==="done"?null:g("div",{className:"core-intent-card__actions",children:B2==="proposed"?g("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!G2||v2!==null,"aria-describedby":`${d2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):H2?_(h,{children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void te2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),g("button",{ref:V2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>U2(false),children:"Cancel"})]}):g("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>U2(true),children:"Mark done"})})]})}function bs(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,o2=X(e2.scopeName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(r2),[y2,x2]=p(null),S2=f(null);if(s(()=>{y2&&S2.current?.focus({preventScroll:true})},[y2]),!o2)return null;let C2=e2.pointer&&typeof e2.pointer=="object"?e2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e3=typeof C2.at=="string"?new Date(C2.at):null;w2=e3&&!Number.isNaN(e3.getTime())?`Conversation · ${new Intl.DateTimeFormat(t2,{month:"short",day:"numeric",timeZone:n2}).format(e3)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=d2===null,E2=async e3=>{let{ok:t3}=await u2(e3);t3&&x2(e3==="dismiss"?"dismissed":"continued")},D2=y2==="continued"?"Picked up":y2==="dismissed"?"Dismissed":"Pick up where you left off";return _("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-handover-card",i2),style:a2,"data-state":y2??(v2?"offered":"display"),"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:D2}),g("p",{className:"core-intent-card__title",children:o2}),w2?g("span",{className:"core-handover-card__where",children:w2}):null]}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,y2?null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:v2?`Continue opens your earlier conversation about ${o2}. Dismiss hides this.`:It}),_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("handover_continue"),children:d2==="handover_continue"?"Opening…":"Continue"}),g("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var xs=12,Ss=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Cs(e2){let{typicalTime:t2,typicalCost:n2,costCap:r2,onIntent:i2,className:a2,style:o2}=e2,l2=X(e2.processName),u2=X(e2.subjectName),d2=c(),{run:m2,busy:v2,message:y2,available:x2}=Lt(i2),[S2,C2]=p(false),w2=f(null);if(s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!l2)return null;let T2=Ss(e2.description),E2=(Array.isArray(e2.needs)?e2.needs:[]).filter(e3=>e3&&typeof e3=="object"&&Ss(e3.label)).slice(0,xs),D2=[t2&&`Typical time: ${Ss(t2,60)}`,n2&&`Typical cost: ${Ss(n2,60)}`,r2&&`Cost cap: ${Ss(r2,60)}`].filter(Boolean).join(" · "),O2=e2.running&&typeof e2.running=="object"?e2.running:null,k2=Rt(O2?.href),A2=x2&&!!u2,j2=x2?u2?"":"Choose who this is for before starting.":It,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e3}=await m2("start_process");e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${d2}-status`,className:b("core-intent-card","core-start-process-card",a2),style:o2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${d2}-status`,className:"core-intent-card__eyebrow",children:M2}),g("p",{className:"core-intent-card__title",children:l2}),u2?_("span",{className:"core-start-process-card__for",children:["For ",u2]}):null]}),T2?g("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?_("div",{className:"core-start-process-card__needs",children:[g("span",{className:"core-start-process-card__label",children:"What it needs"}),g("ul",{children:E2.map((e3,t3)=>_("li",{"data-have":e3.have===true?"":void 0,children:[g("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),g("span",{children:Ss(e3.label)}),g("span",{className:"core-start-process-card__have",children:e3.have===true?"Have":"Needed"})]},t3))})]}):null,D2?g("p",{className:"core-start-process-card__meta",children:D2}):null,y2?g("p",{className:"core-intent-card__message",role:"alert",children:y2}):null,S2?g("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?g("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:_(h,{children:[g("p",{className:"core-intent-card__does",id:`${d2}-does`,children:A2?`Start begins ${l2} for ${u2}. Nothing is shared with ${u2} until you choose to share it.`:j2}),g("div",{className:"core-intent-card__actions",children:g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${d2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var ws=12,Ts=8,Es=600;function Ds(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=c(),{run:a2,busy:o2,message:l2,available:u2}=Lt(t2),[d2,m2]=p({}),[v2,y2]=p({}),[x2,S2]=p(null),C2=f(null),w2=f(false);s(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[d2]);let T2=new Set,E2=(Array.isArray(e2.parts)?e2.parts:[]).filter(e3=>!e3||typeof e3!="object"||typeof e3.id!="string"||typeof e3.text!="string"||!e3.text.trim()||T2.has(e3.id)?false:(T2.add(e3.id),true)).slice(0,ws);if(E2.length===0)return null;let D2=e3=>(Array.isArray(e3.matches)?e3.matches:[]).filter(e4=>e4&&typeof e4.id=="string"&&X(e4.name)&&(e4.kind==="client"||e4.kind==="project")).slice(0,Ts),O2=e3=>d2[e3.id]??(e3.state==="assigned"||e3.state==="dropped"?{state:e3.state,name:X(e3.assignedToName)}:null),k2=E2.filter(e3=>!O2(e3)),A2=k2.length===0,j2=async(e3,t3)=>{S2(e3.id);let{ok:n3}=await a2("confirm_part",{partId:e3.id,targetId:t3.id,targetKind:t3.kind});n3&&(w2.current=true,m2(n4=>({...n4,[e3.id]:{state:"assigned",name:X(t3.name)}})))},M2=async e3=>{S2(e3.id);let{ok:t3}=await a2("drop_part",{partId:e3.id});t3&&(w2.current=true,m2(t4=>({...t4,[e3.id]:{state:"dropped"}})))},N2=o2===null;return _("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${i2}-status`,className:b("core-intent-card","core-note-split-card",n2),style:r2,"data-state":A2?"sorted":u2?"open":"display","aria-busy":o2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${i2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),g("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),g("ol",{className:"core-note-split-card__parts",children:E2.map((e3,t3)=>{let n3=O2(e3),r3=D2(e3),a3=v2[e3.id]??(r3.length===1?r3[0].id:""),s2=r3.find(e4=>e4.id===a3),c2=e3.text.length>Es?`${e3.text.slice(0,599)}…`:e3.text,d3=`Part ${t3+1}`;return _("li",{className:"core-note-split-card__part","data-state":n3?.state??"open",children:[g("span",{className:"core-note-split-card__label",children:d3}),g("p",{className:"core-note-split-card__text",children:c2}),n3?g("p",{className:"core-note-split-card__result",children:n3.state==="dropped"?"Dropped":`Assigned${n3.name?` to ${n3.name}`:""}`}):_(h,{children:[r3.length===0?g("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):r3.length===1?_("p",{className:"core-note-split-card__hint",children:["Looks like ",g("strong",{children:X(r3[0].name)}),r3[0].detail?` · ${X(r3[0].detail)}`:"",". Confirm it, or drop the part."]}):_("fieldset",{className:"core-note-split-card__choices",disabled:!u2||!N2,children:[_("legend",{className:"core-note-split-card__hint",children:[r3.length," match: choose who this is for."]}),r3.map(t4=>_("label",{className:"core-note-split-card__choice",children:[g("input",{type:"radio",name:`${i2}-${e3.id}`,value:t4.id,checked:a3===t4.id,onChange:()=>y2(n4=>({...n4,[e3.id]:t4.id}))}),_("span",{children:[g("span",{className:"core-note-split-card__name",children:X(t4.name)}),g("span",{className:"core-note-split-card__detail",children:[t4.kind==="project"?"Project":"Client",X(t4.detail)].filter(Boolean).join(" · ")})]})]},t4.id))]}),x2===e3.id&&l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,_("div",{className:"core-intent-card__actions",children:[r3.length>0?g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!u2||!N2||!s2,"aria-label":`Confirm ${d3}${s2?` for ${X(s2.name)}`:""}`,onClick:()=>s2&&void j2(e3,s2),children:o2==="confirm_part"&&x2===e3.id?"Confirming…":"Confirm"}):null,g("button",{type:"button",className:"core-intent-card__button",disabled:!u2||!N2,"aria-label":`Drop ${d3}`,onClick:()=>void M2(e3),children:"Drop"})]})]})]},e3.id)})}),A2?null:g("p",{className:"core-intent-card__does",children:u2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":It})]})}var Os=20;function ks(e2){let{onIntent:t2,onCancel:n2,className:r2,style:i2}=e2,a2=e2.mode==="withdraw"?"withdraw":"share",o2=X(e2.clientName),l2=c(),{run:u2,busy:d2,message:m2,available:v2}=Lt(t2),[y2,x2]=p(false),[S2,C2]=p(false),w2=f(null);s(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&typeof e3=="object"&&X(e3.name)).slice(0,Os);if(T2.length===0)return null;let E2=a2==="share",D2=v2&&!!o2&&(!E2||y2),O2=v2?o2?E2&&!y2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":It,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||d2!==null)return;let{ok:e3}=await u2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e3&&C2(true)};return _("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:b("core-intent-card","core-share-approval-card",r2),style:i2,"data-state":S2?"done":v2?"asking":"display","data-mode":a2,"aria-busy":d2!==null||void 0,children:[_("div",{className:"core-intent-card__head",children:[g("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:A2}),g("p",{className:"core-intent-card__title",children:o2?E2?`Share with ${o2}`:`Stop sharing with ${o2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),g("ul",{className:"core-share-approval-card__items",children:T2.map((e3,t3)=>_("li",{children:[g("span",{className:"core-share-approval-card__name",children:X(e3.name)}),X(e3.projectName)?g("span",{className:"core-share-approval-card__project",children:X(e3.projectName)}):null]},t3))}),m2?g("p",{className:"core-intent-card__message",role:"alert",children:m2}):null,S2?g("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${o2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${o2}.`}):_(h,{children:[g("p",{className:"core-intent-card__does",id:`${l2}-does`,children:o2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${o2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${o2}’s portal.`:O2}),E2?_("label",{className:"core-share-approval-card__review",children:[g("input",{type:"checkbox",checked:y2,disabled:!v2||d2!==null,onChange:e3=>x2(e3.target.checked)}),g("span",{children:"I’ve reviewed this"})]}):null,O2&&o2?g("p",{className:"core-share-approval-card__reason",id:`${l2}-reason`,children:O2}):null,_("div",{className:"core-intent-card__actions",children:[g("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||d2!==null,"aria-describedby":`${l2}-does`,onClick:()=>void j2(),children:d2===null?k2:"Saving…"}),typeof n2=="function"?g("button",{type:"button",className:"core-intent-card__button",disabled:d2!==null,onClick:n2,children:"Not now"}):null]})]})]})}var As={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},js=["save_as_note","make_follow_up"];function Ms(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=Array.isArray(e2.actions)?js.filter(t3=>e2.actions.includes(t3)):js,a2=c(),{run:o2,busy:s2,message:l2,available:u2}=Lt(t2),[d2,f2]=p(new Set);if(i2.length===0)return null;let m2=async e3=>{let{ok:t3}=await o2(e3);t3&&f2(t4=>new Set(t4).add(e3))};return _("div",{role:"group","aria-label":"Suggested actions",className:b("core-suggested-actions",n2),style:r2,"aria-busy":s2!==null||void 0,children:[g("div",{className:"core-suggested-actions__row",children:i2.map(e3=>{let t3=d2.has(e3);return g("button",{type:"button",className:"core-suggested-actions__chip","data-done":t3||void 0,disabled:!u2||s2!==null||t3,"aria-describedby":u2?void 0:`${a2}-does`,onClick:()=>void m2(e3),children:t3?As[e3].done:s2===e3?As[e3].busy:As[e3].label},e3)})}),l2?g("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,u2?null:g("p",{id:`${a2}-does`,className:"core-suggested-actions__does",children:It})]})}var Ns=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&ua(e2.href)!==null;function Ps(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Ns)}function Fs({action:e2,className:t2}){let n2=ua(e2.href);if(n2===null)return null;let r2=e2.variant==="secondary"?"secondary":"primary";return g("a",{className:b("core-public-action",t2),"data-variant":r2,href:n2,children:e2.label})}function Is({actions:e2,className:t2}){return e2.length?g("div",{className:b("core-public-actions",t2),children:e2.map((e3,t3)=>g(Fs,{action:e3},`${e3.href}-${t3}`))}):null}function Ls(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=da(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Rs({eyebrow:e2,title:t2,intro:n2,actions:r2,media:i2,align:a2,className:o2,style:s2}){let c2=Ls(i2),l2=a2==="center";return _("section",{className:b("core-hero",o2),"data-align":l2?"center":"start","data-media":c2?"yes":"no",style:s2,children:[_("div",{className:"core-hero__text",children:[e2?g("p",{className:"core-hero__eyebrow",children:e2}):null,g("h1",{className:"core-hero__title",children:t2}),n2?g("p",{className:"core-hero__intro",children:n2}):null,g(Is,{actions:Ps(r2).slice(0,2),className:"core-hero__actions"})]}),c2?g("div",{className:"core-hero__media",children:g("img",{src:c2.src,alt:c2.alt,loading:"eager",decoding:"async"})}):null]})}function zs({text:e2,src:t2,href:n2,size:r2,className:i2,style:a2}){let o2=r2==="sm"||r2==="lg"?r2:"md",s2=da(t2),c2=ua(n2),l2=s2?g("img",{className:"core-logo-mark__img",src:s2,alt:e2}):g("span",{className:"core-logo-mark__text",children:e2});return c2?g("a",{className:b("core-logo-mark",i2),"data-size":o2,href:c2,style:a2,children:l2}):g("span",{className:b("core-logo-mark",i2),"data-size":o2,style:a2,children:l2})}var Bs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&ua(e3.href)!==null).map(e3=>({label:e3.label,href:ua(e3.href)}));function Vs({logo:e2,links:t2,signIn:n2,className:r2,style:i2}){let a2=Bs(t2).slice(0,5),o2=n2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...n2??{}};return _("header",{className:b("core-public-header",r2),style:i2,children:[e2?g(zs,{...e2}):g("span",{}),a2.length?_("nav",{className:"core-public-header__nav","aria-label":"Main",children:[g("ul",{className:"core-public-header__links",children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))}),_("details",{className:"core-public-header__menu",children:[g("summary",{children:"Menu"}),g("ul",{children:a2.map(e3=>g("li",{children:g("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,o2?g(Fs,{action:o2,className:"core-public-header__sign-in"}):null]})}var Hs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Bs(e3.links)}));function Us({logo:e2,groups:t2,legal:n2,className:r2,style:i2}){let a2=Hs(t2).slice(0,4);return _("footer",{className:b("core-public-footer",r2),style:i2,children:[_("div",{className:"core-public-footer__top",children:[e2?g(zs,{size:"sm",...e2}):null,a2.length?g("div",{className:"core-public-footer__groups",children:a2.map(e3=>_("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[g("p",{className:"core-public-footer__title",children:e3.title}),g("ul",{children:e3.links.map(e4=>g("li",{children:g("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),n2?g("p",{className:"core-public-footer__legal",children:n2}):null]})}var Ws=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function Gs({src:e2,alt:t2,decorative:n2,ratio:r2,caption:i2,priority:a2,className:o2,style:s2}){let c2=da(e2);if(c2===null)return null;!n2&&!t2&&we(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let l2=r2&&Ws.test(r2)?{aspectRatio:r2.replace(/\s/g,"")}:void 0;return _("figure",{className:b("core-image",o2),style:s2,children:[g("div",{className:"core-image__frame","data-ratio":l2?"set":"auto",style:l2,children:g("img",{src:c2,alt:n2?"":t2??"",loading:a2?"eager":"lazy",decoding:"async"})}),i2?g("figcaption",{className:"core-image__caption",children:i2}):null]})}var Ks=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function qs({title:e2,intro:t2,items:n2,columns:r2,className:i2,style:a2}){let o2=Ks(n2);if(!o2.length)return null;let s2=r2===2||r2===4?r2:3;return _("section",{className:b("core-feature-grid",i2),"data-columns":s2,style:a2,children:[e2||t2?_("div",{className:"core-feature-grid__head",children:[e2?g("h2",{className:"core-feature-grid__title",children:e2}):null,t2?g("p",{className:"core-feature-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-feature-grid__items",children:o2.map((e3,t3)=>_("li",{className:"core-feature-grid__item",children:[e3.icon?g("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,g("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?g("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${t3}`))})]})}var Js=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Ys=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function Xs({title:e2,intro:t2,members:n2,className:r2,style:i2}){let a2=Js(n2);return a2.length?_("section",{className:b("core-team-grid",r2),style:i2,children:[e2||t2?_("div",{className:"core-team-grid__head",children:[e2?g("h2",{className:"core-team-grid__title",children:e2}):null,t2?g("p",{className:"core-team-grid__intro",children:t2}):null]}):null,g("ul",{className:"core-team-grid__members",children:a2.map((e3,t3)=>{let n3=Ls(e3.photo);return _("li",{className:"core-team-grid__member",children:[g("div",{className:"core-team-grid__photo",children:n3?g("img",{src:n3.src,alt:n3.alt||e3.name,loading:"lazy",decoding:"async"}):g("span",{"aria-hidden":"true",children:Ys(e3.name)})}),g("p",{className:"core-team-grid__name",children:e3.name}),e3.role?g("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?g("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${t3}`)})})]}):null}function Zs({quote:e2,name:t2,role:n2,photo:r2,className:i2,style:a2}){if(typeof e2!="string"||!e2)return null;let o2=Ls(r2);return _("figure",{className:b("core-testimonial",i2),style:a2,children:[g("blockquote",{className:"core-testimonial__quote",children:g("p",{children:e2})}),_("figcaption",{className:"core-testimonial__by",children:[o2?g("img",{className:"core-testimonial__photo",src:o2.src,alt:o2.alt||t2,loading:"lazy",decoding:"async"}):null,_("span",{children:[g("span",{className:"core-testimonial__name",children:t2}),n2?g("span",{className:"core-testimonial__role",children:n2}):null]})]})]})}function Qs({title:e2,text:t2,actions:n2,tone:r2,className:i2,style:a2}){let o2=r2==="strong"||r2==="neutral"?r2:"accent";return _("section",{className:b("core-cta-band",i2),"data-tone":o2,style:a2,children:[_("div",{className:"core-cta-band__text",children:[g("h2",{className:"core-cta-band__title",children:e2}),t2?g("p",{className:"core-cta-band__body",children:t2}):null]}),g(Is,{actions:Ps(n2).slice(0,2)})]})}function $s({title:e2,intro:t2,askPhone:n2,consent:r2,submitLabel:i2,thanks:a2,actions:o2,className:s2,style:l2}){let u2=c(),[d2,f2]=p({name:"",email:"",phone:"",message:"",consent:false,website:""}),[m2,h2]=p(false),[v2,y2]=p(false),[x2,S2]=p(""),C2=o2?.submitRequest,w2=e3=>t3=>f2(n3=>({...n3,[e3]:t3.target.type==="checkbox"?!!t3.target.checked:t3.target.value}));return v2?g("section",{className:b("core-contact-form",s2),style:l2,children:g("p",{className:"core-contact-form__thanks",role:"status",children:a2||"Thanks. We'll be in touch within one business day."})}):_("section",{className:b("core-contact-form",s2),style:l2,children:[e2?g("h2",{className:"core-contact-form__title",children:e2}):null,t2?g("p",{className:"core-contact-form__intro",children:t2}):null,_("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!m2){if(!d2.consent){S2("Please tick the box to agree to be contacted.");return}h2(true),S2("");try{let e4=await C2({name:d2.name.trim(),email:d2.email.trim(),...n2&&d2.phone.trim()?{phone:d2.phone.trim()}:{},...d2.message.trim()?{message:d2.message.trim()}:{},consent:d2.consent,website:d2.website});e4.success?y2(true):S2(jt(e4))}catch{S2("Something went wrong. Try again.")}finally{h2(false)}}},children:[_("div",{className:"core-contact-form__row",children:[_("label",{className:"core-contact-form__field",children:[g("span",{children:"Name"}),g("input",{name:"name",autoComplete:"name",required:true,value:d2.name,onChange:w2("name")})]}),_("label",{className:"core-contact-form__field",children:[g("span",{children:"Email"}),g("input",{name:"email",type:"email",autoComplete:"email",required:true,value:d2.email,onChange:w2("email")})]})]}),n2?_("label",{className:"core-contact-form__field",children:[g("span",{children:"Phone (optional)"}),g("input",{name:"phone",type:"tel",autoComplete:"tel",value:d2.phone,onChange:w2("phone")})]}):null,_("label",{className:"core-contact-form__field",children:[g("span",{children:"Message (optional)"}),g("textarea",{name:"message",rows:4,value:d2.message,onChange:w2("message")})]}),_("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[g("label",{htmlFor:`${u2}-website`,children:"Website"}),g("input",{id:`${u2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:d2.website,onChange:w2("website")})]}),_("label",{className:"core-contact-form__check",children:[g("input",{type:"checkbox",name:"consent",checked:d2.consent,onChange:w2("consent")}),g("span",{children:r2||"I agree to be contacted about my request."})]}),x2?g("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:g("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),g("div",{className:"core-contact-form__actions",children:g("button",{type:"submit",className:"core-contact-form__submit",disabled:m2||!C2,children:m2?"Sending…":i2||"Send"})})]})]})}function ec({length:e2=6,label:t2,value:n2,onChange:r2,onComplete:i2,error:a2,disabled:o2,autoFocus:s2,name:l2="code",className:u2,style:d2}){let f2=c(),m2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[h2,v2]=p(""),y2=(n2??h2).replace(/\D/g,"").slice(0,m2),x2=e3=>{let t3=e3.target.value.replace(/\D/g,"").slice(0,m2);n2===void 0&&v2(t3),r2?.(t3),t3.length===m2&&y2.length!==m2&&i2?.(t3)};return _("div",{className:b("core-code-field",u2),style:{...d2,"--core-code-field-n":m2},children:[g("label",{className:"core-code-field__label",htmlFor:f2,children:t2||"Code"}),_("div",{className:"core-code-field__boxes","data-error":a2?"yes":"no",children:[g("input",{id:f2,className:"core-code-field__input",name:l2,value:y2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${m2}}`,maxLength:m2,disabled:o2,autoFocus:s2,"aria-invalid":a2?true:void 0,"aria-describedby":a2?`${f2}-error`:void 0}),g("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:m2},(e3,t3)=>g("span",{className:"core-code-field__cell","data-filled":t3<y2.length?"yes":"no","data-caret":t3===Math.min(y2.length,m2-1)?"yes":"no",children:y2[t3]??""},t3))})]}),a2?g("p",{id:`${f2}-error`,className:"core-code-field__error",role:"alert",children:a2}):null]})}export{$r as ANSWER_COLUMN_PX,jn as Accordion,Fs as ActionLink,Is as ActionRow,ei as AnswerRows,_r as Aside,Gt as Avatar,sr as BLOCK_KINDS,Oi as BLOCK_SCHEMAS,gn as Badge,ss as BookEventCard,D as Box,Tn as Button,go as CalendarFilters,Co as CalendarView,Mn as Card,O as Center,nn as Checkbox,rn as CheckboxGroup,En as Chip,Kt as Code,ec as CodeField,Pn as Columns,Qo as Combobox,ni as ComparisonBars,$s as ContactForm,k as Container,xi as Contents,Qs as CtaBand,za as DAY_MINUTES,Hr as DEFAULT_DISPLAY_LOCALE,Xn as DEFAULT_PROFILE_ID,ft as DEFAULT_VIEWER,Ta as DataTable,an as DateRange,br as Definition,We as Dialog,qi as DisclaimerBlock,In as Disclosure,A as Divider,Ti as DocumentBlocks,Pr as DocumentLabel,Di as DocumentSection,yi as DocumentShell,Vr as DocumentTable,ms as EditEventCard,T as EmbedContext,_n as EmptyState,ka as EventCard,Ma as EventDetail,Pa as EventLogForm,gs as EventNoteCard,ja as EventRespond,Ia as EventSchedule,Ra as EventTimeline,Ci as ExecutionBlock,it as Eyebrow,qs as FeatureGrid,Mr as Figure,sn as FileField,kn as FilterChips,jr as Footnote,Zt as FormField,Ln as Grid,bs as HandoverCard,Jt as Heading,Rs as Hero,j as Hide,zi as HighlightBox,Zo as Highlighted,ro as HourGrid,Dn as IconButton,Gs as Image,M as Inline,sa as KpiCardGrid,On as Link,Xe as ListRow,Ko as LogCard,zs as LogoMark,mi as Masthead,Er as Math,Se as Menu,gi as MetaRail,yo as MiniMonth,It as NOT_AVAILABLE,ai as NextSteps,Ds as NoteSplitCard,si as Notes,yn as Notice,V as OVERLAY_DISMISS_EVENT,ta as OptionCard,ho as OverlapNotice,K as OverlayHost,zn as PAGINATOR_BINDINGS,Nr as PageBreak,Ze as PageFrame,ct as PageHead,Vt as PageStaffTools,se as Popover,na as ProfileCard,bn as Progress,Ki as ProposedComponent,vr as Prose,Us as PublicFooter,Vs as PublicHeader,ts as QuickNoteCard,yr as Quote,cn as RadioGroup,L as Rail,Br as Reference,Rn as Repeat,Qr as RowList,Ht as RuleSection,vi as RunningFooter,Ja as SERIES_SHAPES,dn as SearchField,Ri as SectionHeader,An as SegmentedControl,fn as Select,Qa as SeriesGlyph,ks as ShareApprovalCard,J as Sheet,R as Show,xn as Skeleton,li as SkippedSection,pn as Slider,Ge as Spacer,Sn as Spinner,Fn as Split,Ke as Stack,Cs as StartProcessCard,Pi as Stat,Fi as StatGroup,Yi as StatStrip,Ms as SuggestedActions,mn as Switch,Qe as TONES,di as TalkItThrough,ys as TaskCard,Xs as TeamGrid,Zs as Testimonial,Xt as Text,hn as TextArea,un as TextField,Ve as Toast,Ue as ToastRegion,Cn as Tooltip,Ut as UnderlinedAction,gt as ViewerProvider,fi as WRITE_HEIGHT_PX,oi as WRITE_LINE_HEIGHT_PX,xo as WeekStrip,pi as WriteInField,Ps as actionsOf,b as cx,Pe as dismissToast,Gr as displayLocale,Yn as documentProfiles,Dt as eventWhen,on as fileSize,Xr as formatValue,yt as hasRole,Ft as hrefFrom,Ls as imageOf,Wt as initialsOf,nt as inkToneOf,Eo as interact,Ha as isBusyOnly,vt as isStaff,Wa as layoutDay,x as length,lo as localWithOffset,pt as normalizeViewer,qa as overlapDays,or as profileCss,Kn as profileIds,ir as profileTokens,Gn as registerProfile,Jr as renderFormatted,qn as resolveProfile,Jn as resolvedProfiles,Rt as sameOriginPath,Za as seriesNumber,Xa as seriesShape,ln as toNumber,Ne as toast,et as toneOf,bt as typeCard,Xo as useCombobox,E as useEmbedded,Lt as useIntent,re as useOverlayFormat,te as useOverlayHost,Be as useToast,_t as useViewer,S as vars,Ga as visibleRange,Va as wallOf,Ka as weekDates};