@llumi/design-system 0.1.0 → 1.0.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/README.md +15 -6
- package/custom-elements.json +68 -9
- package/dist/review.cjs +26 -26
- package/dist/review.js +26 -26
- package/dist/review.mjs +485 -391
- package/dist/types/components/review/review.element.d.ts +10 -4
- package/dist/types/components/review/review.machine.d.ts +6 -0
- package/dist/types/components/review/review.persistence.d.ts +16 -0
- package/dist/types/components/review/review.type.d.ts +5 -0
- package/package.json +1 -1
package/dist/review.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(C,Gt){typeof exports=="object"&&typeof module<"u"?Gt(exports):typeof define=="function"&&define.amd?define(["exports"],Gt):(C=typeof globalThis<"u"?globalThis:C||self,Gt(C.Llumi={}))})(this,(function(C){"use strict";var rr;function Gt(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function ur(){const n=Gt();if(n.__xstate__)return n.__xstate__}const hr=n=>{if(typeof window>"u")return;const t=ur();t&&t.register(n)};class ii{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const oi=".",fr="",ri="",mr="#",pr="*",si="xstate.init",gr="xstate.error",fe="xstate.stop";function vr(n,t){return{type:`xstate.after.${n}.${t}`}}function tn(n,t){return{type:`xstate.done.state.${n}`,output:t}}function br(n,t){return{type:`xstate.done.actor.${n}`,output:t,actorId:n}}function ai(n,t){return{type:`xstate.error.actor.${n}`,error:t,actorId:n}}function li(n){return{type:si,input:n}}function K(n){setTimeout(()=>{throw n})}const yr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ci(n,t){const e=di(n),i=di(t);return typeof i=="string"?typeof e=="string"?i===e:!1:typeof e=="string"?e in i:Object.keys(e).every(o=>o in i?ci(e[o],i[o]):!1)}function en(n){if(fi(n))return n;const t=[];let e="";for(let i=0;i<n.length;i++){switch(n.charCodeAt(i)){case 92:e+=n[i+1],i++;continue;case 46:t.push(e),e="";continue}e+=n[i]}return t.push(e),t}function di(n){if(os(n))return n.value;if(typeof n!="string")return n;const t=en(n);return wr(t)}function wr(n){if(n.length===1)return n[0];const t={};let e=t;for(let i=0;i<n.length-1;i++)if(i===n.length-2)e[n[i]]=n[i+1];else{const o=e;e={},o[n[i]]=e}return t}function ui(n,t){const e={},i=Object.keys(n);for(let o=0;o<i.length;o++){const r=i[o];e[r]=t(n[r],r,n,o)}return e}function hi(n){return fi(n)?n:[n]}function st(n){return n===void 0?[]:hi(n)}function nn(n,t,e,i){return typeof n=="function"?n({context:t,event:e,self:i}):n}function fi(n){return Array.isArray(n)}function xr(n){return n.type.startsWith("xstate.error.actor")}function Ot(n){return hi(n).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function mi(n){if(!(n===void 0||n===fr))return st(n)}function me(n,t,e){var r,s,a;const i=typeof n=="object",o=i?n:void 0;return{next:(r=i?n.next:n)==null?void 0:r.bind(o),error:(s=i?n.error:t)==null?void 0:s.bind(o),complete:(a=i?n.complete:e)==null?void 0:a.bind(o)}}function pi(n,t){return`${t}.${n}`}function on(n,t){const e=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!e)return n.implementations.actors[t];const[,i,o]=e,s=n.getStateNodeById(o).config.invoke;return(Array.isArray(s)?s[i]:s).src}function _r(n,t){if(t===n||t===pr)return!0;if(!t.endsWith(".*"))return!1;const e=t.split("."),i=n.split(".");for(let o=0;o<e.length;o++){const r=e[o],s=i[o];if(r==="*")return o===e.length-1;if(r!==s)return!1}return!0}function gi(n,t){return`${n.sessionId}.${t}`}let Er=0;function Cr(n,t){const e=new Map,i=new Map,o=new WeakMap,r=new Set,s={},{clock:a,logger:l}=t,c={schedule:(u,h,m,p,g=Math.random().toString(36).slice(2))=>{const v={source:u,target:h,event:m,delay:p,id:g,startedAt:Date.now()},x=gi(u,g);d._snapshot._scheduledEvents[x]=v;const _=a.setTimeout(()=>{delete s[x],delete d._snapshot._scheduledEvents[x],d._relay(u,h,m)},p);s[x]=_},cancel:(u,h)=>{const m=gi(u,h),p=s[m];delete s[m],delete d._snapshot._scheduledEvents[m],p!==void 0&&a.clearTimeout(p)},cancelAll:u=>{for(const h in d._snapshot._scheduledEvents){const m=d._snapshot._scheduledEvents[h];m.source===u&&c.cancel(u,m.id)}}},f=u=>{if(!r.size)return;const h={...u,rootId:n.sessionId};r.forEach(m=>{var p;return(p=m.next)==null?void 0:p.call(m,h)})},d={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Er++}`,_register:(u,h)=>(e.set(u,h),u),_unregister:u=>{e.delete(u.sessionId);const h=o.get(u);h!==void 0&&(i.delete(h),o.delete(u))},get:u=>i.get(u),getAll:()=>Object.fromEntries(i.entries()),_set:(u,h)=>{const m=i.get(u);if(m&&m!==h)throw new Error(`Actor with system ID '${u}' already exists.`);i.set(u,h),o.set(h,u)},inspect:u=>{const h=me(u);return r.add(h),{unsubscribe(){r.delete(h)}}},_sendInspectionEvent:f,_relay:(u,h,m)=>{d._sendInspectionEvent({type:"@xstate.event",sourceRef:u,actorRef:h,event:m}),h._send(m)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...d._snapshot._scheduledEvents}}),start:()=>{const u=d._snapshot._scheduledEvents;d._snapshot._scheduledEvents={};for(const h in u){const{source:m,target:p,event:g,delay:v,id:x}=u[h];c.schedule(m,p,g,v,x)}},_clock:a,_logger:l};return d}let rn=!1;const sn=1;let H=(function(n){return n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped",n})({});const Sr={clock:{setTimeout:(n,t)=>setTimeout(n,t),clearTimeout:n=>clearTimeout(n)},logger:console.log.bind(console),devTools:!1};class Ar{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new ii(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=H.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const i={...Sr,...e},{clock:o,logger:r,parent:s,syncSnapshot:a,id:l,systemId:c,inspect:f}=i;this.system=s?s.system:Cr(this,{clock:o,logger:r}),f&&!s&&this.system.inspect(me(f)),this.sessionId=this.system._bookId(),this.id=l??this.sessionId,this.logger=(e==null?void 0:e.logger)??this.system._logger,this.clock=(e==null?void 0:e.clock)??this.system._clock,this._parent=s,this._syncSnapshot=a,this.options=i,this.src=i.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:d=>{this._deferred.push(d)},system:this.system,stopChild:d=>{if(d._parent!==this)throw new Error(`Cannot stop child actor ${d.id} of ${this.id} because it is not a child`);d._stop()},emit:d=>{const u=this.eventListeners.get(d.type),h=this.eventListeners.get("*");if(!u&&!h)return;const m=[...u?u.values():[],...h?h.values():[]];for(const p of m)try{p(d)}catch(g){K(g)}},actionExecutor:d=>{const u=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:d.type,params:d.params}}),!d.exec)return;const h=rn;try{rn=!0,d.exec(d.info,d.params)}finally{rn=h}};this._processingStatus===H.Running?u():this._deferred.push(u)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this.systemId=c,this.system._set(c,this)),this._initState((e==null?void 0:e.snapshot)??(e==null?void 0:e.state)),c&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var e;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(e=this.options)==null?void 0:e.input)}catch(i){this._snapshot={status:"error",output:void 0,error:i}}}update(t,e){var o,r;this._snapshot=t;let i;for(;i=this._deferred.shift();)try{i()}catch(s){this._deferred.length=0,this._snapshot={...t,status:"error",error:s}}switch(this._snapshot.status){case"active":for(const s of this.observers)try{(o=s.next)==null||o.call(s,t)}catch(a){K(a)}break;case"done":for(const s of this.observers)try{(r=s.next)==null||r.call(s,t)}catch(a){K(a)}this._stopProcedure(),this._complete(),this._doneEvent=br(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,i){var r;const o=me(t,e,i);if(this._processingStatus!==H.Stopped)this.observers.add(o);else switch(this._snapshot.status){case"done":try{(r=o.complete)==null||r.call(o)}catch(s){K(s)}break;case"error":{const s=this._snapshot.error;if(!o.error)K(s);else try{o.error(s)}catch(a){K(a)}break}}return{unsubscribe:()=>{this.observers.delete(o)}}}on(t,e){let i=this.eventListeners.get(t);i||(i=new Set,this.eventListeners.set(t,i));const o=e.bind(void 0);return i.add(o),{unsubscribe:()=>{i.delete(o)}}}select(t,e=Object.is){return{subscribe:i=>{const o=me(i),r=this.getSnapshot();let s=t(r);return this.subscribe(a=>{var c;const l=t(a);e(s,l)||(s=l,(c=o.next)==null||c.call(o,l))})},get:()=>t(this.getSnapshot())}}start(){if(this._processingStatus===H.Running)return this;this._syncSnapshot&&this.subscribe({next:i=>{i.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:i})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=H.Running;const t=li(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(i){return this._snapshot={...this._snapshot,status:"error",error:i},this._error(i),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,i;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(o){i={err:o}}if(i){const{err:o}=i;this._snapshot={...this._snapshot,status:"error",error:o},this._error(o);return}this.update(e,t),t.type===fe&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===H.Stopped?this:(this.mailbox.clear(),this._processingStatus===H.NotStarted?(this._processingStatus=H.Stopped,this):(this.mailbox.enqueue({type:fe}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const e of this.observers)try{(t=e.complete)==null||t.call(e)}catch(i){K(i)}this.observers.clear(),this.eventListeners.clear()}_reportError(t){if(!this.observers.size){this._parent||K(t),this.eventListeners.clear();return}let e=!1;for(const i of this.observers){const o=i.error;e||(e=!o);try{o==null||o(t)}catch(r){K(r)}}this.observers.clear(),this.eventListeners.clear(),e&&K(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,ai(this.id,t))}_stopProcedure(){return this._processingStatus!==H.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new ii(this._process.bind(this)),this._processingStatus=H.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==H.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:hr)(this)}toJSON(){return{xstate$$type:sn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[yr](){return this}getSnapshot(){return this._snapshot}}function Ft(n,...[t]){return new Ar(n,t)}function kr(n,t,e,i,{sendId:o}){const r=typeof o=="function"?o(e,i):o;return[t,{sendId:r},void 0]}function $r(n,t){n.defer(()=>{n.system.scheduler.cancel(n.self,t.sendId)})}function an(n){function t(e,i){}return t.type="xstate.cancel",t.sendId=n,t.resolve=kr,t.execute=$r,t}function Tr(n,t,e,i,{id:o,systemId:r,src:s,input:a,syncSnapshot:l}){const c=typeof s=="string"?on(t.machine,s):s,f=typeof o=="function"?o(e):o;let d,u;return c&&(u=typeof a=="function"?a({context:t.context,event:e.event,self:n.self}):a,d=Ft(c,{id:f,src:s,parent:n.self,syncSnapshot:l,systemId:r,input:u})),[yt(t,{children:{...t.children,[f]:d}}),{id:o,systemId:r,actorRef:d,src:s,input:u},void 0]}function Ir(n,{actorRef:t}){t&&n.defer(()=>{t._processingStatus!==H.Stopped&&t.start()})}function ln(...[n,{id:t,systemId:e,input:i,syncSnapshot:o=!1}={}]){function r(s,a){}return r.type="xstate.spawnChild",r.id=t,r.systemId=e,r.src=n,r.input=i,r.syncSnapshot=o,r.resolve=Tr,r.execute=Ir,r}function Or(n,t,e,i,{actorRef:o}){const r=typeof o=="function"?o(e,i):o,s=typeof r=="string"?t.children[r]:r;let a=t.children;return s&&(a={...a},delete a[s.id]),[yt(t,{children:a}),s,void 0]}function vi(n,t){const e=t.getSnapshot();if(e&&"children"in e)for(const i of Object.values(e.children))vi(n,i);n.system._unregister(t)}function Lr(n,t){if(t){if(vi(n,t),t._processingStatus!==H.Running){n.stopChild(t);return}n.defer(()=>{n.stopChild(t)})}}function pe(n){function t(e,i){}return t.type="xstate.stopChild",t.actorRef=n,t.resolve=Or,t.execute=Lr,t}function Rr(n,t,{stateValue:e}){if(typeof e=="string"&&Xt(e)){const i=n.machine.getStateNodeById(e);return n._nodes.some(o=>o===i)}return n.matches(e)}function zr(n){function t(){return!1}return t.check=Rr,t.stateValue=n,t}function Mr(n,{context:t,event:e},{guards:i}){return i.every(o=>Vt(o,t,e,n))}function Dr(n){function t(e,i){return!1}return t.check=Mr,t.guards=n,t}function Vt(n,t,e,i){const{machine:o}=i,r=typeof n=="function",s=r?n:o.implementations.guards[typeof n=="string"?n:n.type];if(!r&&!s)throw new Error(`Guard '${typeof n=="string"?n:n.type}' is not implemented.'.`);if(typeof s!="function")return Vt(s,t,e,i);const a={context:t,event:e},l=r||typeof n=="string"?void 0:"params"in n?typeof n.params=="function"?n.params({context:t,event:e}):n.params:void 0;return"check"in s?s.check(i,a,s):s(a,l)}function cn(n){return n.type==="atomic"||n.type==="final"}function Lt(n){return Object.values(n.states).filter(t=>t.type!=="history")}function qt(n,t){const e=[];if(t===n)return e;let i=n.parent;for(;i&&i!==t;)e.push(i),i=i.parent;return e}function ge(n){const t=new Set(n),e=yi(t);for(const i of t)if(i.type==="compound"&&(!e.get(i)||!e.get(i).length))_i(i).forEach(o=>t.add(o));else if(i.type==="parallel"){for(const o of Lt(i))if(o.type!=="history"&&!t.has(o)){const r=_i(o);for(const s of r)t.add(s)}}for(const i of t){let o=i.parent;for(;o;)t.add(o),o=o.parent}return t}function bi(n,t){const e=t.get(n);if(!e)return{};if(n.type==="compound"){const o=e[0];if(o){if(cn(o))return o.key}else return{}}const i={};for(const o of e)i[o.key]=bi(o,t);return i}function yi(n){const t=new Map;for(const e of n)t.has(e)||t.set(e,[]),e.parent&&(t.has(e.parent)||t.set(e.parent,[]),t.get(e.parent).push(e));return t}function wi(n,t){const e=ge(t);return bi(n,yi(e))}function dn(n,t){return t.type==="compound"?Lt(t).some(e=>e.type==="final"&&n.has(e)):t.type==="parallel"?Lt(t).every(e=>dn(n,e)):t.type==="final"}const Xt=n=>n[0]===mr;function Pr(n,t){return n.transitions.get(t)||[...n.transitions.keys()].filter(i=>_r(t,i)).sort((i,o)=>o.length-i.length).flatMap(i=>n.transitions.get(i))}function Nr(n){const t=n.config.after;if(!t)return[];const e=o=>{const r=vr(o,n.id),s=r.type;return n.entry.push(vn(r,{id:s,delay:o})),n.exit.push(an(s)),s};return Object.keys(t).flatMap(o=>{const r=t[o],s=typeof r=="string"?{target:r}:r,a=Number.isNaN(+o)?o:+o,l=e(a);return st(s).map(c=>({...c,event:l,delay:a}))}).map(o=>{const{delay:r}=o;return{...at(n,o.event,o),delay:r}})}function at(n,t,e){const i=mi(e.target),o=e.reenter??!1,r=Br(n,i),s={...e,actions:st(e.actions),guard:e.guard,target:r,source:n,reenter:o,eventType:t,toJSON:()=>({...s,source:`#${n.id}`,target:r?r.map(a=>`#${a.id}`):void 0})};return s}function Hr(n){const t=new Map;if(n.config.on)for(const e of Object.keys(n.config.on)){if(e===ri)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const i=n.config.on[e];t.set(e,Ot(i).map(o=>at(n,e,o)))}if(n.config.onDone){const e=`xstate.done.state.${n.id}`;t.set(e,Ot(n.config.onDone).map(i=>at(n,e,i)))}for(const e of n.invoke){if(e.onDone){const i=`xstate.done.actor.${e.id}`;t.set(i,Ot(e.onDone).map(o=>at(n,i,o)))}if(e.onError){const i=`xstate.error.actor.${e.id}`;t.set(i,Ot(e.onError).map(o=>at(n,i,o)))}if(e.onSnapshot){const i=`xstate.snapshot.${e.id}`;t.set(i,Ot(e.onSnapshot).map(o=>at(n,i,o)))}}for(const e of n.after){let i=t.get(e.eventType);i||(i=[],t.set(e.eventType,i)),i.push(e)}return t}function jr(n){const t=[],e=i=>{Object.values(i).forEach(o=>{if(o.config.route&&o.config.id){const r=o.config.id,s=o.config.route.guard,a=({event:c})=>c.to===`#${r}`,l={...o.config.route,guard:s?Dr([a,s]):a,target:`#${r}`};t.push(at(n,"xstate.route",l))}o.states&&e(o.states)})};e(n.states),t.length>0&&n.transitions.set("xstate.route",t)}function Ur(n,t){const e=typeof t=="string"?n.states[t]:t?n.states[t.target]:void 0;if(!e&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${n.id}`);const i={source:n,actions:!t||typeof t=="string"?[]:st(t.actions),eventType:null,reenter:!1,target:e?[e]:[],toJSON:()=>({...i,source:`#${n.id}`,target:e?[`#${e.id}`]:[]})};return i}function Br(n,t){if(t!==void 0)return t.map(e=>{if(typeof e!="string")return e;if(Xt(e))return n.machine.getStateNodeById(e);const i=e[0]===oi;if(i&&!n.parent)return ve(n,e.slice(1));const o=i?n.key+e:e;if(n.parent)try{return ve(n.parent,o)}catch(r){throw new Error(`Invalid transition definition for state node '${n.id}':
|
|
2
|
-
${r.message}`)}else throw new Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}function xi(n){const t=mi(n.config.target);return t?{target:t.map(e=>typeof e=="string"?ve(n.parent,e):e)}:n.parent.initial}function bt(n){return n.type==="history"}function _i(n){const t=Ei(n);for(const e of t)for(const i of qt(e,n))t.add(i);return t}function Ei(n){const t=new Set;function e(i){if(!t.has(i)){if(t.add(i),i.type==="compound")e(i.initial.target[0]);else if(i.type==="parallel")for(const o of Lt(i))e(o)}}return e(n),t}function Rt(n,t){if(Xt(t))return n.machine.getStateNodeById(t);if(!n.states)throw new Error(`Unable to retrieve child state '${t}' from '${n.id}'; no child states exist.`);const e=n.states[t];if(!e)throw new Error(`Child state '${t}' does not exist on '${n.id}'`);return e}function ve(n,t){if(typeof t=="string"&&Xt(t))try{return n.machine.getStateNodeById(t)}catch{}const e=en(t).slice();let i=n;for(;e.length;){const o=e.shift();if(!o.length)break;i=Rt(i,o)}return i}function be(n,t){if(typeof t=="string"){const o=n.states[t];if(!o)throw new Error(`State '${t}' does not exist on '${n.id}'`);return[n,o]}const e=Object.keys(t),i=e.map(o=>Rt(n,o)).filter(Boolean);return[n.machine.root,n].concat(i,e.reduce((o,r)=>{const s=Rt(n,r);if(!s)return o;const a=be(s,t[r]);return o.concat(a)},[]))}function Wr(n,t,e,i){const r=Rt(n,t).next(e,i);return!r||!r.length?n.next(e,i):r}function Gr(n,t,e,i){const o=Object.keys(t),r=Rt(n,o[0]),s=un(r,t[o[0]],e,i);return!s||!s.length?n.next(e,i):s}function Fr(n,t,e,i){const o=[];for(const r of Object.keys(t)){const s=t[r];if(!s)continue;const a=Rt(n,r),l=un(a,s,e,i);l&&o.push(...l)}return o.length?o:n.next(e,i)}function un(n,t,e,i){return typeof t=="string"?Wr(n,t,e,i):Object.keys(t).length===1?Gr(n,t,e,i):Fr(n,t,e,i)}function Vr(n){return Object.keys(n.states).map(t=>n.states[t]).filter(t=>t.type==="history")}function lt(n,t){let e=n;for(;e.parent&&e.parent!==t;)e=e.parent;return e.parent===t}function qr(n,t){const e=new Set(n),i=new Set(t);for(const o of e)if(i.has(o))return!0;for(const o of i)if(e.has(o))return!0;return!1}function Ci(n,t,e){const i=new Set;for(const o of n){let r=!1;const s=new Set;for(const a of i)if(qr(fn([o],t,e),fn([a],t,e)))if(lt(o.source,a.source))s.add(a);else{r=!0;break}if(!r){for(const a of s)i.delete(a);i.add(o)}}return Array.from(i)}function Xr(n){const[t,...e]=n;for(const i of qt(t,void 0))if(e.every(o=>lt(o,i)))return i}function hn(n,t){if(!n.target)return[];const e=new Set;for(const i of n.target)if(bt(i))if(t[i.id])for(const o of t[i.id])e.add(o);else for(const o of hn(xi(i),t))e.add(o);else e.add(i);return[...e]}function Si(n,t){const e=hn(n,t);if(!e)return;if(!n.reenter&&e.every(o=>o===n.source||lt(o,n.source)))return n.source;const i=Xr(e.concat(n.source));if(i)return i;if(!n.reenter)return n.source.machine.root}function fn(n,t,e){var o;const i=new Set;for(const r of n)if((o=r.target)!=null&&o.length){const s=Si(r,e);r.reenter&&r.source===s&&i.add(s);for(const a of t)lt(a,s)&&i.add(a)}return[...i]}function Kr(n,t){if(n.length!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}function Jr(n,t,e,i,o){return mn([{target:[...Ei(n)],source:n,reenter:!0,actions:[],eventType:null,toJSON:null}],t,e,i,!0,o)}function mn(n,t,e,i,o,r){const s=[];if(!n.length)return[t,s];const a=e.actionExecutor;e.actionExecutor=l=>{s.push(l),a(l)};try{const l=new Set(t._nodes);let c=t.historyValue;const f=Ci(n,l,c);let d=t;o||([d,c]=ts(d,i,e,f,l,c,r,e.actionExecutor)),d=Mt(d,i,e,f.flatMap(h=>h.actions),r,void 0),d=Zr(d,i,e,f,l,r,c,o);const u=[...l];d.status==="done"&&(d=Mt(d,i,e,u.sort((h,m)=>m.order-h.order).flatMap(h=>h.exit),r,void 0));try{return c===t.historyValue&&Kr(t._nodes,l)?[d,s]:[yt(d,{_nodes:u,historyValue:c}),s]}catch(h){throw h}}finally{e.actionExecutor=a}}function Yr(n,t,e,i,o){if(i.output===void 0)return;const r=tn(o.id,o.output!==void 0&&o.parent?nn(o.output,n.context,t,e.self):void 0);return nn(i.output,n.context,r,e.self)}function Zr(n,t,e,i,o,r,s,a){let l=n;const c=new Set,f=new Set;Qr(i,s,f,c),a&&f.add(n.machine.root);const d=new Set;for(const u of[...c].sort((h,m)=>h.order-m.order)){o.add(u);const h=[];h.push(...u.entry);for(const m of u.invoke)h.push(ln(m.src,{...m,syncSnapshot:!!m.onSnapshot}));if(f.has(u)){const m=u.initial.actions;h.push(...m)}if(l=Mt(l,t,e,h,r,u.invoke.map(m=>m.id)),u.type==="final"){const m=u.parent;let p=(m==null?void 0:m.type)==="parallel"?m:m==null?void 0:m.parent,g=p||u;for((m==null?void 0:m.type)==="compound"&&r.push(tn(m.id,u.output!==void 0?nn(u.output,l.context,t,e.self):void 0));(p==null?void 0:p.type)==="parallel"&&!d.has(p)&&dn(o,p);)d.add(p),r.push(tn(p.id)),g=p,p=p.parent;if(p)continue;l=yt(l,{status:"done",output:Yr(l,t,e,l.machine.root,g)})}}return l}function Qr(n,t,e,i){for(const o of n){const r=Si(o,t);for(const a of o.target||[])!bt(a)&&(o.source!==a||o.source!==r||o.reenter)&&(i.add(a),e.add(a)),zt(a,t,e,i);const s=hn(o,t);for(const a of s){const l=qt(a,r);(r==null?void 0:r.type)==="parallel"&&l.push(r),Ai(i,t,e,l,!o.source.parent&&o.reenter?void 0:r)}}}function zt(n,t,e,i){var o;if(bt(n))if(t[n.id]){const r=t[n.id];for(const s of r)i.add(s),zt(s,t,e,i);for(const s of r)pn(s,n.parent,i,t,e)}else{const r=xi(n);for(const s of r.target)i.add(s),r===((o=n.parent)==null?void 0:o.initial)&&e.add(n.parent),zt(s,t,e,i);for(const s of r.target)pn(s,n.parent,i,t,e)}else if(n.type==="compound"){const[r]=n.initial.target;bt(r)||(i.add(r),e.add(r)),zt(r,t,e,i),pn(r,n,i,t,e)}else if(n.type==="parallel")for(const r of Lt(n).filter(s=>!bt(s)))[...i].some(s=>lt(s,r))||(bt(r)||(i.add(r),e.add(r)),zt(r,t,e,i))}function Ai(n,t,e,i,o){for(const r of i)if((!o||lt(r,o))&&n.add(r),r.type==="parallel")for(const s of Lt(r).filter(a=>!bt(a)))[...n].some(a=>lt(a,s))||(n.add(s),zt(s,t,e,n))}function pn(n,t,e,i,o){Ai(e,i,o,qt(n,t))}function ts(n,t,e,i,o,r,s,a){let l=n;const c=fn(i,o,r);c.sort((d,u)=>u.order-d.order);let f;for(const d of c)for(const u of Vr(d)){let h;u.history==="deep"?h=m=>cn(m)&<(m,d):h=m=>m.parent===d,f??(f={...r}),f[u.id]=Array.from(o).filter(h)}for(const d of c)l=Mt(l,t,e,[...d.exit,...d.invoke.map(u=>pe(u.id))],s,void 0),o.delete(d);return[l,f||r]}function es(n,t){return n.implementations.actions[t]}function ki(n,t,e,i,o,r){const{machine:s}=n;let a=n;for(const l of i){const c=typeof l=="function",f=c?l:es(s,typeof l=="string"?l:l.type),d={context:a.context,event:t,self:e.self,system:e.system},u=c||typeof l=="string"?void 0:"params"in l?typeof l.params=="function"?l.params({context:a.context,event:t}):l.params:void 0;if(!f||!("resolve"in f)){e.actionExecutor({type:typeof l=="string"?l:typeof l=="object"?l.type:l.name||"(anonymous)",info:d,params:u,exec:f});continue}const h=f,[m,p,g]=h.resolve(e,a,d,u,f,o);a=m,"retryResolve"in h&&(r==null||r.push([h,p])),"execute"in h&&e.actionExecutor({type:h.type,info:d,params:p,exec:h.execute.bind(null,e,p)}),g&&(a=ki(a,t,e,g,o,r))}return a}function Mt(n,t,e,i,o,r){const s=r?[]:void 0,a=ki(n,t,e,i,{internalQueue:o,deferredActorIds:r},s);return s==null||s.forEach(([l,c])=>{l.retryResolve(e,a,c)}),a}function gn(n,t,e,i){var d;let o=n;const r=[];function s(u,h,m){e.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:e.self,event:h,snapshot:u[0],_transitions:m}),r.push(u)}if(t.type===fe)return o=yt($i(o,t,e),{status:"stopped"}),s([o,[]],t,[]),{snapshot:o,microsteps:r};let a=t;if(a.type!==si){const u=a,h=xr(u),m=Ti(u,o);if(h&&!m.length)return o=yt(n,{status:"error",error:u.error}),s([o,[]],u,[]),{snapshot:o,microsteps:r};const p=mn(m,n,e,a,!1,i);o=p[0],s(p,u,m)}let l=!0;const c=((d=n.machine.options)==null?void 0:d.maxIterations)??1/0;let f=0;for(;o.status==="active";){if(f++,f>c)throw new Error(`Infinite loop detected: the machine has processed more than ${c} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let u=l?ns(o,a):[];const h=u.length?o:void 0;if(!u.length){if(!i.length)break;a=i.shift(),u=Ti(a,o)}const m=mn(u,o,e,a,!1,i);o=m[0],l=o!==h,s(m,a,u)}return o.status!=="active"&&$i(o,a,e),{snapshot:o,microsteps:r}}function $i(n,t,e){return Mt(n,t,e,Object.values(n.children).map(i=>pe(i)),[],void 0)}function Ti(n,t){return t.machine.getTransitionData(t,n)}function ns(n,t){const e=new Set,i=n._nodes.filter(cn);for(const o of i)t:for(const r of[o].concat(qt(o,void 0)))if(r.always){for(const s of r.always)if(s.guard===void 0||Vt(s.guard,n.context,t,n)){e.add(s);break t}}return Ci(Array.from(e),new Set(n._nodes),n.historyValue)}function is(n,t){const e=ge(be(n,t));return wi(n,[...e])}function os(n){return!!n&&typeof n=="object"&&"machine"in n&&"value"in n}const rs=function(t){return ci(t,this.value)},ss=function(t){return this.tags.has(t)},as=function(t){const e=this.machine.getTransitionData(this,t);return!!(e!=null&&e.length)&&e.some(i=>i.target!==void 0||i.actions.length)},ls=function(){const{_nodes:t,tags:e,machine:i,getMeta:o,toJSON:r,can:s,hasTag:a,matches:l,...c}=this;return{...c,tags:Array.from(e)}},cs=function(){return this._nodes.reduce((t,e)=>(e.meta!==void 0&&(t[e.id]=e.meta),t),{})};function ye(n,t){return{status:n.status,output:n.output,error:n.error,machine:t,context:n.context,_nodes:n._nodes,value:wi(t.root,n._nodes),tags:new Set(n._nodes.flatMap(e=>e.tags)),children:n.children,historyValue:n.historyValue||{},matches:rs,hasTag:ss,can:as,getMeta:cs,toJSON:ls}}function yt(n,t={}){return ye({...n,...t},n.machine)}function ds(n){if(typeof n!="object"||n===null)return{};const t={};for(const e in n){const i=n[e];Array.isArray(i)&&(t[e]=i.map(o=>({id:o.id})))}return t}function us(n,t){const{_nodes:e,tags:i,machine:o,children:r,context:s,can:a,hasTag:l,matches:c,getMeta:f,toJSON:d,...u}=n,h={};for(const p in r){const g=r[p];h[p]={snapshot:g.getPersistedSnapshot(t),src:g.src,systemId:g.systemId,syncSnapshot:g._syncSnapshot}}return{...u,context:Ii(s),children:h,historyValue:ds(u.historyValue)}}function Ii(n){let t;for(const e in n){const i=n[e];if(i&&typeof i=="object")if("sessionId"in i&&"send"in i&&"ref"in i)t??(t=Array.isArray(n)?n.slice():{...n}),t[e]={xstate$$type:sn,id:i.id};else{const o=Ii(i);o!==i&&(t??(t=Array.isArray(n)?n.slice():{...n}),t[e]=o)}}return t??n}function hs(n,t,e,i,{event:o,id:r,delay:s},{internalQueue:a}){const l=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${o}" }) instead`);const c=typeof o=="function"?o(e,i):o;let f;if(typeof s=="string"){const d=l&&l[s];f=typeof d=="function"?d(e,i):d}else f=typeof s=="function"?s(e,i):s;return typeof f!="number"&&a.push(c),[t,{event:c,id:r,delay:f},void 0]}function fs(n,t){const{event:e,delay:i,id:o}=t;if(typeof i=="number"){n.defer(()=>{const r=n.self;n.system.scheduler.schedule(r,r,e,i,o)});return}}function vn(n,t){function e(i,o){}return e.type="xstate.raise",e.event=n,e.id=t==null?void 0:t.id,e.delay=t==null?void 0:t.delay,e.resolve=hs,e.execute=fs,e}const bn=new WeakMap;function Oi(n){return{config:n,start:(e,i)=>{const{self:o,system:r,emit:s}=i,a={receivers:void 0,dispose:void 0};bn.set(o,a),a.dispose=n({input:e.input,system:r,self:o,sendBack:l=>{o.getSnapshot().status!=="stopped"&&o._parent&&r._relay(o,o._parent,l)},receive:l=>{a.receivers??(a.receivers=new Set),a.receivers.add(l)},emit:s})},transition:(e,i,o)=>{var s,a,l;const r=bn.get(o.self);return i.type===fe?(e={...e,status:"stopped",error:void 0},bn.delete(o.self),(s=r.receivers)==null||s.clear(),(a=r.dispose)==null||a.call(r),e):((l=r.receivers)==null||l.forEach(c=>c(i)),e)},getInitialSnapshot:(e,i)=>({status:"active",output:void 0,error:void 0,input:i}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}function ms(n,{machine:t,context:e},i,o){const r=(s,a)=>{if(typeof s=="string"){const l=on(t,s);if(!l)throw new Error(`Actor logic '${s}' not implemented in machine '${t.id}'`);const c=Ft(l,{id:a==null?void 0:a.id,parent:n.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:typeof(a==null?void 0:a.input)=="function"?a.input({context:e,event:i,self:n.self}):a==null?void 0:a.input,src:s,systemId:a==null?void 0:a.systemId});return o[c.id]=c,c}else return Ft(s,{id:a==null?void 0:a.id,parent:n.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:a==null?void 0:a.input,src:s,systemId:a==null?void 0:a.systemId})};return(s,a)=>{const l=r(s,a);return o[l.id]=l,n.defer(()=>{l._processingStatus!==H.Stopped&&l.start()}),l}}function ps(n,t,e,i,{assignment:o}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const r={},s={context:t.context,event:e.event,spawn:ms(n,t,e.event,r),self:n.self,system:n.system};let a={};if(typeof o=="function")a=o(s,i);else for(const c of Object.keys(o)){const f=o[c];a[c]=typeof f=="function"?f(s,i):f}const l=Object.assign({},t.context,a);return[yt(t,{context:l,children:Object.keys(r).length?{...t.children,...r}:t.children}),void 0,void 0]}function F(n){function t(e,i){}return t.type="xstate.assign",t.assignment=n,t.resolve=ps,t}const Li=new WeakMap;function Dt(n,t,e){let i=Li.get(n);return i?t in i||(i[t]=e()):(i={[t]:e()},Li.set(n,i)),i[t]}const gs={},Kt=n=>typeof n=="string"?{type:n}:typeof n=="function"?"resolve"in n?{type:n.type}:{type:n.name}:n;class we{constructor(t,e){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(oi),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?ui(this.config.states,(i,o)=>new we(i,{_parent:this,_key:o,_machine:this.machine})):gs,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=st(this.config.entry).slice(),this.exit=st(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=st(t.tags).slice()}_initialize(){this.transitions=Hr(this),this.config.always&&(this.always=Ot(this.config.always).map(t=>at(this,ri,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Kt),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Kt),eventType:null})}:void 0,history:this.history,states:ui(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(Kt)})),entry:this.entry.map(Kt),exit:this.exit.map(Kt),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Dt(this,"invoke",()=>st(this.config.invoke).map((t,e)=>{const{src:i,systemId:o}=t,r=t.id??pi(this.id,e),s=typeof i=="string"?i:`xstate.invoke.${pi(this.id,e)}`;return{...t,src:s,id:r,systemId:o,toJSON(){const{onDone:a,onError:l,...c}=t;return{...c,type:"xstate.invoke",src:s,id:r}}}}))}get on(){return Dt(this,"on",()=>[...this.transitions].flatMap(([e,i])=>i.map(o=>[e,o])).reduce((e,[i,o])=>(e[i]=e[i]||[],e[i].push(o),e),{}))}get after(){return Dt(this,"delayedTransitions",()=>Nr(this))}get initial(){return Dt(this,"initial",()=>Ur(this,this.config.initial))}next(t,e){const i=e.type,o=[];let r;const s=Dt(this,`candidates-${i}`,()=>Pr(this,i));for(const a of s){const{guard:l}=a,c=t.context;let f=!1;try{f=!l||Vt(l,c,e,t)}catch(d){const u=typeof l=="string"?l:typeof l=="object"?l.type:void 0;throw new Error(`Unable to evaluate guard ${u?`'${u}' `:""}in transition for event '${i}' in state node '${this.id}':
|
|
3
|
-
${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get events(){return Dt(this,"events",()=>{const{states:t}=this,e=new Set(this.ownEvents);if(t)for(const i of Object.keys(t)){const o=t[i];if(o.states)for(const r of o.events)e.add(`${r}`)}return Array.from(e)})}get ownEvents(){const t=Object.keys(Object.fromEntries(this.transitions)),e=new Set(t.filter(i=>this.transitions.get(i).some(o=>!(!o.target&&!o.actions.length&&!o.reenter))));return Array.from(e)}}const vs="#";class yn{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:(e==null?void 0:e.actors)??{},actions:(e==null?void 0:e.actions)??{},delays:(e==null?void 0:e.delays)??{},guards:(e==null?void 0:e.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new we(t,{_key:this.id,_machine:this}),this.root._initialize(),jr(this.root),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:e,guards:i,actors:o,delays:r}=this.implementations;return new yn(this.config,{actions:{...e,...t.actions},guards:{...i,...t.guards},actors:{...o,...t.actors},delays:{...r,...t.delays}})}resolveState(t){const e=is(this.root,t.value),i=ge(be(this.root,e));return ye({_nodes:[...i],context:t.context||{},children:{},status:dn(i,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,i){return gn(t,e,i,[]).snapshot}microstep(t,e,i){return gn(t,e,i,[]).microsteps.map(([o])=>o)}getTransitionData(t,e){return un(this.root,t.value,t,e)||[]}_getPreInitialState(t,e,i){const{context:o}=this.config,r=ye({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?Mt(r,e,t,[F(({spawn:a,event:l,self:c})=>o({spawn:a,input:l.input,self:c}))],i,void 0):r}getInitialSnapshot(t,e){const i=li(e),o=[],r=this._getPreInitialState(t,i,o),[s]=Jr(this.root,r,t,i,o),{snapshot:a}=gn(s,i,t,o);return a}start(t){Object.values(t.children).forEach(e=>{e.getSnapshot().status==="active"&&e.start()})}getStateNodeById(t){const e=en(t),i=e.slice(1),o=Xt(e[0])?e[0].slice(vs.length):e[0],r=this.idMap.get(o);if(!r)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return ve(r,i)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return us(t,e)}restoreSnapshot(t,e){const i={},o=t.children;Object.keys(o).forEach(d=>{const u=o[d],h=u.snapshot,m=u.src,p=typeof m=="string"?on(this,m):m;if(!p)return;const g=Ft(p,{id:d,parent:e.self,syncSnapshot:u.syncSnapshot,snapshot:h,src:m,systemId:u.systemId});i[d]=g});function r(d,u){if(u instanceof we)return u;try{return d.machine.getStateNodeById(u.id)}catch{}}function s(d,u){if(!u||typeof u!="object")return{};const h={};for(const m in u){const p=u[m];for(const g of p){const v=r(d,g);v&&(h[m]??(h[m]=[]),h[m].push(v))}}return h}const a=s(this.root,t.historyValue),l=ye({...t,children:i,_nodes:Array.from(ge(be(this.root,t.value))),historyValue:a},this),c=new Set;function f(d,u){if(!c.has(d)){c.add(d);for(const h in d){const m=d[h];if(m&&typeof m=="object"){if("xstate$$type"in m&&m.xstate$$type===sn){d[h]=u[m.id];continue}f(m,u)}}}}return f(l.context,i),l}}function bs(n,t,e,i,{event:o}){const r=typeof o=="function"?o(e,i):o;return[t,{event:r},void 0]}function ys(n,{event:t}){n.defer(()=>n.emit(t))}function xe(n){function t(e,i){}return t.type="xstate.emit",t.event=n,t.resolve=bs,t.execute=ys,t}let wn=(function(n){return n.Parent="#_parent",n.Internal="#_internal",n})({});function ws(n,t,e,i,{to:o,event:r,id:s,delay:a},l){var m;const c=t.machine.implementations.delays;if(typeof r=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);const f=typeof r=="function"?r(e,i):r;let d;if(typeof a=="string"){const p=c&&c[a];d=typeof p=="function"?p(e,i):p}else d=typeof a=="function"?a(e,i):a;const u=typeof o=="function"?o(e,i):o;let h;if(typeof u=="string"){if(u===wn.Parent?h=n.self._parent:u===wn.Internal?h=n.self:u.startsWith("#_")?h=t.children[u.slice(2)]:h=(m=l.deferredActorIds)!=null&&m.includes(u)?u:t.children[u],!h)throw new Error(`Unable to send event to actor '${u}' from machine '${t.machine.id}'.`)}else h=u||n.self;return[t,{to:h,targetId:typeof u=="string"?u:void 0,event:f,id:s,delay:d},void 0]}function xs(n,t,e){typeof e.to=="string"&&(e.to=t.children[e.to])}function _s(n,t){n.defer(()=>{const{to:e,event:i,delay:o,id:r}=t;if(typeof o=="number"){n.system.scheduler.schedule(n.self,e,i,o,r);return}n.system._relay(n.self,e,i.type===gr?ai(n.self.id,i.data):i)})}function xn(n,t,e){function i(o,r){}return i.type="xstate.sendTo",i.to=n,i.event=t,i.id=e==null?void 0:e.id,i.delay=e==null?void 0:e.delay,i.resolve=ws,i.retryResolve=xs,i.execute=_s,i}function Es(n,t){return xn(wn.Parent,n,t)}function Cs(n,t,e,i,{collect:o}){const r=[],s=function(l){r.push(l)};return s.assign=(...a)=>{r.push(F(...a))},s.cancel=(...a)=>{r.push(an(...a))},s.raise=(...a)=>{r.push(vn(...a))},s.sendTo=(...a)=>{r.push(xn(...a))},s.sendParent=(...a)=>{r.push(Es(...a))},s.spawnChild=(...a)=>{r.push(ln(...a))},s.stopChild=(...a)=>{r.push(pe(...a))},s.emit=(...a)=>{r.push(xe(...a))},o({context:e.context,event:e.event,enqueue:s,check:a=>Vt(a,t.context,e.event,t),self:n.self,system:n.system},i),[t,void 0,r]}function Ri(n){function t(e,i){}return t.type="xstate.enqueueActions",t.collect=n,t.resolve=Cs,t}function Ss(n,t,e,i,{value:o,label:r}){return[t,{value:typeof o=="function"?o(e,i):o,label:r},void 0]}function As({logger:n},{value:t,label:e}){e?n(e,t):n(t)}function ks(n=({context:e,event:i})=>({context:e,event:i}),t){function e(i,o){}return e.type="xstate.log",e.value=n,e.label=t,e.resolve=Ss,e.execute=As,e}function $s(n,t){return new yn(n,t)}function zi({schemas:n,actors:t,actions:e,guards:i,delays:o}){return{assign:F,sendTo:xn,raise:vn,log:ks,cancel:an,stopChild:pe,enqueueActions:Ri,emit:xe,spawnChild:ln,createStateConfig:r=>r,createAction:r=>r,createMachine:r=>$s({...r,schemas:n},{actors:t,actions:e,guards:i,delays:o}),extend:r=>zi({schemas:n,actors:t,actions:{...e,...r.actions},guards:{...i,...r.guards},delays:{...o,...r.delays}})}}function Mi(n,t){const e=n.getAttribute("data-review-id");if(e)return e;for(const i of t??[])if(n.matches(i.selector)){const o=i.toId(n);if(o)return o}return null}function _e(n,t){const e=n.closest("[data-review-id]");if(e){const i=e.getAttribute("data-review-id");if(i)return{element:e,targetId:i}}for(const i of t??[]){const o=n.closest(i.selector);if(o){const r=i.toId(o);if(r)return{element:o,targetId:r}}}return null}function Ee(n,t){const e=new Set,i=[];for(const o of Array.from(n.querySelectorAll("[data-review-id]"))){const r=o.getAttribute("data-review-id");if(!r)continue;const s=o.hasAttribute("data-review-selectable");i.push({element:o,targetId:r,kind:s?"both":"element"}),e.add(o)}for(const o of t??[])for(const r of Array.from(n.querySelectorAll(o.selector))){if(e.has(r))continue;const s=o.toId(r);if(!s)continue;const a=r.hasAttribute("data-review-selectable");i.push({element:r,targetId:s,kind:a?"both":"element"}),e.add(r)}for(const o of Array.from(n.querySelectorAll("[data-review-selectable]"))){if(e.has(o))continue;const r=o.getAttribute("data-review-selectable");r&&(i.push({element:o,targetId:r,kind:"selectable"}),e.add(o))}return i}const _n="review-highlight-hover",wt="review-highlight-commented",Ce="review-highlight-editing",Se="review-highlight-uncommented",En="review-target",Di="review-active";function Cn(n){n.classList.remove(_n,wt,Ce,Se)}function Ts(n,t){let e=null,i=null,o=null;function r(g){n.classList.add(Di);const v=Ee(n,t);for(const{element:x,targetId:_,kind:A}of v)(A==="element"||A==="both")&&(x.hasAttribute("data-review-id")||x.classList.add(En),g.has(_)&&x.classList.add(wt))}function s(){n.classList.remove(Di),e&&(clearTimeout(e),e=null);const g=Ee(n,t);for(const{element:v}of g)Cn(v),v.classList.remove(En)}function a(g){const v=Ee(n,t),x=[];for(const{element:_}of v)!_.classList.contains(wt)&&!_.classList.contains(Ce)&&(_.classList.add(Se),x.push(_));g&&(e&&clearTimeout(e),e=setTimeout(()=>{e=null;for(const _ of x)_.classList.contains(Ce)||_.classList.remove(Se)},500))}function l(){e&&(clearTimeout(e),e=null);const g=Ee(n,t);for(const{element:v}of g)v.classList.remove(Se)}function c(g,v){v||(Cn(g),g.classList.add(Ce))}function f(g,v){Cn(g),v&&g.classList.add(wt)}function d(g,v){(Mi(g,t)??g.getAttribute("data-review-selectable"))!==v&&g.classList.add(_n)}function u(g,v,x){const _=Mi(g,t)??g.getAttribute("data-review-selectable");_!==v&&(g.classList.remove(_n),_&&(x!=null&&x.has(_))&&g.classList.add(wt))}function h(g){m(),o=g.editingTarget??null,i=new MutationObserver(v=>{for(const x of v){for(const _ of Array.from(x.removedNodes)){if(!(_ instanceof HTMLElement))continue;o&&(_===o||_.contains(o))&&(o=null,g.onTargetDisconnected()),(_.hasAttribute("data-review-selectable")||_.querySelector("[data-review-selectable]")!==null)&&g.onSelectableReconnected()}for(const _ of Array.from(x.addedNodes)){if(!(_ instanceof HTMLElement))continue;const A=[..._.matches("[data-review-id]")?[_]:[],...Array.from(_.querySelectorAll("[data-review-id]"))];for(const k of A){const $=k.getAttribute("data-review-id");$&&g.commentedIds.has($)&&k.classList.add(wt)}for(const k of t??[]){const $=[..._.matches(k.selector)?[_]:[],...Array.from(_.querySelectorAll(k.selector))];for(const b of $){const T=k.toId(b);b.classList.add(En),T&&g.commentedIds.has(T)&&b.classList.add(wt)}}(_.hasAttribute("data-review-selectable")||_.querySelector("[data-review-selectable]")!==null)&&g.onSelectableReconnected()}}}),i.observe(n,{childList:!0,subtree:!0})}function m(){i&&(i.disconnect(),i=null),o=null}function p(){s(),m()}return{activate:r,deactivate:s,reveal:a,unreveal:l,setEditing:c,clearEditing:f,applyHover:d,clearHover:u,startObserving:h,stopObserving:m,destroy:p}}const Is=`:root{--review-highlight-uncommented-color: oklch(.7 0 0 / .15);--review-highlight-commented-color: oklch(.7 0 0 / .3);--review-highlight-color: oklch(.7 0 0 / .5);--review-highlight-editing-color: oklch(.6 0 0 / .7);--review-badge-icon-color: oklch(.35 0 0);--review-z-index: 9998;--review-selection-commented-color: oklch(.85 .08 250 / .4);--review-selection-editing-color: oklch(.75 .12 250 / .6);--review-selection-hover-color: oklch(.8 .1 250 / .5)}[data-review-id],[data-review-selectable],.review-target{outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease}.review-highlight-uncommented{outline-color:var(--review-highlight-uncommented-color)}.review-highlight-commented{outline-color:var(--review-highlight-commented-color);position:relative}.review-highlight-hover{outline-color:var(--review-highlight-color)}.review-highlight-commented:after{content:"";position:absolute;top:-12px;right:-14px;width:20px;height:20px;border-radius:50%;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");background-size:12px 12px;background-repeat:no-repeat;background-position:center;box-shadow:0 1px 3px #0000001a;pointer-events:none}.review-highlight-editing:after{display:none}[data-review-selectable]:not([data-review-id]).review-highlight-commented:after{display:none}.review-highlight-editing{outline-color:var(--review-highlight-editing-color)}::highlight(review-selection-commented){background-color:var(--review-selection-commented-color)}::highlight(review-selection-editing){background-color:var(--review-selection-editing-color)}::highlight(review-selection-hover){background-color:var(--review-selection-hover-color)}.review-active [data-review-id],.review-active .review-target{cursor:pointer}.review-active [data-review-selectable]{cursor:text}`;var Os=["Shift","Meta","Alt","Control"],Pi=typeof navigator=="object"?navigator.platform:"",Ni=/Mac|iPod|iPhone|iPad/.test(Pi),Ls=Ni?"Meta":"Control",Rs=Pi==="Win32"?["Control","Alt"]:Ni?["Alt"]:[];function Sn(n,t){return typeof n.getModifierState=="function"&&(n.getModifierState(t)||Rs.includes(t)&&n.getModifierState("AltGraph"))}function zs(n){return n.trim().split(" ").map(function(t){var e=t.split(/\b\+/),i=e.pop(),o=i.match(/^\((.+)\)$/);return o&&(i=new RegExp("^(?:"+o[1]+")$","iv")),[e=e.map(function(r){return r==="$mod"?Ls:r}),i]})}function Ms(n,t){var e=t[0],i=t[1];return!((i instanceof RegExp?!i.test(n.key)&&!i.test(n.code):i.toUpperCase()!==n.key.toUpperCase()&&i!==n.code)||e.find(function(o){return!Sn(n,o)})||Os.find(function(o){return!e.includes(o)&&i!==o&&Sn(n,o)}))}function Ds(n,t){var e;t===void 0&&(t={});var i=(e=t.timeout)!=null?e:1e3,o=Object.keys(n).map(function(a){return[zs(a),n[a]]}),r=new Map,s=null;return function(a){a instanceof KeyboardEvent&&(o.forEach(function(l){var c=l[0],f=l[1],d=r.get(c)||c;Ms(a,d[0])?d.length>1?r.set(c,d.slice(1)):(r.delete(c),f(a)):Sn(a,a.key)||r.delete(c)}),s&&clearTimeout(s),s=setTimeout(r.clear.bind(r),i))}}function Ps(n,t,e){var i={},o=i.event,r=o===void 0?"keydown":o,s=i.capture,a=Ds(t,{timeout:i.timeout});return n.addEventListener(r,a,s),function(){n.removeEventListener(r,a,s)}}function Ns(n,t){const e=n.find(o=>o.targetId===t&&!o.selection);return e?{comment:e,isNew:!1}:{comment:{commentId:crypto.randomUUID(),targetId:t,content:"",createdAt:new Date().toISOString()},isNew:!0}}function Hs(n){let t=n.comments;if(n.editingCommentId!==null){const e=t.find(i=>i.commentId===n.editingCommentId);e&&e.content===""&&(t=t.filter(i=>i.commentId!==n.editingCommentId))}return{comments:t,editingCommentId:null,targetElement:null,selectionRange:null}}function Hi(n){const t=n.comments.filter(o=>o.content.trim()),e=t.length>0,i=n.overallComment.trim().length>0;return!e&&!i?{status:"approved"}:{status:"commented",comments:t,overallComment:i?n.overallComment.trim():void 0}}function js(n){const t=new Set;for(const e of n.comments)!e.selection&&e.content.trim()&&t.add(e.targetId);return t}function Us(){const n=Oi(({sendBack:e,input:i})=>{const o=()=>e({type:"RELEASE_ANNOTATE"}),r=l=>{l.key==="Alt"&&(l.preventDefault(),e({type:"HOLD_ANNOTATE"}))},s=l=>{l.key==="Alt"&&e({type:"RELEASE_ANNOTATE"})},a=Ps(window,{[i.shortcut]:l=>{l.preventDefault(),e({type:"TOGGLE"})},"$mod+Enter":l=>{l.preventDefault(),e({type:"CLOSE"})},"$mod+Shift+Backspace":l=>{l.preventDefault(),e({type:"DELETE"})},Escape:l=>{l.preventDefault(),e({type:"CLOSE"})}});return window.addEventListener("keydown",r),window.addEventListener("keyup",s),window.addEventListener("blur",o),()=>{a(),window.removeEventListener("keydown",r),window.removeEventListener("keyup",s),window.removeEventListener("blur",o)}}),t=Oi(({sendBack:e,input:i})=>{const o=new MutationObserver(r=>{for(const s of r)for(const a of Array.from(s.removedNodes))if(a instanceof HTMLElement&&(a===i.targetElement||a.contains(i.targetElement))){e({type:"TARGET_DISCONNECTED"});return}});return o.observe(i.wrapperElement,{childList:!0,subtree:!0}),()=>o.disconnect()});return zi({actors:{keyboardActor:n,mutationObserverActor:t},guards:{isCommentingEditing:zr({commenting:"editing"}),hasSelectionCommentId:({event:e})=>e.type!=="CLICK"?!1:!!e.selectionCommentId,hasTargetId:({event:e})=>e.type!=="CLICK"?!1:!!e.targetId&&!e.selectionCommentId,hasNoTarget:({event:e})=>e.type!=="CLICK"?!1:!e.targetId&&!e.selectionCommentId,isSameComment:({context:e,event:i})=>{if(i.type!=="CLICK")return!1;if(i.selectionCommentId)return e.editingCommentId===i.selectionCommentId;if(i.targetId){const o=e.comments.find(r=>r.commentId===e.editingCommentId);return!!o&&o.targetId===i.targetId&&!o.selection}return!1}},delays:{flashDuration:500},actions:{openElementComment:F(({context:e,event:i})=>{if(i.type!=="CLICK"||!i.targetId)return{};const{comment:o,isNew:r}=Ns(e.comments,i.targetId);return{comments:r?[...e.comments,o]:e.comments,editingCommentId:o.commentId,targetElement:i.element??null,selectionRange:null}}),openSelectionComment:F(({event:e})=>e.type!=="CLICK"||!e.selectionCommentId?{}:{editingCommentId:e.selectionCommentId,targetElement:e.element??null,selectionRange:null}),createSelectionComment:F(({context:e,event:i})=>{if(i.type!=="SELECT_TEXT")return{};const o={commentId:crypto.randomUUID(),targetId:i.targetId,content:"",createdAt:new Date().toISOString(),selection:i.selectionRange};return{comments:[...e.comments,o],editingCommentId:o.commentId,targetElement:i.targetElement,selectionRange:i.selectionRange}}),updateContent:F(({context:e,event:i})=>i.type!=="COMMENT_CHANGE"?{}:e.editingCommentId===null?{overallComment:i.content}:{comments:e.comments.map(o=>o.commentId===e.editingCommentId?{...o,content:i.content}:o)}),deleteComment:F(({context:e})=>({comments:e.comments.filter(i=>i.commentId!==e.editingCommentId),editingCommentId:null,targetElement:null,selectionRange:null})),cleanup:F(({context:e})=>Hs(e)),emitChanged:xe(({context:e})=>({type:"REVIEW_CHANGED",result:Hi(e)})),emitSubmitted:xe(({context:e})=>({type:"REVIEW_SUBMITTED",result:Hi(e)})),highlightsActivate:({context:e})=>{e.highlights.activate(js(e))},highlightsDeactivate:({context:e})=>{e.highlights.deactivate()},highlightsRevealFlash:({context:e})=>{e.highlights.reveal(!0)},highlightsReveal:({context:e})=>{e.highlights.reveal(!1)},highlightsUnreveal:({context:e})=>{e.highlights.unreveal()},editingTargetSet:({context:e})=>{var o;if(!e.targetElement)return;const i=!!((o=e.comments.find(r=>r.commentId===e.editingCommentId))!=null&&o.selection);e.highlights.setEditing(e.targetElement,i)},editingTargetCleared:({context:e})=>{if(!e.targetElement)return;const i=e.comments.find(o=>o.commentId===e.editingCommentId);e.highlights.clearEditing(e.targetElement,!!(i!=null&&i.content.trim()))}}}).createMachine({id:"review",type:"parallel",context:({input:e})=>{var r,s;const i=((r=e.initialData)==null?void 0:r.status)==="commented"?e.initialData.comments??[]:[],o=((s=e.initialData)==null?void 0:s.status)==="commented"?e.initialData.overallComment??"":"";return{comments:i,overallComment:o,editingCommentId:null,targetElement:null,selectionRange:null,shortcut:e.shortcut,defaultMode:e.defaultMode,highlights:e.highlights}},invoke:{id:"keyboard",src:"keyboardActor",input:({context:e})=>({shortcut:e.shortcut})},states:{annotating:{initial:"waitingForMount",on:{SUBMIT:".inactive"},states:{waitingForMount:{on:{MOUNTED:[{guard:({context:e})=>e.defaultMode==="annotating",target:"toggled"},{target:"inactive"}]}},inactive:{on:{TOGGLE:"toggled",HOLD_ANNOTATE:"held"}},toggled:{initial:"flashing",entry:"highlightsActivate",exit:"highlightsDeactivate",on:{TOGGLE:{target:"inactive",actions:Ri(({enqueue:e,check:i})=>{i("isCommentingEditing")&&e.raise({type:"CLOSE"})})}},states:{flashing:{entry:"highlightsRevealFlash",exit:"highlightsUnreveal",after:{flashDuration:"ready"},on:{HOLD_ANNOTATE:"revealing"}},ready:{on:{HOLD_ANNOTATE:"revealing"}},revealing:{entry:"highlightsReveal",exit:"highlightsUnreveal",on:{RELEASE_ANNOTATE:"ready"}}}},held:{initial:"revealing",entry:"highlightsActivate",exit:"highlightsDeactivate",states:{revealing:{entry:"highlightsReveal",exit:"highlightsUnreveal",on:{RELEASE_ANNOTATE:[{guard:"isCommentingEditing",target:"lingering"},{target:"#review.annotating.inactive"}]}},lingering:{on:{CLOSE:"#review.annotating.inactive",DELETE:"#review.annotating.inactive"}}}}}},commenting:{initial:"idle",states:{idle:{on:{CLICK:[{guard:"hasSelectionCommentId",target:"editing.selection",actions:["openSelectionComment","editingTargetSet"]},{guard:"hasTargetId",target:"editing.element",actions:["openElementComment","editingTargetSet"]}],SELECT_TEXT:{target:"editing.selection",actions:["createSelectionComment","editingTargetSet"]},OPEN_OVERALL:{target:"editing.element",actions:F({editingCommentId:null,targetElement:null,selectionRange:null})},SUBMIT:{actions:["emitSubmitted"]}}},editing:{initial:"element",on:{CLICK:[{guard:"isSameComment"},{guard:"hasSelectionCommentId",target:".selection",reenter:!0,actions:["editingTargetCleared","cleanup","openSelectionComment","editingTargetSet"]},{guard:"hasTargetId",target:".element",reenter:!0,actions:["editingTargetCleared","cleanup","openElementComment","editingTargetSet"]},{guard:"hasNoTarget",target:"idle",actions:["editingTargetCleared","cleanup","emitChanged"]}],SELECT_TEXT:{target:".selection",reenter:!0,actions:["editingTargetCleared","cleanup","createSelectionComment","editingTargetSet"]},COMMENT_CHANGE:{actions:["updateContent","emitChanged"]},DELETE:{target:"idle",actions:["editingTargetCleared","deleteComment","emitChanged"]},CLOSE:{target:"idle",actions:["editingTargetCleared","cleanup","emitChanged"]},TARGET_DISCONNECTED:{target:"idle",actions:["editingTargetCleared","cleanup","emitChanged"]},SUBMIT:{target:"idle",actions:["editingTargetCleared","cleanup","emitSubmitted"]},OPEN_OVERALL:{target:".element",reenter:!0,actions:["editingTargetCleared","cleanup",F({editingCommentId:null,targetElement:null,selectionRange:null})]}},states:{element:{},selection:{}}}}}}})}const Bs=3;function Ws(n){const t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return null;const e=t.getRangeAt(0),i=e.toString();if(i.length<Bs)return null;const o=Vs(n,e.startContainer,e.startOffset),r=o+i.length;if(o<0)return null;const s=qs(n.textContent??"",i,o);return{startOffset:o,endOffset:r,selectedText:i,matchIndex:s}}function ji(n,t){const e=n.textContent??"";if(e.slice(t.startOffset,t.endOffset)===t.selectedText)return Ui(n,t.startOffset,t.endOffset);const o=Xs(e,t.selectedText,t.matchIndex);return o<0?null:Ui(n,o,o+t.selectedText.length)}function Gs(n,t){if(n.isCollapsed||n.rangeCount===0)return!1;const e=n.getRangeAt(0);return t.contains(e.startContainer)&&t.contains(e.endContainer)}function An(n){const t=n instanceof HTMLElement?n:n.parentElement;return(t==null?void 0:t.closest("[data-review-selectable]"))??null}function Fs(n,t){var s;if(n.isCollapsed||n.rangeCount===0)return null;const e=n.getRangeAt(0),i=e.cloneRange(),o=t.contains(e.startContainer),r=t.contains(e.endContainer);if(o&&r)return i;if(o&&!r){const a=Ks(t);return a&&i.setEnd(a,((s=a.textContent)==null?void 0:s.length)??0),i}return null}function Vs(n,t,e){var r;const i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;i.nextNode();){if(i.currentNode===t)return o+e;o+=((r=i.currentNode.textContent)==null?void 0:r.length)??0}return-1}function Ui(n,t,e){var a;const i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),o=document.createRange();let r=0,s=!1;for(;i.nextNode();){const l=((a=i.currentNode.textContent)==null?void 0:a.length)??0;if(!s&&r+l>t&&(o.setStart(i.currentNode,t-r),s=!0),s&&r+l>=e)return o.setEnd(i.currentNode,e-r),o;r+=l}return null}function qs(n,t,e){let i=0,o=0;for(;;){const r=n.indexOf(t,o);if(r<0||r===e)return i;o=r+1,i++}}function Xs(n,t,e){let i=0,o=0;for(;;){const r=n.indexOf(t,o);if(r<0)return-1;if(i===e)return r;o=r+1,i++}}function Ks(n){const t=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let e=null;for(;t.nextNode();)e=t.currentNode;return e}function Js(n,t){const e=new Map;return t.querySelectorAll("[data-review-id]").forEach((o,r)=>{const s=o.getAttribute("data-review-id");s&&e.set(s,r)}),[...n].sort((o,r)=>{const s=e.get(o.targetId)??Number.MAX_SAFE_INTEGER,a=e.get(r.targetId)??Number.MAX_SAFE_INTEGER;return s-a})}/**
|
|
1
|
+
(function(C,Gt){typeof exports=="object"&&typeof module<"u"?Gt(exports):typeof define=="function"&&define.amd?define(["exports"],Gt):(C=typeof globalThis<"u"?globalThis:C||self,Gt(C.Llumi={}))})(this,(function(C){"use strict";var ar;function Gt(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function fr(){const n=Gt();if(n.__xstate__)return n.__xstate__}const pr=n=>{if(typeof window>"u")return;const t=fr();t&&t.register(n)};class ri{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const si=".",mr="",ai="",gr="#",vr="*",li="xstate.init",br="xstate.error",fe="xstate.stop";function yr(n,t){return{type:`xstate.after.${n}.${t}`}}function tn(n,t){return{type:`xstate.done.state.${n}`,output:t}}function wr(n,t){return{type:`xstate.done.actor.${n}`,output:t,actorId:n}}function ci(n,t){return{type:`xstate.error.actor.${n}`,error:t,actorId:n}}function di(n){return{type:li,input:n}}function K(n){setTimeout(()=>{throw n})}const xr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ui(n,t){const e=hi(n),i=hi(t);return typeof i=="string"?typeof e=="string"?i===e:!1:typeof e=="string"?e in i:Object.keys(e).every(o=>o in i?ui(e[o],i[o]):!1)}function en(n){if(mi(n))return n;const t=[];let e="";for(let i=0;i<n.length;i++){switch(n.charCodeAt(i)){case 92:e+=n[i+1],i++;continue;case 46:t.push(e),e="";continue}e+=n[i]}return t.push(e),t}function hi(n){if(ss(n))return n.value;if(typeof n!="string")return n;const t=en(n);return _r(t)}function _r(n){if(n.length===1)return n[0];const t={};let e=t;for(let i=0;i<n.length-1;i++)if(i===n.length-2)e[n[i]]=n[i+1];else{const o=e;e={},o[n[i]]=e}return t}function fi(n,t){const e={},i=Object.keys(n);for(let o=0;o<i.length;o++){const r=i[o];e[r]=t(n[r],r,n,o)}return e}function pi(n){return mi(n)?n:[n]}function st(n){return n===void 0?[]:pi(n)}function nn(n,t,e,i){return typeof n=="function"?n({context:t,event:e,self:i}):n}function mi(n){return Array.isArray(n)}function Er(n){return n.type.startsWith("xstate.error.actor")}function Ot(n){return pi(n).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function gi(n){if(!(n===void 0||n===mr))return st(n)}function pe(n,t,e){var r,s,a;const i=typeof n=="object",o=i?n:void 0;return{next:(r=i?n.next:n)==null?void 0:r.bind(o),error:(s=i?n.error:t)==null?void 0:s.bind(o),complete:(a=i?n.complete:e)==null?void 0:a.bind(o)}}function vi(n,t){return`${t}.${n}`}function on(n,t){const e=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!e)return n.implementations.actors[t];const[,i,o]=e,s=n.getStateNodeById(o).config.invoke;return(Array.isArray(s)?s[i]:s).src}function Cr(n,t){if(t===n||t===vr)return!0;if(!t.endsWith(".*"))return!1;const e=t.split("."),i=n.split(".");for(let o=0;o<e.length;o++){const r=e[o],s=i[o];if(r==="*")return o===e.length-1;if(r!==s)return!1}return!0}function bi(n,t){return`${n.sessionId}.${t}`}let Sr=0;function Ar(n,t){const e=new Map,i=new Map,o=new WeakMap,r=new Set,s={},{clock:a,logger:l}=t,c={schedule:(u,h,p,m,g=Math.random().toString(36).slice(2))=>{const v={source:u,target:h,event:p,delay:m,id:g,startedAt:Date.now()},x=bi(u,g);d._snapshot._scheduledEvents[x]=v;const _=a.setTimeout(()=>{delete s[x],delete d._snapshot._scheduledEvents[x],d._relay(u,h,p)},m);s[x]=_},cancel:(u,h)=>{const p=bi(u,h),m=s[p];delete s[p],delete d._snapshot._scheduledEvents[p],m!==void 0&&a.clearTimeout(m)},cancelAll:u=>{for(const h in d._snapshot._scheduledEvents){const p=d._snapshot._scheduledEvents[h];p.source===u&&c.cancel(u,p.id)}}},f=u=>{if(!r.size)return;const h={...u,rootId:n.sessionId};r.forEach(p=>{var m;return(m=p.next)==null?void 0:m.call(p,h)})},d={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Sr++}`,_register:(u,h)=>(e.set(u,h),u),_unregister:u=>{e.delete(u.sessionId);const h=o.get(u);h!==void 0&&(i.delete(h),o.delete(u))},get:u=>i.get(u),getAll:()=>Object.fromEntries(i.entries()),_set:(u,h)=>{const p=i.get(u);if(p&&p!==h)throw new Error(`Actor with system ID '${u}' already exists.`);i.set(u,h),o.set(h,u)},inspect:u=>{const h=pe(u);return r.add(h),{unsubscribe(){r.delete(h)}}},_sendInspectionEvent:f,_relay:(u,h,p)=>{d._sendInspectionEvent({type:"@xstate.event",sourceRef:u,actorRef:h,event:p}),h._send(p)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...d._snapshot._scheduledEvents}}),start:()=>{const u=d._snapshot._scheduledEvents;d._snapshot._scheduledEvents={};for(const h in u){const{source:p,target:m,event:g,delay:v,id:x}=u[h];c.schedule(p,m,g,v,x)}},_clock:a,_logger:l};return d}let rn=!1;const sn=1;let j=(function(n){return n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped",n})({});const kr={clock:{setTimeout:(n,t)=>setTimeout(n,t),clearTimeout:n=>clearTimeout(n)},logger:console.log.bind(console),devTools:!1};class $r{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new ri(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=j.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const i={...kr,...e},{clock:o,logger:r,parent:s,syncSnapshot:a,id:l,systemId:c,inspect:f}=i;this.system=s?s.system:Ar(this,{clock:o,logger:r}),f&&!s&&this.system.inspect(pe(f)),this.sessionId=this.system._bookId(),this.id=l??this.sessionId,this.logger=(e==null?void 0:e.logger)??this.system._logger,this.clock=(e==null?void 0:e.clock)??this.system._clock,this._parent=s,this._syncSnapshot=a,this.options=i,this.src=i.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:d=>{this._deferred.push(d)},system:this.system,stopChild:d=>{if(d._parent!==this)throw new Error(`Cannot stop child actor ${d.id} of ${this.id} because it is not a child`);d._stop()},emit:d=>{const u=this.eventListeners.get(d.type),h=this.eventListeners.get("*");if(!u&&!h)return;const p=[...u?u.values():[],...h?h.values():[]];for(const m of p)try{m(d)}catch(g){K(g)}},actionExecutor:d=>{const u=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:d.type,params:d.params}}),!d.exec)return;const h=rn;try{rn=!0,d.exec(d.info,d.params)}finally{rn=h}};this._processingStatus===j.Running?u():this._deferred.push(u)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this.systemId=c,this.system._set(c,this)),this._initState((e==null?void 0:e.snapshot)??(e==null?void 0:e.state)),c&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var e;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(e=this.options)==null?void 0:e.input)}catch(i){this._snapshot={status:"error",output:void 0,error:i}}}update(t,e){var o,r;this._snapshot=t;let i;for(;i=this._deferred.shift();)try{i()}catch(s){this._deferred.length=0,this._snapshot={...t,status:"error",error:s}}switch(this._snapshot.status){case"active":for(const s of this.observers)try{(o=s.next)==null||o.call(s,t)}catch(a){K(a)}break;case"done":for(const s of this.observers)try{(r=s.next)==null||r.call(s,t)}catch(a){K(a)}this._stopProcedure(),this._complete(),this._doneEvent=wr(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,i){var r;const o=pe(t,e,i);if(this._processingStatus!==j.Stopped)this.observers.add(o);else switch(this._snapshot.status){case"done":try{(r=o.complete)==null||r.call(o)}catch(s){K(s)}break;case"error":{const s=this._snapshot.error;if(!o.error)K(s);else try{o.error(s)}catch(a){K(a)}break}}return{unsubscribe:()=>{this.observers.delete(o)}}}on(t,e){let i=this.eventListeners.get(t);i||(i=new Set,this.eventListeners.set(t,i));const o=e.bind(void 0);return i.add(o),{unsubscribe:()=>{i.delete(o)}}}select(t,e=Object.is){return{subscribe:i=>{const o=pe(i),r=this.getSnapshot();let s=t(r);return this.subscribe(a=>{var c;const l=t(a);e(s,l)||(s=l,(c=o.next)==null||c.call(o,l))})},get:()=>t(this.getSnapshot())}}start(){if(this._processingStatus===j.Running)return this;this._syncSnapshot&&this.subscribe({next:i=>{i.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:i})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=j.Running;const t=di(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(i){return this._snapshot={...this._snapshot,status:"error",error:i},this._error(i),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,i;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(o){i={err:o}}if(i){const{err:o}=i;this._snapshot={...this._snapshot,status:"error",error:o},this._error(o);return}this.update(e,t),t.type===fe&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===j.Stopped?this:(this.mailbox.clear(),this._processingStatus===j.NotStarted?(this._processingStatus=j.Stopped,this):(this.mailbox.enqueue({type:fe}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const e of this.observers)try{(t=e.complete)==null||t.call(e)}catch(i){K(i)}this.observers.clear(),this.eventListeners.clear()}_reportError(t){if(!this.observers.size){this._parent||K(t),this.eventListeners.clear();return}let e=!1;for(const i of this.observers){const o=i.error;e||(e=!o);try{o==null||o(t)}catch(r){K(r)}}this.observers.clear(),this.eventListeners.clear(),e&&K(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,ci(this.id,t))}_stopProcedure(){return this._processingStatus!==j.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new ri(this._process.bind(this)),this._processingStatus=j.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==j.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:pr)(this)}toJSON(){return{xstate$$type:sn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[xr](){return this}getSnapshot(){return this._snapshot}}function Ft(n,...[t]){return new $r(n,t)}function Tr(n,t,e,i,{sendId:o}){const r=typeof o=="function"?o(e,i):o;return[t,{sendId:r},void 0]}function Ir(n,t){n.defer(()=>{n.system.scheduler.cancel(n.self,t.sendId)})}function an(n){function t(e,i){}return t.type="xstate.cancel",t.sendId=n,t.resolve=Tr,t.execute=Ir,t}function Or(n,t,e,i,{id:o,systemId:r,src:s,input:a,syncSnapshot:l}){const c=typeof s=="string"?on(t.machine,s):s,f=typeof o=="function"?o(e):o;let d,u;return c&&(u=typeof a=="function"?a({context:t.context,event:e.event,self:n.self}):a,d=Ft(c,{id:f,src:s,parent:n.self,syncSnapshot:l,systemId:r,input:u})),[yt(t,{children:{...t.children,[f]:d}}),{id:o,systemId:r,actorRef:d,src:s,input:u},void 0]}function Lr(n,{actorRef:t}){t&&n.defer(()=>{t._processingStatus!==j.Stopped&&t.start()})}function ln(...[n,{id:t,systemId:e,input:i,syncSnapshot:o=!1}={}]){function r(s,a){}return r.type="xstate.spawnChild",r.id=t,r.systemId=e,r.src=n,r.input=i,r.syncSnapshot=o,r.resolve=Or,r.execute=Lr,r}function Rr(n,t,e,i,{actorRef:o}){const r=typeof o=="function"?o(e,i):o,s=typeof r=="string"?t.children[r]:r;let a=t.children;return s&&(a={...a},delete a[s.id]),[yt(t,{children:a}),s,void 0]}function yi(n,t){const e=t.getSnapshot();if(e&&"children"in e)for(const i of Object.values(e.children))yi(n,i);n.system._unregister(t)}function zr(n,t){if(t){if(yi(n,t),t._processingStatus!==j.Running){n.stopChild(t);return}n.defer(()=>{n.stopChild(t)})}}function me(n){function t(e,i){}return t.type="xstate.stopChild",t.actorRef=n,t.resolve=Rr,t.execute=zr,t}function Mr(n,t,{stateValue:e}){if(typeof e=="string"&&Xt(e)){const i=n.machine.getStateNodeById(e);return n._nodes.some(o=>o===i)}return n.matches(e)}function Dr(n){function t(){return!1}return t.check=Mr,t.stateValue=n,t}function Pr(n,{context:t,event:e},{guards:i}){return i.every(o=>Vt(o,t,e,n))}function Nr(n){function t(e,i){return!1}return t.check=Pr,t.guards=n,t}function Vt(n,t,e,i){const{machine:o}=i,r=typeof n=="function",s=r?n:o.implementations.guards[typeof n=="string"?n:n.type];if(!r&&!s)throw new Error(`Guard '${typeof n=="string"?n:n.type}' is not implemented.'.`);if(typeof s!="function")return Vt(s,t,e,i);const a={context:t,event:e},l=r||typeof n=="string"?void 0:"params"in n?typeof n.params=="function"?n.params({context:t,event:e}):n.params:void 0;return"check"in s?s.check(i,a,s):s(a,l)}function cn(n){return n.type==="atomic"||n.type==="final"}function Lt(n){return Object.values(n.states).filter(t=>t.type!=="history")}function qt(n,t){const e=[];if(t===n)return e;let i=n.parent;for(;i&&i!==t;)e.push(i),i=i.parent;return e}function ge(n){const t=new Set(n),e=xi(t);for(const i of t)if(i.type==="compound"&&(!e.get(i)||!e.get(i).length))Ci(i).forEach(o=>t.add(o));else if(i.type==="parallel"){for(const o of Lt(i))if(o.type!=="history"&&!t.has(o)){const r=Ci(o);for(const s of r)t.add(s)}}for(const i of t){let o=i.parent;for(;o;)t.add(o),o=o.parent}return t}function wi(n,t){const e=t.get(n);if(!e)return{};if(n.type==="compound"){const o=e[0];if(o){if(cn(o))return o.key}else return{}}const i={};for(const o of e)i[o.key]=wi(o,t);return i}function xi(n){const t=new Map;for(const e of n)t.has(e)||t.set(e,[]),e.parent&&(t.has(e.parent)||t.set(e.parent,[]),t.get(e.parent).push(e));return t}function _i(n,t){const e=ge(t);return wi(n,xi(e))}function dn(n,t){return t.type==="compound"?Lt(t).some(e=>e.type==="final"&&n.has(e)):t.type==="parallel"?Lt(t).every(e=>dn(n,e)):t.type==="final"}const Xt=n=>n[0]===gr;function jr(n,t){return n.transitions.get(t)||[...n.transitions.keys()].filter(i=>Cr(t,i)).sort((i,o)=>o.length-i.length).flatMap(i=>n.transitions.get(i))}function Hr(n){const t=n.config.after;if(!t)return[];const e=o=>{const r=yr(o,n.id),s=r.type;return n.entry.push(vn(r,{id:s,delay:o})),n.exit.push(an(s)),s};return Object.keys(t).flatMap(o=>{const r=t[o],s=typeof r=="string"?{target:r}:r,a=Number.isNaN(+o)?o:+o,l=e(a);return st(s).map(c=>({...c,event:l,delay:a}))}).map(o=>{const{delay:r}=o;return{...at(n,o.event,o),delay:r}})}function at(n,t,e){const i=gi(e.target),o=e.reenter??!1,r=Gr(n,i),s={...e,actions:st(e.actions),guard:e.guard,target:r,source:n,reenter:o,eventType:t,toJSON:()=>({...s,source:`#${n.id}`,target:r?r.map(a=>`#${a.id}`):void 0})};return s}function Ur(n){const t=new Map;if(n.config.on)for(const e of Object.keys(n.config.on)){if(e===ai)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const i=n.config.on[e];t.set(e,Ot(i).map(o=>at(n,e,o)))}if(n.config.onDone){const e=`xstate.done.state.${n.id}`;t.set(e,Ot(n.config.onDone).map(i=>at(n,e,i)))}for(const e of n.invoke){if(e.onDone){const i=`xstate.done.actor.${e.id}`;t.set(i,Ot(e.onDone).map(o=>at(n,i,o)))}if(e.onError){const i=`xstate.error.actor.${e.id}`;t.set(i,Ot(e.onError).map(o=>at(n,i,o)))}if(e.onSnapshot){const i=`xstate.snapshot.${e.id}`;t.set(i,Ot(e.onSnapshot).map(o=>at(n,i,o)))}}for(const e of n.after){let i=t.get(e.eventType);i||(i=[],t.set(e.eventType,i)),i.push(e)}return t}function Br(n){const t=[],e=i=>{Object.values(i).forEach(o=>{if(o.config.route&&o.config.id){const r=o.config.id,s=o.config.route.guard,a=({event:c})=>c.to===`#${r}`,l={...o.config.route,guard:s?Nr([a,s]):a,target:`#${r}`};t.push(at(n,"xstate.route",l))}o.states&&e(o.states)})};e(n.states),t.length>0&&n.transitions.set("xstate.route",t)}function Wr(n,t){const e=typeof t=="string"?n.states[t]:t?n.states[t.target]:void 0;if(!e&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${n.id}`);const i={source:n,actions:!t||typeof t=="string"?[]:st(t.actions),eventType:null,reenter:!1,target:e?[e]:[],toJSON:()=>({...i,source:`#${n.id}`,target:e?[`#${e.id}`]:[]})};return i}function Gr(n,t){if(t!==void 0)return t.map(e=>{if(typeof e!="string")return e;if(Xt(e))return n.machine.getStateNodeById(e);const i=e[0]===si;if(i&&!n.parent)return ve(n,e.slice(1));const o=i?n.key+e:e;if(n.parent)try{return ve(n.parent,o)}catch(r){throw new Error(`Invalid transition definition for state node '${n.id}':
|
|
2
|
+
${r.message}`)}else throw new Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}function Ei(n){const t=gi(n.config.target);return t?{target:t.map(e=>typeof e=="string"?ve(n.parent,e):e)}:n.parent.initial}function bt(n){return n.type==="history"}function Ci(n){const t=Si(n);for(const e of t)for(const i of qt(e,n))t.add(i);return t}function Si(n){const t=new Set;function e(i){if(!t.has(i)){if(t.add(i),i.type==="compound")e(i.initial.target[0]);else if(i.type==="parallel")for(const o of Lt(i))e(o)}}return e(n),t}function Rt(n,t){if(Xt(t))return n.machine.getStateNodeById(t);if(!n.states)throw new Error(`Unable to retrieve child state '${t}' from '${n.id}'; no child states exist.`);const e=n.states[t];if(!e)throw new Error(`Child state '${t}' does not exist on '${n.id}'`);return e}function ve(n,t){if(typeof t=="string"&&Xt(t))try{return n.machine.getStateNodeById(t)}catch{}const e=en(t).slice();let i=n;for(;e.length;){const o=e.shift();if(!o.length)break;i=Rt(i,o)}return i}function be(n,t){if(typeof t=="string"){const o=n.states[t];if(!o)throw new Error(`State '${t}' does not exist on '${n.id}'`);return[n,o]}const e=Object.keys(t),i=e.map(o=>Rt(n,o)).filter(Boolean);return[n.machine.root,n].concat(i,e.reduce((o,r)=>{const s=Rt(n,r);if(!s)return o;const a=be(s,t[r]);return o.concat(a)},[]))}function Fr(n,t,e,i){const r=Rt(n,t).next(e,i);return!r||!r.length?n.next(e,i):r}function Vr(n,t,e,i){const o=Object.keys(t),r=Rt(n,o[0]),s=un(r,t[o[0]],e,i);return!s||!s.length?n.next(e,i):s}function qr(n,t,e,i){const o=[];for(const r of Object.keys(t)){const s=t[r];if(!s)continue;const a=Rt(n,r),l=un(a,s,e,i);l&&o.push(...l)}return o.length?o:n.next(e,i)}function un(n,t,e,i){return typeof t=="string"?Fr(n,t,e,i):Object.keys(t).length===1?Vr(n,t,e,i):qr(n,t,e,i)}function Xr(n){return Object.keys(n.states).map(t=>n.states[t]).filter(t=>t.type==="history")}function lt(n,t){let e=n;for(;e.parent&&e.parent!==t;)e=e.parent;return e.parent===t}function Kr(n,t){const e=new Set(n),i=new Set(t);for(const o of e)if(i.has(o))return!0;for(const o of i)if(e.has(o))return!0;return!1}function Ai(n,t,e){const i=new Set;for(const o of n){let r=!1;const s=new Set;for(const a of i)if(Kr(fn([o],t,e),fn([a],t,e)))if(lt(o.source,a.source))s.add(a);else{r=!0;break}if(!r){for(const a of s)i.delete(a);i.add(o)}}return Array.from(i)}function Jr(n){const[t,...e]=n;for(const i of qt(t,void 0))if(e.every(o=>lt(o,i)))return i}function hn(n,t){if(!n.target)return[];const e=new Set;for(const i of n.target)if(bt(i))if(t[i.id])for(const o of t[i.id])e.add(o);else for(const o of hn(Ei(i),t))e.add(o);else e.add(i);return[...e]}function ki(n,t){const e=hn(n,t);if(!e)return;if(!n.reenter&&e.every(o=>o===n.source||lt(o,n.source)))return n.source;const i=Jr(e.concat(n.source));if(i)return i;if(!n.reenter)return n.source.machine.root}function fn(n,t,e){var o;const i=new Set;for(const r of n)if((o=r.target)!=null&&o.length){const s=ki(r,e);r.reenter&&r.source===s&&i.add(s);for(const a of t)lt(a,s)&&i.add(a)}return[...i]}function Yr(n,t){if(n.length!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}function Zr(n,t,e,i,o){return pn([{target:[...Si(n)],source:n,reenter:!0,actions:[],eventType:null,toJSON:null}],t,e,i,!0,o)}function pn(n,t,e,i,o,r){const s=[];if(!n.length)return[t,s];const a=e.actionExecutor;e.actionExecutor=l=>{s.push(l),a(l)};try{const l=new Set(t._nodes);let c=t.historyValue;const f=Ai(n,l,c);let d=t;o||([d,c]=ns(d,i,e,f,l,c,r,e.actionExecutor)),d=Mt(d,i,e,f.flatMap(h=>h.actions),r,void 0),d=ts(d,i,e,f,l,r,c,o);const u=[...l];d.status==="done"&&(d=Mt(d,i,e,u.sort((h,p)=>p.order-h.order).flatMap(h=>h.exit),r,void 0));try{return c===t.historyValue&&Yr(t._nodes,l)?[d,s]:[yt(d,{_nodes:u,historyValue:c}),s]}catch(h){throw h}}finally{e.actionExecutor=a}}function Qr(n,t,e,i,o){if(i.output===void 0)return;const r=tn(o.id,o.output!==void 0&&o.parent?nn(o.output,n.context,t,e.self):void 0);return nn(i.output,n.context,r,e.self)}function ts(n,t,e,i,o,r,s,a){let l=n;const c=new Set,f=new Set;es(i,s,f,c),a&&f.add(n.machine.root);const d=new Set;for(const u of[...c].sort((h,p)=>h.order-p.order)){o.add(u);const h=[];h.push(...u.entry);for(const p of u.invoke)h.push(ln(p.src,{...p,syncSnapshot:!!p.onSnapshot}));if(f.has(u)){const p=u.initial.actions;h.push(...p)}if(l=Mt(l,t,e,h,r,u.invoke.map(p=>p.id)),u.type==="final"){const p=u.parent;let m=(p==null?void 0:p.type)==="parallel"?p:p==null?void 0:p.parent,g=m||u;for((p==null?void 0:p.type)==="compound"&&r.push(tn(p.id,u.output!==void 0?nn(u.output,l.context,t,e.self):void 0));(m==null?void 0:m.type)==="parallel"&&!d.has(m)&&dn(o,m);)d.add(m),r.push(tn(m.id)),g=m,m=m.parent;if(m)continue;l=yt(l,{status:"done",output:Qr(l,t,e,l.machine.root,g)})}}return l}function es(n,t,e,i){for(const o of n){const r=ki(o,t);for(const a of o.target||[])!bt(a)&&(o.source!==a||o.source!==r||o.reenter)&&(i.add(a),e.add(a)),zt(a,t,e,i);const s=hn(o,t);for(const a of s){const l=qt(a,r);(r==null?void 0:r.type)==="parallel"&&l.push(r),$i(i,t,e,l,!o.source.parent&&o.reenter?void 0:r)}}}function zt(n,t,e,i){var o;if(bt(n))if(t[n.id]){const r=t[n.id];for(const s of r)i.add(s),zt(s,t,e,i);for(const s of r)mn(s,n.parent,i,t,e)}else{const r=Ei(n);for(const s of r.target)i.add(s),r===((o=n.parent)==null?void 0:o.initial)&&e.add(n.parent),zt(s,t,e,i);for(const s of r.target)mn(s,n.parent,i,t,e)}else if(n.type==="compound"){const[r]=n.initial.target;bt(r)||(i.add(r),e.add(r)),zt(r,t,e,i),mn(r,n,i,t,e)}else if(n.type==="parallel")for(const r of Lt(n).filter(s=>!bt(s)))[...i].some(s=>lt(s,r))||(bt(r)||(i.add(r),e.add(r)),zt(r,t,e,i))}function $i(n,t,e,i,o){for(const r of i)if((!o||lt(r,o))&&n.add(r),r.type==="parallel")for(const s of Lt(r).filter(a=>!bt(a)))[...n].some(a=>lt(a,s))||(n.add(s),zt(s,t,e,n))}function mn(n,t,e,i,o){$i(e,i,o,qt(n,t))}function ns(n,t,e,i,o,r,s,a){let l=n;const c=fn(i,o,r);c.sort((d,u)=>u.order-d.order);let f;for(const d of c)for(const u of Xr(d)){let h;u.history==="deep"?h=p=>cn(p)&<(p,d):h=p=>p.parent===d,f??(f={...r}),f[u.id]=Array.from(o).filter(h)}for(const d of c)l=Mt(l,t,e,[...d.exit,...d.invoke.map(u=>me(u.id))],s,void 0),o.delete(d);return[l,f||r]}function is(n,t){return n.implementations.actions[t]}function Ti(n,t,e,i,o,r){const{machine:s}=n;let a=n;for(const l of i){const c=typeof l=="function",f=c?l:is(s,typeof l=="string"?l:l.type),d={context:a.context,event:t,self:e.self,system:e.system},u=c||typeof l=="string"?void 0:"params"in l?typeof l.params=="function"?l.params({context:a.context,event:t}):l.params:void 0;if(!f||!("resolve"in f)){e.actionExecutor({type:typeof l=="string"?l:typeof l=="object"?l.type:l.name||"(anonymous)",info:d,params:u,exec:f});continue}const h=f,[p,m,g]=h.resolve(e,a,d,u,f,o);a=p,"retryResolve"in h&&(r==null||r.push([h,m])),"execute"in h&&e.actionExecutor({type:h.type,info:d,params:m,exec:h.execute.bind(null,e,m)}),g&&(a=Ti(a,t,e,g,o,r))}return a}function Mt(n,t,e,i,o,r){const s=r?[]:void 0,a=Ti(n,t,e,i,{internalQueue:o,deferredActorIds:r},s);return s==null||s.forEach(([l,c])=>{l.retryResolve(e,a,c)}),a}function gn(n,t,e,i){var d;let o=n;const r=[];function s(u,h,p){e.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:e.self,event:h,snapshot:u[0],_transitions:p}),r.push(u)}if(t.type===fe)return o=yt(Ii(o,t,e),{status:"stopped"}),s([o,[]],t,[]),{snapshot:o,microsteps:r};let a=t;if(a.type!==li){const u=a,h=Er(u),p=Oi(u,o);if(h&&!p.length)return o=yt(n,{status:"error",error:u.error}),s([o,[]],u,[]),{snapshot:o,microsteps:r};const m=pn(p,n,e,a,!1,i);o=m[0],s(m,u,p)}let l=!0;const c=((d=n.machine.options)==null?void 0:d.maxIterations)??1/0;let f=0;for(;o.status==="active";){if(f++,f>c)throw new Error(`Infinite loop detected: the machine has processed more than ${c} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let u=l?os(o,a):[];const h=u.length?o:void 0;if(!u.length){if(!i.length)break;a=i.shift(),u=Oi(a,o)}const p=pn(u,o,e,a,!1,i);o=p[0],l=o!==h,s(p,a,u)}return o.status!=="active"&&Ii(o,a,e),{snapshot:o,microsteps:r}}function Ii(n,t,e){return Mt(n,t,e,Object.values(n.children).map(i=>me(i)),[],void 0)}function Oi(n,t){return t.machine.getTransitionData(t,n)}function os(n,t){const e=new Set,i=n._nodes.filter(cn);for(const o of i)t:for(const r of[o].concat(qt(o,void 0)))if(r.always){for(const s of r.always)if(s.guard===void 0||Vt(s.guard,n.context,t,n)){e.add(s);break t}}return Ai(Array.from(e),new Set(n._nodes),n.historyValue)}function rs(n,t){const e=ge(be(n,t));return _i(n,[...e])}function ss(n){return!!n&&typeof n=="object"&&"machine"in n&&"value"in n}const as=function(t){return ui(t,this.value)},ls=function(t){return this.tags.has(t)},cs=function(t){const e=this.machine.getTransitionData(this,t);return!!(e!=null&&e.length)&&e.some(i=>i.target!==void 0||i.actions.length)},ds=function(){const{_nodes:t,tags:e,machine:i,getMeta:o,toJSON:r,can:s,hasTag:a,matches:l,...c}=this;return{...c,tags:Array.from(e)}},us=function(){return this._nodes.reduce((t,e)=>(e.meta!==void 0&&(t[e.id]=e.meta),t),{})};function ye(n,t){return{status:n.status,output:n.output,error:n.error,machine:t,context:n.context,_nodes:n._nodes,value:_i(t.root,n._nodes),tags:new Set(n._nodes.flatMap(e=>e.tags)),children:n.children,historyValue:n.historyValue||{},matches:as,hasTag:ls,can:cs,getMeta:us,toJSON:ds}}function yt(n,t={}){return ye({...n,...t},n.machine)}function hs(n){if(typeof n!="object"||n===null)return{};const t={};for(const e in n){const i=n[e];Array.isArray(i)&&(t[e]=i.map(o=>({id:o.id})))}return t}function fs(n,t){const{_nodes:e,tags:i,machine:o,children:r,context:s,can:a,hasTag:l,matches:c,getMeta:f,toJSON:d,...u}=n,h={};for(const m in r){const g=r[m];h[m]={snapshot:g.getPersistedSnapshot(t),src:g.src,systemId:g.systemId,syncSnapshot:g._syncSnapshot}}return{...u,context:Li(s),children:h,historyValue:hs(u.historyValue)}}function Li(n){let t;for(const e in n){const i=n[e];if(i&&typeof i=="object")if("sessionId"in i&&"send"in i&&"ref"in i)t??(t=Array.isArray(n)?n.slice():{...n}),t[e]={xstate$$type:sn,id:i.id};else{const o=Li(i);o!==i&&(t??(t=Array.isArray(n)?n.slice():{...n}),t[e]=o)}}return t??n}function ps(n,t,e,i,{event:o,id:r,delay:s},{internalQueue:a}){const l=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${o}" }) instead`);const c=typeof o=="function"?o(e,i):o;let f;if(typeof s=="string"){const d=l&&l[s];f=typeof d=="function"?d(e,i):d}else f=typeof s=="function"?s(e,i):s;return typeof f!="number"&&a.push(c),[t,{event:c,id:r,delay:f},void 0]}function ms(n,t){const{event:e,delay:i,id:o}=t;if(typeof i=="number"){n.defer(()=>{const r=n.self;n.system.scheduler.schedule(r,r,e,i,o)});return}}function vn(n,t){function e(i,o){}return e.type="xstate.raise",e.event=n,e.id=t==null?void 0:t.id,e.delay=t==null?void 0:t.delay,e.resolve=ps,e.execute=ms,e}const bn=new WeakMap;function Ri(n){return{config:n,start:(e,i)=>{const{self:o,system:r,emit:s}=i,a={receivers:void 0,dispose:void 0};bn.set(o,a),a.dispose=n({input:e.input,system:r,self:o,sendBack:l=>{o.getSnapshot().status!=="stopped"&&o._parent&&r._relay(o,o._parent,l)},receive:l=>{a.receivers??(a.receivers=new Set),a.receivers.add(l)},emit:s})},transition:(e,i,o)=>{var s,a,l;const r=bn.get(o.self);return i.type===fe?(e={...e,status:"stopped",error:void 0},bn.delete(o.self),(s=r.receivers)==null||s.clear(),(a=r.dispose)==null||a.call(r),e):((l=r.receivers)==null||l.forEach(c=>c(i)),e)},getInitialSnapshot:(e,i)=>({status:"active",output:void 0,error:void 0,input:i}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}function gs(n,{machine:t,context:e},i,o){const r=(s,a)=>{if(typeof s=="string"){const l=on(t,s);if(!l)throw new Error(`Actor logic '${s}' not implemented in machine '${t.id}'`);const c=Ft(l,{id:a==null?void 0:a.id,parent:n.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:typeof(a==null?void 0:a.input)=="function"?a.input({context:e,event:i,self:n.self}):a==null?void 0:a.input,src:s,systemId:a==null?void 0:a.systemId});return o[c.id]=c,c}else return Ft(s,{id:a==null?void 0:a.id,parent:n.self,syncSnapshot:a==null?void 0:a.syncSnapshot,input:a==null?void 0:a.input,src:s,systemId:a==null?void 0:a.systemId})};return(s,a)=>{const l=r(s,a);return o[l.id]=l,n.defer(()=>{l._processingStatus!==j.Stopped&&l.start()}),l}}function vs(n,t,e,i,{assignment:o}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const r={},s={context:t.context,event:e.event,spawn:gs(n,t,e.event,r),self:n.self,system:n.system};let a={};if(typeof o=="function")a=o(s,i);else for(const c of Object.keys(o)){const f=o[c];a[c]=typeof f=="function"?f(s,i):f}const l=Object.assign({},t.context,a);return[yt(t,{context:l,children:Object.keys(r).length?{...t.children,...r}:t.children}),void 0,void 0]}function F(n){function t(e,i){}return t.type="xstate.assign",t.assignment=n,t.resolve=vs,t}const zi=new WeakMap;function Dt(n,t,e){let i=zi.get(n);return i?t in i||(i[t]=e()):(i={[t]:e()},zi.set(n,i)),i[t]}const bs={},Kt=n=>typeof n=="string"?{type:n}:typeof n=="function"?"resolve"in n?{type:n.type}:{type:n.name}:n;class we{constructor(t,e){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(si),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?fi(this.config.states,(i,o)=>new we(i,{_parent:this,_key:o,_machine:this.machine})):bs,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=st(this.config.entry).slice(),this.exit=st(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=st(t.tags).slice()}_initialize(){this.transitions=Ur(this),this.config.always&&(this.always=Ot(this.config.always).map(t=>at(this,ai,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Kt),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Kt),eventType:null})}:void 0,history:this.history,states:fi(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(Kt)})),entry:this.entry.map(Kt),exit:this.exit.map(Kt),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Dt(this,"invoke",()=>st(this.config.invoke).map((t,e)=>{const{src:i,systemId:o}=t,r=t.id??vi(this.id,e),s=typeof i=="string"?i:`xstate.invoke.${vi(this.id,e)}`;return{...t,src:s,id:r,systemId:o,toJSON(){const{onDone:a,onError:l,...c}=t;return{...c,type:"xstate.invoke",src:s,id:r}}}}))}get on(){return Dt(this,"on",()=>[...this.transitions].flatMap(([e,i])=>i.map(o=>[e,o])).reduce((e,[i,o])=>(e[i]=e[i]||[],e[i].push(o),e),{}))}get after(){return Dt(this,"delayedTransitions",()=>Hr(this))}get initial(){return Dt(this,"initial",()=>Wr(this,this.config.initial))}next(t,e){const i=e.type,o=[];let r;const s=Dt(this,`candidates-${i}`,()=>jr(this,i));for(const a of s){const{guard:l}=a,c=t.context;let f=!1;try{f=!l||Vt(l,c,e,t)}catch(d){const u=typeof l=="string"?l:typeof l=="object"?l.type:void 0;throw new Error(`Unable to evaluate guard ${u?`'${u}' `:""}in transition for event '${i}' in state node '${this.id}':
|
|
3
|
+
${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get events(){return Dt(this,"events",()=>{const{states:t}=this,e=new Set(this.ownEvents);if(t)for(const i of Object.keys(t)){const o=t[i];if(o.states)for(const r of o.events)e.add(`${r}`)}return Array.from(e)})}get ownEvents(){const t=Object.keys(Object.fromEntries(this.transitions)),e=new Set(t.filter(i=>this.transitions.get(i).some(o=>!(!o.target&&!o.actions.length&&!o.reenter))));return Array.from(e)}}const ys="#";class yn{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:(e==null?void 0:e.actors)??{},actions:(e==null?void 0:e.actions)??{},delays:(e==null?void 0:e.delays)??{},guards:(e==null?void 0:e.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new we(t,{_key:this.id,_machine:this}),this.root._initialize(),Br(this.root),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:e,guards:i,actors:o,delays:r}=this.implementations;return new yn(this.config,{actions:{...e,...t.actions},guards:{...i,...t.guards},actors:{...o,...t.actors},delays:{...r,...t.delays}})}resolveState(t){const e=rs(this.root,t.value),i=ge(be(this.root,e));return ye({_nodes:[...i],context:t.context||{},children:{},status:dn(i,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,i){return gn(t,e,i,[]).snapshot}microstep(t,e,i){return gn(t,e,i,[]).microsteps.map(([o])=>o)}getTransitionData(t,e){return un(this.root,t.value,t,e)||[]}_getPreInitialState(t,e,i){const{context:o}=this.config,r=ye({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?Mt(r,e,t,[F(({spawn:a,event:l,self:c})=>o({spawn:a,input:l.input,self:c}))],i,void 0):r}getInitialSnapshot(t,e){const i=di(e),o=[],r=this._getPreInitialState(t,i,o),[s]=Zr(this.root,r,t,i,o),{snapshot:a}=gn(s,i,t,o);return a}start(t){Object.values(t.children).forEach(e=>{e.getSnapshot().status==="active"&&e.start()})}getStateNodeById(t){const e=en(t),i=e.slice(1),o=Xt(e[0])?e[0].slice(ys.length):e[0],r=this.idMap.get(o);if(!r)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return ve(r,i)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return fs(t,e)}restoreSnapshot(t,e){const i={},o=t.children;Object.keys(o).forEach(d=>{const u=o[d],h=u.snapshot,p=u.src,m=typeof p=="string"?on(this,p):p;if(!m)return;const g=Ft(m,{id:d,parent:e.self,syncSnapshot:u.syncSnapshot,snapshot:h,src:p,systemId:u.systemId});i[d]=g});function r(d,u){if(u instanceof we)return u;try{return d.machine.getStateNodeById(u.id)}catch{}}function s(d,u){if(!u||typeof u!="object")return{};const h={};for(const p in u){const m=u[p];for(const g of m){const v=r(d,g);v&&(h[p]??(h[p]=[]),h[p].push(v))}}return h}const a=s(this.root,t.historyValue),l=ye({...t,children:i,_nodes:Array.from(ge(be(this.root,t.value))),historyValue:a},this),c=new Set;function f(d,u){if(!c.has(d)){c.add(d);for(const h in d){const p=d[h];if(p&&typeof p=="object"){if("xstate$$type"in p&&p.xstate$$type===sn){d[h]=u[p.id];continue}f(p,u)}}}}return f(l.context,i),l}}function ws(n,t,e,i,{event:o}){const r=typeof o=="function"?o(e,i):o;return[t,{event:r},void 0]}function xs(n,{event:t}){n.defer(()=>n.emit(t))}function xe(n){function t(e,i){}return t.type="xstate.emit",t.event=n,t.resolve=ws,t.execute=xs,t}let wn=(function(n){return n.Parent="#_parent",n.Internal="#_internal",n})({});function _s(n,t,e,i,{to:o,event:r,id:s,delay:a},l){var p;const c=t.machine.implementations.delays;if(typeof r=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);const f=typeof r=="function"?r(e,i):r;let d;if(typeof a=="string"){const m=c&&c[a];d=typeof m=="function"?m(e,i):m}else d=typeof a=="function"?a(e,i):a;const u=typeof o=="function"?o(e,i):o;let h;if(typeof u=="string"){if(u===wn.Parent?h=n.self._parent:u===wn.Internal?h=n.self:u.startsWith("#_")?h=t.children[u.slice(2)]:h=(p=l.deferredActorIds)!=null&&p.includes(u)?u:t.children[u],!h)throw new Error(`Unable to send event to actor '${u}' from machine '${t.machine.id}'.`)}else h=u||n.self;return[t,{to:h,targetId:typeof u=="string"?u:void 0,event:f,id:s,delay:d},void 0]}function Es(n,t,e){typeof e.to=="string"&&(e.to=t.children[e.to])}function Cs(n,t){n.defer(()=>{const{to:e,event:i,delay:o,id:r}=t;if(typeof o=="number"){n.system.scheduler.schedule(n.self,e,i,o,r);return}n.system._relay(n.self,e,i.type===br?ci(n.self.id,i.data):i)})}function xn(n,t,e){function i(o,r){}return i.type="xstate.sendTo",i.to=n,i.event=t,i.id=e==null?void 0:e.id,i.delay=e==null?void 0:e.delay,i.resolve=_s,i.retryResolve=Es,i.execute=Cs,i}function Ss(n,t){return xn(wn.Parent,n,t)}function As(n,t,e,i,{collect:o}){const r=[],s=function(l){r.push(l)};return s.assign=(...a)=>{r.push(F(...a))},s.cancel=(...a)=>{r.push(an(...a))},s.raise=(...a)=>{r.push(vn(...a))},s.sendTo=(...a)=>{r.push(xn(...a))},s.sendParent=(...a)=>{r.push(Ss(...a))},s.spawnChild=(...a)=>{r.push(ln(...a))},s.stopChild=(...a)=>{r.push(me(...a))},s.emit=(...a)=>{r.push(xe(...a))},o({context:e.context,event:e.event,enqueue:s,check:a=>Vt(a,t.context,e.event,t),self:n.self,system:n.system},i),[t,void 0,r]}function Mi(n){function t(e,i){}return t.type="xstate.enqueueActions",t.collect=n,t.resolve=As,t}function ks(n,t,e,i,{value:o,label:r}){return[t,{value:typeof o=="function"?o(e,i):o,label:r},void 0]}function $s({logger:n},{value:t,label:e}){e?n(e,t):n(t)}function Ts(n=({context:e,event:i})=>({context:e,event:i}),t){function e(i,o){}return e.type="xstate.log",e.value=n,e.label=t,e.resolve=ks,e.execute=$s,e}function Is(n,t){return new yn(n,t)}function Di({schemas:n,actors:t,actions:e,guards:i,delays:o}){return{assign:F,sendTo:xn,raise:vn,log:Ts,cancel:an,stopChild:me,enqueueActions:Mi,emit:xe,spawnChild:ln,createStateConfig:r=>r,createAction:r=>r,createMachine:r=>Is({...r,schemas:n},{actors:t,actions:e,guards:i,delays:o}),extend:r=>Di({schemas:n,actors:t,actions:{...e,...r.actions},guards:{...i,...r.guards},delays:{...o,...r.delays}})}}function Pi(n,t){const e=n.getAttribute("data-review-id");if(e)return e;for(const i of t??[])if(n.matches(i.selector)){const o=i.toId(n);if(o)return o}return null}function _e(n,t){const e=n.closest("[data-review-id]");if(e){const i=e.getAttribute("data-review-id");if(i)return{element:e,targetId:i}}for(const i of t??[]){const o=n.closest(i.selector);if(o){const r=i.toId(o);if(r)return{element:o,targetId:r}}}return null}function Ee(n,t){const e=new Set,i=[];for(const o of Array.from(n.querySelectorAll("[data-review-id]"))){const r=o.getAttribute("data-review-id");if(!r)continue;const s=o.hasAttribute("data-review-selectable");i.push({element:o,targetId:r,kind:s?"both":"element"}),e.add(o)}for(const o of t??[])for(const r of Array.from(n.querySelectorAll(o.selector))){if(e.has(r))continue;const s=o.toId(r);if(!s)continue;const a=r.hasAttribute("data-review-selectable");i.push({element:r,targetId:s,kind:a?"both":"element"}),e.add(r)}for(const o of Array.from(n.querySelectorAll("[data-review-selectable]"))){if(e.has(o))continue;const r=o.getAttribute("data-review-selectable");r&&(i.push({element:o,targetId:r,kind:"selectable"}),e.add(o))}return i}const _n="review-highlight-hover",wt="review-highlight-commented",Ce="review-highlight-editing",Se="review-highlight-uncommented",En="review-target",Ni="review-active";function Cn(n){n.classList.remove(_n,wt,Ce,Se)}function Os(n,t){let e=null,i=null,o=null;function r(g){n.classList.add(Ni);const v=Ee(n,t);for(const{element:x,targetId:_,kind:A}of v)(A==="element"||A==="both")&&(x.hasAttribute("data-review-id")||x.classList.add(En),g.has(_)&&x.classList.add(wt))}function s(){n.classList.remove(Ni),e&&(clearTimeout(e),e=null);const g=Ee(n,t);for(const{element:v}of g)Cn(v),v.classList.remove(En)}function a(g){const v=Ee(n,t),x=[];for(const{element:_}of v)!_.classList.contains(wt)&&!_.classList.contains(Ce)&&(_.classList.add(Se),x.push(_));g&&(e&&clearTimeout(e),e=setTimeout(()=>{e=null;for(const _ of x)_.classList.contains(Ce)||_.classList.remove(Se)},500))}function l(){e&&(clearTimeout(e),e=null);const g=Ee(n,t);for(const{element:v}of g)v.classList.remove(Se)}function c(g,v){v||(Cn(g),g.classList.add(Ce))}function f(g,v){Cn(g),v&&g.classList.add(wt)}function d(g,v){(Pi(g,t)??g.getAttribute("data-review-selectable"))!==v&&g.classList.add(_n)}function u(g,v,x){const _=Pi(g,t)??g.getAttribute("data-review-selectable");_!==v&&(g.classList.remove(_n),_&&(x!=null&&x.has(_))&&g.classList.add(wt))}function h(g){p(),o=g.editingTarget??null,i=new MutationObserver(v=>{for(const x of v){for(const _ of Array.from(x.removedNodes)){if(!(_ instanceof HTMLElement))continue;o&&(_===o||_.contains(o))&&(o=null,g.onTargetDisconnected()),(_.hasAttribute("data-review-selectable")||_.querySelector("[data-review-selectable]")!==null)&&g.onSelectableReconnected()}for(const _ of Array.from(x.addedNodes)){if(!(_ instanceof HTMLElement))continue;const A=[..._.matches("[data-review-id]")?[_]:[],...Array.from(_.querySelectorAll("[data-review-id]"))];for(const k of A){const $=k.getAttribute("data-review-id");$&&g.commentedIds.has($)&&k.classList.add(wt)}for(const k of t??[]){const $=[..._.matches(k.selector)?[_]:[],...Array.from(_.querySelectorAll(k.selector))];for(const b of $){const T=k.toId(b);b.classList.add(En),T&&g.commentedIds.has(T)&&b.classList.add(wt)}}(_.hasAttribute("data-review-selectable")||_.querySelector("[data-review-selectable]")!==null)&&g.onSelectableReconnected()}}}),i.observe(n,{childList:!0,subtree:!0})}function p(){i&&(i.disconnect(),i=null),o=null}function m(){s(),p()}return{activate:r,deactivate:s,reveal:a,unreveal:l,setEditing:c,clearEditing:f,applyHover:d,clearHover:u,startObserving:h,stopObserving:p,destroy:m}}const Ls=`:root{--review-highlight-uncommented-color: oklch(.7 0 0 / .15);--review-highlight-commented-color: oklch(.7 0 0 / .3);--review-highlight-color: oklch(.7 0 0 / .5);--review-highlight-editing-color: oklch(.6 0 0 / .7);--review-badge-icon-color: oklch(.35 0 0);--review-z-index: 9998;--review-selection-commented-color: oklch(.85 .08 250 / .4);--review-selection-editing-color: oklch(.75 .12 250 / .6);--review-selection-hover-color: oklch(.8 .1 250 / .5)}[data-review-id],[data-review-selectable],.review-target{outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease}.review-highlight-uncommented{outline-color:var(--review-highlight-uncommented-color)}.review-highlight-commented{outline-color:var(--review-highlight-commented-color);position:relative}.review-highlight-hover{outline-color:var(--review-highlight-color)}.review-highlight-commented:after{content:"";position:absolute;top:-12px;right:-14px;width:20px;height:20px;border-radius:50%;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");background-size:12px 12px;background-repeat:no-repeat;background-position:center;box-shadow:0 1px 3px #0000001a;pointer-events:none}.review-highlight-editing:after{display:none}[data-review-selectable]:not([data-review-id]).review-highlight-commented:after{display:none}.review-highlight-editing{outline-color:var(--review-highlight-editing-color)}::highlight(review-selection-commented){background-color:var(--review-selection-commented-color)}::highlight(review-selection-editing){background-color:var(--review-selection-editing-color)}::highlight(review-selection-hover){background-color:var(--review-selection-hover-color)}.review-active [data-review-id],.review-active .review-target{cursor:pointer}.review-active [data-review-selectable]{cursor:text}`;var Rs=["Shift","Meta","Alt","Control"],ji=typeof navigator=="object"?navigator.platform:"",Hi=/Mac|iPod|iPhone|iPad/.test(ji),zs=Hi?"Meta":"Control",Ms=ji==="Win32"?["Control","Alt"]:Hi?["Alt"]:[];function Sn(n,t){return typeof n.getModifierState=="function"&&(n.getModifierState(t)||Ms.includes(t)&&n.getModifierState("AltGraph"))}function Ds(n){return n.trim().split(" ").map(function(t){var e=t.split(/\b\+/),i=e.pop(),o=i.match(/^\((.+)\)$/);return o&&(i=new RegExp("^(?:"+o[1]+")$","iv")),[e=e.map(function(r){return r==="$mod"?zs:r}),i]})}function Ps(n,t){var e=t[0],i=t[1];return!((i instanceof RegExp?!i.test(n.key)&&!i.test(n.code):i.toUpperCase()!==n.key.toUpperCase()&&i!==n.code)||e.find(function(o){return!Sn(n,o)})||Rs.find(function(o){return!e.includes(o)&&i!==o&&Sn(n,o)}))}function Ns(n,t){var e;t===void 0&&(t={});var i=(e=t.timeout)!=null?e:1e3,o=Object.keys(n).map(function(a){return[Ds(a),n[a]]}),r=new Map,s=null;return function(a){a instanceof KeyboardEvent&&(o.forEach(function(l){var c=l[0],f=l[1],d=r.get(c)||c;Ps(a,d[0])?d.length>1?r.set(c,d.slice(1)):(r.delete(c),f(a)):Sn(a,a.key)||r.delete(c)}),s&&clearTimeout(s),s=setTimeout(r.clear.bind(r),i))}}function js(n,t,e){var i={},o=i.event,r=o===void 0?"keydown":o,s=i.capture,a=Ns(t,{timeout:i.timeout});return n.addEventListener(r,a,s),function(){n.removeEventListener(r,a,s)}}function Hs(n,t){const e=n.find(o=>o.targetId===t&&!o.selection);return e?{comment:e,isNew:!1}:{comment:{commentId:crypto.randomUUID(),targetId:t,content:"",createdAt:new Date().toISOString()},isNew:!0}}function Us(n){let t=n.comments;if(n.editingCommentId!==null){const e=t.find(i=>i.commentId===n.editingCommentId);e&&e.content===""&&(t=t.filter(i=>i.commentId!==n.editingCommentId))}return{comments:t,editingCommentId:null,targetElement:null,selectionRange:null}}function An(n){const t=n.comments.filter(o=>o.content.trim()),e=t.length>0,i=n.overallComment.trim().length>0;return!e&&!i?{status:"approved"}:{status:"commented",comments:t,overallComment:i?n.overallComment.trim():void 0}}function Bs(n){const t=new Set;for(const e of n.comments)!e.selection&&e.content.trim()&&t.add(e.targetId);return t}function Ws(){const n=Ri(({sendBack:e,input:i})=>{const o=()=>e({type:"RELEASE_ANNOTATE"}),r=l=>{l.key==="Alt"&&(l.preventDefault(),e({type:"HOLD_ANNOTATE"}))},s=l=>{l.key==="Alt"&&e({type:"RELEASE_ANNOTATE"})},a=js(window,{[i.shortcut]:l=>{l.preventDefault(),e({type:"TOGGLE"})},"$mod+Enter":l=>{l.preventDefault(),e({type:"CLOSE"})},"$mod+Shift+Backspace":l=>{l.preventDefault(),e({type:"DELETE"})},Escape:l=>{l.preventDefault(),e({type:"CLOSE"})}});return window.addEventListener("keydown",r),window.addEventListener("keyup",s),window.addEventListener("blur",o),()=>{a(),window.removeEventListener("keydown",r),window.removeEventListener("keyup",s),window.removeEventListener("blur",o)}}),t=Ri(({sendBack:e,input:i})=>{const o=new MutationObserver(r=>{for(const s of r)for(const a of Array.from(s.removedNodes))if(a instanceof HTMLElement&&(a===i.targetElement||a.contains(i.targetElement))){e({type:"TARGET_DISCONNECTED"});return}});return o.observe(i.wrapperElement,{childList:!0,subtree:!0}),()=>o.disconnect()});return Di({actors:{keyboardActor:n,mutationObserverActor:t},guards:{isCommentingEditing:Dr({commenting:"editing"}),hasSelectionCommentId:({event:e})=>e.type!=="CLICK"?!1:!!e.selectionCommentId,hasTargetId:({event:e})=>e.type!=="CLICK"?!1:!!e.targetId&&!e.selectionCommentId,hasNoTarget:({event:e})=>e.type!=="CLICK"?!1:!e.targetId&&!e.selectionCommentId,isSameComment:({context:e,event:i})=>{if(i.type!=="CLICK")return!1;if(i.selectionCommentId)return e.editingCommentId===i.selectionCommentId;if(i.targetId){const o=e.comments.find(r=>r.commentId===e.editingCommentId);return!!o&&o.targetId===i.targetId&&!o.selection}return!1}},delays:{flashDuration:500},actions:{openElementComment:F(({context:e,event:i})=>{if(i.type!=="CLICK"||!i.targetId)return{};const{comment:o,isNew:r}=Hs(e.comments,i.targetId);return{comments:r?[...e.comments,o]:e.comments,editingCommentId:o.commentId,targetElement:i.element??null,selectionRange:null}}),openSelectionComment:F(({event:e})=>e.type!=="CLICK"||!e.selectionCommentId?{}:{editingCommentId:e.selectionCommentId,targetElement:e.element??null,selectionRange:null}),createSelectionComment:F(({context:e,event:i})=>{if(i.type!=="SELECT_TEXT")return{};const o={commentId:crypto.randomUUID(),targetId:i.targetId,content:"",createdAt:new Date().toISOString(),selection:i.selectionRange};return{comments:[...e.comments,o],editingCommentId:o.commentId,targetElement:i.targetElement,selectionRange:i.selectionRange}}),updateContent:F(({context:e,event:i})=>i.type!=="COMMENT_CHANGE"?{}:e.editingCommentId===null?{overallComment:i.content}:{comments:e.comments.map(o=>o.commentId===e.editingCommentId?{...o,content:i.content}:o)}),deleteComment:F(({context:e})=>({comments:e.comments.filter(i=>i.commentId!==e.editingCommentId),editingCommentId:null,targetElement:null,selectionRange:null})),cleanup:F(({context:e})=>Us(e)),emitChanged:xe(({context:e})=>({type:"REVIEW_CHANGED",result:An(e)})),persistSave:({context:e})=>{e.persistence.save(An(e))},emitSubmitted:xe(({context:e})=>({type:"REVIEW_SUBMITTED",result:An(e)})),highlightsActivate:({context:e})=>{e.highlights.activate(Bs(e))},highlightsDeactivate:({context:e})=>{e.highlights.deactivate()},highlightsRevealFlash:({context:e})=>{e.highlights.reveal(!0)},highlightsReveal:({context:e})=>{e.highlights.reveal(!1)},highlightsUnreveal:({context:e})=>{e.highlights.unreveal()},editingTargetSet:({context:e})=>{var o;if(!e.targetElement)return;const i=!!((o=e.comments.find(r=>r.commentId===e.editingCommentId))!=null&&o.selection);e.highlights.setEditing(e.targetElement,i)},editingTargetCleared:({context:e})=>{if(!e.targetElement)return;const i=e.comments.find(o=>o.commentId===e.editingCommentId);e.highlights.clearEditing(e.targetElement,!!(i!=null&&i.content.trim()))}}}).createMachine({id:"review",type:"parallel",context:({input:e})=>{const i=e.persistence.load()??e.initialData,o=(i==null?void 0:i.status)==="commented"?i.comments??[]:[],r=(i==null?void 0:i.status)==="commented"?i.overallComment??"":"";return{comments:o,overallComment:r,editingCommentId:null,targetElement:null,selectionRange:null,shortcut:e.shortcut,defaultMode:e.defaultMode,highlights:e.highlights,persistence:e.persistence}},invoke:{id:"keyboard",src:"keyboardActor",input:({context:e})=>({shortcut:e.shortcut})},states:{annotating:{initial:"waitingForMount",on:{SUBMIT:".inactive"},states:{waitingForMount:{on:{MOUNTED:[{guard:({context:e})=>e.defaultMode==="annotating",target:"toggled"},{target:"inactive"}]}},inactive:{on:{TOGGLE:"toggled",HOLD_ANNOTATE:"held"}},toggled:{initial:"flashing",entry:"highlightsActivate",exit:"highlightsDeactivate",on:{TOGGLE:{target:"inactive",actions:Mi(({enqueue:e,check:i})=>{i("isCommentingEditing")&&e.raise({type:"CLOSE"})})}},states:{flashing:{entry:"highlightsRevealFlash",exit:"highlightsUnreveal",after:{flashDuration:"ready"},on:{HOLD_ANNOTATE:"revealing"}},ready:{on:{HOLD_ANNOTATE:"revealing"}},revealing:{entry:"highlightsReveal",exit:"highlightsUnreveal",on:{RELEASE_ANNOTATE:"ready"}}}},held:{initial:"revealing",entry:"highlightsActivate",exit:"highlightsDeactivate",states:{revealing:{entry:"highlightsReveal",exit:"highlightsUnreveal",on:{RELEASE_ANNOTATE:[{guard:"isCommentingEditing",target:"lingering"},{target:"#review.annotating.inactive"}]}},lingering:{on:{CLOSE:"#review.annotating.inactive",DELETE:"#review.annotating.inactive"}}}}}},commenting:{initial:"idle",states:{idle:{on:{CLICK:[{guard:"hasSelectionCommentId",target:"editing.selection",actions:["openSelectionComment","editingTargetSet"]},{guard:"hasTargetId",target:"editing.element",actions:["openElementComment","editingTargetSet"]}],SELECT_TEXT:{target:"editing.selection",actions:["createSelectionComment","editingTargetSet"]},OPEN_OVERALL:{target:"editing.element",actions:F({editingCommentId:null,targetElement:null,selectionRange:null})},SUBMIT:{actions:["emitSubmitted"]}}},editing:{initial:"element",on:{CLICK:[{guard:"isSameComment"},{guard:"hasSelectionCommentId",target:".selection",reenter:!0,actions:["editingTargetCleared","cleanup","openSelectionComment","editingTargetSet"]},{guard:"hasTargetId",target:".element",reenter:!0,actions:["editingTargetCleared","cleanup","openElementComment","editingTargetSet"]},{guard:"hasNoTarget",target:"idle",actions:["editingTargetCleared","cleanup","emitChanged","persistSave"]}],SELECT_TEXT:{target:".selection",reenter:!0,actions:["editingTargetCleared","cleanup","createSelectionComment","editingTargetSet"]},COMMENT_CHANGE:{actions:["updateContent","emitChanged","persistSave"]},DELETE:{target:"idle",actions:["editingTargetCleared","deleteComment","emitChanged","persistSave"]},CLOSE:{target:"idle",actions:["editingTargetCleared","cleanup","emitChanged","persistSave"]},TARGET_DISCONNECTED:{target:"idle",actions:["editingTargetCleared","cleanup","emitChanged","persistSave"]},SUBMIT:{target:"idle",actions:["editingTargetCleared","cleanup","emitSubmitted"]},OPEN_OVERALL:{target:".element",reenter:!0,actions:["editingTargetCleared","cleanup",F({editingCommentId:null,targetElement:null,selectionRange:null})]}},states:{element:{},selection:{}}}}}}})}const Ui={load:()=>{},save:()=>{},clear:()=>{}};function kn(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function Gs(n){if(typeof n!="object"||n===null)return!1;const t=n.status;return t==="approved"||t==="commented"}function Fs(n){return{load(){const t=kn();if(t)try{const e=t.getItem(n);if(e===null)return;const i=JSON.parse(e);return Gs(i)?i:void 0}catch{return}},save(t){const e=kn();if(e)try{if(t.status==="approved"){e.removeItem(n);return}e.setItem(n,JSON.stringify(t))}catch{}},clear(){const t=kn();if(t)try{t.removeItem(n)}catch{}}}}const Vs=3;function qs(n){const t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return null;const e=t.getRangeAt(0),i=e.toString();if(i.length<Vs)return null;const o=Js(n,e.startContainer,e.startOffset),r=o+i.length;if(o<0)return null;const s=Ys(n.textContent??"",i,o);return{startOffset:o,endOffset:r,selectedText:i,matchIndex:s}}function Bi(n,t){const e=n.textContent??"";if(e.slice(t.startOffset,t.endOffset)===t.selectedText)return Wi(n,t.startOffset,t.endOffset);const o=Zs(e,t.selectedText,t.matchIndex);return o<0?null:Wi(n,o,o+t.selectedText.length)}function Xs(n,t){if(n.isCollapsed||n.rangeCount===0)return!1;const e=n.getRangeAt(0);return t.contains(e.startContainer)&&t.contains(e.endContainer)}function $n(n){const t=n instanceof HTMLElement?n:n.parentElement;return(t==null?void 0:t.closest("[data-review-selectable]"))??null}function Ks(n,t){var s;if(n.isCollapsed||n.rangeCount===0)return null;const e=n.getRangeAt(0),i=e.cloneRange(),o=t.contains(e.startContainer),r=t.contains(e.endContainer);if(o&&r)return i;if(o&&!r){const a=Qs(t);return a&&i.setEnd(a,((s=a.textContent)==null?void 0:s.length)??0),i}return null}function Js(n,t,e){var r;const i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;i.nextNode();){if(i.currentNode===t)return o+e;o+=((r=i.currentNode.textContent)==null?void 0:r.length)??0}return-1}function Wi(n,t,e){var a;const i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),o=document.createRange();let r=0,s=!1;for(;i.nextNode();){const l=((a=i.currentNode.textContent)==null?void 0:a.length)??0;if(!s&&r+l>t&&(o.setStart(i.currentNode,t-r),s=!0),s&&r+l>=e)return o.setEnd(i.currentNode,e-r),o;r+=l}return null}function Ys(n,t,e){let i=0,o=0;for(;;){const r=n.indexOf(t,o);if(r<0||r===e)return i;o=r+1,i++}}function Zs(n,t,e){let i=0,o=0;for(;;){const r=n.indexOf(t,o);if(r<0)return-1;if(i===e)return r;o=r+1,i++}}function Qs(n){const t=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let e=null;for(;t.nextNode();)e=t.currentNode;return e}function ta(n,t){const e=new Map;return t.querySelectorAll("[data-review-id]").forEach((o,r)=>{const s=o.getAttribute("data-review-id");s&&e.set(s,r)}),[...n].sort((o,r)=>{const s=e.get(o.targetId)??Number.MAX_SAFE_INTEGER,a=e.get(r.targetId)??Number.MAX_SAFE_INTEGER;return s-a})}/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright 2019 Google LLC
|
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/const Ae=globalThis,
|
|
7
|
+
*/const Ae=globalThis,Tn=Ae.ShadowRoot&&(Ae.ShadyCSS===void 0||Ae.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gi=Symbol(),Fi=new WeakMap;let ea=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Gi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Tn&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Fi.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Fi.set(e,t))}return t}toString(){return this.cssText}};const Vi=n=>new ea(typeof n=="string"?n:n+"",void 0,Gi),na=(n,t)=>{if(Tn)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),o=Ae.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=e.cssText,n.appendChild(i)}},qi=Tn?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Vi(e)})(n):n;/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const{is:
|
|
11
|
+
*/const{is:ia,defineProperty:oa,getOwnPropertyDescriptor:ra,getOwnPropertyNames:sa,getOwnPropertySymbols:aa,getPrototypeOf:la}=Object,ct=globalThis,Xi=ct.trustedTypes,ca=Xi?Xi.emptyScript:"",In=ct.reactiveElementPolyfillSupport,Jt=(n,t)=>n,ke={toAttribute(n,t){switch(t){case Boolean:n=n?ca:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},On=(n,t)=>!ia(n,t),Ki={attribute:!0,type:String,converter:ke,reflect:!1,useDefault:!1,hasChanged:On};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ct.litPropertyMetadata??(ct.litPropertyMetadata=new WeakMap);let Pt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ki){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);o!==void 0&&oa(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:r}=ra(this.prototype,t)??{get(){return this[e]},set(s){this[e]=s}};return{get:o,set(s){const a=o==null?void 0:o.call(this);r==null||r.call(this,s),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ki}static _$Ei(){if(this.hasOwnProperty(Jt("elementProperties")))return;const t=la(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jt("properties"))){const e=this.properties,i=[...sa(e),...aa(e)];for(const o of i)this.createProperty(o,e[o])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,o]of e)this.elementProperties.set(i,o)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const o=this._$Eu(e,i);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const o of i)e.unshift(qi(o))}else t!==void 0&&e.push(qi(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return na(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var r;const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(o!==void 0&&i.reflect===!0){const s=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:ke).toAttribute(e,i.type);this._$Em=t,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,e){var r,s;const i=this.constructor,o=i._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const a=i.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:ke;this._$Em=o;const c=l.fromAttribute(e,a.type);this[o]=c??((s=this._$Ej)==null?void 0:s.get(o))??c,this._$Em=null}}requestUpdate(t,e,i,o=!1,r){var s;if(t!==void 0){const a=this.constructor;if(o===!1&&(r=this[t]),i??(i=a.getPropertyOptions(t)),!((i.hasChanged??On)(r,e)||i.useDefault&&i.reflect&&r===((s=this._$Ej)==null?void 0:s.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:r},s){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,s??e??this[t]),r!==!0||s!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[r,s]of o){const{wrapped:a}=s,l=this[r];a!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,s,l)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(o=>{var r;return(r=o.hostUpdate)==null?void 0:r.call(o)}),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var o;return(o=i.hostUpdated)==null?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};Pt.elementStyles=[],Pt.shadowRootOptions={mode:"open"},Pt[Jt("elementProperties")]=new Map,Pt[Jt("finalized")]=new Map,In==null||In({ReactiveElement:Pt}),(ct.reactiveElementVersions??(ct.reactiveElementVersions=[])).push("2.1.2");/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2017 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const Yt=globalThis,
|
|
16
|
-
\f\r]`,te=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
15
|
+
*/const Yt=globalThis,Ji=n=>n,$e=Yt.trustedTypes,Yi=$e?$e.createPolicy("lit-html",{createHTML:n=>n}):void 0,Zi="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qi="?"+dt,da=`<${Qi}>`,xt=document,Zt=()=>xt.createComment(""),Qt=n=>n===null||typeof n!="object"&&typeof n!="function",Ln=Array.isArray,ua=n=>Ln(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Rn=`[
|
|
16
|
+
\f\r]`,te=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,to=/-->/g,eo=/>/g,_t=RegExp(`>|${Rn}(?:([^\\s"'>=/]+)(${Rn}*=${Rn}*(?:[^
|
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),no=/'/g,io=/"/g,oo=/^(?:script|style|textarea|title)$/i,ro=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),et=ro(1),Te=ro(2),nt=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),so=new WeakMap,Et=xt.createTreeWalker(xt,129);function ao(n,t){if(!Ln(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(t):t}const ha=(n,t)=>{const e=n.length-1,i=[];let o,r=t===2?"<svg>":t===3?"<math>":"",s=te;for(let a=0;a<e;a++){const l=n[a];let c,f,d=-1,u=0;for(;u<l.length&&(s.lastIndex=u,f=s.exec(l),f!==null);)u=s.lastIndex,s===te?f[1]==="!--"?s=to:f[1]!==void 0?s=eo:f[2]!==void 0?(oo.test(f[2])&&(o=RegExp("</"+f[2],"g")),s=_t):f[3]!==void 0&&(s=_t):s===_t?f[0]===">"?(s=o??te,d=-1):f[1]===void 0?d=-2:(d=s.lastIndex-f[2].length,c=f[1],s=f[3]===void 0?_t:f[3]==='"'?io:no):s===io||s===no?s=_t:s===to||s===eo?s=te:(s=_t,o=void 0);const h=s===_t&&n[a+1].startsWith("/>")?" ":"";r+=s===te?l+da:d>=0?(i.push(c),l.slice(0,d)+Zi+l.slice(d)+dt+h):l+dt+(d===-2?a:h)}return[ao(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class ee{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const a=t.length-1,l=this.parts,[c,f]=ha(t,e);if(this.el=ee.createElement(c,i),Et.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Et.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(const d of o.getAttributeNames())if(d.endsWith(Zi)){const u=f[s++],h=o.getAttribute(d).split(dt),p=/([.?@])?(.*)/.exec(u);l.push({type:1,index:r,name:p[2],strings:h,ctor:p[1]==="."?pa:p[1]==="?"?ma:p[1]==="@"?ga:Ie}),o.removeAttribute(d)}else d.startsWith(dt)&&(l.push({type:6,index:r}),o.removeAttribute(d));if(oo.test(o.tagName)){const d=o.textContent.split(dt),u=d.length-1;if(u>0){o.textContent=$e?$e.emptyScript:"";for(let h=0;h<u;h++)o.append(d[h],Zt()),Et.nextNode(),l.push({type:2,index:++r});o.append(d[u],Zt())}}}else if(o.nodeType===8)if(o.data===Qi)l.push({type:2,index:r});else{let d=-1;for(;(d=o.data.indexOf(dt,d+1))!==-1;)l.push({type:7,index:r}),d+=dt.length-1}r++}}static createElement(t,e){const i=xt.createElement("template");return i.innerHTML=t,i}}function Nt(n,t,e=n,i){var s,a;if(t===nt)return t;let o=i!==void 0?(s=e._$Co)==null?void 0:s[i]:e._$Cl;const r=Qt(t)?void 0:t._$litDirective$;return(o==null?void 0:o.constructor)!==r&&((a=o==null?void 0:o._$AO)==null||a.call(o,!1),r===void 0?o=void 0:(o=new r(n),o._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=o:e._$Cl=o),o!==void 0&&(t=Nt(n,o._$AS(n,t.values),o,i)),t}class fa{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=((t==null?void 0:t.creationScope)??xt).importNode(e,!0);Et.currentNode=o;let r=Et.nextNode(),s=0,a=0,l=i[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new jt(r,r.nextSibling,this,t):l.type===1?c=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(c=new va(r,this,t)),this._$AV.push(c),l=i[++a]}s!==(l==null?void 0:l.index)&&(r=Et.nextNode(),s++)}return Et.currentNode=xt,o}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class jt{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Nt(this,t,e),Qt(t)?t===L||t==null||t===""?(this._$AH!==L&&this._$AR(),this._$AH=L):t!==this._$AH&&t!==nt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ua(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==L&&Qt(this._$AH)?this._$AA.nextSibling.data=t:this.T(xt.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=ee.createElement(ao(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===o)this._$AH.p(e);else{const s=new fa(o,this),a=s.u(this.options);s.p(e),this.T(a),this._$AH=s}}_$AC(t){let e=so.get(t.strings);return e===void 0&&so.set(t.strings,e=new ee(t)),e}k(t){Ln(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new jt(this.O(Zt()),this.O(Zt()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const o=Ji(t).nextSibling;Ji(t).remove(),t=o}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,r){this.type=1,this._$AH=L,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(r===void 0)t=Nt(this,t,e,0),s=!Qt(t)||t!==this._$AH&&t!==nt,s&&(this._$AH=t);else{const a=t;let l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Nt(this,a[i+l],e,l),c===nt&&(c=this._$AH[l]),s||(s=!Qt(c)||c!==this._$AH[l]),c===L?t=L:t!==L&&(t+=(c??"")+r[l+1]),this._$AH[l]=c}s&&!o&&this.j(t)}j(t){t===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class pa extends Ie{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===L?void 0:t}}class ma extends Ie{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==L)}}class ga extends Ie{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){if((t=Nt(this,t,e,0)??L)===nt)return;const i=this._$AH,o=t===L&&i!==L||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==L&&(i===L||o);o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class va{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Nt(this,t)}}const ba={I:jt},zn=Yt.litHtmlPolyfillSupport;zn==null||zn(ee,jt),(Yt.litHtmlVersions??(Yt.litHtmlVersions=[])).push("3.3.3");const ya=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let o=i._$litPart$;if(o===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=o=new jt(t.insertBefore(Zt(),r),r,void 0,e??{})}return o._$AI(n),o};/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/const Ct=globalThis;let ne=class extends Pt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
21
|
+
*/const Ct=globalThis;let ne=class extends Pt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ya(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return nt}};ne._$litElement$=!0,ne.finalized=!0,(ar=Ct.litElementHydrateSupport)==null||ar.call(Ct,{LitElement:ne});const Mn=Ct.litElementPolyfillSupport;Mn==null||Mn({LitElement:ne}),(Ct.litElementVersions??(Ct.litElementVersions=[])).push("4.2.2");/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -26,19 +26,19 @@ ${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get eve
|
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/const
|
|
29
|
+
*/const wa={attribute:!0,type:String,converter:ke,reflect:!1,hasChanged:On},xa=(n=wa,t,e)=>{const{kind:i,metadata:o}=e;let r=globalThis.litPropertyMetadata.get(o);if(r===void 0&&globalThis.litPropertyMetadata.set(o,r=new Map),i==="setter"&&((n=Object.create(n)).wrapped=!0),r.set(e.name,n),i==="accessor"){const{name:s}=e;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(s,l,n,!0,a)},init(a){return a!==void 0&&this.C(s,void 0,n,a),a}}}if(i==="setter"){const{name:s}=e;return function(a){const l=this[s];t.call(this,a),this.requestUpdate(s,l,n,!0,a)}}throw Error("Unsupported decorator location: "+i)};function H(n){return(t,e)=>typeof e=="object"?xa(n,t,e):((i,o,r)=>{const s=o.hasOwnProperty(r);return o.constructor.createProperty(r,i),s?Object.getOwnPropertyDescriptor(o,r):void 0})(n,t,e)}/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/function
|
|
33
|
+
*/function _a(n){return H({...n,state:!0,attribute:!1})}/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/const
|
|
37
|
+
*/const Ea=(n,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(n,t,e),e);/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/function Oe(n,t){return(e,i,o)=>{const r=s=>{var a;return((a=s.renderRoot)==null?void 0:a.querySelector(n))??null};return ya(e,i,{get(){return r(this)}})}}function so(n){var t,e,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(t=0;t<o;t++)n[t]&&(e=so(n[t]))&&(i&&(i+=" "),i+=e)}else for(e in n)n[e]&&(i&&(i+=" "),i+=e);return i}function wa(){for(var n,t,e=0,i="",o=arguments.length;e<o;e++)(n=arguments[e])&&(t=so(n))&&(i&&(i+=" "),i+=t);return i}const xa=(n,t)=>{const e=new Array(n.length+t.length);for(let i=0;i<n.length;i++)e[i]=n[i];for(let i=0;i<t.length;i++)e[n.length+i]=t[i];return e},_a=(n,t)=>({classGroupId:n,validator:t}),ao=(n=new Map,t=null,e)=>({nextPart:n,validators:t,classGroupId:e}),Le="-",lo=[],Ea="arbitrary..",Ca=n=>{const t=Aa(n),{conflictingClassGroups:e,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Sa(s);const a=s.split(Le),l=a[0]===""&&a.length>1?1:0;return co(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=i[s],c=e[s];return l?c?xa(c,l):l:c||lo}return e[s]||lo}}},co=(n,t,e)=>{if(n.length-t===0)return e.classGroupId;const o=n[t],r=e.nextPart.get(o);if(r){const c=co(n,t+1,r);if(c)return c}const s=e.validators;if(s===null)return;const a=t===0?n.join(Le):n.slice(t).join(Le),l=s.length;for(let c=0;c<l;c++){const f=s[c];if(f.validator(a))return f.classGroupId}},Sa=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),e=t.indexOf(":"),i=t.slice(0,e);return i?Ea+i:void 0})(),Aa=n=>{const{theme:t,classGroups:e}=n;return ka(e,t)},ka=(n,t)=>{const e=ao();for(const i in n){const o=n[i];zn(o,e,i,t)}return e},zn=(n,t,e,i)=>{const o=n.length;for(let r=0;r<o;r++){const s=n[r];$a(s,t,e,i)}},$a=(n,t,e,i)=>{if(typeof n=="string"){Ta(n,t,e);return}if(typeof n=="function"){Ia(n,t,e,i);return}Oa(n,t,e,i)},Ta=(n,t,e)=>{const i=n===""?t:uo(t,n);i.classGroupId=e},Ia=(n,t,e,i)=>{if(La(n)){zn(n(i),t,e,i);return}t.validators===null&&(t.validators=[]),t.validators.push(_a(e,n))},Oa=(n,t,e,i)=>{const o=Object.entries(n),r=o.length;for(let s=0;s<r;s++){const[a,l]=o[s];zn(l,uo(t,a),e,i)}},uo=(n,t)=>{let e=n;const i=t.split(Le),o=i.length;for(let r=0;r<o;r++){const s=i[r];let a=e.nextPart.get(s);a||(a=ao(),e.nextPart.set(s,a)),e=a}return e},La=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Ra=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,e=Object.create(null),i=Object.create(null);const o=(r,s)=>{e[r]=s,t++,t>n&&(t=0,i=e,e=Object.create(null))};return{get(r){let s=e[r];if(s!==void 0)return s;if((s=i[r])!==void 0)return o(r,s),s},set(r,s){r in e?e[r]=s:o(r,s)}}},Mn="!",ho=":",za=[],fo=(n,t,e,i,o)=>({modifiers:n,hasImportantModifier:t,baseClassName:e,maybePostfixModifierPosition:i,isExternal:o}),Ma=n=>{const{prefix:t,experimentalParseClassName:e}=n;let i=o=>{const r=[];let s=0,a=0,l=0,c;const f=o.length;for(let p=0;p<f;p++){const g=o[p];if(s===0&&a===0){if(g===ho){r.push(o.slice(l,p)),l=p+1;continue}if(g==="/"){c=p;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const d=r.length===0?o:o.slice(l);let u=d,h=!1;d.endsWith(Mn)?(u=d.slice(0,-1),h=!0):d.startsWith(Mn)&&(u=d.slice(1),h=!0);const m=c&&c>l?c-l:void 0;return fo(r,h,u,m)};if(t){const o=t+ho,r=i;i=s=>s.startsWith(o)?r(s.slice(o.length)):fo(za,!1,s,void 0,!0)}if(e){const o=i;i=r=>e({className:r,parseClassName:o})}return i},Da=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((e,i)=>{t.set(e,1e6+i)}),e=>{const i=[];let o=[];for(let r=0;r<e.length;r++){const s=e[r],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(s)):o.push(s)}return o.length>0&&(o.sort(),i.push(...o)),i}},Pa=n=>({cache:Ra(n.cacheSize),parseClassName:Ma(n),sortModifiers:Da(n),postfixLookupClassGroupIds:Na(n),...Ca(n)}),Na=n=>{const t=Object.create(null),e=n.postfixLookupClassGroups;if(e)for(let i=0;i<e.length;i++)t[e[i]]=!0;return t},Ha=/\s+/,ja=(n,t)=>{const{parseClassName:e,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:r,postfixLookupClassGroupIds:s}=t,a=[],l=n.trim().split(Ha);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{isExternal:u,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:g}=e(d);if(u){c=d+(c.length>0?" "+c:c);continue}let v=!!g,x;if(v){const $=p.substring(0,g);x=i($);const b=x&&s[x]?i(p):void 0;b&&b!==x&&(x=b,v=!1)}else x=i(p);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=i(p),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const _=h.length===0?"":h.length===1?h[0]:r(h).join(":"),A=m?_+Mn:_,I=A+x;if(a.indexOf(I)>-1)continue;a.push(I);const k=o(x,v);for(let $=0;$<k.length;++$){const b=k[$];a.push(A+b)}c=d+(c.length>0?" "+c:c)}return c},Ua=(...n)=>{let t=0,e,i,o="";for(;t<n.length;)(e=n[t++])&&(i=mo(e))&&(o&&(o+=" "),o+=i);return o},mo=n=>{if(typeof n=="string")return n;let t,e="";for(let i=0;i<n.length;i++)n[i]&&(t=mo(n[i]))&&(e&&(e+=" "),e+=t);return e},Ba=(n,...t)=>{let e,i,o,r;const s=l=>{const c=t.reduce((f,d)=>d(f),n());return e=Pa(c),i=e.cache.get,o=e.cache.set,r=a,a(l)},a=l=>{const c=i(l);if(c)return c;const f=ja(l,e);return o(l,f),f};return r=s,(...l)=>r(Ua(...l))},Wa=[],O=n=>{const t=e=>e[n]||Wa;return t.isThemeGetter=!0,t},po=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,go=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ga=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Fa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Va=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ka=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ut=n=>Ga.test(n),S=n=>!!n&&!Number.isNaN(Number(n)),J=n=>!!n&&Number.isInteger(Number(n)),Dn=n=>n.endsWith("%")&&S(n.slice(0,-1)),it=n=>Fa.test(n),vo=()=>!0,Ja=n=>Va.test(n)&&!qa.test(n),Pn=()=>!1,Ya=n=>Xa.test(n),Za=n=>Ka.test(n),Qa=n=>!y(n)&&!w(n),tl=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),el=n=>ht(n,Eo,Pn),y=n=>po.test(n),St=n=>ht(n,Co,Ja),bo=n=>ht(n,cl,S),nl=n=>ht(n,Ao,vo),il=n=>ht(n,So,Pn),yo=n=>ht(n,xo,Pn),ol=n=>ht(n,_o,Za),Re=n=>ht(n,ko,Ya),w=n=>go.test(n),oe=n=>At(n,Co),rl=n=>At(n,So),wo=n=>At(n,xo),sl=n=>At(n,Eo),al=n=>At(n,_o),ze=n=>At(n,ko,!0),ll=n=>At(n,Ao,!0),ht=(n,t,e)=>{const i=po.exec(n);return i?i[1]?t(i[1]):e(i[2]):!1},At=(n,t,e=!1)=>{const i=go.exec(n);return i?i[1]?t(i[1]):e:!1},xo=n=>n==="position"||n==="percentage",_o=n=>n==="image"||n==="url",Eo=n=>n==="length"||n==="size"||n==="bg-size",Co=n=>n==="length",cl=n=>n==="number",So=n=>n==="family-name",Ao=n=>n==="number"||n==="weight",ko=n=>n==="shadow",dl=Ba(()=>{const n=O("color"),t=O("font"),e=O("text"),i=O("font-weight"),o=O("tracking"),r=O("leading"),s=O("breakpoint"),a=O("container"),l=O("spacing"),c=O("radius"),f=O("shadow"),d=O("inset-shadow"),u=O("text-shadow"),h=O("drop-shadow"),m=O("blur"),p=O("perspective"),g=O("aspect"),v=O("ease"),x=O("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...A(),w,y],k=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[w,y,l],T=()=>[ut,"full","auto",...b()],W=()=>[J,"none","subgrid",w,y],gt=()=>["auto",{span:["full",J,w,y]},J,w,y],Q=()=>[J,"auto",w,y],vt=()=>["auto","min","max","fr",w,y],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],tt=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...b()],M=()=>[ut,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],D=()=>[ut,"screen","full","dvw","lvw","svw","min","max","fit",...b()],G=()=>[ut,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],E=()=>[n,w,y],sr=()=>[...A(),wo,yo,{position:[w,y]}],ar=()=>["no-repeat",{repeat:["","x","y","space","round"]}],lr=()=>["auto","cover","contain",sl,el,{size:[w,y]}],ei=()=>[Dn,oe,St],P=()=>["","none","full",c,w,y],N=()=>["",S,oe,St],Je=()=>["solid","dashed","dotted","double"],cr=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>[S,Dn,wo,yo],dr=()=>["","none",m,w,y],Ye=()=>["none",S,w,y],Ze=()=>["none",S,w,y],ni=()=>[S,w,y],Qe=()=>[ut,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[it],breakpoint:[it],color:[vo],container:[it],"drop-shadow":[it],ease:["in","out","in-out"],font:[Qa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[it],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[it],shadow:[it],spacing:["px",S],text:[it],"text-shadow":[it],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ut,y,w,g]}],container:["container"],"container-type":[{"@container":["","normal","size",w,y]}],"container-named":[tl],columns:[{columns:[S,y,w,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[J,"auto",w,y]}],basis:[{basis:[ut,"full","auto",a,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[S,ut,"auto","initial","none",y]}],grow:[{grow:["",S,w,y]}],shrink:[{shrink:["",S,w,y]}],order:[{order:[J,"first","last","none",w,y]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:gt()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:gt()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":vt()}],"auto-rows":[{"auto-rows":vt()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...tt(),"normal"]}],"justify-self":[{"justify-self":["auto",...tt()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...tt(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...tt(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...tt(),"baseline"]}],"place-self":[{"place-self":["auto",...tt()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...D()]}],"min-inline-size":[{"min-inline":["auto",...D()]}],"max-inline-size":[{"max-inline":["none",...D()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",e,oe,St]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ll,nl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dn,y]}],"font-family":[{font:[rl,il,t]}],"font-features":[{"font-features":[y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,w,y]}],"line-clamp":[{"line-clamp":[S,"none",w,bo]}],leading:[{leading:[r,...b()]}],"list-image":[{"list-image":["none",w,y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",w,y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Je(),"wavy"]}],"text-decoration-thickness":[{decoration:[S,"from-font","auto",w,St]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[S,"auto",w,y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"tab-size":[{tab:[J,w,y]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",w,y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",w,y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:sr()}],"bg-repeat":[{bg:ar()}],"bg-size":[{bg:lr()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},J,w,y],radial:["",w,y],conic:[J,w,y]},al,ol]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:ei()}],"gradient-via-pos":[{via:ei()}],"gradient-to-pos":[{to:ei()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Je(),"hidden","none"]}],"divide-style":[{divide:[...Je(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[S,w,y]}],"outline-w":[{outline:["",S,oe,St]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",f,ze,Re]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,ze,Re]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[S,St]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",u,ze,Re]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[S,w,y]}],"mix-blend":[{"mix-blend":[...cr(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":cr()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[S]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[w,y]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[S]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:sr()}],"mask-repeat":[{mask:ar()}],"mask-size":[{mask:lr()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",w,y]}],filter:[{filter:["","none",w,y]}],blur:[{blur:dr()}],brightness:[{brightness:[S,w,y]}],contrast:[{contrast:[S,w,y]}],"drop-shadow":[{"drop-shadow":["","none",h,ze,Re]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",S,w,y]}],"hue-rotate":[{"hue-rotate":[S,w,y]}],invert:[{invert:["",S,w,y]}],saturate:[{saturate:[S,w,y]}],sepia:[{sepia:["",S,w,y]}],"backdrop-filter":[{"backdrop-filter":["","none",w,y]}],"backdrop-blur":[{"backdrop-blur":dr()}],"backdrop-brightness":[{"backdrop-brightness":[S,w,y]}],"backdrop-contrast":[{"backdrop-contrast":[S,w,y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",S,w,y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S,w,y]}],"backdrop-invert":[{"backdrop-invert":["",S,w,y]}],"backdrop-opacity":[{"backdrop-opacity":[S,w,y]}],"backdrop-saturate":[{"backdrop-saturate":[S,w,y]}],"backdrop-sepia":[{"backdrop-sepia":["",S,w,y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",w,y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[S,"initial",w,y]}],ease:[{ease:["linear","initial",v,w,y]}],delay:[{delay:[S,w,y]}],animate:[{animate:["none",x,w,y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,w,y]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ye()}],"rotate-x":[{"rotate-x":Ye()}],"rotate-y":[{"rotate-y":Ye()}],"rotate-z":[{"rotate-z":Ye()}],scale:[{scale:Ze()}],"scale-x":[{"scale-x":Ze()}],"scale-y":[{"scale-y":Ze()}],"scale-z":[{"scale-z":Ze()}],"scale-3d":["scale-3d"],skew:[{skew:ni()}],"skew-x":[{"skew-x":ni()}],"skew-y":[{"skew-y":ni()}],transform:[{transform:[w,y,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[J,w,y]}],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",w,y]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",w,y]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[S,oe,St,bo]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function re(...n){return dl(wa(n))}function Me(n){return et`<svg
|
|
41
|
+
*/function Oe(n,t){return(e,i,o)=>{const r=s=>{var a;return((a=s.renderRoot)==null?void 0:a.querySelector(n))??null};return Ea(e,i,{get(){return r(this)}})}}function lo(n){var t,e,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(t=0;t<o;t++)n[t]&&(e=lo(n[t]))&&(i&&(i+=" "),i+=e)}else for(e in n)n[e]&&(i&&(i+=" "),i+=e);return i}function Ca(){for(var n,t,e=0,i="",o=arguments.length;e<o;e++)(n=arguments[e])&&(t=lo(n))&&(i&&(i+=" "),i+=t);return i}const Sa=(n,t)=>{const e=new Array(n.length+t.length);for(let i=0;i<n.length;i++)e[i]=n[i];for(let i=0;i<t.length;i++)e[n.length+i]=t[i];return e},Aa=(n,t)=>({classGroupId:n,validator:t}),co=(n=new Map,t=null,e)=>({nextPart:n,validators:t,classGroupId:e}),Le="-",uo=[],ka="arbitrary..",$a=n=>{const t=Ia(n),{conflictingClassGroups:e,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ta(s);const a=s.split(Le),l=a[0]===""&&a.length>1?1:0;return ho(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=i[s],c=e[s];return l?c?Sa(c,l):l:c||uo}return e[s]||uo}}},ho=(n,t,e)=>{if(n.length-t===0)return e.classGroupId;const o=n[t],r=e.nextPart.get(o);if(r){const c=ho(n,t+1,r);if(c)return c}const s=e.validators;if(s===null)return;const a=t===0?n.join(Le):n.slice(t).join(Le),l=s.length;for(let c=0;c<l;c++){const f=s[c];if(f.validator(a))return f.classGroupId}},Ta=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),e=t.indexOf(":"),i=t.slice(0,e);return i?ka+i:void 0})(),Ia=n=>{const{theme:t,classGroups:e}=n;return Oa(e,t)},Oa=(n,t)=>{const e=co();for(const i in n){const o=n[i];Dn(o,e,i,t)}return e},Dn=(n,t,e,i)=>{const o=n.length;for(let r=0;r<o;r++){const s=n[r];La(s,t,e,i)}},La=(n,t,e,i)=>{if(typeof n=="string"){Ra(n,t,e);return}if(typeof n=="function"){za(n,t,e,i);return}Ma(n,t,e,i)},Ra=(n,t,e)=>{const i=n===""?t:fo(t,n);i.classGroupId=e},za=(n,t,e,i)=>{if(Da(n)){Dn(n(i),t,e,i);return}t.validators===null&&(t.validators=[]),t.validators.push(Aa(e,n))},Ma=(n,t,e,i)=>{const o=Object.entries(n),r=o.length;for(let s=0;s<r;s++){const[a,l]=o[s];Dn(l,fo(t,a),e,i)}},fo=(n,t)=>{let e=n;const i=t.split(Le),o=i.length;for(let r=0;r<o;r++){const s=i[r];let a=e.nextPart.get(s);a||(a=co(),e.nextPart.set(s,a)),e=a}return e},Da=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Pa=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,e=Object.create(null),i=Object.create(null);const o=(r,s)=>{e[r]=s,t++,t>n&&(t=0,i=e,e=Object.create(null))};return{get(r){let s=e[r];if(s!==void 0)return s;if((s=i[r])!==void 0)return o(r,s),s},set(r,s){r in e?e[r]=s:o(r,s)}}},Pn="!",po=":",Na=[],mo=(n,t,e,i,o)=>({modifiers:n,hasImportantModifier:t,baseClassName:e,maybePostfixModifierPosition:i,isExternal:o}),ja=n=>{const{prefix:t,experimentalParseClassName:e}=n;let i=o=>{const r=[];let s=0,a=0,l=0,c;const f=o.length;for(let m=0;m<f;m++){const g=o[m];if(s===0&&a===0){if(g===po){r.push(o.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const d=r.length===0?o:o.slice(l);let u=d,h=!1;d.endsWith(Pn)?(u=d.slice(0,-1),h=!0):d.startsWith(Pn)&&(u=d.slice(1),h=!0);const p=c&&c>l?c-l:void 0;return mo(r,h,u,p)};if(t){const o=t+po,r=i;i=s=>s.startsWith(o)?r(s.slice(o.length)):mo(Na,!1,s,void 0,!0)}if(e){const o=i;i=r=>e({className:r,parseClassName:o})}return i},Ha=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((e,i)=>{t.set(e,1e6+i)}),e=>{const i=[];let o=[];for(let r=0;r<e.length;r++){const s=e[r],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(s)):o.push(s)}return o.length>0&&(o.sort(),i.push(...o)),i}},Ua=n=>({cache:Pa(n.cacheSize),parseClassName:ja(n),sortModifiers:Ha(n),postfixLookupClassGroupIds:Ba(n),...$a(n)}),Ba=n=>{const t=Object.create(null),e=n.postfixLookupClassGroups;if(e)for(let i=0;i<e.length;i++)t[e[i]]=!0;return t},Wa=/\s+/,Ga=(n,t)=>{const{parseClassName:e,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:r,postfixLookupClassGroupIds:s}=t,a=[],l=n.trim().split(Wa);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{isExternal:u,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=e(d);if(u){c=d+(c.length>0?" "+c:c);continue}let v=!!g,x;if(v){const $=m.substring(0,g);x=i($);const b=x&&s[x]?i(m):void 0;b&&b!==x&&(x=b,v=!1)}else x=i(m);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=i(m),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const _=h.length===0?"":h.length===1?h[0]:r(h).join(":"),A=p?_+Pn:_,I=A+x;if(a.indexOf(I)>-1)continue;a.push(I);const k=o(x,v);for(let $=0;$<k.length;++$){const b=k[$];a.push(A+b)}c=d+(c.length>0?" "+c:c)}return c},Fa=(...n)=>{let t=0,e,i,o="";for(;t<n.length;)(e=n[t++])&&(i=go(e))&&(o&&(o+=" "),o+=i);return o},go=n=>{if(typeof n=="string")return n;let t,e="";for(let i=0;i<n.length;i++)n[i]&&(t=go(n[i]))&&(e&&(e+=" "),e+=t);return e},Va=(n,...t)=>{let e,i,o,r;const s=l=>{const c=t.reduce((f,d)=>d(f),n());return e=Ua(c),i=e.cache.get,o=e.cache.set,r=a,a(l)},a=l=>{const c=i(l);if(c)return c;const f=Ga(l,e);return o(l,f),f};return r=s,(...l)=>r(Fa(...l))},qa=[],O=n=>{const t=e=>e[n]||qa;return t.isThemeGetter=!0,t},vo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xa=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ka=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ja=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ya=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Za=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ut=n=>Xa.test(n),S=n=>!!n&&!Number.isNaN(Number(n)),J=n=>!!n&&Number.isInteger(Number(n)),Nn=n=>n.endsWith("%")&&S(n.slice(0,-1)),it=n=>Ka.test(n),yo=()=>!0,tl=n=>Ja.test(n)&&!Ya.test(n),jn=()=>!1,el=n=>Za.test(n),nl=n=>Qa.test(n),il=n=>!y(n)&&!w(n),ol=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),rl=n=>ht(n,So,jn),y=n=>vo.test(n),St=n=>ht(n,Ao,tl),wo=n=>ht(n,fl,S),sl=n=>ht(n,$o,yo),al=n=>ht(n,ko,jn),xo=n=>ht(n,Eo,jn),ll=n=>ht(n,Co,nl),Re=n=>ht(n,To,el),w=n=>bo.test(n),oe=n=>At(n,Ao),cl=n=>At(n,ko),_o=n=>At(n,Eo),dl=n=>At(n,So),ul=n=>At(n,Co),ze=n=>At(n,To,!0),hl=n=>At(n,$o,!0),ht=(n,t,e)=>{const i=vo.exec(n);return i?i[1]?t(i[1]):e(i[2]):!1},At=(n,t,e=!1)=>{const i=bo.exec(n);return i?i[1]?t(i[1]):e:!1},Eo=n=>n==="position"||n==="percentage",Co=n=>n==="image"||n==="url",So=n=>n==="length"||n==="size"||n==="bg-size",Ao=n=>n==="length",fl=n=>n==="number",ko=n=>n==="family-name",$o=n=>n==="number"||n==="weight",To=n=>n==="shadow",pl=Va(()=>{const n=O("color"),t=O("font"),e=O("text"),i=O("font-weight"),o=O("tracking"),r=O("leading"),s=O("breakpoint"),a=O("container"),l=O("spacing"),c=O("radius"),f=O("shadow"),d=O("inset-shadow"),u=O("text-shadow"),h=O("drop-shadow"),p=O("blur"),m=O("perspective"),g=O("aspect"),v=O("ease"),x=O("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...A(),w,y],k=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[w,y,l],T=()=>[ut,"full","auto",...b()],W=()=>[J,"none","subgrid",w,y],gt=()=>["auto",{span:["full",J,w,y]},J,w,y],Q=()=>[J,"auto",w,y],vt=()=>["auto","min","max","fr",w,y],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],tt=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...b()],M=()=>[ut,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],D=()=>[ut,"screen","full","dvw","lvw","svw","min","max","fit",...b()],G=()=>[ut,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],E=()=>[n,w,y],lr=()=>[...A(),_o,xo,{position:[w,y]}],cr=()=>["no-repeat",{repeat:["","x","y","space","round"]}],dr=()=>["auto","cover","contain",dl,rl,{size:[w,y]}],ii=()=>[Nn,oe,St],P=()=>["","none","full",c,w,y],N=()=>["",S,oe,St],Je=()=>["solid","dashed","dotted","double"],ur=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>[S,Nn,_o,xo],hr=()=>["","none",p,w,y],Ye=()=>["none",S,w,y],Ze=()=>["none",S,w,y],oi=()=>[S,w,y],Qe=()=>[ut,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[it],breakpoint:[it],color:[yo],container:[it],"drop-shadow":[it],ease:["in","out","in-out"],font:[il],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[it],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[it],shadow:[it],spacing:["px",S],text:[it],"text-shadow":[it],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ut,y,w,g]}],container:["container"],"container-type":[{"@container":["","normal","size",w,y]}],"container-named":[ol],columns:[{columns:[S,y,w,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[J,"auto",w,y]}],basis:[{basis:[ut,"full","auto",a,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[S,ut,"auto","initial","none",y]}],grow:[{grow:["",S,w,y]}],shrink:[{shrink:["",S,w,y]}],order:[{order:[J,"first","last","none",w,y]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:gt()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:gt()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":vt()}],"auto-rows":[{"auto-rows":vt()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...tt(),"normal"]}],"justify-self":[{"justify-self":["auto",...tt()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...tt(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...tt(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...tt(),"baseline"]}],"place-self":[{"place-self":["auto",...tt()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...D()]}],"min-inline-size":[{"min-inline":["auto",...D()]}],"max-inline-size":[{"max-inline":["none",...D()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",e,oe,St]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,hl,sl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nn,y]}],"font-family":[{font:[cl,al,t]}],"font-features":[{"font-features":[y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,w,y]}],"line-clamp":[{"line-clamp":[S,"none",w,wo]}],leading:[{leading:[r,...b()]}],"list-image":[{"list-image":["none",w,y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",w,y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Je(),"wavy"]}],"text-decoration-thickness":[{decoration:[S,"from-font","auto",w,St]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[S,"auto",w,y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"tab-size":[{tab:[J,w,y]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",w,y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",w,y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:lr()}],"bg-repeat":[{bg:cr()}],"bg-size":[{bg:dr()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},J,w,y],radial:["",w,y],conic:[J,w,y]},ul,ll]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:ii()}],"gradient-via-pos":[{via:ii()}],"gradient-to-pos":[{to:ii()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Je(),"hidden","none"]}],"divide-style":[{divide:[...Je(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[S,w,y]}],"outline-w":[{outline:["",S,oe,St]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",f,ze,Re]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,ze,Re]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[S,St]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",u,ze,Re]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[S,w,y]}],"mix-blend":[{"mix-blend":[...ur(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ur()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[S]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[w,y]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[S]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:lr()}],"mask-repeat":[{mask:cr()}],"mask-size":[{mask:dr()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",w,y]}],filter:[{filter:["","none",w,y]}],blur:[{blur:hr()}],brightness:[{brightness:[S,w,y]}],contrast:[{contrast:[S,w,y]}],"drop-shadow":[{"drop-shadow":["","none",h,ze,Re]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",S,w,y]}],"hue-rotate":[{"hue-rotate":[S,w,y]}],invert:[{invert:["",S,w,y]}],saturate:[{saturate:[S,w,y]}],sepia:[{sepia:["",S,w,y]}],"backdrop-filter":[{"backdrop-filter":["","none",w,y]}],"backdrop-blur":[{"backdrop-blur":hr()}],"backdrop-brightness":[{"backdrop-brightness":[S,w,y]}],"backdrop-contrast":[{"backdrop-contrast":[S,w,y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",S,w,y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S,w,y]}],"backdrop-invert":[{"backdrop-invert":["",S,w,y]}],"backdrop-opacity":[{"backdrop-opacity":[S,w,y]}],"backdrop-saturate":[{"backdrop-saturate":[S,w,y]}],"backdrop-sepia":[{"backdrop-sepia":["",S,w,y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",w,y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[S,"initial",w,y]}],ease:[{ease:["linear","initial",v,w,y]}],delay:[{delay:[S,w,y]}],animate:[{animate:["none",x,w,y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,w,y]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ye()}],"rotate-x":[{"rotate-x":Ye()}],"rotate-y":[{"rotate-y":Ye()}],"rotate-z":[{"rotate-z":Ye()}],scale:[{scale:Ze()}],"scale-x":[{"scale-x":Ze()}],"scale-y":[{"scale-y":Ze()}],"scale-z":[{"scale-z":Ze()}],"scale-3d":["scale-3d"],skew:[{skew:oi()}],"skew-x":[{"skew-x":oi()}],"skew-y":[{"skew-y":oi()}],transform:[{transform:[w,y,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[J,w,y]}],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",w,y]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",w,y]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[S,oe,St,wo]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function re(...n){return pl(Ca(n))}function Me(n){return et`<svg
|
|
42
42
|
xmlns="http://www.w3.org/2000/svg"
|
|
43
43
|
viewBox="0 0 24 24"
|
|
44
44
|
fill="none"
|
|
@@ -49,7 +49,7 @@ ${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get eve
|
|
|
49
49
|
aria-hidden="true"
|
|
50
50
|
>
|
|
51
51
|
${n}
|
|
52
|
-
</svg>`}const De={check:Me(Te`<path d="M20 6 9 17l-5-5" />`),gripVertical:Me(Te`<circle cx="9" cy="12" r="1" /><circle cx="9" cy="5" r="1" /><circle cx="9" cy="19" r="1" /><circle cx="15" cy="12" r="1" /><circle cx="15" cy="5" r="1" /><circle cx="15" cy="19" r="1" />`),messageSquare:Me(Te`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />`),trash:Me(Te`<path d="M3 6h18" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`)},ul=Gi('/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-\\[calc\\(var\\(--review-z-index\\,9998\\)\\+1\\)\\]{z-index:calc(var(--review-z-index,9998) + 1)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-\\[18px\\]{height:18px}.max-h-\\[200px\\]{max-height:200px}.w-7{width:calc(var(--spacing) * 7)}.w-\\[400px\\]{width:400px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.min-w-\\[18px\\]{min-width:18px}.flex-1{flex:1}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-3\\.5{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[llumi-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out llumi-fade-in}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-zinc-200{border-color:var(--color-zinc-200)}.border-zinc-300{border-color:var(--color-zinc-300)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.bg-zinc-200{background-color:var(--color-zinc-200)}.bg-zinc-300{background-color:var(--color-zinc-300)}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-white{color:var(--color-white)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-700{color:var(--color-zinc-700)}.text-zinc-900{color:var(--color-zinc-900)}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-zinc-400\\/20{--tw-ring-color:#9f9fa933}@supports (color:color-mix(in lab,red,red)){.ring-zinc-400\\/20{--tw-ring-color:color-mix(in oklab, var(--color-zinc-400) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:max-w-\\[60px\\]:is(:where(.group):hover *){max-width:60px}}.placeholder\\:text-zinc-400::placeholder{color:var(--color-zinc-400)}@media(hover:hover){.hover\\:bg-zinc-50:hover{background-color:var(--color-zinc-50)}.hover\\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-zinc-950:active{background-color:var(--color-zinc-950)}}@keyframes llumi-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}'),Qn=class Qn extends ne{};Qn.styles=ul;let kt=Qn;var hl=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,ft=(n,t,e,i)=>{for(var o=i>1?void 0:i?fl(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&hl(t,e,o),o};const ml={"top-left":{top:"16px",left:"16px"},"top-center":{top:"16px",left:"50%",translateX:"-50%"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-center":{bottom:"16px",left:"50%",translateX:"-50%"},"bottom-right":{bottom:"16px",right:"16px"}};C.LlumiReviewBar=class extends kt{constructor(){super(...arguments),this.mode="idle",this.commentCount=0,this.hasOverallComment=!1,this.overallCommentOpen=!1,this.barPosition="bottom-center",this.dragOffset=null,this.dragStart=null,this.onDragStart=t=>{const e=this.bar.getBoundingClientRect();this.dragStart={px:t.clientX,py:t.clientY,ox:e.left,oy:e.top},window.addEventListener("pointermove",this.onDragMove),window.addEventListener("pointerup",this.onDragEnd)},this.onDragMove=t=>{if(!this.dragStart)return;const e=this.dragStart.ox+(t.clientX-this.dragStart.px),i=this.dragStart.oy+(t.clientY-this.dragStart.py),o=16,r=window.innerWidth-this.bar.offsetWidth-o,s=window.innerHeight-this.bar.offsetHeight-o;this.dragOffset={x:Math.max(o,Math.min(e,r)),y:Math.max(o,Math.min(i,s))}},this.onDragEnd=()=>{this.dragStart=null,window.removeEventListener("pointermove",this.onDragMove),window.removeEventListener("pointerup",this.onDragEnd)}}get barRoot(){return this.bar??null}render(){const t=this.mode!=="idle",e=this.commentCount+(this.hasOverallComment?1:0),i=e>0,o=ml[this.barPosition],r=this.dragOffset?`position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);`:`position:fixed;${o.top?`top:${o.top};`:""}${o.bottom?`bottom:${o.bottom};`:""}${o.left?`left:${o.left};`:""}${o.right?`right:${o.right};`:""}${o.translateX?`transform:translateX(${o.translateX});`:""}z-index:var(--review-z-index,9998);`;return et`<div
|
|
52
|
+
</svg>`}const De={check:Me(Te`<path d="M20 6 9 17l-5-5" />`),gripVertical:Me(Te`<circle cx="9" cy="12" r="1" /><circle cx="9" cy="5" r="1" /><circle cx="9" cy="19" r="1" /><circle cx="15" cy="12" r="1" /><circle cx="15" cy="5" r="1" /><circle cx="15" cy="19" r="1" />`),messageSquare:Me(Te`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />`),trash:Me(Te`<path d="M3 6h18" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`)},ml=Vi('/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-\\[calc\\(var\\(--review-z-index\\,9998\\)\\+1\\)\\]{z-index:calc(var(--review-z-index,9998) + 1)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-\\[18px\\]{height:18px}.max-h-\\[200px\\]{max-height:200px}.w-7{width:calc(var(--spacing) * 7)}.w-\\[400px\\]{width:400px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.min-w-\\[18px\\]{min-width:18px}.flex-1{flex:1}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-3\\.5{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[llumi-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out llumi-fade-in}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-zinc-200{border-color:var(--color-zinc-200)}.border-zinc-300{border-color:var(--color-zinc-300)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.bg-zinc-200{background-color:var(--color-zinc-200)}.bg-zinc-300{background-color:var(--color-zinc-300)}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-white{color:var(--color-white)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-700{color:var(--color-zinc-700)}.text-zinc-900{color:var(--color-zinc-900)}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-zinc-400\\/20{--tw-ring-color:#9f9fa933}@supports (color:color-mix(in lab,red,red)){.ring-zinc-400\\/20{--tw-ring-color:color-mix(in oklab, var(--color-zinc-400) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:max-w-\\[60px\\]:is(:where(.group):hover *){max-width:60px}}.placeholder\\:text-zinc-400::placeholder{color:var(--color-zinc-400)}@media(hover:hover){.hover\\:bg-zinc-50:hover{background-color:var(--color-zinc-50)}.hover\\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-zinc-950:active{background-color:var(--color-zinc-950)}}@keyframes llumi-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}'),ei=class ei extends ne{};ei.styles=ml;let kt=ei;var gl=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,ft=(n,t,e,i)=>{for(var o=i>1?void 0:i?vl(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&gl(t,e,o),o};const bl={"top-left":{top:"16px",left:"16px"},"top-center":{top:"16px",left:"50%",translateX:"-50%"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-center":{bottom:"16px",left:"50%",translateX:"-50%"},"bottom-right":{bottom:"16px",right:"16px"}};C.LlumiReviewBar=class extends kt{constructor(){super(...arguments),this.mode="idle",this.commentCount=0,this.hasOverallComment=!1,this.overallCommentOpen=!1,this.barPosition="bottom-center",this.dragOffset=null,this.dragStart=null,this.onDragStart=t=>{const e=this.bar.getBoundingClientRect();this.dragStart={px:t.clientX,py:t.clientY,ox:e.left,oy:e.top},window.addEventListener("pointermove",this.onDragMove),window.addEventListener("pointerup",this.onDragEnd)},this.onDragMove=t=>{if(!this.dragStart)return;const e=this.dragStart.ox+(t.clientX-this.dragStart.px),i=this.dragStart.oy+(t.clientY-this.dragStart.py),o=16,r=window.innerWidth-this.bar.offsetWidth-o,s=window.innerHeight-this.bar.offsetHeight-o;this.dragOffset={x:Math.max(o,Math.min(e,r)),y:Math.max(o,Math.min(i,s))}},this.onDragEnd=()=>{this.dragStart=null,window.removeEventListener("pointermove",this.onDragMove),window.removeEventListener("pointerup",this.onDragEnd)}}get barRoot(){return this.bar??null}render(){const t=this.mode!=="idle",e=this.commentCount+(this.hasOverallComment?1:0),i=e>0,o=bl[this.barPosition],r=this.dragOffset?`position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);`:`position:fixed;${o.top?`top:${o.top};`:""}${o.bottom?`bottom:${o.bottom};`:""}${o.left?`left:${o.left};`:""}${o.right?`right:${o.right};`:""}${o.translateX?`transform:translateX(${o.translateX});`:""}z-index:var(--review-z-index,9998);`;return et`<div
|
|
53
53
|
data-bar
|
|
54
54
|
class=${re("flex items-center gap-2 rounded-full border border-zinc-200 bg-white p-1 shadow-lg",t&&"ring-1 ring-zinc-400/20")}
|
|
55
55
|
style=${r}
|
|
@@ -100,27 +100,27 @@ ${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get eve
|
|
|
100
100
|
${i?e:et`<span class="size-3">${De.check}</span>`}
|
|
101
101
|
</span>
|
|
102
102
|
</button>
|
|
103
|
-
</div>`}onToggle(){this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))}onOverallToggle(){this.dispatchEvent(new CustomEvent("overall-toggle",{bubbles:!0,composed:!0}))}onSubmit(){this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("pointermove",this.onDragMove),window.removeEventListener("pointerup",this.onDragEnd)}},ft([j()],C.LlumiReviewBar.prototype,"mode",2),ft([j({type:Number})],C.LlumiReviewBar.prototype,"commentCount",2),ft([j({type:Boolean})],C.LlumiReviewBar.prototype,"hasOverallComment",2),ft([j({type:Boolean})],C.LlumiReviewBar.prototype,"overallCommentOpen",2),ft([j()],C.LlumiReviewBar.prototype,"barPosition",2),ft([Oe("[data-bar]")],C.LlumiReviewBar.prototype,"bar",2),ft([ba()],C.LlumiReviewBar.prototype,"dragOffset",2),C.LlumiReviewBar=ft([ie("llumi-review-bar")],C.LlumiReviewBar);const jt=Math.min,U=Math.max,Pe=Math.round,Ne=Math.floor,Y=n=>({x:n,y:n}),pl={left:"right",right:"left",bottom:"top",top:"bottom"};function $o(n,t,e){return U(n,jt(t,e))}function se(n,t){return typeof n=="function"?n(t):n}function mt(n){return n.split("-")[0]}function ae(n){return n.split("-")[1]}function To(n){return n==="x"?"y":"x"}function Io(n){return n==="y"?"height":"width"}function ot(n){const t=n[0];return t==="t"||t==="b"?"y":"x"}function Oo(n){return To(ot(n))}function gl(n,t,e){e===void 0&&(e=!1);const i=ae(n),o=Oo(n),r=Io(o);let s=o==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=He(s)),[s,He(s)]}function vl(n){const t=He(n);return[Nn(n),t,Nn(t)]}function Nn(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Lo=["left","right"],Ro=["right","left"],bl=["top","bottom"],yl=["bottom","top"];function wl(n,t,e){switch(n){case"top":case"bottom":return e?t?Ro:Lo:t?Lo:Ro;case"left":case"right":return t?bl:yl;default:return[]}}function xl(n,t,e,i){const o=ae(n);let r=wl(mt(n),e==="start",i);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Nn)))),r}function He(n){const t=mt(n);return pl[t]+n.slice(t.length)}function _l(n){return{top:0,right:0,bottom:0,left:0,...n}}function El(n){return typeof n!="number"?_l(n):{top:n,right:n,bottom:n,left:n}}function je(n){const{x:t,y:e,width:i,height:o}=n;return{width:i,height:o,top:e,left:t,right:t+i,bottom:e+o,x:t,y:e}}function zo(n,t,e){let{reference:i,floating:o}=n;const r=ot(t),s=Oo(t),a=Io(s),l=mt(t),c=r==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,u=i[a]/2-o[a]/2;let h;switch(l){case"top":h={x:f,y:i.y-o.height};break;case"bottom":h={x:f,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-o.width,y:d};break;default:h={x:i.x,y:i.y}}switch(ae(t)){case"start":h[s]-=u*(e&&c?-1:1);break;case"end":h[s]+=u*(e&&c?-1:1);break}return h}async function Cl(n,t){var e;t===void 0&&(t={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:u=!1,padding:h=0}=se(t,n),m=El(h),g=a[u?d==="floating"?"reference":"floating":d],v=je(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(g)))==null||e?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),x=d==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),A=await(r.isElement==null?void 0:r.isElement(_))?await(r.getScale==null?void 0:r.getScale(_))||{x:1,y:1}:{x:1,y:1},I=je(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:l}):x);return{top:(v.top-I.top+m.top)/A.y,bottom:(I.bottom-v.bottom+m.bottom)/A.y,left:(v.left-I.left+m.left)/A.x,right:(I.right-v.right+m.right)/A.x}}const Sl=50,Al=async(n,t,e)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=e,a=s.detectOverflow?s:{...s,detectOverflow:Cl},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:n,floating:t,strategy:o}),{x:f,y:d}=zo(c,i,l),u=i,h=0;const m={};for(let p=0;p<r.length;p++){const g=r[p];if(!g)continue;const{name:v,fn:x}=g,{x:_,y:A,data:I,reset:k}=await x({x:f,y:d,initialPlacement:i,placement:u,strategy:o,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});f=_??f,d=A??d,m[v]={...m[v],...I},k&&h<Sl&&(h++,typeof k=="object"&&(k.placement&&(u=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:n,floating:t,strategy:o}):k.rects),{x:f,y:d}=zo(c,u,l)),p=-1)}return{x:f,y:d,placement:u,strategy:o,middlewareData:m}},kl=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=se(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const v=mt(o),x=ot(a),_=mt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=u||(_||!p?[He(a)]:vl(a)),k=m!=="none";!u&&k&&I.push(...xl(a,p,m,A));const $=[a,...I],b=await l.detectOverflow(t,g),T=[];let W=((i=r.flip)==null?void 0:i.overflows)||[];if(f&&T.push(b[v]),d){const X=gl(o,s,A);T.push(b[X[0]],b[X[1]])}if(W=[...W,{placement:o,overflows:T}],!T.every(X=>X<=0)){var gt,Q;const X=(((gt=r.flip)==null?void 0:gt.index)||0)+1,tt=$[X];if(tt&&(!(d==="alignment"?x!==ot(tt):!1)||W.every(D=>ot(D.placement)===x?D.overflows[0]>0:!0)))return{data:{index:X,overflows:W},reset:{placement:tt}};let z=(Q=W.filter(M=>M.overflows[0]<=0).sort((M,D)=>M.overflows[1]-D.overflows[1])[0])==null?void 0:Q.placement;if(!z)switch(h){case"bestFit":{var vt;const M=(vt=W.filter(D=>{if(k){const G=ot(D.placement);return G===x||G==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(G=>G>0).reduce((G,E)=>G+E,0)]).sort((D,G)=>D[1]-G[1])[0])==null?void 0:vt[0];M&&(z=M);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}},$l=new Set(["left","top"]);async function Tl(n,t){const{placement:e,platform:i,elements:o}=n,r=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=mt(e),a=ae(e),l=ot(e)==="y",c=$l.has(s)?-1:1,f=r&&l?-1:1,d=se(t,n);let{mainAxis:u,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*f,y:u*c}:{x:u*c,y:h*f}}const Il=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;const{x:o,y:r,placement:s,middlewareData:a}=t,l=await Tl(t,n);return s===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}},Ol=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:i,placement:o,platform:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x,y:_}=v;return{x,y:_}}},...c}=se(n,t),f={x:e,y:i},d=await r.detectOverflow(t,c),u=ot(mt(o)),h=To(u);let m=f[h],p=f[u];if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=m+d[v],A=m-d[x];m=$o(_,m,A)}if(a){const v=u==="y"?"top":"left",x=u==="y"?"bottom":"right",_=p+d[v],A=p-d[x];p=$o(_,p,A)}const g=l.fn({...t,[h]:m,[u]:p});return{...g,data:{x:g.x-e,y:g.y-i,enabled:{[h]:s,[u]:a}}}}}},Ll=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,i;const{placement:o,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...c}=se(n,t),f=await s.detectOverflow(t,c),d=mt(o),u=ae(o),h=ot(o)==="y",{width:m,height:p}=r.floating;let g,v;d==="top"||d==="bottom"?(g=d,v=u===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g=u==="end"?"top":"bottom");const x=p-f.top-f.bottom,_=m-f.left-f.right,A=jt(p-f[g],x),I=jt(m-f[v],_),k=!t.middlewareData.shift;let $=A,b=I;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(b=_),(i=t.middlewareData.shift)!=null&&i.enabled.y&&($=x),k&&!u){const W=U(f.left,0),gt=U(f.right,0),Q=U(f.top,0),vt=U(f.bottom,0);h?b=m-2*(W!==0||gt!==0?W+gt:U(f.left,f.right)):$=p-2*(Q!==0||vt!==0?Q+vt:U(f.top,f.bottom))}await l({...t,availableWidth:b,availableHeight:$});const T=await s.getDimensions(a.floating);return m!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ue(){return typeof window<"u"}function Ut(n){return Mo(n)?(n.nodeName||"").toLowerCase():"#document"}function B(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Z(n){var t;return(t=(Mo(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Mo(n){return Ue()?n instanceof Node||n instanceof B(n).Node:!1}function V(n){return Ue()?n instanceof Element||n instanceof B(n).Element:!1}function rt(n){return Ue()?n instanceof HTMLElement||n instanceof B(n).HTMLElement:!1}function Do(n){return!Ue()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof B(n).ShadowRoot}function le(n){const{overflow:t,overflowX:e,overflowY:i,display:o}=q(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&o!=="inline"&&o!=="contents"}function Rl(n){return/^(table|td|th)$/.test(Ut(n))}function Be(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const zl=/transform|translate|scale|rotate|perspective|filter/,Ml=/paint|layout|strict|content/,$t=n=>!!n&&n!=="none";let Hn;function jn(n){const t=V(n)?q(n):n;return $t(t.transform)||$t(t.translate)||$t(t.scale)||$t(t.rotate)||$t(t.perspective)||!Un()&&($t(t.backdropFilter)||$t(t.filter))||zl.test(t.willChange||"")||Ml.test(t.contain||"")}function Dl(n){let t=pt(n);for(;rt(t)&&!Bt(t);){if(jn(t))return t;if(Be(t))return null;t=pt(t)}return null}function Un(){return Hn==null&&(Hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hn}function Bt(n){return/^(html|body|#document)$/.test(Ut(n))}function q(n){return B(n).getComputedStyle(n)}function We(n){return V(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function pt(n){if(Ut(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Do(n)&&n.host||Z(n);return Do(t)?t.host:t}function Po(n){const t=pt(n);return Bt(t)?n.ownerDocument?n.ownerDocument.body:n.body:rt(t)&&le(t)?t:Po(t)}function ce(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Po(n),r=o===((i=n.ownerDocument)==null?void 0:i.body),s=B(o);if(r){const a=Bn(s);return t.concat(s,s.visualViewport||[],le(o)?o:[],a&&e?ce(a):[])}else return t.concat(o,ce(o,[],e))}function Bn(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function No(n){const t=q(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=rt(n),r=o?n.offsetWidth:e,s=o?n.offsetHeight:i,a=Pe(e)!==r||Pe(i)!==s;return a&&(e=r,i=s),{width:e,height:i,$:a}}function Wn(n){return V(n)?n:n.contextElement}function Wt(n){const t=Wn(n);if(!rt(t))return Y(1);const e=t.getBoundingClientRect(),{width:i,height:o,$:r}=No(t);let s=(r?Pe(e.width):e.width)/i,a=(r?Pe(e.height):e.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Pl=Y(0);function Ho(n){const t=B(n);return!Un()||!t.visualViewport?Pl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nl(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==B(n)?!1:t}function Tt(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),r=Wn(n);let s=Y(1);t&&(i?V(i)&&(s=Wt(i)):s=Wt(n));const a=Nl(r,e,i)?Ho(r):Y(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(r){const u=B(r),h=i&&V(i)?B(i):i;let m=u,p=Bn(m);for(;p&&i&&h!==m;){const g=Wt(p),v=p.getBoundingClientRect(),x=q(p),_=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,A=v.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,f*=g.x,d*=g.y,l+=_,c+=A,m=B(p),p=Bn(m)}}return je({width:f,height:d,x:l,y:c})}function Ge(n,t){const e=We(n).scrollLeft;return t?t.left+e:Tt(Z(n)).left+e}function jo(n,t){const e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-Ge(n,e),o=e.top+t.scrollTop;return{x:i,y:o}}function Hl(n){let{elements:t,rect:e,offsetParent:i,strategy:o}=n;const r=o==="fixed",s=Z(i),a=t?Be(t.floating):!1;if(i===s||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=Y(1);const f=Y(0),d=rt(i);if((d||!d&&!r)&&((Ut(i)!=="body"||le(s))&&(l=We(i)),d)){const h=Tt(i);c=Wt(i),f.x=h.x+i.clientLeft,f.y=h.y+i.clientTop}const u=s&&!d&&!r?jo(s,l):Y(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x+u.x,y:e.y*c.y-l.scrollTop*c.y+f.y+u.y}}function jl(n){return Array.from(n.getClientRects())}function Ul(n){const t=Z(n),e=We(n),i=n.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=U(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-e.scrollLeft+Ge(n);const a=-e.scrollTop;return q(i).direction==="rtl"&&(s+=U(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:a}}const Uo=25;function Bl(n,t){const e=B(n),i=Z(n),o=e.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const f=Un();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Ge(i);if(c<=0){const f=i.ownerDocument,d=f.body,u=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,m=Math.abs(i.clientWidth-d.clientWidth-h);m<=Uo&&(r-=m)}else c<=Uo&&(r+=c);return{width:r,height:s,x:a,y:l}}function Wl(n,t){const e=Tt(n,!0,t==="fixed"),i=e.top+n.clientTop,o=e.left+n.clientLeft,r=rt(n)?Wt(n):Y(1),s=n.clientWidth*r.x,a=n.clientHeight*r.y,l=o*r.x,c=i*r.y;return{width:s,height:a,x:l,y:c}}function Bo(n,t,e){let i;if(t==="viewport")i=Bl(n,e);else if(t==="document")i=Ul(Z(n));else if(V(t))i=Wl(t,e);else{const o=Ho(n);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return je(i)}function Wo(n,t){const e=pt(n);return e===t||!V(e)||Bt(e)?!1:q(e).position==="fixed"||Wo(e,t)}function Gl(n,t){const e=t.get(n);if(e)return e;let i=ce(n,[],!1).filter(a=>V(a)&&Ut(a)!=="body"),o=null;const r=q(n).position==="fixed";let s=r?pt(n):n;for(;V(s)&&!Bt(s);){const a=q(s),l=jn(s);!l&&a.position==="fixed"&&(o=null),(r?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||le(s)&&!l&&Wo(n,s))?i=i.filter(f=>f!==s):o=a,s=pt(s)}return t.set(n,i),i}function Fl(n){let{element:t,boundary:e,rootBoundary:i,strategy:o}=n;const s=[...e==="clippingAncestors"?Be(t)?[]:Gl(t,this._c):[].concat(e),i],a=Bo(t,s[0],o);let l=a.top,c=a.right,f=a.bottom,d=a.left;for(let u=1;u<s.length;u++){const h=Bo(t,s[u],o);l=U(h.top,l),c=jt(h.right,c),f=jt(h.bottom,f),d=U(h.left,d)}return{width:c-d,height:f-l,x:d,y:l}}function Vl(n){const{width:t,height:e}=No(n);return{width:t,height:e}}function ql(n,t,e){const i=rt(t),o=Z(t),r=e==="fixed",s=Tt(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=Y(0);function c(){l.x=Ge(o)}if(i||!i&&!r)if((Ut(t)!=="body"||le(o))&&(a=We(t)),i){const h=Tt(t,!0,r,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();r&&!i&&o&&c();const f=o&&!i&&!r?jo(o,a):Y(0),d=s.left+a.scrollLeft-l.x-f.x,u=s.top+a.scrollTop-l.y-f.y;return{x:d,y:u,width:s.width,height:s.height}}function Gn(n){return q(n).position==="static"}function Go(n,t){if(!rt(n)||q(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return Z(n)===e&&(e=e.ownerDocument.body),e}function Fo(n,t){const e=B(n);if(Be(n))return e;if(!rt(n)){let o=pt(n);for(;o&&!Bt(o);){if(V(o)&&!Gn(o))return o;o=pt(o)}return e}let i=Go(n,t);for(;i&&Rl(i)&&Gn(i);)i=Go(i,t);return i&&Bt(i)&&Gn(i)&&!jn(i)?e:i||Dl(n)||e}const Xl=async function(n){const t=this.getOffsetParent||Fo,e=this.getDimensions,i=await e(n.floating);return{reference:ql(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Kl(n){return q(n).direction==="rtl"}const Jl={convertOffsetParentRelativeRectToViewportRelativeRect:Hl,getDocumentElement:Z,getClippingRect:Fl,getOffsetParent:Fo,getElementRects:Xl,getClientRects:jl,getDimensions:Vl,getScale:Wt,isElement:V,isRTL:Kl};function Vo(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Yl(n,t){let e=null,i;const o=Z(n);function r(){var a;clearTimeout(i),(a=e)==null||a.disconnect(),e=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:f,top:d,width:u,height:h}=c;if(a||t(),!u||!h)return;const m=Ne(d),p=Ne(o.clientWidth-(f+u)),g=Ne(o.clientHeight-(d+h)),v=Ne(f),_={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:U(0,jt(1,l))||1};let A=!0;function I(k){const $=k[0].intersectionRatio;if($!==l){if(!A)return s();$?s(!1,$):i=setTimeout(()=>{s(!1,1e-7)},1e3)}$===1&&!Vo(c,n.getBoundingClientRect())&&s(),A=!1}try{e=new IntersectionObserver(I,{..._,root:o.ownerDocument})}catch{e=new IntersectionObserver(I,_)}e.observe(n)}return s(!0),r}function qo(n,t,e,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Wn(n),f=o||r?[...c?ce(c):[],...t?ce(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",e,{passive:!0}),r&&v.addEventListener("resize",e)});const d=c&&a?Yl(c,e):null;let u=-1,h=null;s&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),e()}),c&&!l&&h.observe(c),t&&h.observe(t));let m,p=l?Tt(n):null;l&&g();function g(){const v=Tt(n);p&&!Vo(p,v)&&e(),p=v,m=requestAnimationFrame(g)}return e(),()=>{var v;f.forEach(x=>{o&&x.removeEventListener("scroll",e),r&&x.removeEventListener("resize",e)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Xo=Il,Ko=Ol,Jo=kl,Yo=Ll,Zo=(n,t,e)=>{const i=new Map,o={platform:Jl,...e},r={...o.platform,_c:i};return Al(n,t,{...o,platform:r})};/**
|
|
103
|
+
</div>`}onToggle(){this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))}onOverallToggle(){this.dispatchEvent(new CustomEvent("overall-toggle",{bubbles:!0,composed:!0}))}onSubmit(){this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("pointermove",this.onDragMove),window.removeEventListener("pointerup",this.onDragEnd)}},ft([H()],C.LlumiReviewBar.prototype,"mode",2),ft([H({type:Number})],C.LlumiReviewBar.prototype,"commentCount",2),ft([H({type:Boolean})],C.LlumiReviewBar.prototype,"hasOverallComment",2),ft([H({type:Boolean})],C.LlumiReviewBar.prototype,"overallCommentOpen",2),ft([H()],C.LlumiReviewBar.prototype,"barPosition",2),ft([Oe("[data-bar]")],C.LlumiReviewBar.prototype,"bar",2),ft([_a()],C.LlumiReviewBar.prototype,"dragOffset",2),C.LlumiReviewBar=ft([ie("llumi-review-bar")],C.LlumiReviewBar);const Ht=Math.min,U=Math.max,Pe=Math.round,Ne=Math.floor,Y=n=>({x:n,y:n}),yl={left:"right",right:"left",bottom:"top",top:"bottom"};function Io(n,t,e){return U(n,Ht(t,e))}function se(n,t){return typeof n=="function"?n(t):n}function pt(n){return n.split("-")[0]}function ae(n){return n.split("-")[1]}function Oo(n){return n==="x"?"y":"x"}function Lo(n){return n==="y"?"height":"width"}function ot(n){const t=n[0];return t==="t"||t==="b"?"y":"x"}function Ro(n){return Oo(ot(n))}function wl(n,t,e){e===void 0&&(e=!1);const i=ae(n),o=Ro(n),r=Lo(o);let s=o==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=je(s)),[s,je(s)]}function xl(n){const t=je(n);return[Hn(n),t,Hn(t)]}function Hn(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const zo=["left","right"],Mo=["right","left"],_l=["top","bottom"],El=["bottom","top"];function Cl(n,t,e){switch(n){case"top":case"bottom":return e?t?Mo:zo:t?zo:Mo;case"left":case"right":return t?_l:El;default:return[]}}function Sl(n,t,e,i){const o=ae(n);let r=Cl(pt(n),e==="start",i);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Hn)))),r}function je(n){const t=pt(n);return yl[t]+n.slice(t.length)}function Al(n){return{top:0,right:0,bottom:0,left:0,...n}}function kl(n){return typeof n!="number"?Al(n):{top:n,right:n,bottom:n,left:n}}function He(n){const{x:t,y:e,width:i,height:o}=n;return{width:i,height:o,top:e,left:t,right:t+i,bottom:e+o,x:t,y:e}}function Do(n,t,e){let{reference:i,floating:o}=n;const r=ot(t),s=Ro(t),a=Lo(s),l=pt(t),c=r==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,u=i[a]/2-o[a]/2;let h;switch(l){case"top":h={x:f,y:i.y-o.height};break;case"bottom":h={x:f,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-o.width,y:d};break;default:h={x:i.x,y:i.y}}switch(ae(t)){case"start":h[s]-=u*(e&&c?-1:1);break;case"end":h[s]+=u*(e&&c?-1:1);break}return h}async function $l(n,t){var e;t===void 0&&(t={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:u=!1,padding:h=0}=se(t,n),p=kl(h),g=a[u?d==="floating"?"reference":"floating":d],v=He(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(g)))==null||e?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),x=d==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),A=await(r.isElement==null?void 0:r.isElement(_))?await(r.getScale==null?void 0:r.getScale(_))||{x:1,y:1}:{x:1,y:1},I=He(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:l}):x);return{top:(v.top-I.top+p.top)/A.y,bottom:(I.bottom-v.bottom+p.bottom)/A.y,left:(v.left-I.left+p.left)/A.x,right:(I.right-v.right+p.right)/A.x}}const Tl=50,Il=async(n,t,e)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=e,a=s.detectOverflow?s:{...s,detectOverflow:$l},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:n,floating:t,strategy:o}),{x:f,y:d}=Do(c,i,l),u=i,h=0;const p={};for(let m=0;m<r.length;m++){const g=r[m];if(!g)continue;const{name:v,fn:x}=g,{x:_,y:A,data:I,reset:k}=await x({x:f,y:d,initialPlacement:i,placement:u,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:n,floating:t}});f=_??f,d=A??d,p[v]={...p[v],...I},k&&h<Tl&&(h++,typeof k=="object"&&(k.placement&&(u=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:n,floating:t,strategy:o}):k.rects),{x:f,y:d}=Do(c,u,l)),m=-1)}return{x:f,y:d,placement:u,strategy:o,middlewareData:p}},Ol=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=se(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const v=pt(o),x=ot(a),_=pt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=u||(_||!m?[je(a)]:xl(a)),k=p!=="none";!u&&k&&I.push(...Sl(a,m,p,A));const $=[a,...I],b=await l.detectOverflow(t,g),T=[];let W=((i=r.flip)==null?void 0:i.overflows)||[];if(f&&T.push(b[v]),d){const X=wl(o,s,A);T.push(b[X[0]],b[X[1]])}if(W=[...W,{placement:o,overflows:T}],!T.every(X=>X<=0)){var gt,Q;const X=(((gt=r.flip)==null?void 0:gt.index)||0)+1,tt=$[X];if(tt&&(!(d==="alignment"?x!==ot(tt):!1)||W.every(D=>ot(D.placement)===x?D.overflows[0]>0:!0)))return{data:{index:X,overflows:W},reset:{placement:tt}};let z=(Q=W.filter(M=>M.overflows[0]<=0).sort((M,D)=>M.overflows[1]-D.overflows[1])[0])==null?void 0:Q.placement;if(!z)switch(h){case"bestFit":{var vt;const M=(vt=W.filter(D=>{if(k){const G=ot(D.placement);return G===x||G==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(G=>G>0).reduce((G,E)=>G+E,0)]).sort((D,G)=>D[1]-G[1])[0])==null?void 0:vt[0];M&&(z=M);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}},Ll=new Set(["left","top"]);async function Rl(n,t){const{placement:e,platform:i,elements:o}=n,r=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=pt(e),a=ae(e),l=ot(e)==="y",c=Ll.has(s)?-1:1,f=r&&l?-1:1,d=se(t,n);let{mainAxis:u,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*f,y:u*c}:{x:u*c,y:h*f}}const zl=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;const{x:o,y:r,placement:s,middlewareData:a}=t,l=await Rl(t,n);return s===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}},Ml=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:i,placement:o,platform:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x,y:_}=v;return{x,y:_}}},...c}=se(n,t),f={x:e,y:i},d=await r.detectOverflow(t,c),u=ot(pt(o)),h=Oo(u);let p=f[h],m=f[u];if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=p+d[v],A=p-d[x];p=Io(_,p,A)}if(a){const v=u==="y"?"top":"left",x=u==="y"?"bottom":"right",_=m+d[v],A=m-d[x];m=Io(_,m,A)}const g=l.fn({...t,[h]:p,[u]:m});return{...g,data:{x:g.x-e,y:g.y-i,enabled:{[h]:s,[u]:a}}}}}},Dl=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,i;const{placement:o,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...c}=se(n,t),f=await s.detectOverflow(t,c),d=pt(o),u=ae(o),h=ot(o)==="y",{width:p,height:m}=r.floating;let g,v;d==="top"||d==="bottom"?(g=d,v=u===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g=u==="end"?"top":"bottom");const x=m-f.top-f.bottom,_=p-f.left-f.right,A=Ht(m-f[g],x),I=Ht(p-f[v],_),k=!t.middlewareData.shift;let $=A,b=I;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(b=_),(i=t.middlewareData.shift)!=null&&i.enabled.y&&($=x),k&&!u){const W=U(f.left,0),gt=U(f.right,0),Q=U(f.top,0),vt=U(f.bottom,0);h?b=p-2*(W!==0||gt!==0?W+gt:U(f.left,f.right)):$=m-2*(Q!==0||vt!==0?Q+vt:U(f.top,f.bottom))}await l({...t,availableWidth:b,availableHeight:$});const T=await s.getDimensions(a.floating);return p!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Ue(){return typeof window<"u"}function Ut(n){return Po(n)?(n.nodeName||"").toLowerCase():"#document"}function B(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Z(n){var t;return(t=(Po(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Po(n){return Ue()?n instanceof Node||n instanceof B(n).Node:!1}function V(n){return Ue()?n instanceof Element||n instanceof B(n).Element:!1}function rt(n){return Ue()?n instanceof HTMLElement||n instanceof B(n).HTMLElement:!1}function No(n){return!Ue()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof B(n).ShadowRoot}function le(n){const{overflow:t,overflowX:e,overflowY:i,display:o}=q(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&o!=="inline"&&o!=="contents"}function Pl(n){return/^(table|td|th)$/.test(Ut(n))}function Be(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Nl=/transform|translate|scale|rotate|perspective|filter/,jl=/paint|layout|strict|content/,$t=n=>!!n&&n!=="none";let Un;function Bn(n){const t=V(n)?q(n):n;return $t(t.transform)||$t(t.translate)||$t(t.scale)||$t(t.rotate)||$t(t.perspective)||!Wn()&&($t(t.backdropFilter)||$t(t.filter))||Nl.test(t.willChange||"")||jl.test(t.contain||"")}function Hl(n){let t=mt(n);for(;rt(t)&&!Bt(t);){if(Bn(t))return t;if(Be(t))return null;t=mt(t)}return null}function Wn(){return Un==null&&(Un=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Un}function Bt(n){return/^(html|body|#document)$/.test(Ut(n))}function q(n){return B(n).getComputedStyle(n)}function We(n){return V(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function mt(n){if(Ut(n)==="html")return n;const t=n.assignedSlot||n.parentNode||No(n)&&n.host||Z(n);return No(t)?t.host:t}function jo(n){const t=mt(n);return Bt(t)?n.ownerDocument?n.ownerDocument.body:n.body:rt(t)&&le(t)?t:jo(t)}function ce(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=jo(n),r=o===((i=n.ownerDocument)==null?void 0:i.body),s=B(o);if(r){const a=Gn(s);return t.concat(s,s.visualViewport||[],le(o)?o:[],a&&e?ce(a):[])}else return t.concat(o,ce(o,[],e))}function Gn(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Ho(n){const t=q(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=rt(n),r=o?n.offsetWidth:e,s=o?n.offsetHeight:i,a=Pe(e)!==r||Pe(i)!==s;return a&&(e=r,i=s),{width:e,height:i,$:a}}function Fn(n){return V(n)?n:n.contextElement}function Wt(n){const t=Fn(n);if(!rt(t))return Y(1);const e=t.getBoundingClientRect(),{width:i,height:o,$:r}=Ho(t);let s=(r?Pe(e.width):e.width)/i,a=(r?Pe(e.height):e.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ul=Y(0);function Uo(n){const t=B(n);return!Wn()||!t.visualViewport?Ul:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bl(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==B(n)?!1:t}function Tt(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),r=Fn(n);let s=Y(1);t&&(i?V(i)&&(s=Wt(i)):s=Wt(n));const a=Bl(r,e,i)?Uo(r):Y(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(r){const u=B(r),h=i&&V(i)?B(i):i;let p=u,m=Gn(p);for(;m&&i&&h!==p;){const g=Wt(m),v=m.getBoundingClientRect(),x=q(m),_=v.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,A=v.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,f*=g.x,d*=g.y,l+=_,c+=A,p=B(m),m=Gn(p)}}return He({width:f,height:d,x:l,y:c})}function Ge(n,t){const e=We(n).scrollLeft;return t?t.left+e:Tt(Z(n)).left+e}function Bo(n,t){const e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-Ge(n,e),o=e.top+t.scrollTop;return{x:i,y:o}}function Wl(n){let{elements:t,rect:e,offsetParent:i,strategy:o}=n;const r=o==="fixed",s=Z(i),a=t?Be(t.floating):!1;if(i===s||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=Y(1);const f=Y(0),d=rt(i);if((d||!d&&!r)&&((Ut(i)!=="body"||le(s))&&(l=We(i)),d)){const h=Tt(i);c=Wt(i),f.x=h.x+i.clientLeft,f.y=h.y+i.clientTop}const u=s&&!d&&!r?Bo(s,l):Y(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x+u.x,y:e.y*c.y-l.scrollTop*c.y+f.y+u.y}}function Gl(n){return Array.from(n.getClientRects())}function Fl(n){const t=Z(n),e=We(n),i=n.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=U(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-e.scrollLeft+Ge(n);const a=-e.scrollTop;return q(i).direction==="rtl"&&(s+=U(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:a}}const Wo=25;function Vl(n,t){const e=B(n),i=Z(n),o=e.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const f=Wn();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Ge(i);if(c<=0){const f=i.ownerDocument,d=f.body,u=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,p=Math.abs(i.clientWidth-d.clientWidth-h);p<=Wo&&(r-=p)}else c<=Wo&&(r+=c);return{width:r,height:s,x:a,y:l}}function ql(n,t){const e=Tt(n,!0,t==="fixed"),i=e.top+n.clientTop,o=e.left+n.clientLeft,r=rt(n)?Wt(n):Y(1),s=n.clientWidth*r.x,a=n.clientHeight*r.y,l=o*r.x,c=i*r.y;return{width:s,height:a,x:l,y:c}}function Go(n,t,e){let i;if(t==="viewport")i=Vl(n,e);else if(t==="document")i=Fl(Z(n));else if(V(t))i=ql(t,e);else{const o=Uo(n);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return He(i)}function Fo(n,t){const e=mt(n);return e===t||!V(e)||Bt(e)?!1:q(e).position==="fixed"||Fo(e,t)}function Xl(n,t){const e=t.get(n);if(e)return e;let i=ce(n,[],!1).filter(a=>V(a)&&Ut(a)!=="body"),o=null;const r=q(n).position==="fixed";let s=r?mt(n):n;for(;V(s)&&!Bt(s);){const a=q(s),l=Bn(s);!l&&a.position==="fixed"&&(o=null),(r?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||le(s)&&!l&&Fo(n,s))?i=i.filter(f=>f!==s):o=a,s=mt(s)}return t.set(n,i),i}function Kl(n){let{element:t,boundary:e,rootBoundary:i,strategy:o}=n;const s=[...e==="clippingAncestors"?Be(t)?[]:Xl(t,this._c):[].concat(e),i],a=Go(t,s[0],o);let l=a.top,c=a.right,f=a.bottom,d=a.left;for(let u=1;u<s.length;u++){const h=Go(t,s[u],o);l=U(h.top,l),c=Ht(h.right,c),f=Ht(h.bottom,f),d=U(h.left,d)}return{width:c-d,height:f-l,x:d,y:l}}function Jl(n){const{width:t,height:e}=Ho(n);return{width:t,height:e}}function Yl(n,t,e){const i=rt(t),o=Z(t),r=e==="fixed",s=Tt(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=Y(0);function c(){l.x=Ge(o)}if(i||!i&&!r)if((Ut(t)!=="body"||le(o))&&(a=We(t)),i){const h=Tt(t,!0,r,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();r&&!i&&o&&c();const f=o&&!i&&!r?Bo(o,a):Y(0),d=s.left+a.scrollLeft-l.x-f.x,u=s.top+a.scrollTop-l.y-f.y;return{x:d,y:u,width:s.width,height:s.height}}function Vn(n){return q(n).position==="static"}function Vo(n,t){if(!rt(n)||q(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return Z(n)===e&&(e=e.ownerDocument.body),e}function qo(n,t){const e=B(n);if(Be(n))return e;if(!rt(n)){let o=mt(n);for(;o&&!Bt(o);){if(V(o)&&!Vn(o))return o;o=mt(o)}return e}let i=Vo(n,t);for(;i&&Pl(i)&&Vn(i);)i=Vo(i,t);return i&&Bt(i)&&Vn(i)&&!Bn(i)?e:i||Hl(n)||e}const Zl=async function(n){const t=this.getOffsetParent||qo,e=this.getDimensions,i=await e(n.floating);return{reference:Yl(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ql(n){return q(n).direction==="rtl"}const tc={convertOffsetParentRelativeRectToViewportRelativeRect:Wl,getDocumentElement:Z,getClippingRect:Kl,getOffsetParent:qo,getElementRects:Zl,getClientRects:Gl,getDimensions:Jl,getScale:Wt,isElement:V,isRTL:Ql};function Xo(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function ec(n,t){let e=null,i;const o=Z(n);function r(){var a;clearTimeout(i),(a=e)==null||a.disconnect(),e=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:f,top:d,width:u,height:h}=c;if(a||t(),!u||!h)return;const p=Ne(d),m=Ne(o.clientWidth-(f+u)),g=Ne(o.clientHeight-(d+h)),v=Ne(f),_={rootMargin:-p+"px "+-m+"px "+-g+"px "+-v+"px",threshold:U(0,Ht(1,l))||1};let A=!0;function I(k){const $=k[0].intersectionRatio;if($!==l){if(!A)return s();$?s(!1,$):i=setTimeout(()=>{s(!1,1e-7)},1e3)}$===1&&!Xo(c,n.getBoundingClientRect())&&s(),A=!1}try{e=new IntersectionObserver(I,{..._,root:o.ownerDocument})}catch{e=new IntersectionObserver(I,_)}e.observe(n)}return s(!0),r}function Ko(n,t,e,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Fn(n),f=o||r?[...c?ce(c):[],...t?ce(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",e,{passive:!0}),r&&v.addEventListener("resize",e)});const d=c&&a?ec(c,e):null;let u=-1,h=null;s&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),e()}),c&&!l&&h.observe(c),t&&h.observe(t));let p,m=l?Tt(n):null;l&&g();function g(){const v=Tt(n);m&&!Xo(m,v)&&e(),m=v,p=requestAnimationFrame(g)}return e(),()=>{var v;f.forEach(x=>{o&&x.removeEventListener("scroll",e),r&&x.removeEventListener("resize",e)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Jo=zl,Yo=Ml,Zo=Ol,Qo=Dl,tr=(n,t,e)=>{const i=new Map,o={platform:tc,...e},r={...o.platform,_c:i};return Il(n,t,{...o,platform:r})};/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2017 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
107
|
+
*/const qn={ATTRIBUTE:1,CHILD:2},Xn=n=>(...t)=>({_$litDirective$:n,values:t});let Kn=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2018 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/const
|
|
111
|
+
*/const nc=Xn(class extends Kn{constructor(n){var t;if(super(n),n.type!==qn.ATTRIBUTE||n.name!=="class"||((t=n.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(t=>n[t]).join(" ")+" "}update(n,[t]){var i,o;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((i=this.nt)!=null&&i.has(r))&&this.st.add(r);return this.render(t)}const e=n.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const s=!!t[r];s===this.st.has(r)||(o=this.nt)!=null&&o.has(r)||(s?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return nt}});var ic=Object.defineProperty,oc=Object.getOwnPropertyDescriptor,de=(n,t,e,i)=>{for(var o=i>1?void 0:i?oc(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&ic(t,e,o),o};C.LlumiDefaultEditor=class extends kt{constructor(){super(...arguments),this.value="",this.autoFocus=!1,this.placeholder="Write a comment..."}focus(){var t;(t=this.textarea)==null||t.focus()}render(){return et`<textarea
|
|
112
112
|
rows="1"
|
|
113
113
|
placeholder=${this.placeholder}
|
|
114
114
|
.value=${this.value}
|
|
115
115
|
class="w-full resize-none bg-transparent text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none max-h-[200px] overflow-y-auto"
|
|
116
116
|
@input=${this.onInput}
|
|
117
|
-
></textarea>`}onInput(t){const e=t.target.value;this.autoGrow(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}autoGrow(){const t=this.textarea;t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}firstUpdated(){this.autoFocus&&this.textarea.focus(),this.autoGrow()}updated(){this.autoGrow()}},de([
|
|
117
|
+
></textarea>`}onInput(t){const e=t.target.value;this.autoGrow(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}autoGrow(){const t=this.textarea;t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}firstUpdated(){this.autoFocus&&this.textarea.focus(),this.autoGrow()}updated(){this.autoGrow()}},de([H()],C.LlumiDefaultEditor.prototype,"value",2),de([H({type:Boolean})],C.LlumiDefaultEditor.prototype,"autoFocus",2),de([H()],C.LlumiDefaultEditor.prototype,"placeholder",2),de([Oe("textarea")],C.LlumiDefaultEditor.prototype,"textarea",2),C.LlumiDefaultEditor=de([ie("llumi-default-editor")],C.LlumiDefaultEditor);var rc=Object.defineProperty,sc=Object.getOwnPropertyDescriptor,Fe=(n,t,e,i)=>{for(var o=i>1?void 0:i?sc(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&rc(t,e,o),o};C.LlumiCommentDialog=class extends kt{constructor(){super(...arguments),this.targetElement=null,this.value=""}render(){const t=this.value.trim().length>0;return et`<div
|
|
118
118
|
data-floating
|
|
119
119
|
class="z-[calc(var(--review-z-index,9998)+1)]"
|
|
120
120
|
style="position:absolute;top:0;left:0;"
|
|
121
121
|
>
|
|
122
122
|
<div
|
|
123
|
-
class=${
|
|
123
|
+
class=${nc({"relative w-[400px] rounded-lg border border-zinc-200 bg-white shadow-xl":!0,"animate-[llumi-fade-in_0.15s_ease-out]":!0})}
|
|
124
124
|
>
|
|
125
125
|
${t?et`<button
|
|
126
126
|
type="button"
|
|
@@ -137,7 +137,7 @@ ${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get eve
|
|
|
137
137
|
</slot>
|
|
138
138
|
</div>
|
|
139
139
|
</div>
|
|
140
|
-
</div>`}onEditorChange(t){if(typeof t.detail!="string")return;const e=t.detail;t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}onCancel(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}onDelete(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0}))}startPositioning(){var i;const t=this.targetElement,e=this.floating;!t||!e||((i=this.cleanup)==null||i.call(this),this.cleanup=
|
|
140
|
+
</div>`}onEditorChange(t){if(typeof t.detail!="string")return;const e=t.detail;t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}onCancel(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}onDelete(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0}))}startPositioning(){var i;const t=this.targetElement,e=this.floating;!t||!e||((i=this.cleanup)==null||i.call(this),this.cleanup=Ko(t,e,()=>{tr(t,e,{placement:"right",middleware:[Jo(12),Zo({padding:16}),Yo({padding:16,crossAxis:!0}),Qo({padding:16,apply({availableWidth:o,elements:r}){Object.assign(r.floating.style,{maxWidth:`${Math.min(400,o)}px`})}})]}).then(({x:o,y:r})=>{Object.assign(e.style,{left:`${o}px`,top:`${r}px`})})}))}updated(t){t.has("targetElement")&&(this.startPositioning(),this.focusEditor())}focusEditor(){const t=this.renderRoot.querySelector('slot[name="editor"]'),i=((t==null?void 0:t.assignedElements())??[])[0]??this.renderRoot.querySelector("llumi-default-editor");i==null||i.focus()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}},Fe([H({attribute:!1})],C.LlumiCommentDialog.prototype,"targetElement",2),Fe([H()],C.LlumiCommentDialog.prototype,"value",2),Fe([Oe("[data-floating]")],C.LlumiCommentDialog.prototype,"floating",2),C.LlumiCommentDialog=Fe([ie("llumi-comment-dialog")],C.LlumiCommentDialog);var ac=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,Ve=(n,t,e,i)=>{for(var o=i>1?void 0:i?lc(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&ac(t,e,o),o};C.LlumiOverallCommentDialog=class extends kt{constructor(){super(...arguments),this.barElement=null,this.value="",this.onDocKeydown=t=>{t.key==="Escape"&&(t.preventDefault(),this.emitClose())},this.onDocPointerdown=t=>{const e=t.composedPath();this.floating&&!e.includes(this.floating)&&!e.includes(this)&&this.emitClose()}}render(){return et`<div
|
|
141
141
|
data-floating
|
|
142
142
|
class="z-[calc(var(--review-z-index,9998)+1)]"
|
|
143
143
|
style="position:absolute;top:0;left:0;"
|
|
@@ -153,20 +153,20 @@ ${d.message}`)}if(f){o.push(...a.actions),r=a;break}}return r?[r]:void 0}get eve
|
|
|
153
153
|
</slot>
|
|
154
154
|
</div>
|
|
155
155
|
</div>
|
|
156
|
-
</div>`}onEditorChange(t){if(typeof t.detail!="string")return;const e=t.detail;t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}emitClose(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}startPositioning(){var i;const t=this.barElement,e=this.floating;!t||!e||((i=this.cleanup)==null||i.call(this),this.cleanup=
|
|
156
|
+
</div>`}onEditorChange(t){if(typeof t.detail!="string")return;const e=t.detail;t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}emitClose(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}startPositioning(){var i;const t=this.barElement,e=this.floating;!t||!e||((i=this.cleanup)==null||i.call(this),this.cleanup=Ko(t,e,()=>{tr(t,e,{placement:"top",middleware:[Jo(12),Zo({padding:16}),Yo({padding:16,crossAxis:!0}),Qo({padding:16,apply({availableWidth:o,elements:r}){Object.assign(r.floating.style,{maxWidth:`${Math.min(400,o)}px`})}})]}).then(({x:o,y:r})=>{Object.assign(e.style,{left:`${o}px`,top:`${r}px`})})}))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onDocKeydown),document.addEventListener("pointerdown",this.onDocPointerdown,!0)}updated(t){t.has("barElement")&&this.startPositioning()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.cleanup)==null||t.call(this),this.cleanup=void 0,document.removeEventListener("keydown",this.onDocKeydown),document.removeEventListener("pointerdown",this.onDocPointerdown,!0)}},Ve([H({attribute:!1})],C.LlumiOverallCommentDialog.prototype,"barElement",2),Ve([H()],C.LlumiOverallCommentDialog.prototype,"value",2),Ve([Oe("[data-floating]")],C.LlumiOverallCommentDialog.prototype,"floating",2),C.LlumiOverallCommentDialog=Ve([ie("llumi-overall-comment-dialog")],C.LlumiOverallCommentDialog);/**
|
|
157
157
|
* @license
|
|
158
158
|
* Copyright 2020 Google LLC
|
|
159
159
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
160
|
-
*/const{I:
|
|
160
|
+
*/const{I:cc}=ba,er=n=>n,nr=()=>document.createComment(""),ue=(n,t,e)=>{var r;const i=n._$AA.parentNode,o=t===void 0?n._$AB:t._$AA;if(e===void 0){const s=i.insertBefore(nr(),o),a=i.insertBefore(nr(),o);e=new cc(s,a,n,n.options)}else{const s=e._$AB.nextSibling,a=e._$AM,l=a!==n;if(l){let c;(r=e._$AQ)==null||r.call(e,n),e._$AM=n,e._$AP!==void 0&&(c=n._$AU)!==a._$AU&&e._$AP(c)}if(s!==o||l){let c=e._$AA;for(;c!==s;){const f=er(c).nextSibling;er(i).insertBefore(c,o),c=f}}}return e},It=(n,t,e=n)=>(n._$AI(t,e),n),dc={},uc=(n,t=dc)=>n._$AH=t,hc=n=>n._$AH,Jn=n=>{n._$AR(),n._$AA.remove()};/**
|
|
161
161
|
* @license
|
|
162
162
|
* Copyright 2017 Google LLC
|
|
163
163
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
164
|
-
*/const
|
|
164
|
+
*/const ir=(n,t,e)=>{const i=new Map;for(let o=t;o<=e;o++)i.set(n[o],o);return i},fc=Xn(class extends Kn{constructor(n){if(super(n),n.type!==qn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const o=[],r=[];let s=0;for(const a of n)o[s]=i?i(a,s):s,r[s]=e(a,s),s++;return{values:r,keys:o}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,i]){const o=hc(n),{values:r,keys:s}=this.dt(t,e,i);if(!Array.isArray(o))return this.ut=s,r;const a=this.ut??(this.ut=[]),l=[];let c,f,d=0,u=o.length-1,h=0,p=r.length-1;for(;d<=u&&h<=p;)if(o[d]===null)d++;else if(o[u]===null)u--;else if(a[d]===s[h])l[h]=It(o[d],r[h]),d++,h++;else if(a[u]===s[p])l[p]=It(o[u],r[p]),u--,p--;else if(a[d]===s[p])l[p]=It(o[d],r[p]),ue(n,l[p+1],o[d]),d++,p--;else if(a[u]===s[h])l[h]=It(o[u],r[h]),ue(n,o[d],o[u]),u--,h++;else if(c===void 0&&(c=ir(s,h,p),f=ir(a,d,u)),c.has(a[d]))if(c.has(a[u])){const m=f.get(s[h]),g=m!==void 0?o[m]:null;if(g===null){const v=ue(n,o[d]);It(v,r[h]),l[h]=v}else l[h]=It(g,r[h]),ue(n,o[d],g),o[m]=null;h++}else Jn(o[u]),u--;else Jn(o[d]),d++;for(;h<=p;){const m=ue(n,l[p+1]);It(m,r[h]),l[h++]=m}for(;d<=u;){const m=o[d++];m!==null&&Jn(m)}return this.ut=s,uc(n,l),nt}});/**
|
|
165
165
|
* @license
|
|
166
166
|
* Copyright 2018 Google LLC
|
|
167
167
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
168
|
-
*/const
|
|
168
|
+
*/const or="important",pc=" !"+or,mc=Xn(class extends Kn{constructor(n){var t;if(super(n),n.type!==qn.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const i=n[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const o=t[i];if(o!=null){this.ft.add(i);const r=typeof o=="string"&&o.endsWith(pc);i.includes("-")||r?e.setProperty(i,r?o.slice(0,-11):o,r?or:""):e[i]=o}}return nt}});var gc=Object.defineProperty,vc=Object.getOwnPropertyDescriptor,rr=(n,t,e,i)=>{for(var o=i>1?void 0:i?vc(t,e):t,r=n.length-1,s;r>=0;r--)(s=n[r])&&(o=(i?s(t,e,o):s(o))||o);return i&&o&&gc(t,e,o),o};const bc="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E";C.LlumiSelectionCommentIcons=class extends kt{constructor(){super(...arguments),this.positions=[]}render(){return et`${fc(this.positions,t=>t.commentId,t=>et`<button
|
|
169
169
|
type="button"
|
|
170
170
|
@click=${e=>this.onClick(e,t.commentId)}
|
|
171
|
-
style=${
|
|
172
|
-
></button>`)}`}onClick(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("icon-click",{detail:e,bubbles:!0,composed:!0}))}},ir([j({attribute:!1})],C.LlumiSelectionCommentIcons.prototype,"positions",2),C.LlumiSelectionCommentIcons=ir([ie("llumi-selection-comment-icons")],C.LlumiSelectionCommentIcons);const qe="data-review-selectable",Kn="review-selection-commented",Jn="review-selection-editing",he="review-selection-hover",pc="$mod+Shift+M",or="data-llumi-review";let Yn=!1;function gc(){if(Yn)return;if(document.querySelector(`style[${or}]`)){Yn=!0;return}const n=document.createElement("style");n.setAttribute(or,""),n.textContent=Is,document.head.append(n),Yn=!0}function Xe(){if(!(typeof CSS>"u"))return CSS.highlights}function Zn(...n){return new Highlight(...n)}const ti=class ti extends HTMLElement{constructor(){super(...arguments),this.manager=null,this.rangeMap=new Map,this.hoveredComment=null,this.selectionJustHandled=!1,this.selectionComments=[],this.commentDialog=null,this.overallDialog=null,this.onPointerUp=()=>{if(!this.isAnnotating())return;const t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return;const e=t.getRangeAt(0),i=An(e.startContainer);if(!i)return;const o=An(e.endContainer);if(o&&o!==i){t.removeAllRanges();return}if(!o||!Gs(t,i)){const a=Fs(t,i);if(!a)return;t.removeAllRanges(),t.addRange(a)}const r=i.getAttribute(qe);if(!r)return;const s=Ws(i);s&&(t.removeAllRanges(),this.selectionJustHandled=!0,this.actor.send({type:"SELECT_TEXT",targetId:r,targetElement:i,selectionRange:s}))},this.onPointerMove=t=>{if(!this.isAnnotating())return;const e=Xe();if(!e)return;const i=this.caretPosition(t.clientX,t.clientY);if(!i){this.hoveredComment&&(e.delete(he),this.hoveredComment=null);return}let o=null;for(const[r,s]of this.rangeMap)if(s.isPointInRange(i.offsetNode,i.offset)){o=r;break}if(o!==this.hoveredComment)if(this.hoveredComment=o,o){const r=this.rangeMap.get(o);r&&e.set(he,Zn(r))}else e.delete(he)},this.onClickCapture=t=>{if(!this.isAnnotating()||t.defaultPrevented)return;if(this.selectionJustHandled){this.selectionJustHandled=!1,t.stopPropagation();return}const e=window.getSelection();if(e&&!e.isCollapsed)return;const i=this.caretPosition(t.clientX,t.clientY);if(i){for(const[a,l]of this.rangeMap)if(l.isPointInRange(i.offsetNode,i.offset)){const c=this.selectionComments.find(d=>d.commentId===a);if(!c)continue;const f=An(i.offsetNode);if(!f)continue;t.stopPropagation(),t.preventDefault(),this.actor.send({type:"CLICK",targetId:c.targetId,element:f,selectionCommentId:a});return}}const o=t.target,s=o.closest(".review-highlight-hover, .review-highlight-commented, .review-highlight-editing");if(s&&this.contains(s)){t.stopPropagation(),t.preventDefault();const a=_e(o,this.customTargets);a?this.actor.send({type:"CLICK",targetId:a.targetId,element:a.element}):this.actor.send({type:"CLICK"})}},this.onWrapperClick=t=>{if(!this.contains(t.target)||!this.isAnnotating())return;const e=_e(t.target,this.customTargets);e?(t.stopPropagation(),t.preventDefault(),this.actor.send({type:"CLICK",targetId:e.targetId,element:e.element})):this.actor.send({type:"CLICK"})},this.onMouseOver=t=>{const e=this.manager;if(!e||!this.isAnnotating())return;const i=this.currentEditingTargetId(),o=_e(t.target,this.customTargets);if(o){e.applyHover(o.element,i);return}const r=t.target.closest("[data-review-selectable]");r&&e.applyHover(r,i)},this.onMouseOut=t=>{const e=this.manager;if(!e||!this.isAnnotating())return;const i=this.currentEditingTargetId(),o=new Set;for(const a of this.actor.getSnapshot().context.comments)!a.selection&&a.content.trim()&&o.add(a.targetId);const r=_e(t.target,this.customTargets);if(r){e.clearHover(r.element,i,o);return}const s=t.target.closest("[data-review-selectable]");s&&e.clearHover(s,i)}}get shortcut(){return this.getAttribute("shortcut")??pc}get barPosition(){return this.getAttribute("bar-position")??"bottom-center"}get defaultMode(){return this.getAttribute("default-mode")==="annotating"?"annotating":"idle"}connectedCallback(){gc(),this.style.position===""&&(this.style.position="relative"),this.style.display===""&&(this.style.display="block");const t=this.buildHighlightCallbacks(),e=Us();this.actor=Ft(e,{input:{shortcut:this.shortcut,initialData:this.initialData,defaultMode:this.defaultMode,highlights:t}}),this.actor.on("REVIEW_CHANGED",i=>this.emitResult("llumi-review-change",i.result)),this.actor.on("REVIEW_SUBMITTED",i=>this.emitResult("llumi-review-submit",i.result)),this.mountChrome(),this.actor.subscribe(()=>this.syncFromSnapshot()),this.actor.start(),this.manager=Ts(this,this.customTargets),this.actor.send({type:"MOUNTED"}),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("click",this.onClickCapture,!0),this.addEventListener("click",this.onWrapperClick),this.addEventListener("mouseover",this.onMouseOver),this.addEventListener("mouseout",this.onMouseOut),this.syncFromSnapshot()}disconnectedCallback(){var e,i,o,r,s,a;this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointermove",this.onPointerMove),this.removeEventListener("click",this.onClickCapture,!0),this.removeEventListener("click",this.onWrapperClick),this.removeEventListener("mouseover",this.onMouseOver),this.removeEventListener("mouseout",this.onMouseOut);const t=Xe();t&&(t.delete(Kn),t.delete(Jn),t.delete(he)),this.icons&&(this.icons.positions=[]),(e=this.manager)==null||e.destroy(),this.manager=null,(i=this.actor)==null||i.stop(),(o=this.bar)==null||o.remove(),(r=this.commentDialog)==null||r.remove(),(s=this.overallDialog)==null||s.remove(),(a=this.icons)==null||a.remove()}attributeChangedCallback(){this.bar&&(this.bar.barPosition=this.barPosition)}emitResult(t,e){let i=e;e.status==="commented"&&(i={...e,comments:Js(e.comments,this)}),this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}mountChrome(){this.bar=document.createElement("llumi-review-bar"),this.bar.barPosition=this.barPosition,this.bar.addEventListener("toggle",()=>this.actor.send({type:"TOGGLE"})),this.bar.addEventListener("overall-toggle",()=>{const t=this.actor.getSnapshot(),e=t.matches({commenting:"editing"})&&t.context.editingCommentId===null;this.actor.send(e?{type:"CLOSE"}:{type:"OPEN_OVERALL"})}),this.bar.addEventListener("submit",()=>this.actor.send({type:"SUBMIT"})),document.body.append(this.bar),this.icons=document.createElement("llumi-selection-comment-icons"),this.icons.addEventListener("icon-click",t=>this.onIconClick(t.detail)),document.body.append(this.icons)}onIconClick(t){const e=this.actor.getSnapshot().context.comments.find(o=>o.commentId===t);if(!e)return;const i=this.querySelector(`[${qe}="${e.targetId}"]`);i&&this.actor.send({type:"CLICK",targetId:e.targetId,element:i,selectionCommentId:t})}syncFromSnapshot(){const t=this.actor.getSnapshot(),{comments:e,overallComment:i,editingCommentId:o,targetElement:r}=t.context;this.selectionComments=e.filter(u=>u.selection&&u.content.trim());const s=!t.matches({annotating:"inactive"}),a=t.matches({commenting:"editing"}),l=o?e.find(u=>u.commentId===o):null,c=a&&o===null,f=e.filter(u=>u.content.trim()).length,d=i.trim().length>0;this.bar.mode=s?l?"editing":"commenting":"idle",this.bar.commentCount=f,this.bar.hasOverallComment=d,this.bar.overallCommentOpen=c,this.icons.style.display=s?"":"none",a&&l&&r?(this.commentDialog||(this.commentDialog=document.createElement("llumi-comment-dialog"),this.commentDialog.addEventListener("change",u=>this.actor.send({type:"COMMENT_CHANGE",content:u.detail})),this.commentDialog.addEventListener("delete",()=>this.actor.send({type:"DELETE"})),this.commentDialog.addEventListener("close",()=>this.actor.send({type:"CLOSE"})),document.body.append(this.commentDialog)),this.commentDialog.targetElement=r,this.commentDialog.value=l.content):this.commentDialog&&(this.commentDialog.remove(),this.commentDialog=null),c?(this.overallDialog||(this.overallDialog=document.createElement("llumi-overall-comment-dialog"),this.overallDialog.addEventListener("change",u=>this.actor.send({type:"COMMENT_CHANGE",content:u.detail})),this.overallDialog.addEventListener("close",()=>this.actor.send({type:"CLOSE"})),document.body.append(this.overallDialog)),this.overallDialog.barElement=this.bar.barRoot,this.overallDialog.value=i):this.overallDialog&&(this.overallDialog.remove(),this.overallDialog=null),s&&this.updateSelectionHighlights()}buildHighlightCallbacks(){return{activate:t=>{const e=this.manager;e&&(e.activate(t),e.startObserving({editingTarget:this.actor.getSnapshot().context.targetElement,onTargetDisconnected:()=>this.actor.send({type:"CLOSE"}),onSelectableReconnected:()=>this.updateSelectionHighlights(),commentedIds:t}))},deactivate:()=>{const t=this.manager;if(!t)return;t.deactivate(),t.stopObserving();const e=Xe();e&&(e.delete(Kn),e.delete(Jn),e.delete(he)),this.rangeMap.clear(),this.icons.positions=[]},reveal:t=>{var e;return(e=this.manager)==null?void 0:e.reveal(t)},unreveal:()=>{var t;return(t=this.manager)==null?void 0:t.unreveal()},setEditing:(t,e)=>{var i;(i=this.manager)==null||i.setEditing(t,e),this.updateSelectionHighlights()},clearEditing:(t,e)=>{var i;(i=this.manager)==null||i.clearEditing(t,e),this.updateSelectionHighlights()}}}updateSelectionHighlights(){const t=Xe();if(!t)return;const e=Zn(),i=Zn(),o=new Map,r=[],s=this.actor.getSnapshot().context;for(const l of this.selectionComments){if(!l.selection)continue;const c=this.querySelector(`[${qe}="${l.targetId}"]`);if(!c)continue;const f=ji(c,l.selection);if(!f)continue;o.set(l.commentId,f),l.commentId===s.editingCommentId?i.add(f):e.add(f);const d=f.getClientRects(),u=d[d.length-1];u&&r.push({commentId:l.commentId,top:u.top+window.scrollY,left:u.right+window.scrollX})}const a=s.editingCommentId;if(a&&!o.has(a)){const l=s.comments.find(c=>c.commentId===a);if(l!=null&&l.selection){const c=this.querySelector(`[${qe}="${l.targetId}"]`);if(c){const f=ji(c,l.selection);f&&i.add(f)}}}this.rangeMap=o,t.set(Kn,e),t.set(Jn,i),this.icons.positions=r}isAnnotating(){return!this.actor.getSnapshot().matches({annotating:"inactive"})}caretPosition(t,e){if("caretPositionFromPoint"in document){const i=document.caretPositionFromPoint(t,e);if(i)return i}else if("caretRangeFromPoint"in document){const i=document.caretRangeFromPoint(t,e);if(i)return{offsetNode:i.startContainer,offset:i.startOffset}}return null}currentEditingTargetId(){var e;const t=this.actor.getSnapshot().context;if(t.editingCommentId)return((e=t.comments.find(i=>i.commentId===t.editingCommentId))==null?void 0:e.targetId)??void 0}};ti.observedAttributes=["bar-position","shortcut","default-mode"];let Ke=ti;customElements.get("llumi-review")||customElements.define("llumi-review",Ke),C.LlumiReview=Ke,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));typeof globalThis<"u"&&typeof Llumi<"u"&&(globalThis.Llumi=Llumi);
|
|
171
|
+
style=${mc({position:"absolute",top:`${t.top-10}px`,left:`${t.left+2}px`,width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"white",backgroundImage:`url("${bc}")`,backgroundSize:"12px 12px",backgroundRepeat:"no-repeat",backgroundPosition:"center",boxShadow:"0 1px 3px oklch(0 0 0 / 0.1)",zIndex:"calc(var(--review-z-index, 9998) + 1)",border:"none",padding:"0",cursor:"pointer"})}
|
|
172
|
+
></button>`)}`}onClick(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("icon-click",{detail:e,bubbles:!0,composed:!0}))}},rr([H({attribute:!1})],C.LlumiSelectionCommentIcons.prototype,"positions",2),C.LlumiSelectionCommentIcons=rr([ie("llumi-selection-comment-icons")],C.LlumiSelectionCommentIcons);const qe="data-review-selectable",Yn="review-selection-commented",Zn="review-selection-editing",he="review-selection-hover",yc="$mod+Shift+M",sr="data-llumi-review";let Qn=!1;function wc(){if(Qn)return;if(document.querySelector(`style[${sr}]`)){Qn=!0;return}const n=document.createElement("style");n.setAttribute(sr,""),n.textContent=Ls,document.head.append(n),Qn=!0}function Xe(){if(!(typeof CSS>"u"))return CSS.highlights}function ti(...n){return new Highlight(...n)}const ni=class ni extends HTMLElement{constructor(){super(...arguments),this.persistence=Ui,this.manager=null,this.rangeMap=new Map,this.hoveredComment=null,this.selectionJustHandled=!1,this.selectionComments=[],this.commentDialog=null,this.overallDialog=null,this.onPointerUp=()=>{if(!this.isAnnotating())return;const t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return;const e=t.getRangeAt(0),i=$n(e.startContainer);if(!i)return;const o=$n(e.endContainer);if(o&&o!==i){t.removeAllRanges();return}if(!o||!Xs(t,i)){const a=Ks(t,i);if(!a)return;t.removeAllRanges(),t.addRange(a)}const r=i.getAttribute(qe);if(!r)return;const s=qs(i);s&&(t.removeAllRanges(),this.selectionJustHandled=!0,this.actor.send({type:"SELECT_TEXT",targetId:r,targetElement:i,selectionRange:s}))},this.onPointerMove=t=>{if(!this.isAnnotating())return;const e=Xe();if(!e)return;const i=this.caretPosition(t.clientX,t.clientY);if(!i){this.hoveredComment&&(e.delete(he),this.hoveredComment=null);return}let o=null;for(const[r,s]of this.rangeMap)if(s.isPointInRange(i.offsetNode,i.offset)){o=r;break}if(o!==this.hoveredComment)if(this.hoveredComment=o,o){const r=this.rangeMap.get(o);r&&e.set(he,ti(r))}else e.delete(he)},this.onClickCapture=t=>{if(!this.isAnnotating()||t.defaultPrevented)return;if(this.selectionJustHandled){this.selectionJustHandled=!1,t.stopPropagation();return}const e=window.getSelection();if(e&&!e.isCollapsed)return;const i=this.caretPosition(t.clientX,t.clientY);if(i){for(const[a,l]of this.rangeMap)if(l.isPointInRange(i.offsetNode,i.offset)){const c=this.selectionComments.find(d=>d.commentId===a);if(!c)continue;const f=$n(i.offsetNode);if(!f)continue;t.stopPropagation(),t.preventDefault(),this.actor.send({type:"CLICK",targetId:c.targetId,element:f,selectionCommentId:a});return}}const o=t.target,s=o.closest(".review-highlight-hover, .review-highlight-commented, .review-highlight-editing");if(s&&this.contains(s)){t.stopPropagation(),t.preventDefault();const a=_e(o,this.customTargets);a?this.actor.send({type:"CLICK",targetId:a.targetId,element:a.element}):this.actor.send({type:"CLICK"})}},this.onWrapperClick=t=>{if(!this.contains(t.target)||!this.isAnnotating())return;const e=_e(t.target,this.customTargets);e?(t.stopPropagation(),t.preventDefault(),this.actor.send({type:"CLICK",targetId:e.targetId,element:e.element})):this.actor.send({type:"CLICK"})},this.onMouseOver=t=>{const e=this.manager;if(!e||!this.isAnnotating())return;const i=this.currentEditingTargetId(),o=_e(t.target,this.customTargets);if(o){e.applyHover(o.element,i);return}const r=t.target.closest("[data-review-selectable]");r&&e.applyHover(r,i)},this.onMouseOut=t=>{const e=this.manager;if(!e||!this.isAnnotating())return;const i=this.currentEditingTargetId(),o=new Set;for(const a of this.actor.getSnapshot().context.comments)!a.selection&&a.content.trim()&&o.add(a.targetId);const r=_e(t.target,this.customTargets);if(r){e.clearHover(r.element,i,o);return}const s=t.target.closest("[data-review-selectable]");s&&e.clearHover(s,i)}}get shortcut(){return this.getAttribute("shortcut")??yc}get barPosition(){return this.getAttribute("bar-position")??"bottom-center"}get defaultMode(){return this.getAttribute("default-mode")==="annotating"?"annotating":"idle"}get persistKey(){const t=this.getAttribute("persist");return t!=null&&t.trim()?t:null}connectedCallback(){wc(),this.style.position===""&&(this.style.position="relative"),this.style.display===""&&(this.style.display="block");const t=this.buildHighlightCallbacks();this.persistence=this.persistKey?Fs(this.persistKey):Ui;const e=Ws();this.actor=Ft(e,{input:{shortcut:this.shortcut,initialData:this.initialData,defaultMode:this.defaultMode,highlights:t,persistence:this.persistence}}),this.actor.on("REVIEW_CHANGED",i=>this.emitChange(i.result)),this.actor.on("REVIEW_SUBMITTED",i=>this.emitSubmit(i.result)),this.mountChrome(),this.actor.subscribe(()=>this.syncFromSnapshot()),this.actor.start(),this.manager=Os(this,this.customTargets),this.actor.send({type:"MOUNTED"}),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("click",this.onClickCapture,!0),this.addEventListener("click",this.onWrapperClick),this.addEventListener("mouseover",this.onMouseOver),this.addEventListener("mouseout",this.onMouseOut),this.syncFromSnapshot()}disconnectedCallback(){var e,i,o,r,s,a;this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointermove",this.onPointerMove),this.removeEventListener("click",this.onClickCapture,!0),this.removeEventListener("click",this.onWrapperClick),this.removeEventListener("mouseover",this.onMouseOver),this.removeEventListener("mouseout",this.onMouseOut);const t=Xe();t&&(t.delete(Yn),t.delete(Zn),t.delete(he)),this.icons&&(this.icons.positions=[]),(e=this.manager)==null||e.destroy(),this.manager=null,(i=this.actor)==null||i.stop(),(o=this.bar)==null||o.remove(),(r=this.commentDialog)==null||r.remove(),(s=this.overallDialog)==null||s.remove(),(a=this.icons)==null||a.remove()}attributeChangedCallback(){this.bar&&(this.bar.barPosition=this.barPosition)}buildDetailResult(t){return t.status==="commented"?{...t,comments:ta(t.comments,this)}:t}emitChange(t){this.dispatchEvent(new CustomEvent("llumi-review-change",{detail:this.buildDetailResult(t),bubbles:!0,composed:!0}))}emitSubmit(t){this.dispatchEvent(new CustomEvent("llumi-review-submit",{detail:{result:this.buildDetailResult(t),clearPersisted:()=>this.clearPersisted()},bubbles:!0,composed:!0}))}clearPersisted(){this.persistence.clear()}mountChrome(){this.bar=document.createElement("llumi-review-bar"),this.bar.barPosition=this.barPosition,this.bar.addEventListener("toggle",()=>this.actor.send({type:"TOGGLE"})),this.bar.addEventListener("overall-toggle",()=>{const t=this.actor.getSnapshot(),e=t.matches({commenting:"editing"})&&t.context.editingCommentId===null;this.actor.send(e?{type:"CLOSE"}:{type:"OPEN_OVERALL"})}),this.bar.addEventListener("submit",()=>this.actor.send({type:"SUBMIT"})),document.body.append(this.bar),this.icons=document.createElement("llumi-selection-comment-icons"),this.icons.addEventListener("icon-click",t=>this.onIconClick(t.detail)),document.body.append(this.icons)}onIconClick(t){const e=this.actor.getSnapshot().context.comments.find(o=>o.commentId===t);if(!e)return;const i=this.querySelector(`[${qe}="${e.targetId}"]`);i&&this.actor.send({type:"CLICK",targetId:e.targetId,element:i,selectionCommentId:t})}syncFromSnapshot(){const t=this.actor.getSnapshot(),{comments:e,overallComment:i,editingCommentId:o,targetElement:r}=t.context;this.selectionComments=e.filter(u=>u.selection&&u.content.trim());const s=!t.matches({annotating:"inactive"}),a=t.matches({commenting:"editing"}),l=o?e.find(u=>u.commentId===o):null,c=a&&o===null,f=e.filter(u=>u.content.trim()).length,d=i.trim().length>0;this.bar.mode=s?l?"editing":"commenting":"idle",this.bar.commentCount=f,this.bar.hasOverallComment=d,this.bar.overallCommentOpen=c,this.icons.style.display=s?"":"none",a&&l&&r?(this.commentDialog||(this.commentDialog=document.createElement("llumi-comment-dialog"),this.commentDialog.addEventListener("change",u=>this.actor.send({type:"COMMENT_CHANGE",content:u.detail})),this.commentDialog.addEventListener("delete",()=>this.actor.send({type:"DELETE"})),this.commentDialog.addEventListener("close",()=>this.actor.send({type:"CLOSE"})),document.body.append(this.commentDialog)),this.commentDialog.targetElement=r,this.commentDialog.value=l.content):this.commentDialog&&(this.commentDialog.remove(),this.commentDialog=null),c?(this.overallDialog||(this.overallDialog=document.createElement("llumi-overall-comment-dialog"),this.overallDialog.addEventListener("change",u=>this.actor.send({type:"COMMENT_CHANGE",content:u.detail})),this.overallDialog.addEventListener("close",()=>this.actor.send({type:"CLOSE"})),document.body.append(this.overallDialog)),this.overallDialog.barElement=this.bar.barRoot,this.overallDialog.value=i):this.overallDialog&&(this.overallDialog.remove(),this.overallDialog=null),s&&this.updateSelectionHighlights()}buildHighlightCallbacks(){return{activate:t=>{const e=this.manager;e&&(e.activate(t),e.startObserving({editingTarget:this.actor.getSnapshot().context.targetElement,onTargetDisconnected:()=>this.actor.send({type:"CLOSE"}),onSelectableReconnected:()=>this.updateSelectionHighlights(),commentedIds:t}))},deactivate:()=>{const t=this.manager;if(!t)return;t.deactivate(),t.stopObserving();const e=Xe();e&&(e.delete(Yn),e.delete(Zn),e.delete(he)),this.rangeMap.clear(),this.icons.positions=[]},reveal:t=>{var e;return(e=this.manager)==null?void 0:e.reveal(t)},unreveal:()=>{var t;return(t=this.manager)==null?void 0:t.unreveal()},setEditing:(t,e)=>{var i;(i=this.manager)==null||i.setEditing(t,e),this.updateSelectionHighlights()},clearEditing:(t,e)=>{var i;(i=this.manager)==null||i.clearEditing(t,e),this.updateSelectionHighlights()}}}updateSelectionHighlights(){const t=Xe();if(!t)return;const e=ti(),i=ti(),o=new Map,r=[],s=this.actor.getSnapshot().context;for(const l of this.selectionComments){if(!l.selection)continue;const c=this.querySelector(`[${qe}="${l.targetId}"]`);if(!c)continue;const f=Bi(c,l.selection);if(!f)continue;o.set(l.commentId,f),l.commentId===s.editingCommentId?i.add(f):e.add(f);const d=f.getClientRects(),u=d[d.length-1];u&&r.push({commentId:l.commentId,top:u.top+window.scrollY,left:u.right+window.scrollX})}const a=s.editingCommentId;if(a&&!o.has(a)){const l=s.comments.find(c=>c.commentId===a);if(l!=null&&l.selection){const c=this.querySelector(`[${qe}="${l.targetId}"]`);if(c){const f=Bi(c,l.selection);f&&i.add(f)}}}this.rangeMap=o,t.set(Yn,e),t.set(Zn,i),this.icons.positions=r}isAnnotating(){return!this.actor.getSnapshot().matches({annotating:"inactive"})}caretPosition(t,e){if("caretPositionFromPoint"in document){const i=document.caretPositionFromPoint(t,e);if(i)return i}else if("caretRangeFromPoint"in document){const i=document.caretRangeFromPoint(t,e);if(i)return{offsetNode:i.startContainer,offset:i.startOffset}}return null}currentEditingTargetId(){var e;const t=this.actor.getSnapshot().context;if(t.editingCommentId)return((e=t.comments.find(i=>i.commentId===t.editingCommentId))==null?void 0:e.targetId)??void 0}};ni.observedAttributes=["bar-position","shortcut","default-mode"];let Ke=ni;customElements.get("llumi-review")||customElements.define("llumi-review",Ke),C.LlumiReview=Ke,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));typeof globalThis<"u"&&typeof Llumi<"u"&&(globalThis.Llumi=Llumi);
|