@inertiaui/modal-react 0.1.2 → 0.1.4

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.
@@ -1,4 +1,4 @@
1
- (function(W,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("@inertiajs/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@inertiajs/react","react-dom"],p):(W=typeof globalThis<"u"?globalThis:W||self,p(W.InertiaUIModal={},W.React,W.react,W.ReactDOM))})(this,function(W,p,De,ya){"use strict";var Hd=Object.defineProperty;var qd=(W,p,De)=>p in W?Hd(W,p,{enumerable:!0,configurable:!0,writable:!0,value:De}):W[p]=De;var Oe=(W,p,De)=>qd(W,typeof p!="symbol"?p+"":p,De);function ha(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const pt=ha(p),Dt={type:"modal",modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class va{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(Dt))}put(t,r){if(typeof t=="object"){this.config={type:t.type??Dt.type,modal:{...Dt.modal,...t.modal??{}},slideover:{...Dt.slideover,...t.slideover??{}}};return}const n=t.split(".");let o=this.config;for(let i=0;i<n.length-1;i++)o=o[n[i]]=o[n[i]]||{};o[n[n.length-1]]=r}get(t){if(typeof t>"u")return this.config;const r=t.split(".");let n=this.config;for(const o of r){if(n[o]===void 0)return null;n=n[o]}return n}}const It=new va,ga=()=>It.reset(),ba=(e,t)=>It.put(e,t),Dn=e=>It.get(e),Ye=(e,t)=>It.get(e?`slideover.${t}`:`modal.${t}`);var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ea(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Er={exports:{}},mt={};/**
1
+ (function(W,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("@inertiajs/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@inertiajs/react","react-dom"],p):(W=typeof globalThis<"u"?globalThis:W||self,p(W.InertiaUIModal={},W.React,W.react,W.ReactDOM))})(this,function(W,p,De,ya){"use strict";var Hd=Object.defineProperty;var qd=(W,p,De)=>p in W?Hd(W,p,{enumerable:!0,configurable:!0,writable:!0,value:De}):W[p]=De;var Se=(W,p,De)=>qd(W,typeof p!="symbol"?p+"":p,De);function ha(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const pt=ha(p),Dt={type:"modal",modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class va{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(Dt))}put(t,r){if(typeof t=="object"){this.config={type:t.type??Dt.type,modal:{...Dt.modal,...t.modal??{}},slideover:{...Dt.slideover,...t.slideover??{}}};return}const n=t.split(".");let o=this.config;for(let i=0;i<n.length-1;i++)o=o[n[i]]=o[n[i]]||{};o[n[n.length-1]]=r}get(t){if(typeof t>"u")return this.config;const r=t.split(".");let n=this.config;for(const o of r){if(n[o]===void 0)return null;n=n[o]}return n}}const It=new va,ga=()=>It.reset(),ba=(e,t)=>It.put(e,t),Dn=e=>It.get(e),Ye=(e,t)=>It.get(e?`slideover.${t}`:`modal.${t}`);var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ea(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Er={exports:{}},mt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -36,8 +36,8 @@ React keys must be passed directly to JSX without using spread:
36
36
  `)>=0)return!1;return!0}function Du(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=he.call(Array(e.indent+1)," ");else return null;return{base:r,prev:he.call(Array(t+1),r)}}function rn(e,t){if(e.length===0)return"";var r=`
37
37
  `+t.prev+t.base;return r+he.call(e,","+r)+`
38
38
  `+t.prev}function Xt(e,t){var r=en(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=Pe(e,o)?t(e[o],e):""}var i=typeof Xr=="function"?Xr(e):[],a;if(at){a={};for(var s=0;s<i.length;s++)a["$"+i[s]]=i[s]}for(var l in e)Pe(e,l)&&(r&&String(Number(l))===l&&l<e.length||at&&a["$"+l]instanceof Symbol||(Go.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof Xr=="function")for(var f=0;f<i.length;f++)Yo.call(e,i[f])&&n.push("["+t(i[f])+"]: "+t(e[i[f]],e));return n}var si=ot,st=au,Iu=vu,Lu=Et,Qt=si("%WeakMap%",!0),Zt=si("%Map%",!0),ku=st("WeakMap.prototype.get",!0),ju=st("WeakMap.prototype.set",!0),Bu=st("WeakMap.prototype.has",!0),Uu=st("Map.prototype.get",!0),Wu=st("Map.prototype.set",!0),Hu=st("Map.prototype.has",!0),nn=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},qu=function(e,t){var r=nn(e,t);return r&&r.value},Vu=function(e,t,r){var n=nn(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},zu=function(e,t){return!!nn(e,t)},Gu=function(){var t,r,n,o={assert:function(i){if(!o.has(i))throw new Lu("Side channel does not contain "+Iu(i))},get:function(i){if(Qt&&i&&(typeof i=="object"||typeof i=="function")){if(t)return ku(t,i)}else if(Zt){if(r)return Uu(r,i)}else if(n)return qu(n,i)},has:function(i){if(Qt&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Bu(t,i)}else if(Zt){if(r)return Hu(r,i)}else if(n)return zu(n,i);return!1},set:function(i,a){Qt&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Qt),ju(t,i,a)):Zt?(r||(r=new Zt),Wu(r,i,a)):(n||(n={key:{},next:null}),Vu(n,i,a))}};return o},Ku=String.prototype.replace,Ju=/%20/g,on={RFC1738:"RFC1738",RFC3986:"RFC3986"},an={default:on.RFC3986,formatters:{RFC1738:function(e){return Ku.call(e,Ju,"+")},RFC3986:function(e){return String(e)}},RFC1738:on.RFC1738,RFC3986:on.RFC3986},Yu=an,sn=Object.prototype.hasOwnProperty,Ue=Array.isArray,ve=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Xu=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Ue(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&o.push(n[i]);r.obj[r.prop]=o}}},li=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(n[o]=t[o]);return n},Qu=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Ue(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!sn.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var o=t;return Ue(t)&&!Ue(r)&&(o=li(t,n)),Ue(t)&&Ue(r)?(r.forEach(function(i,a){if(sn.call(t,a)){var s=t[a];s&&typeof s=="object"&&i&&typeof i=="object"?t[a]=e(s,i,n):t.push(i)}else t[a]=i}),t):Object.keys(r).reduce(function(i,a){var s=r[a];return sn.call(i,a)?i[a]=e(i[a],s,n):i[a]=s,i},o)},Zu=function(t,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},t)},ec=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},ln=1024,tc=function(t,r,n,o,i){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var s="",l=0;l<a.length;l+=ln){for(var f=a.length>=ln?a.slice(l,l+ln):a,u=[],h=0;h<f.length;++h){var v=f.charCodeAt(h);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||i===Yu.RFC1738&&(v===40||v===41)){u[u.length]=f.charAt(h);continue}if(v<128){u[u.length]=ve[v];continue}if(v<2048){u[u.length]=ve[192|v>>6]+ve[128|v&63];continue}if(v<55296||v>=57344){u[u.length]=ve[224|v>>12]+ve[128|v>>6&63]+ve[128|v&63];continue}h+=1,v=65536+((v&1023)<<10|f.charCodeAt(h)&1023),u[u.length]=ve[240|v>>18]+ve[128|v>>12&63]+ve[128|v>>6&63]+ve[128|v&63]}s+=u.join("")}return s},rc=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],a=i.obj[i.prop],s=Object.keys(a),l=0;l<s.length;++l){var f=s[l],u=a[f];typeof u=="object"&&u!==null&&n.indexOf(u)===-1&&(r.push({obj:a,prop:f}),n.push(u))}return Xu(r),t},nc=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},oc=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},ic=function(t,r){return[].concat(t,r)},ac=function(t,r){if(Ue(t)){for(var n=[],o=0;o<t.length;o+=1)n.push(r(t[o]));return n}return r(t)},ui={arrayToObject:li,assign:Zu,combine:ic,compact:rc,decode:ec,encode:tc,isBuffer:oc,isRegExp:nc,maybeMap:ac,merge:Qu},ci=Gu,er=ui,Tt=an,sc=Object.prototype.hasOwnProperty,fi={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},ge=Array.isArray,lc=Array.prototype.push,di=function(e,t){lc.apply(e,ge(t)?t:[t])},uc=Date.prototype.toISOString,pi=Tt.default,Y={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:er.encode,encodeValuesOnly:!1,format:pi,formatter:Tt.formatters[pi],indices:!1,serializeDate:function(t){return uc.call(t)},skipNulls:!1,strictNullHandling:!1},cc=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},un={},fc=function e(t,r,n,o,i,a,s,l,f,u,h,v,g,c,m,y,w,S){for(var x=t,O=S,T=0,P=!1;(O=O.get(un))!==void 0&&!P;){var _=O.get(t);if(T+=1,typeof _<"u"){if(_===T)throw new RangeError("Cyclic object value");P=!0}typeof O.get(un)>"u"&&(T=0)}if(typeof u=="function"?x=u(r,x):x instanceof Date?x=g(x):n==="comma"&&ge(x)&&(x=er.maybeMap(x,function(U){return U instanceof Date?g(U):U})),x===null){if(a)return f&&!y?f(r,Y.encoder,w,"key",c):r;x=""}if(cc(x)||er.isBuffer(x)){if(f){var j=y?r:f(r,Y.encoder,w,"key",c);return[m(j)+"="+m(f(x,Y.encoder,w,"value",c))]}return[m(r)+"="+m(String(x))]}var H=[];if(typeof x>"u")return H;var I;if(n==="comma"&&ge(x))y&&f&&(x=er.maybeMap(x,f)),I=[{value:x.length>0?x.join(",")||null:void 0}];else if(ge(u))I=u;else{var X=Object.keys(x);I=h?X.sort(h):X}var Z=l?r.replace(/\./g,"%2E"):r,C=o&&ge(x)&&x.length===1?Z+"[]":Z;if(i&&ge(x)&&x.length===0)return C+"[]";for(var L=0;L<I.length;++L){var K=I[L],ce=typeof K=="object"&&typeof K.value<"u"?K.value:x[K];if(!(s&&ce===null)){var ye=v&&l?K.replace(/\./g,"%2E"):K,we=ge(x)?typeof n=="function"?n(C,ye):C:C+(v?"."+ye:"["+ye+"]");S.set(t,T);var re=ci();re.set(un,S),di(H,e(ce,we,n,o,i,a,s,l,n==="comma"&&y&&ge(x)?null:f,u,h,v,g,c,m,y,w,re))}}return H},dc=function(t){if(!t)return Y;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Y.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tt.default;if(typeof t.format<"u"){if(!sc.call(Tt.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var o=Tt.formatters[n],i=Y.filter;(typeof t.filter=="function"||ge(t.filter))&&(i=t.filter);var a;if(t.arrayFormat in fi?a=t.arrayFormat:"indices"in t?a=t.indices?"indices":"repeat":a=Y.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var s=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Y.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Y.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Y.allowEmptyArrays,arrayFormat:a,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Y.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Y.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Y.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Y.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Y.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Y.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Y.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Y.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Y.strictNullHandling}},pc=function(e,t){var r=e,n=dc(t),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):ge(n.filter)&&(i=n.filter,o=i);var a=[];if(typeof r!="object"||r===null)return"";var s=fi[n.arrayFormat],l=s==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var f=ci(),u=0;u<o.length;++u){var h=o[u];n.skipNulls&&r[h]===null||di(a,fc(r[h],h,s,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,f))}var v=a.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),v.length>0?g+v:""},lt=ui,cn=Object.prototype.hasOwnProperty,mc=Array.isArray,V={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:lt.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},yc=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},mi=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},hc="utf8=%26%2310003%3B",vc="utf8=%E2%9C%93",gc=function(t,r){var n={__proto__:null},o=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=r.parameterLimit===1/0?void 0:r.parameterLimit,a=o.split(r.delimiter,i),s=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<a.length;++l)a[l].indexOf("utf8=")===0&&(a[l]===vc?f="utf-8":a[l]===hc&&(f="iso-8859-1"),s=l,l=a.length);for(l=0;l<a.length;++l)if(l!==s){var u=a[l],h=u.indexOf("]="),v=h===-1?u.indexOf("="):h+1,g,c;v===-1?(g=r.decoder(u,V.decoder,f,"key"),c=r.strictNullHandling?null:""):(g=r.decoder(u.slice(0,v),V.decoder,f,"key"),c=lt.maybeMap(mi(u.slice(v+1),r),function(y){return r.decoder(y,V.decoder,f,"value")})),c&&r.interpretNumericEntities&&f==="iso-8859-1"&&(c=yc(c)),u.indexOf("[]=")>-1&&(c=mc(c)?[c]:c);var m=cn.call(n,g);m&&r.duplicates==="combine"?n[g]=lt.combine(n[g],c):(!m||r.duplicates==="last")&&(n[g]=c)}return n},bc=function(e,t,r,n){for(var o=n?t:mi(t,r),i=e.length-1;i>=0;--i){var a,s=e[i];if(s==="[]"&&r.parseArrays)a=r.allowEmptyArrays&&(o===""||r.strictNullHandling&&o===null)?[]:[].concat(o);else{a=r.plainObjects?Object.create(null):{};var l=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,f=r.decodeDotInKeys?l.replace(/%2E/g,"."):l,u=parseInt(f,10);!r.parseArrays&&f===""?a={0:o}:!isNaN(u)&&s!==f&&String(u)===f&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[],a[u]=o):f!=="__proto__"&&(a[f]=o)}o=a}return o},wc=function(t,r,n,o){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,l=n.depth>0&&a.exec(i),f=l?i.slice(0,l.index):i,u=[];if(f){if(!n.plainObjects&&cn.call(Object.prototype,f)&&!n.allowPrototypes)return;u.push(f)}for(var h=0;n.depth>0&&(l=s.exec(i))!==null&&h<n.depth;){if(h+=1,!n.plainObjects&&cn.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(l[1])}if(l){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");u.push("["+i.slice(l.index)+"]")}return bc(u,r,n,o)}},Ec=function(t){if(!t)return V;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?V.charset:t.charset,n=typeof t.duplicates>"u"?V.duplicates:t.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:V.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:V.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:V.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:V.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:V.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:V.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:V.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:V.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:V.decoder,delimiter:typeof t.delimiter=="string"||lt.isRegExp(t.delimiter)?t.delimiter:V.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:V.depth,duplicates:n,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:V.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:V.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:V.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:V.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:V.strictNullHandling}},Sc=function(e,t){var r=Ec(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?gc(e,r):e,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a<i.length;++a){var s=i[a],l=wc(s,n[s],r,typeof e=="string");o=lt.merge(o,l,r)}return r.allowSparse===!0?o:lt.compact(o)},xc=pc,Oc=Sc,Ac=an,yi={formats:Ac,parse:Oc,stringify:xc},Tc={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
39
- * @license MIT */(function(e,t){(function(r,n){e.exports=n()})(wr,function(){var r={};r.version="0.2.0";var n=r.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};r.configure=function(c){var m,y;for(m in c)y=c[m],y!==void 0&&c.hasOwnProperty(m)&&(n[m]=y);return this},r.status=null,r.set=function(c){var m=r.isStarted();c=o(c,n.minimum,1),r.status=c===1?null:c;var y=r.render(!m),w=y.querySelector(n.barSelector),S=n.speed,x=n.easing;return y.offsetWidth,s(function(O){n.positionUsing===""&&(n.positionUsing=r.getPositioningCSS()),l(w,a(c,S,x)),c===1?(l(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){l(y,{transition:"all "+S+"ms linear",opacity:0}),setTimeout(function(){r.remove(),O()},S)},S)):setTimeout(O,S)}),this},r.isStarted=function(){return typeof r.status=="number"},r.start=function(){r.status||r.set(0);var c=function(){setTimeout(function(){r.status&&(r.trickle(),c())},n.trickleSpeed)};return n.trickle&&c(),this},r.done=function(c){return!c&&!r.status?this:r.inc(.3+.5*Math.random()).set(1)},r.inc=function(c){var m=r.status;return m?(typeof c!="number"&&(c=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+c,0,.994),r.set(m)):r.start()},r.trickle=function(){return r.inc(Math.random()*n.trickleRate)},function(){var c=0,m=0;r.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&r.start(),c++,m++,y.always(function(){m--,m===0?(c=0,r.done()):r.set((c-m)/c)}),this)}}(),r.render=function(c){if(r.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),w=c?"-100":i(r.status||0),S=document.querySelector(n.parent),x;return l(y,{transition:"all 0 linear",transform:"translate3d("+w+"%,0,0)"}),n.showSpinner||(x=m.querySelector(n.spinnerSelector),x&&g(x)),S!=document.body&&u(S,"nprogress-custom-parent"),S.appendChild(m),m},r.remove=function(){h(document.documentElement,"nprogress-busy"),h(document.querySelector(n.parent),"nprogress-custom-parent");var c=document.getElementById("nprogress");c&&g(c)},r.isRendered=function(){return!!document.getElementById("nprogress")},r.getPositioningCSS=function(){var c=document.body.style,m="WebkitTransform"in c?"Webkit":"MozTransform"in c?"Moz":"msTransform"in c?"ms":"OTransform"in c?"O":"";return m+"Perspective"in c?"translate3d":m+"Transform"in c?"translate":"margin"};function o(c,m,y){return c<m?m:c>y?y:c}function i(c){return(-1+c)*100}function a(c,m,y){var w;return n.positionUsing==="translate3d"?w={transform:"translate3d("+i(c)+"%,0,0)"}:n.positionUsing==="translate"?w={transform:"translate("+i(c)+"%,0)"}:w={"margin-left":i(c)+"%"},w.transition="all "+m+"ms "+y,w}var s=function(){var c=[];function m(){var y=c.shift();y&&y(m)}return function(y){c.push(y),c.length==1&&m()}}(),l=function(){var c=["Webkit","O","Moz","ms"],m={};function y(O){return O.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,P){return P.toUpperCase()})}function w(O){var T=document.body.style;if(O in T)return O;for(var P=c.length,_=O.charAt(0).toUpperCase()+O.slice(1),j;P--;)if(j=c[P]+_,j in T)return j;return O}function S(O){return O=y(O),m[O]||(m[O]=w(O))}function x(O,T,P){T=S(T),O.style[T]=P}return function(O,T){var P=arguments,_,j;if(P.length==2)for(_ in T)j=T[_],j!==void 0&&T.hasOwnProperty(_)&&x(O,_,j);else x(O,P[1],P[2])}}();function f(c,m){var y=typeof c=="string"?c:v(c);return y.indexOf(" "+m+" ")>=0}function u(c,m){var y=v(c),w=y+m;f(y,m)||(c.className=w.substring(1))}function h(c,m){var y=v(c),w;f(c,m)&&(w=y.replace(" "+m+" "," "),c.className=w.substring(1,w.length-1))}function v(c){return(" "+(c.className||"")+" ").replace(/\s+/gi," ")}function g(c){c&&c.parentNode&&c.parentNode.removeChild(c)}return r})})(Tc);function Pc(e,t,r,n="brackets"){let o=/^https?:\/\//.test(t.toString()),i=o||t.toString().startsWith("/"),a=!i&&!t.toString().startsWith("#")&&!t.toString().startsWith("?"),s=t.toString().includes("?")||e==="get"&&Object.keys(r).length,l=t.toString().includes("#"),f=new URL(t.toString(),"http://localhost");return e==="get"&&Object.keys(r).length&&(f.search=yi.stringify(cl(yi.parse(f.search,{ignoreQueryPrefix:!0}),r),{encodeValuesOnly:!0,arrayFormat:n}),r={}),[[o?`${f.protocol}//${f.host}`:"",i?f.pathname:"",a?f.pathname.substring(1):"",s?f.search:"",l?f.hash:""].join(""),r]}const tr=p.createContext(null);tr.displayName="ModalStackContext";const Cc=({children:e})=>{const[t,r]=p.useState([]),[n,o]=p.useState({});class i{constructor(c,m,y,w,S){Oe(this,"updateStack",c=>{r(m=>{const y=c([...m]);return y.forEach((w,S)=>{y[S].index=S,y[S].onTopOfStack=S===y.length-1}),y})});Oe(this,"close",()=>{this.updateStack(c=>c.map(m=>{var y;return m.id===this.id&&(Object.keys(m.listeners).forEach(w=>{m.off(w)}),m.open=!1,(y=m.onCloseCallback)==null||y.call(m)),m}))});Oe(this,"afterLeave",()=>{this.updateStack(c=>c.filter(m=>{var y;return m.id!==this.id?!0:((y=m.afterLeaveCallback)==null||y.call(m),!1)}))});Oe(this,"on",(c,m)=>{this.listeners[c]=this.listeners[c]??[],this.listeners[c].push(m)});Oe(this,"off",(c,m)=>{var y;m?this.listeners[c]=((y=this.listeners[c])==null?void 0:y.filter(w=>w!==m))??[]:delete this.listeners[c]});Oe(this,"emit",(c,...m)=>{var y;return console.log("Emitting",c,"with args",m),(y=this.listeners[c])==null||y.forEach(w=>w(...m)),"OK"});Oe(this,"registerEventListenersFromProps",c=>{const m=[];return Object.keys(c).filter(y=>y.startsWith("on")).forEach(y=>{const w=y.replace(/^on/,"").replace(/^./,S=>S.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase();this.on(w,c[y]),m.push(()=>this.off(w,c[y]))}),()=>m.forEach(y=>y())});Oe(this,"reload",(c={})=>{let m=Object.keys(this.response.props);c.only&&(m=xo(m,c.only)),c.except&&(m=Gs(m,c.except)),z.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":m.join(",")}}).then(y=>{Object.assign(this.componentProps,y.data.props),r(w=>[...w])})});this.id=i.generateId(),this.open=!0,this.listeners={},this.component=c,this.componentProps=m.props,this.response=m,this.modalProps=y,this.onCloseCallback=w,this.afterLeaveCallback=S,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const a=(g,c,m,y,w)=>{const S=new i(g,c,m,y,w);return r(x=>{const O=[...x,S];return O.forEach((T,P)=>{T.index=P,T.onTopOfStack=P===O.length-1}),O.forEach((T,P)=>{T.getParentModal=()=>P>0?O[P-1]:null,T.getChildModal=()=>P<O.length-1?O[P+1]:null}),O}),S};function s(g,c,m,y){if(!n[g])throw new Error(`The local modal "${g}" has not been registered.`);const w=a(null,{},c,m,y);return w.name=g,n[g].callback(w),w}const l=(g,c={})=>f(g,c.method??"get",c.data??{},c.headers??{},c.config??{},c.onClose,c.onAfterLeave,c.queryStringArrayFormat??"brackets"),f=(g,c,m={},y={},w={},S=null,x=null,O="brackets")=>new Promise((T,P)=>{if(g.startsWith("#")){const H=s(g.substring(1),w,S,x);T(H);return}const[_,j]=Pc(c,g||"",m,O);Js().then(H=>{z({url:_,method:c,data:j,headers:{...y,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":H.version,"X-InertiaUI-Modal":!0}}).then(I=>{De.router.resolveComponent(I.data.component).then(X=>{T(a(X,I.data,w,S,x))})}).catch(I=>{P(I)})})}),v={stack:t,localModals:n,push:a,reset:()=>r([]),visit:f,visitModal:l,registerLocalModal:(g,c)=>{o(m=>({...m,[g]:{name:g,callback:c}}))},removeLocalModal:g=>{o(c=>{const m={...c};return delete m[g],m})}};return R.jsx(tr.Provider,{value:v,children:e})},rr=()=>{const e=p.useContext(tr);if(e===null)throw new Error("useModalStack must be used within a ModalStackProvider");return e},hi=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Fc=({children:e})=>{const t=p.useContext(tr).stack;return R.jsxs(R.Fragment,{children:[e,t.length>0&&R.jsx(gi,{index:0})]})},fn=p.createContext(null);fn.displayName="ModalIndexContext";const vi=()=>{const e=p.useContext(fn);if(e===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return e},gi=({index:e})=>{const{stack:t}=rr(),r=t[e];return!r||!r.component?null:R.jsx(fn.Provider,{value:e,children:R.jsx(r.component,{...r.componentProps,onModalEvent:(...n)=>r.emit(...n)})})},dn=p.forwardRef(({name:e,children:t,...r},n)=>{const o=vi(),{stack:i,registerLocalModal:a,removeLocalModal:s}=rr(),[l,f]=p.useState(null),u=p.useMemo(()=>e?l:i[o]),h=p.useMemo(()=>(u==null?void 0:u.modalProps.slideover)??r.slideover??Dn("type")==="slideover",[r.slideover]),v=p.useMemo(()=>({slideover:h,closeButton:r.closeButton??Ye(h,"closeButton"),closeExplicitly:r.closeExplicitly??Ye(h,"closeExplicitly"),maxWidth:r.maxWidth??Ye(h,"maxWidth"),paddingClasses:r.paddingClasses??Ye(h,"paddingClasses"),panelClasses:r.panelClasses??Ye(h,"panelClasses"),position:r.position??Ye(h,"position"),...u==null?void 0:u.modalProps}),[r,u==null?void 0:u.modalProps]);return p.useEffect(()=>{if(e){let g=null;return a(e,c=>{g=c.registerEventListenersFromProps(r),f(c)}),()=>{g==null||g(),g=null,s(e)}}return u.registerEventListenersFromProps(r)},[e]),p.useImperativeHandle(n,()=>({afterLeave:()=>u.afterLeave(),close:()=>u.close(),emit:(...g)=>u.emit(...g),getChildModal:()=>u.getChildModal(),getParentModal:()=>u.getParentModal(),modalContext:u,modalProps:v,reload:()=>u.reload()}),[u]),u&&R.jsxs(R.Fragment,{children:[typeof t=="function"?t({afterLeave:u.afterLeave,close:u.close,emit:u.emit,getChildModal:u.getChildModal,getParentModal:u.getParentModal,modalContext:u,modalProps:v,reload:u.reload}):t,i[u.index+1]&&R.jsx(gi,{index:u.index+1})]})});dn.displayName="HeadlessModal";function bi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=bi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function nr(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=bi(e))&&(n&&(n+=" "),n+=t);return n}var $c=Object.defineProperty,_c=(e,t,r)=>t in e?$c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pn=(e,t,r)=>(_c(e,typeof t!="symbol"?t+"":t,r),r);let Nc=class{constructor(){pn(this,"current",this.detect()),pn(this,"handoffState","pending"),pn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},We=new Nc;function or(e){return We.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function ir(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Fe(){let e=[],t={addEventListener(r,n,o,i){return r.addEventListener(n,o,i),t.add(()=>r.removeEventListener(n,o,i))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return ir(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let i=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:i})})},group(r){let n=Fe();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function mn(){let[e]=p.useState(Fe);return p.useEffect(()=>()=>e.dispose(),[e]),e}let ne=(e,t)=>{We.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function He(e){let t=p.useRef(e);return ne(()=>{t.current=e},[e]),t}let q=function(e){let t=He(e);return p.useCallback((...r)=>t.current(...r),[t])},Mc=p.createContext(void 0);function Rc(){return p.useContext(Mc)}function yn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function $e(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,$e),n}var ar=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ar||{}),_e=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_e||{});function fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??Dc;let l=wi(t,e);if(i)return sr(l,r,n,a,s);let f=o??0;if(f&2){let{static:u=!1,...h}=l;if(u)return sr(h,r,n,a,s)}if(f&1){let{unmount:u=!0,...h}=l;return $e(u?0:1,{0(){return null},1(){return sr({...h,hidden:!0,style:{display:"none"}},r,n,a,s)}})}return sr(l,r,n,a,s)}function sr(e,t={},r,n,o){let{as:i=r,children:a,refName:s="ref",...l}=hn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},u=typeof a=="function"?a(t):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let v=!1,g=[];for(let[c,m]of Object.entries(t))typeof m=="boolean"&&(v=!0),m===!0&&g.push(c.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){h["data-headlessui-state"]=g.join(" ");for(let c of g)h[`data-${c}`]=""}}if(i===p.Fragment&&(Object.keys(qe(l)).length>0||Object.keys(qe(h)).length>0))if(!p.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(qe(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(qe(l)).concat(Object.keys(qe(h))).map(v=>` - ${v}`).join(`
39
+ * @license MIT */(function(e,t){(function(r,n){e.exports=n()})(wr,function(){var r={};r.version="0.2.0";var n=r.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};r.configure=function(c){var m,y;for(m in c)y=c[m],y!==void 0&&c.hasOwnProperty(m)&&(n[m]=y);return this},r.status=null,r.set=function(c){var m=r.isStarted();c=o(c,n.minimum,1),r.status=c===1?null:c;var y=r.render(!m),w=y.querySelector(n.barSelector),S=n.speed,x=n.easing;return y.offsetWidth,s(function(O){n.positionUsing===""&&(n.positionUsing=r.getPositioningCSS()),l(w,a(c,S,x)),c===1?(l(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){l(y,{transition:"all "+S+"ms linear",opacity:0}),setTimeout(function(){r.remove(),O()},S)},S)):setTimeout(O,S)}),this},r.isStarted=function(){return typeof r.status=="number"},r.start=function(){r.status||r.set(0);var c=function(){setTimeout(function(){r.status&&(r.trickle(),c())},n.trickleSpeed)};return n.trickle&&c(),this},r.done=function(c){return!c&&!r.status?this:r.inc(.3+.5*Math.random()).set(1)},r.inc=function(c){var m=r.status;return m?(typeof c!="number"&&(c=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+c,0,.994),r.set(m)):r.start()},r.trickle=function(){return r.inc(Math.random()*n.trickleRate)},function(){var c=0,m=0;r.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&r.start(),c++,m++,y.always(function(){m--,m===0?(c=0,r.done()):r.set((c-m)/c)}),this)}}(),r.render=function(c){if(r.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),w=c?"-100":i(r.status||0),S=document.querySelector(n.parent),x;return l(y,{transition:"all 0 linear",transform:"translate3d("+w+"%,0,0)"}),n.showSpinner||(x=m.querySelector(n.spinnerSelector),x&&g(x)),S!=document.body&&u(S,"nprogress-custom-parent"),S.appendChild(m),m},r.remove=function(){h(document.documentElement,"nprogress-busy"),h(document.querySelector(n.parent),"nprogress-custom-parent");var c=document.getElementById("nprogress");c&&g(c)},r.isRendered=function(){return!!document.getElementById("nprogress")},r.getPositioningCSS=function(){var c=document.body.style,m="WebkitTransform"in c?"Webkit":"MozTransform"in c?"Moz":"msTransform"in c?"ms":"OTransform"in c?"O":"";return m+"Perspective"in c?"translate3d":m+"Transform"in c?"translate":"margin"};function o(c,m,y){return c<m?m:c>y?y:c}function i(c){return(-1+c)*100}function a(c,m,y){var w;return n.positionUsing==="translate3d"?w={transform:"translate3d("+i(c)+"%,0,0)"}:n.positionUsing==="translate"?w={transform:"translate("+i(c)+"%,0)"}:w={"margin-left":i(c)+"%"},w.transition="all "+m+"ms "+y,w}var s=function(){var c=[];function m(){var y=c.shift();y&&y(m)}return function(y){c.push(y),c.length==1&&m()}}(),l=function(){var c=["Webkit","O","Moz","ms"],m={};function y(O){return O.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,P){return P.toUpperCase()})}function w(O){var T=document.body.style;if(O in T)return O;for(var P=c.length,_=O.charAt(0).toUpperCase()+O.slice(1),j;P--;)if(j=c[P]+_,j in T)return j;return O}function S(O){return O=y(O),m[O]||(m[O]=w(O))}function x(O,T,P){T=S(T),O.style[T]=P}return function(O,T){var P=arguments,_,j;if(P.length==2)for(_ in T)j=T[_],j!==void 0&&T.hasOwnProperty(_)&&x(O,_,j);else x(O,P[1],P[2])}}();function f(c,m){var y=typeof c=="string"?c:v(c);return y.indexOf(" "+m+" ")>=0}function u(c,m){var y=v(c),w=y+m;f(y,m)||(c.className=w.substring(1))}function h(c,m){var y=v(c),w;f(c,m)&&(w=y.replace(" "+m+" "," "),c.className=w.substring(1,w.length-1))}function v(c){return(" "+(c.className||"")+" ").replace(/\s+/gi," ")}function g(c){c&&c.parentNode&&c.parentNode.removeChild(c)}return r})})(Tc);function Pc(e,t,r,n="brackets"){let o=/^https?:\/\//.test(t.toString()),i=o||t.toString().startsWith("/"),a=!i&&!t.toString().startsWith("#")&&!t.toString().startsWith("?"),s=t.toString().includes("?")||e==="get"&&Object.keys(r).length,l=t.toString().includes("#"),f=new URL(t.toString(),"http://localhost");return e==="get"&&Object.keys(r).length&&(f.search=yi.stringify(cl(yi.parse(f.search,{ignoreQueryPrefix:!0}),r),{encodeValuesOnly:!0,arrayFormat:n}),r={}),[[o?`${f.protocol}//${f.host}`:"",i?f.pathname:"",a?f.pathname.substring(1):"",s?f.search:"",l?f.hash:""].join(""),r]}const tr=p.createContext(null);tr.displayName="ModalStackContext";const Cc=({children:e})=>{const[t,r]=p.useState([]),[n,o]=p.useState({});class i{constructor(c,m,y,w,S){Se(this,"updateStack",c=>{r(m=>{const y=c([...m]);return y.forEach((w,S)=>{y[S].index=S,y[S].onTopOfStack=S===y.length-1}),y})});Se(this,"setOpen",c=>{c?this.open=!0:this.close()});Se(this,"close",()=>{this.updateStack(c=>c.map(m=>{var y;return m.id===this.id&&(Object.keys(m.listeners).forEach(w=>{m.off(w)}),m.open=!1,(y=m.onCloseCallback)==null||y.call(m)),m}))});Se(this,"afterLeave",()=>{this.open||this.updateStack(c=>c.filter(m=>{var y;return m.id!==this.id?!0:((y=m.afterLeaveCallback)==null||y.call(m),!1)}))});Se(this,"on",(c,m)=>{this.listeners[c]=this.listeners[c]??[],this.listeners[c].push(m)});Se(this,"off",(c,m)=>{var y;m?this.listeners[c]=((y=this.listeners[c])==null?void 0:y.filter(w=>w!==m))??[]:delete this.listeners[c]});Se(this,"emit",(c,...m)=>{var y;return console.log("Emitting",c,"with args",m),(y=this.listeners[c])==null||y.forEach(w=>w(...m)),"OK"});Se(this,"registerEventListenersFromProps",c=>{const m=[];return Object.keys(c).filter(y=>y.startsWith("on")).forEach(y=>{const w=y.replace(/^on/,"").replace(/^./,S=>S.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase();this.on(w,c[y]),m.push(()=>this.off(w,c[y]))}),()=>m.forEach(y=>y())});Se(this,"reload",(c={})=>{let m=Object.keys(this.response.props);c.only&&(m=xo(m,c.only)),c.except&&(m=Gs(m,c.except)),z.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":m.join(",")}}).then(y=>{Object.assign(this.componentProps,y.data.props),r(w=>[...w])})});this.id=i.generateId(),this.open=!0,this.listeners={},this.component=c,this.componentProps=m.props,this.response=m,this.modalProps=y,this.onCloseCallback=w,this.afterLeaveCallback=S,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const a=(g,c,m,y,w)=>{const S=new i(g,c,m,y,w);return r(x=>{const O=[...x,S];return O.forEach((T,P)=>{T.index=P,T.onTopOfStack=P===O.length-1}),O.forEach((T,P)=>{T.getParentModal=()=>P>0?O[P-1]:null,T.getChildModal=()=>P<O.length-1?O[P+1]:null}),O}),S};function s(g,c,m,y){if(!n[g])throw new Error(`The local modal "${g}" has not been registered.`);const w=a(null,{},c,m,y);return w.name=g,n[g].callback(w),w}const l=(g,c={})=>f(g,c.method??"get",c.data??{},c.headers??{},c.config??{},c.onClose,c.onAfterLeave,c.queryStringArrayFormat??"brackets"),f=(g,c,m={},y={},w={},S=null,x=null,O="brackets")=>new Promise((T,P)=>{if(g.startsWith("#")){const H=s(g.substring(1),w,S,x);T(H);return}const[_,j]=Pc(c,g||"",m,O);Js().then(H=>{z({url:_,method:c,data:j,headers:{...y,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":H.version,"X-InertiaUI-Modal":!0}}).then(I=>{De.router.resolveComponent(I.data.component).then(X=>{T(a(X,I.data,w,S,x))})}).catch(I=>{P(I)})})}),v={stack:t,localModals:n,push:a,reset:()=>r([]),visit:f,visitModal:l,registerLocalModal:(g,c)=>{o(m=>({...m,[g]:{name:g,callback:c}}))},removeLocalModal:g=>{o(c=>{const m={...c};return delete m[g],m})}};return R.jsx(tr.Provider,{value:v,children:e})},rr=()=>{const e=p.useContext(tr);if(e===null)throw new Error("useModalStack must be used within a ModalStackProvider");return e},hi=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Fc=({children:e})=>{const t=p.useContext(tr).stack;return R.jsxs(R.Fragment,{children:[e,t.length>0&&R.jsx(gi,{index:0})]})},fn=p.createContext(null);fn.displayName="ModalIndexContext";const vi=()=>{const e=p.useContext(fn);if(e===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return e},gi=({index:e})=>{const{stack:t}=rr(),r=t[e];return!r||!r.component?null:R.jsx(fn.Provider,{value:e,children:R.jsx(r.component,{...r.componentProps,onModalEvent:(...n)=>r.emit(...n)})})},dn=p.forwardRef(({name:e,children:t,...r},n)=>{const o=vi(),{stack:i,registerLocalModal:a,removeLocalModal:s}=rr(),[l,f]=p.useState(null),u=p.useMemo(()=>e?l:i[o]),h=p.useMemo(()=>(u==null?void 0:u.modalProps.slideover)??r.slideover??Dn("type")==="slideover",[r.slideover]),v=p.useMemo(()=>({slideover:h,closeButton:r.closeButton??Ye(h,"closeButton"),closeExplicitly:r.closeExplicitly??Ye(h,"closeExplicitly"),maxWidth:r.maxWidth??Ye(h,"maxWidth"),paddingClasses:r.paddingClasses??Ye(h,"paddingClasses"),panelClasses:r.panelClasses??Ye(h,"panelClasses"),position:r.position??Ye(h,"position"),...u==null?void 0:u.modalProps}),[r,u==null?void 0:u.modalProps]);return p.useEffect(()=>{if(e){let g=null;return a(e,c=>{g=c.registerEventListenersFromProps(r),f(c)}),()=>{g==null||g(),g=null,s(e)}}return u.registerEventListenersFromProps(r)},[e]),p.useImperativeHandle(n,()=>({afterLeave:()=>u.afterLeave(),close:()=>u.close(),emit:(...g)=>u.emit(...g),getChildModal:()=>u.getChildModal(),getParentModal:()=>u.getParentModal(),index:u==null?void 0:u.index,isOpen:u==null?void 0:u.open,modalContext:u,modalProps:v,reload:()=>u.reload(),setOpen:()=>u.setOpen()}),[u]),u&&R.jsxs(R.Fragment,{children:[typeof t=="function"?t({afterLeave:u.afterLeave,close:u.close,emit:u.emit,getChildModal:u.getChildModal,getParentModal:u.getParentModal,index:u.index,isOpen:u.open,modalContext:u,modalProps:v,reload:u.reload,setOpen:u.setOpen}):t,i[u.index+1]&&R.jsx(gi,{index:u.index+1})]})});dn.displayName="HeadlessModal";function bi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=bi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function nr(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=bi(e))&&(n&&(n+=" "),n+=t);return n}var $c=Object.defineProperty,_c=(e,t,r)=>t in e?$c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pn=(e,t,r)=>(_c(e,typeof t!="symbol"?t+"":t,r),r);let Nc=class{constructor(){pn(this,"current",this.detect()),pn(this,"handoffState","pending"),pn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},We=new Nc;function or(e){return We.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function ir(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Fe(){let e=[],t={addEventListener(r,n,o,i){return r.addEventListener(n,o,i),t.add(()=>r.removeEventListener(n,o,i))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return ir(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let i=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:i})})},group(r){let n=Fe();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function mn(){let[e]=p.useState(Fe);return p.useEffect(()=>()=>e.dispose(),[e]),e}let ne=(e,t)=>{We.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function He(e){let t=p.useRef(e);return ne(()=>{t.current=e},[e]),t}let q=function(e){let t=He(e);return p.useCallback((...r)=>t.current(...r),[t])},Mc=p.createContext(void 0);function Rc(){return p.useContext(Mc)}function yn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function $e(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,$e),n}var ar=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ar||{}),_e=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_e||{});function fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??Dc;let l=wi(t,e);if(i)return sr(l,r,n,a,s);let f=o??0;if(f&2){let{static:u=!1,...h}=l;if(u)return sr(h,r,n,a,s)}if(f&1){let{unmount:u=!0,...h}=l;return $e(u?0:1,{0(){return null},1(){return sr({...h,hidden:!0,style:{display:"none"}},r,n,a,s)}})}return sr(l,r,n,a,s)}function sr(e,t={},r,n,o){let{as:i=r,children:a,refName:s="ref",...l}=hn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},u=typeof a=="function"?a(t):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let v=!1,g=[];for(let[c,m]of Object.entries(t))typeof m=="boolean"&&(v=!0),m===!0&&g.push(c.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){h["data-headlessui-state"]=g.join(" ");for(let c of g)h[`data-${c}`]=""}}if(i===p.Fragment&&(Object.keys(qe(l)).length>0||Object.keys(qe(h)).length>0))if(!p.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(qe(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(qe(l)).concat(Object.keys(qe(h))).map(v=>` - ${v}`).join(`
40
40
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(v=>` - ${v}`).join(`
41
41
  `)].join(`
42
- `))}else{let v=u.props,g=v==null?void 0:v.className,c=typeof g=="function"?(...w)=>yn(g(...w),l.className):yn(g,l.className),m=c?{className:c}:{},y=wi(u.props,qe(hn(l,["ref"])));for(let w in h)w in y&&delete h[w];return p.cloneElement(u,Object.assign({},y,h,f,{ref:o(u.ref,f.ref)},m))}return p.createElement(i,Object.assign({},hn(l,["ref"]),i!==p.Fragment&&f,i!==p.Fragment&&h),u)}function Dc(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function wi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...i){let a=r[n];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function se(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qe(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function hn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let Ic="span";var lr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(lr||{});function Lc(e,t){var r;let{features:n=1,...o}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return fe({ourProps:i,theirProps:o,slot:{},defaultTag:Ic,name:"Hidden"})}let vn=se(Lc),Ei=Symbol();function kc(e,t=!0){return Object.assign(e,{[Ei]:t})}function be(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=q(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ei]))?void 0:r}let gn=p.createContext(null);gn.displayName="DescriptionContext";function Si(){let e=p.useContext(gn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Si),t}return e}function jc(){let[e,t]=p.useState([]);return[e.length>0?e.join(" "):void 0,p.useMemo(()=>function(r){let n=q(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=p.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return p.createElement(gn.Provider,{value:o},r.children)},[t])]}let Bc="p";function Uc(e,t){let r=p.useId(),n=Rc(),{id:o=`headlessui-description-${r}`,...i}=e,a=Si(),s=be(t);ne(()=>a.register(o),[o,a.register]);let l=n||!1,f=p.useMemo(()=>({...a.slot,disabled:l}),[a.slot,l]),u={ref:s,...a.props,id:o};return fe({ourProps:u,theirProps:i,slot:f,defaultTag:Bc,name:a.name||"Description"})}let Wc=se(Uc),Hc=Object.assign(Wc,{});var xi=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(xi||{});let qc=p.createContext(()=>{});function Vc({value:e,children:t}){return p.createElement(qc.Provider,{value:e},t)}let zc=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};function Oi(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...i){let a=t[o].call(r,...i);a&&(r=a,n.forEach(s=>s()))}}}function Ai(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Gc=new zc(()=>Oi(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let r=this.slice();return r.splice(t,1),r}}));function ut(e,t){let r=Gc.get(t),n=p.useId(),o=Ai(r);if(ne(()=>{if(e)return r.dispatch("ADD",n),()=>r.dispatch("REMOVE",n)},[r,e]),!e)return!1;let i=o.indexOf(n),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let bn=new Map,Pt=new Map;function Ti(e){var t;let r=(t=Pt.get(e))!=null?t:0;return Pt.set(e,r+1),r!==0?()=>Pi(e):(bn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Pi(e))}function Pi(e){var t;let r=(t=Pt.get(e))!=null?t:1;if(r===1?Pt.delete(e):Pt.set(e,r-1),r!==1)return;let n=bn.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,bn.delete(e))}function Kc(e,{allowed:t,disallowed:r}={}){let n=ut(e,"inert-others");ne(()=>{var o,i;if(!n)return;let a=Fe();for(let l of(o=r==null?void 0:r())!=null?o:[])l&&a.add(Ti(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let f=or(l);if(!f)continue;let u=l.parentElement;for(;u&&u!==f.body;){for(let h of u.children)s.some(v=>h.contains(v))||a.add(Ti(h));u=u.parentElement}}return a.dispose},[n,t,r])}function Jc(e,t,r){let n=He(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&r()});p.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=Fe();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>n.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>n.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,n,e])}let ur=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yc=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Se=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Se||{}),wn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wn||{}),Xc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Xc||{});function Qc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ur)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Zc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yc)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ci=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ci||{});function ef(e,t=0){var r;return e===((r=or(e))==null?void 0:r.body)?!1:$e(t,{0(){return e.matches(ur)},1(){let n=e;for(;n!==null;){if(n.matches(ur))return!0;n=n.parentElement}return!1}})}var tf=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(tf||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function xe(e){e==null||e.focus({preventScroll:!0})}let rf=["textarea","input"].join(",");function nf(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,rf))!=null?r:!1}function of(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),i=t(n);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ct(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?of(e):e:t&64?Zc(e):Qc(e);o.length>0&&a.length>1&&(a=a.filter(g=>!o.some(c=>c!=null&&"current"in c?(c==null?void 0:c.current)===g:c===g))),n=n??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(n))-1;if(t&4)return Math.max(0,a.indexOf(n))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},u=0,h=a.length,v;do{if(u>=h||u+h<=0)return 0;let g=l+u;if(t&16)g=(g+h)%h;else{if(g<0)return 3;if(g>=h)return 1}v=a[g],v==null||v.focus(f),u+=s}while(v!==i.activeElement);return t&6&&nf(v)&&v.select(),2}function Fi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function af(){return/Android/gi.test(window.navigator.userAgent)}function sf(){return Fi()||af()}function Ft(e,t,r,n){let o=He(r);p.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,n),()=>document.removeEventListener(t,i,n)},[e,t,n])}function $i(e,t,r,n){let o=He(r);p.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,n),()=>window.removeEventListener(t,i,n)},[e,t,n])}const _i=30;function lf(e,t,r){let n=ut(e,"outside-click"),o=He(r),i=p.useCallback(function(l,f){if(l.defaultPrevented)return;let u=f(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let h=function v(g){return typeof g=="function"?v(g()):Array.isArray(g)||g instanceof Set?g:[g]}(t);for(let v of h)if(v!==null&&(v.contains(u)||l.composed&&l.composedPath().includes(v)))return;return!ef(u,Ci.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),a=p.useRef(null);Ft(n,"pointerdown",l=>{var f,u;a.current=((u=(f=l.composedPath)==null?void 0:f.call(l))==null?void 0:u[0])||l.target},!0),Ft(n,"mousedown",l=>{var f,u;a.current=((u=(f=l.composedPath)==null?void 0:f.call(l))==null?void 0:u[0])||l.target},!0),Ft(n,"click",l=>{sf()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=p.useRef({x:0,y:0});Ft(n,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ft(n,"touchend",l=>{let f={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(f.x-s.current.x)>=_i||Math.abs(f.y-s.current.y)>=_i))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),$i(n,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function $t(...e){return p.useMemo(()=>or(...e),[...e])}function Ni(e,t,r,n){let o=He(r);p.useEffect(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)},[e,t,n])}function uf(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),i=Math.max(0,e-o);r.style(n,"paddingRight",`${i}px`)}}}function cf(){return Fi()?{before({doc:e,d:t,meta:r}){function n(o){return r.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=Fe();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:f}=new URL(l.href),u=e.querySelector(f);u&&!n(u)&&(a=u)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let l=s.target;for(;l.parentElement&&n(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(n(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function ff(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function df(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ve=Oi(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Fe(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:df(r)},o=[cf(),uf(),ff()];o.forEach(({before:i})=>i==null?void 0:i(n)),o.forEach(({after:i})=>i==null?void 0:i(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ve.subscribe(()=>{let e=Ve.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ve.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ve.dispatch("TEARDOWN",r)}});function pf(e,t,r=()=>({containers:[]})){let n=Ai(Ve),o=t?n.get(t):void 0,i=o?o.count>0:!1;return ne(()=>{if(!(!t||!e))return Ve.dispatch("PUSH",t,r),()=>Ve.dispatch("POP",t,r)},[e,t]),i}function mf(e,t,r=()=>[document.body]){let n=ut(e,"scroll-lock");pf(n,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],r]}})}function yf(e=0){let[t,r]=p.useState(e),n=p.useCallback(l=>r(l),[t]),o=p.useCallback(l=>r(f=>f|l),[t]),i=p.useCallback(l=>(t&l)===l,[t]),a=p.useCallback(l=>r(f=>f&~l),[r]),s=p.useCallback(l=>r(f=>f^l),[r]);return{flags:t,setFlag:n,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var Mi,Ri;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Mi=process==null?void 0:process.env)==null?void 0:Mi.NODE_ENV)==="test"&&typeof((Ri=Element==null?void 0:Element.prototype)==null?void 0:Ri.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
43
- `)),[]});var hf=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(hf||{});function vf(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function gf(e,t,r,n){let[o,i]=p.useState(r),{hasFlag:a,addFlag:s,removeFlag:l}=yf(e&&o?3:0),f=p.useRef(!1),u=p.useRef(!1),h=mn();return ne(()=>{var v;if(e){if(r&&i(!0),!t){r&&s(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,r),bf(t,{inFlight:f,prepare(){u.current?u.current=!1:u.current=f.current,f.current=!0,!u.current&&(r?(s(3),l(4)):(s(4),l(2)))},run(){u.current?r?(l(3),s(4)):(l(4),s(3)):r?l(1):s(1)},done(){var g;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,l(7),r||i(!1),(g=n==null?void 0:n.end)==null||g.call(n,r))}})}},[e,r,t,h]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function bf(e,{prepare:t,run:r,done:n,inFlight:o}){let i=Fe();return Ef(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{r(),i.requestAnimationFrame(()=>{i.add(wf(e,n))})}),i.dispose}function wf(e,t){var r,n;let o=Fe();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let a=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(s=>s instanceof CSSTransition))!=null?n:[];return a.length===0?(t(),o.dispose):(Promise.allSettled(a.map(s=>s.finished)).then(()=>{i||t()}),o.dispose)}function Ef(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function En(e,t){let r=p.useRef([]),n=q(e);p.useEffect(()=>{let o=[...r.current];for(let[i,a]of t.entries())if(r.current[i]!==a){let s=n(t,o);return r.current=t,s}},[n,...t])}let cr=p.createContext(null);cr.displayName="OpenClosedContext";var me=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(me||{});function fr(){return p.useContext(cr)}function Sf({value:e,children:t}){return p.createElement(cr.Provider,{value:e},t)}function xf({children:e}){return p.createElement(cr.Provider,{value:null},e)}function Of(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ne=[];Of(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Ne[0]===t.target)return;let r=t.target;r=r.closest(ur),Ne.unshift(r??t.target),Ne=Ne.filter(n=>n!=null&&n.isConnected),Ne.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Di(e){let t=q(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,ir(()=>{r.current&&t()})}),[t])}function Af(){let e=typeof document>"u";return"useSyncExternalStore"in pt?(t=>t.useSyncExternalStore)(pt)(()=>()=>{},()=>!1,()=>!e):!1}function _t(){let e=Af(),[t,r]=pt.useState(We.isHandoffComplete);return t&&We.isHandoffComplete===!1&&r(!1),pt.useEffect(()=>{t!==!0&&r(!0)},[t]),pt.useEffect(()=>We.handoff(),[]),e?!1:t}let Ii=p.createContext(!1);function Tf(){return p.useContext(Ii)}function Li(e){return p.createElement(Ii.Provider,{value:e.force},e.children)}function Pf(e){let t=Tf(),r=p.useContext(ji),n=$t(e),[o,i]=p.useState(()=>{var a;if(!t&&r!==null)return(a=r.current)!=null?a:null;if(We.isServer)return null;let s=n==null?void 0:n.getElementById("headlessui-portal-root");if(s)return s;if(n===null)return null;let l=n.createElement("div");return l.setAttribute("id","headlessui-portal-root"),n.body.appendChild(l)});return p.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),p.useEffect(()=>{t||r!==null&&i(r.current)},[r,i,t]),o}let ki=p.Fragment,Cf=se(function(e,t){let r=e,n=p.useRef(null),o=be(kc(u=>{n.current=u}),t),i=$t(n),a=Pf(n),[s]=p.useState(()=>{var u;return We.isServer?null:(u=i==null?void 0:i.createElement("div"))!=null?u:null}),l=p.useContext(Sn),f=_t();return ne(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),ne(()=>{if(s&&l)return l.register(s)},[l,s]),Di(()=>{var u;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((u=a.parentElement)==null||u.removeChild(a)))}),f?!a||!s?null:ya.createPortal(fe({ourProps:{ref:o},theirProps:r,slot:{},defaultTag:ki,name:"Portal"}),s):null});function Ff(e,t){let r=be(t),{enabled:n=!0,...o}=e;return n?p.createElement(Cf,{...o,ref:r}):fe({ourProps:{ref:r},theirProps:o,slot:{},defaultTag:ki,name:"Portal"})}let $f=p.Fragment,ji=p.createContext(null);function _f(e,t){let{target:r,...n}=e,o={ref:be(t)};return p.createElement(ji.Provider,{value:r},fe({ourProps:o,theirProps:n,defaultTag:$f,name:"Popover.Group"}))}let Sn=p.createContext(null);function Nf(){let e=p.useContext(Sn),t=p.useRef([]),r=q(i=>(t.current.push(i),e&&e.register(i),()=>n(i))),n=q(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=p.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,p.useMemo(()=>function({children:i}){return p.createElement(Sn.Provider,{value:o},i)},[o])]}let Mf=se(Ff),Bi=se(_f),Rf=Object.assign(Mf,{Group:Bi});function Df(e,t=typeof document<"u"?document.defaultView:null,r){let n=ut(e,"escape");Ni(t,"keydown",o=>{n&&(o.defaultPrevented||o.key===xi.Escape&&r(o))})}function If(){var e;let[t]=p.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=p.useState((e=t==null?void 0:t.matches)!=null?e:!1);return ne(()=>{if(!t)return;function o(i){n(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),r}function Lf({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=$t(r),o=q(()=>{var i,a;let s=[];for(let l of e)l!==null&&(l instanceof HTMLElement?s.push(l):"current"in l&&l.current instanceof HTMLElement&&s.push(l.current));if(t!=null&&t.current)for(let l of t.current)s.push(l);for(let l of(i=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?i:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(r&&(l.contains(r)||l.contains((a=r==null?void 0:r.getRootNode())==null?void 0:a.host))||s.some(f=>l.contains(f))||s.push(l));return s});return{resolveContainers:o,contains:q(i=>o().some(a=>a.contains(i)))}}let Ui=p.createContext(null);function Wi({children:e,node:t}){let[r,n]=p.useState(null),o=Hi(t??r);return p.createElement(Ui.Provider,{value:o},e,o===null&&p.createElement(vn,{features:lr.Hidden,ref:i=>{var a,s;if(i){for(let l of(s=(a=or(i))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(i)){n(l);break}}}}))}function Hi(e=null){var t;return(t=p.useContext(Ui))!=null?t:e}function xn(){let e=p.useRef(!1);return ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Nt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Nt||{});function kf(){let e=p.useRef(0);return $i(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function qi(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let jf="div";var ze=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(ze||{});function Bf(e,t){let r=p.useRef(null),n=be(r,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;_t()||(s=0);let f=$t(r);qf(s,{ownerDocument:f});let u=Vf(s,{ownerDocument:f,container:r,initialFocus:o,initialFocusFallback:i});zf(s,{ownerDocument:f,container:r,containers:a,previousActiveElement:u});let h=kf(),v=q(w=>{let S=r.current;S&&(x=>x())(()=>{$e(h.current,{[Nt.Forwards]:()=>{Ct(S,Se.First,{skipElements:[w.relatedTarget,i]})},[Nt.Backwards]:()=>{Ct(S,Se.Last,{skipElements:[w.relatedTarget,i]})}})})}),g=ut(!!(s&2),"focus-trap#tab-lock"),c=mn(),m=p.useRef(!1),y={ref:n,onKeyDown(w){w.key=="Tab"&&(m.current=!0,c.requestAnimationFrame(()=>{m.current=!1}))},onBlur(w){if(!(s&4))return;let S=qi(a);r.current instanceof HTMLElement&&S.add(r.current);let x=w.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&(Vi(S,x)||(m.current?Ct(r.current,$e(h.current,{[Nt.Forwards]:()=>Se.Next,[Nt.Backwards]:()=>Se.Previous})|Se.WrapAround,{relativeTo:w.target}):w.target instanceof HTMLElement&&xe(w.target)))}};return p.createElement(p.Fragment,null,g&&p.createElement(vn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:lr.Focusable}),fe({ourProps:y,theirProps:l,defaultTag:jf,name:"FocusTrap"}),g&&p.createElement(vn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:lr.Focusable}))}let Uf=se(Bf),Wf=Object.assign(Uf,{features:ze});function Hf(e=!0){let t=p.useRef(Ne.slice());return En(([r],[n])=>{n===!0&&r===!1&&ir(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=Ne.slice())},[e,Ne,t]),q(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function qf(e,{ownerDocument:t}){let r=!!(e&8),n=Hf(r);En(()=>{r||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&xe(n())},[r]),Di(()=>{r&&xe(n())})}function Vf(e,{ownerDocument:t,container:r,initialFocus:n,initialFocusFallback:o}){let i=p.useRef(null),a=ut(!!(e&1),"focus-trap#initial-focus"),s=xn();return En(()=>{if(e===0)return;if(!a){o!=null&&o.current&&xe(o.current);return}let l=r.current;l&&ir(()=>{if(!s.current)return;let f=t==null?void 0:t.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===f){i.current=f;return}}else if(l.contains(f)){i.current=f;return}if(n!=null&&n.current)xe(n.current);else{if(e&16){if(Ct(l,Se.First|Se.AutoFocus)!==wn.Error)return}else if(Ct(l,Se.First)!==wn.Error)return;if(o!=null&&o.current&&(xe(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,a,e]),i}function zf(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:o}){let i=xn(),a=!!(e&4);Ni(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=qi(n);r.current instanceof HTMLElement&&l.add(r.current);let f=o.current;if(!f)return;let u=s.target;u&&u instanceof HTMLElement?Vi(l,u)?(o.current=u,xe(u)):(s.preventDefault(),s.stopPropagation(),xe(f)):xe(o.current)},!0)}function Vi(e,t){for(let r of e)if(r.contains(t))return!0;return!1}function zi(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Ki)!==p.Fragment||p.Children.count(e.children)===1}let dr=p.createContext(null);dr.displayName="TransitionContext";var Gf=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Gf||{});function Kf(){let e=p.useContext(dr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Jf(){let e=p.useContext(pr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let pr=p.createContext(null);pr.displayName="NestingContext";function mr(e){return"children"in e?mr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Gi(e,t){let r=He(e),n=p.useRef([]),o=xn(),i=mn(),a=q((g,c=_e.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===g);m!==-1&&($e(c,{[_e.Unmount](){n.current.splice(m,1)},[_e.Hidden](){n.current[m].state="hidden"}}),i.microTask(()=>{var y;!mr(n)&&o.current&&((y=r.current)==null||y.call(r))}))}),s=q(g=>{let c=n.current.find(({el:m})=>m===g);return c?c.state!=="visible"&&(c.state="visible"):n.current.push({el:g,state:"visible"}),()=>a(g,_e.Unmount)}),l=p.useRef([]),f=p.useRef(Promise.resolve()),u=p.useRef({enter:[],leave:[]}),h=q((g,c,m)=>{l.current.splice(0),t&&(t.chains.current[c]=t.chains.current[c].filter(([y])=>y!==g)),t==null||t.chains.current[c].push([g,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[c].push([g,new Promise(y=>{Promise.all(u.current[c].map(([w,S])=>S)).then(()=>y())})]),c==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(c)):m(c)}),v=q((g,c,m)=>{Promise.all(u.current[c].splice(0).map(([y,w])=>w)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>m(c))});return p.useMemo(()=>({children:n,register:s,unregister:a,onStart:h,onStop:v,wait:f,chains:u}),[s,a,n,h,v,u,f])}let Ki=p.Fragment,Ji=ar.RenderStrategy;function Yf(e,t){var r,n;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:f,enterFrom:u,enterTo:h,entered:v,leave:g,leaveFrom:c,leaveTo:m,...y}=e,[w,S]=p.useState(null),x=p.useRef(null),O=zi(e),T=be(...O?[x,t,S]:t===null?[]:[t]),P=(r=y.unmount)==null||r?_e.Unmount:_e.Hidden,{show:_,appear:j,initial:H}=Kf(),[I,X]=p.useState(_?"visible":"hidden"),Z=Jf(),{register:C,unregister:L}=Z;ne(()=>C(x),[C,x]),ne(()=>{if(P===_e.Hidden&&x.current){if(_&&I!=="visible"){X("visible");return}return $e(I,{hidden:()=>L(x),visible:()=>C(x)})}},[I,x,C,L,_,P]);let K=_t();ne(()=>{if(O&&K&&I==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,I,K,O]);let ce=H&&!j,ye=j&&_&&H,we=p.useRef(!1),re=Gi(()=>{we.current||(X("hidden"),L(x))},Z),U=q(Ke=>{we.current=!0;let Re=Ke?"enter":"leave";re.onStart(x,Re,Ee=>{Ee==="enter"?i==null||i():Ee==="leave"&&(s==null||s())})}),Me=q(Ke=>{let Re=Ke?"enter":"leave";we.current=!1,re.onStop(x,Re,Ee=>{Ee==="enter"?a==null||a():Ee==="leave"&&(l==null||l())}),Re==="leave"&&!mr(re)&&(X("hidden"),L(x))});p.useEffect(()=>{O&&o||(U(_),Me(_))},[_,O,o]);let hr=!(!o||!O||!K||ce),[,ee]=gf(hr,w,_,{start:U,end:Me}),Pn=qe({ref:T,className:((n=yn(y.className,ye&&f,ye&&u,ee.enter&&f,ee.enter&&ee.closed&&u,ee.enter&&!ee.closed&&h,ee.leave&&g,ee.leave&&!ee.closed&&c,ee.leave&&ee.closed&&m,!ee.transition&&_&&v))==null?void 0:n.trim())||void 0,...vf(ee)}),Ge=0;return I==="visible"&&(Ge|=me.Open),I==="hidden"&&(Ge|=me.Closed),ee.enter&&(Ge|=me.Opening),ee.leave&&(Ge|=me.Closing),p.createElement(pr.Provider,{value:re},p.createElement(Sf,{value:Ge},fe({ourProps:Pn,theirProps:y,defaultTag:Ki,features:Ji,visible:I==="visible",name:"Transition.Child"})))}function Xf(e,t){let{show:r,appear:n=!1,unmount:o=!0,...i}=e,a=p.useRef(null),s=zi(e),l=be(...s?[a,t]:t===null?[]:[t]);_t();let f=fr();if(r===void 0&&f!==null&&(r=(f&me.Open)===me.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,h]=p.useState(r?"visible":"hidden"),v=Gi(()=>{r||h("hidden")}),[g,c]=p.useState(!0),m=p.useRef([r]);ne(()=>{g!==!1&&m.current[m.current.length-1]!==r&&(m.current.push(r),c(!1))},[m,r]);let y=p.useMemo(()=>({show:r,appear:n,initial:g}),[r,n,g]);ne(()=>{r?h("visible"):!mr(v)&&a.current!==null&&h("hidden")},[r,v]);let w={unmount:o},S=q(()=>{var O;g&&c(!1),(O=e.beforeEnter)==null||O.call(e)}),x=q(()=>{var O;g&&c(!1),(O=e.beforeLeave)==null||O.call(e)});return p.createElement(pr.Provider,{value:v},p.createElement(dr.Provider,{value:y},fe({ourProps:{...w,as:p.Fragment,children:p.createElement(Yi,{ref:l,...w,...i,beforeEnter:S,beforeLeave:x})},theirProps:{},defaultTag:p.Fragment,features:Ji,visible:u==="visible",name:"Transition"})))}function Qf(e,t){let r=p.useContext(dr)!==null,n=fr()!==null;return p.createElement(p.Fragment,null,!r&&n?p.createElement(On,{ref:t,...e}):p.createElement(Yi,{ref:t,...e}))}let On=se(Xf),Yi=se(Yf),ct=se(Qf),Xi=Object.assign(On,{Child:ct,Root:On});var Zf=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zf||{}),ed=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ed||{});let td={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},An=p.createContext(null);An.displayName="DialogContext";function yr(e){let t=p.useContext(An);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,yr),r}return t}function rd(e,t){return $e(t.type,td,e,t)}let Qi=se(function(e,t){let r=p.useId(),{id:n=`headlessui-dialog-${r}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:f=!1,unmount:u=!1,...h}=e,v=p.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(v.current||(v.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=fr();o===void 0&&g!==null&&(o=(g&me.Open)===me.Open);let c=p.useRef(null),m=be(c,t),y=$t(c),w=o?0:1,[S,x]=p.useReducer(rd,{titleId:null,descriptionId:null,panelRef:p.createRef()}),O=q(()=>i(!1)),T=q(U=>x({type:0,id:U})),P=_t()?w===0:!1,[_,j]=Nf(),H={get current(){var U;return(U=S.panelRef.current)!=null?U:c.current}},I=Hi(),{resolveContainers:X}=Lf({mainTreeNode:I,portals:_,defaultContainers:[H]}),Z=g!==null?(g&me.Closing)===me.Closing:!1;Kc(f||Z?!1:P,{allowed:q(()=>{var U,Me;return[(Me=(U=c.current)==null?void 0:U.closest("[data-headlessui-portal]"))!=null?Me:null]}),disallowed:q(()=>{var U;return[(U=I==null?void 0:I.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),lf(P,X,U=>{U.preventDefault(),O()}),Df(P,y==null?void 0:y.defaultView,U=>{U.preventDefault(),U.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),O()}),mf(f||Z?!1:P,y,X),Jc(P,c,O);let[C,L]=jc(),K=p.useMemo(()=>[{dialogState:w,close:O,setTitleId:T,unmount:u},S],[w,S,O,T,u]),ce=p.useMemo(()=>({open:w===0}),[w]),ye={ref:m,id:n,role:s,tabIndex:-1,"aria-modal":f?void 0:w===0?!0:void 0,"aria-labelledby":S.titleId,"aria-describedby":C,unmount:u},we=!If(),re=ze.None;return P&&!f&&(re|=ze.RestoreFocus,re|=ze.TabLock,l&&(re|=ze.AutoFocus),we&&(re|=ze.InitialFocus)),p.createElement(xf,null,p.createElement(Li,{force:!0},p.createElement(Rf,null,p.createElement(An.Provider,{value:K},p.createElement(Bi,{target:c},p.createElement(Li,{force:!1},p.createElement(L,{slot:ce},p.createElement(j,null,p.createElement(Wf,{initialFocus:a,initialFocusFallback:c,containers:X,features:re},p.createElement(Vc,{value:O},fe({ourProps:ye,theirProps:h,slot:ce,defaultTag:nd,features:od,visible:w===0,name:"Dialog"})))))))))))}),nd="div",od=ar.RenderStrategy|ar.Static;function id(e,t){let{transition:r=!1,open:n,...o}=e,i=fr(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(n!==void 0||r)&&!o.static?p.createElement(Wi,null,p.createElement(Xi,{show:n,transition:r,unmount:o.unmount},p.createElement(Qi,{ref:t,...o}))):p.createElement(Wi,null,p.createElement(Qi,{ref:t,open:n,...o}))}let ad="div";function sd(e,t){let r=p.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:o=!1,...i}=e,[{dialogState:a,unmount:s},l]=yr("Dialog.Panel"),f=be(t,l.panelRef),u=p.useMemo(()=>({open:a===0}),[a]),h=q(g=>{g.stopPropagation()}),v={ref:f,id:n,onClick:h};return p.createElement(o?ct:p.Fragment,{...o?{unmount:s}:{}},fe({ourProps:v,theirProps:i,slot:u,defaultTag:ad,name:"Dialog.Panel"}))}let ld="div";function ud(e,t){let{transition:r=!1,...n}=e,[{dialogState:o,unmount:i}]=yr("Dialog.Backdrop"),a=p.useMemo(()=>({open:o===0}),[o]),s={ref:t,"aria-hidden":!0};return p.createElement(r?ct:p.Fragment,{...r?{unmount:i}:{}},fe({ourProps:s,theirProps:n,slot:a,defaultTag:ld,name:"Dialog.Backdrop"}))}let cd="h2";function fd(e,t){let r=p.useId(),{id:n=`headlessui-dialog-title-${r}`,...o}=e,[{dialogState:i,setTitleId:a}]=yr("Dialog.Title"),s=be(t);p.useEffect(()=>(a(n),()=>a(null)),[n,a]);let l=p.useMemo(()=>({open:i===0}),[i]);return fe({ourProps:{ref:s,id:n},theirProps:o,slot:l,defaultTag:cd,name:"Dialog.Title"})}let dd=se(id),Tn=se(sd);se(ud);let pd=se(fd),md=Object.assign(dd,{Panel:Tn,Title:pd,Description:Hc});function Zi({onClick:e}){return R.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:e,children:[R.jsx("span",{className:"sr-only",children:"Close"}),R.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const yd=({modalContext:e,modalProps:t,children:r})=>R.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:R.jsx("div",{className:nr("im-modal-positioner flex min-h-full justify-center",{"items-start":t.position==="top","items-center":t.position==="center","items-end":t.position==="bottom"}),children:R.jsx(ct,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:e.afterLeave,className:nr("im-modal-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:R.jsxs(Tn,{className:`im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&R.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:R.jsx(Zi,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,modalProps:t}):r]})})})}),hd=({modalContext:e,modalProps:t,children:r})=>R.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:R.jsx("div",{className:nr("im-slideover-positioner flex min-h-full items-center",{"justify-start":t.position==="left","justify-end":t.position==="right"}),children:R.jsx(ct,{enterFrom:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:e.afterLeave,className:nr("im-slideover-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:R.jsxs(Tn,{className:`im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&R.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:R.jsx(Zi,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,modalProps:t}):r]})})})}),ea=p.forwardRef(({name:e,children:t,...r},n)=>{const o=a=>typeof t=="function"?t(a):t,i=p.useRef(null);return p.useImperativeHandle(n,()=>i.current,[i]),R.jsx(dn,{ref:i,name:e,...r,children:({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})=>R.jsx(Xi,{appear:!0,show:h.open??!1,children:R.jsxs(md,{as:"div",className:"im-dialog relative z-20",onClose:()=>v.closeExplicitly?null:s(),"data-inertiaui-modal-id":h.id,"data-inertiaui-modal-index":h.index,children:[h.index===0?R.jsx(ct,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:h.onTopOfStack?R.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):R.jsx("div",{})}):null,h.index>0&&h.onTopOfStack?R.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,v.slideover?R.jsx(hd,{modalContext:h,modalProps:v,children:o({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})}):R.jsx(yd,{modalContext:h,modalProps:v,children:o({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})})]})})})});ea.displayName="Modal";const vd=({href:e,method:t="get",data:r={},as:n="a",fragment:o=null,headers:i={},queryStringArrayFormat:a="brackets",onAfterLeave:s=null,onBlur:l=null,onClose:f=null,onError:u=null,onFocus:h=null,onStart:v=null,onSuccess:g=null,children:c,...m})=>{const[y,w]=p.useState(!1),[S,x]=p.useState(null),{stack:O,visit:T}=rr(),P={},_={};Object.keys(m).forEach(C=>{hi.includes(C)||(C.startsWith("on")&&typeof m[C]=="function"?C.toLowerCase()in window?P[C]=m[C]:_[C]=m[C]:P[C]=m[C])}),p.useEffect(()=>{o&&window.location.hash===`#${o}`&&Z()},[o]);const[j,H]=p.useState(!1);p.useEffect(()=>{S&&(S.onTopOfStack&&j?h==null||h():!S.onTopOfStack&&!j&&(l==null||l()),H(!S.onTopOfStack))},[O]);const I=p.useCallback(C=>{o&&C===0&&(window.location.hash=""),f==null||f()},[f,o]),X=p.useCallback(()=>{x(null),s==null||s()},[s]),Z=p.useCallback(C=>{C==null||C.preventDefault(),!y&&(e.startsWith("#")||(w(!0),v==null||v()),T(e,t,r,i,Ks(xo(m,hi)),()=>I(O.length),X,a).then(L=>{x(L),o&&L.index===0&&(window.location.hash=o),L.registerEventListenersFromProps(_),g==null||g()}).catch(L=>{console.error(L),u==null||u(L)}).finally(()=>w(!1)))},[e,t,r,i,a,m,I,X]);return R.jsx(n,{...P,href:e,onClick:Z,children:typeof c=="function"?c({loading:y}):c})};W.HeadlessModal=dn,W.Modal=ea,W.ModalLink=vd,W.ModalRoot=Fc,W.ModalStackProvider=Cc,W.getConfig=Dn,W.putConfig=ba,W.resetConfig=ga,W.useModalIndex=vi,W.useModalStack=rr,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
42
+ `))}else{let v=u.props,g=v==null?void 0:v.className,c=typeof g=="function"?(...w)=>yn(g(...w),l.className):yn(g,l.className),m=c?{className:c}:{},y=wi(u.props,qe(hn(l,["ref"])));for(let w in h)w in y&&delete h[w];return p.cloneElement(u,Object.assign({},y,h,f,{ref:o(u.ref,f.ref)},m))}return p.createElement(i,Object.assign({},hn(l,["ref"]),i!==p.Fragment&&f,i!==p.Fragment&&h),u)}function Dc(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function wi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...i){let a=r[n];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function se(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qe(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function hn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let Ic="span";var lr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(lr||{});function Lc(e,t){var r;let{features:n=1,...o}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return fe({ourProps:i,theirProps:o,slot:{},defaultTag:Ic,name:"Hidden"})}let vn=se(Lc),Ei=Symbol();function kc(e,t=!0){return Object.assign(e,{[Ei]:t})}function be(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=q(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ei]))?void 0:r}let gn=p.createContext(null);gn.displayName="DescriptionContext";function Si(){let e=p.useContext(gn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Si),t}return e}function jc(){let[e,t]=p.useState([]);return[e.length>0?e.join(" "):void 0,p.useMemo(()=>function(r){let n=q(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=p.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return p.createElement(gn.Provider,{value:o},r.children)},[t])]}let Bc="p";function Uc(e,t){let r=p.useId(),n=Rc(),{id:o=`headlessui-description-${r}`,...i}=e,a=Si(),s=be(t);ne(()=>a.register(o),[o,a.register]);let l=n||!1,f=p.useMemo(()=>({...a.slot,disabled:l}),[a.slot,l]),u={ref:s,...a.props,id:o};return fe({ourProps:u,theirProps:i,slot:f,defaultTag:Bc,name:a.name||"Description"})}let Wc=se(Uc),Hc=Object.assign(Wc,{});var xi=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(xi||{});let qc=p.createContext(()=>{});function Vc({value:e,children:t}){return p.createElement(qc.Provider,{value:e},t)}let zc=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};function Oi(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...i){let a=t[o].call(r,...i);a&&(r=a,n.forEach(s=>s()))}}}function Ai(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Gc=new zc(()=>Oi(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let r=this.slice();return r.splice(t,1),r}}));function ut(e,t){let r=Gc.get(t),n=p.useId(),o=Ai(r);if(ne(()=>{if(e)return r.dispatch("ADD",n),()=>r.dispatch("REMOVE",n)},[r,e]),!e)return!1;let i=o.indexOf(n),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let bn=new Map,Pt=new Map;function Ti(e){var t;let r=(t=Pt.get(e))!=null?t:0;return Pt.set(e,r+1),r!==0?()=>Pi(e):(bn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Pi(e))}function Pi(e){var t;let r=(t=Pt.get(e))!=null?t:1;if(r===1?Pt.delete(e):Pt.set(e,r-1),r!==1)return;let n=bn.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,bn.delete(e))}function Kc(e,{allowed:t,disallowed:r}={}){let n=ut(e,"inert-others");ne(()=>{var o,i;if(!n)return;let a=Fe();for(let l of(o=r==null?void 0:r())!=null?o:[])l&&a.add(Ti(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let f=or(l);if(!f)continue;let u=l.parentElement;for(;u&&u!==f.body;){for(let h of u.children)s.some(v=>h.contains(v))||a.add(Ti(h));u=u.parentElement}}return a.dispose},[n,t,r])}function Jc(e,t,r){let n=He(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&r()});p.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=Fe();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>n.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>n.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,n,e])}let ur=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yc=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var xe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(xe||{}),wn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wn||{}),Xc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Xc||{});function Qc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ur)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Zc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yc)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ci=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ci||{});function ef(e,t=0){var r;return e===((r=or(e))==null?void 0:r.body)?!1:$e(t,{0(){return e.matches(ur)},1(){let n=e;for(;n!==null;){if(n.matches(ur))return!0;n=n.parentElement}return!1}})}var tf=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(tf||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Oe(e){e==null||e.focus({preventScroll:!0})}let rf=["textarea","input"].join(",");function nf(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,rf))!=null?r:!1}function of(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),i=t(n);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ct(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?of(e):e:t&64?Zc(e):Qc(e);o.length>0&&a.length>1&&(a=a.filter(g=>!o.some(c=>c!=null&&"current"in c?(c==null?void 0:c.current)===g:c===g))),n=n??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(n))-1;if(t&4)return Math.max(0,a.indexOf(n))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},u=0,h=a.length,v;do{if(u>=h||u+h<=0)return 0;let g=l+u;if(t&16)g=(g+h)%h;else{if(g<0)return 3;if(g>=h)return 1}v=a[g],v==null||v.focus(f),u+=s}while(v!==i.activeElement);return t&6&&nf(v)&&v.select(),2}function Fi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function af(){return/Android/gi.test(window.navigator.userAgent)}function sf(){return Fi()||af()}function Ft(e,t,r,n){let o=He(r);p.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,n),()=>document.removeEventListener(t,i,n)},[e,t,n])}function $i(e,t,r,n){let o=He(r);p.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,n),()=>window.removeEventListener(t,i,n)},[e,t,n])}const _i=30;function lf(e,t,r){let n=ut(e,"outside-click"),o=He(r),i=p.useCallback(function(l,f){if(l.defaultPrevented)return;let u=f(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let h=function v(g){return typeof g=="function"?v(g()):Array.isArray(g)||g instanceof Set?g:[g]}(t);for(let v of h)if(v!==null&&(v.contains(u)||l.composed&&l.composedPath().includes(v)))return;return!ef(u,Ci.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),a=p.useRef(null);Ft(n,"pointerdown",l=>{var f,u;a.current=((u=(f=l.composedPath)==null?void 0:f.call(l))==null?void 0:u[0])||l.target},!0),Ft(n,"mousedown",l=>{var f,u;a.current=((u=(f=l.composedPath)==null?void 0:f.call(l))==null?void 0:u[0])||l.target},!0),Ft(n,"click",l=>{sf()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=p.useRef({x:0,y:0});Ft(n,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ft(n,"touchend",l=>{let f={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(f.x-s.current.x)>=_i||Math.abs(f.y-s.current.y)>=_i))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),$i(n,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function $t(...e){return p.useMemo(()=>or(...e),[...e])}function Ni(e,t,r,n){let o=He(r);p.useEffect(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)},[e,t,n])}function uf(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),i=Math.max(0,e-o);r.style(n,"paddingRight",`${i}px`)}}}function cf(){return Fi()?{before({doc:e,d:t,meta:r}){function n(o){return r.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=Fe();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:f}=new URL(l.href),u=e.querySelector(f);u&&!n(u)&&(a=u)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let l=s.target;for(;l.parentElement&&n(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(n(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function ff(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function df(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ve=Oi(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Fe(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:df(r)},o=[cf(),uf(),ff()];o.forEach(({before:i})=>i==null?void 0:i(n)),o.forEach(({after:i})=>i==null?void 0:i(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ve.subscribe(()=>{let e=Ve.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ve.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ve.dispatch("TEARDOWN",r)}});function pf(e,t,r=()=>({containers:[]})){let n=Ai(Ve),o=t?n.get(t):void 0,i=o?o.count>0:!1;return ne(()=>{if(!(!t||!e))return Ve.dispatch("PUSH",t,r),()=>Ve.dispatch("POP",t,r)},[e,t]),i}function mf(e,t,r=()=>[document.body]){let n=ut(e,"scroll-lock");pf(n,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],r]}})}function yf(e=0){let[t,r]=p.useState(e),n=p.useCallback(l=>r(l),[t]),o=p.useCallback(l=>r(f=>f|l),[t]),i=p.useCallback(l=>(t&l)===l,[t]),a=p.useCallback(l=>r(f=>f&~l),[r]),s=p.useCallback(l=>r(f=>f^l),[r]);return{flags:t,setFlag:n,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var Mi,Ri;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Mi=process==null?void 0:process.env)==null?void 0:Mi.NODE_ENV)==="test"&&typeof((Ri=Element==null?void 0:Element.prototype)==null?void 0:Ri.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
43
+ `)),[]});var hf=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(hf||{});function vf(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function gf(e,t,r,n){let[o,i]=p.useState(r),{hasFlag:a,addFlag:s,removeFlag:l}=yf(e&&o?3:0),f=p.useRef(!1),u=p.useRef(!1),h=mn();return ne(()=>{var v;if(e){if(r&&i(!0),!t){r&&s(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,r),bf(t,{inFlight:f,prepare(){u.current?u.current=!1:u.current=f.current,f.current=!0,!u.current&&(r?(s(3),l(4)):(s(4),l(2)))},run(){u.current?r?(l(3),s(4)):(l(4),s(3)):r?l(1):s(1)},done(){var g;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,l(7),r||i(!1),(g=n==null?void 0:n.end)==null||g.call(n,r))}})}},[e,r,t,h]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function bf(e,{prepare:t,run:r,done:n,inFlight:o}){let i=Fe();return Ef(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{r(),i.requestAnimationFrame(()=>{i.add(wf(e,n))})}),i.dispose}function wf(e,t){var r,n;let o=Fe();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let a=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(s=>s instanceof CSSTransition))!=null?n:[];return a.length===0?(t(),o.dispose):(Promise.allSettled(a.map(s=>s.finished)).then(()=>{i||t()}),o.dispose)}function Ef(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function En(e,t){let r=p.useRef([]),n=q(e);p.useEffect(()=>{let o=[...r.current];for(let[i,a]of t.entries())if(r.current[i]!==a){let s=n(t,o);return r.current=t,s}},[n,...t])}let cr=p.createContext(null);cr.displayName="OpenClosedContext";var me=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(me||{});function fr(){return p.useContext(cr)}function Sf({value:e,children:t}){return p.createElement(cr.Provider,{value:e},t)}function xf({children:e}){return p.createElement(cr.Provider,{value:null},e)}function Of(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ne=[];Of(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Ne[0]===t.target)return;let r=t.target;r=r.closest(ur),Ne.unshift(r??t.target),Ne=Ne.filter(n=>n!=null&&n.isConnected),Ne.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Di(e){let t=q(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,ir(()=>{r.current&&t()})}),[t])}function Af(){let e=typeof document>"u";return"useSyncExternalStore"in pt?(t=>t.useSyncExternalStore)(pt)(()=>()=>{},()=>!1,()=>!e):!1}function _t(){let e=Af(),[t,r]=pt.useState(We.isHandoffComplete);return t&&We.isHandoffComplete===!1&&r(!1),pt.useEffect(()=>{t!==!0&&r(!0)},[t]),pt.useEffect(()=>We.handoff(),[]),e?!1:t}let Ii=p.createContext(!1);function Tf(){return p.useContext(Ii)}function Li(e){return p.createElement(Ii.Provider,{value:e.force},e.children)}function Pf(e){let t=Tf(),r=p.useContext(ji),n=$t(e),[o,i]=p.useState(()=>{var a;if(!t&&r!==null)return(a=r.current)!=null?a:null;if(We.isServer)return null;let s=n==null?void 0:n.getElementById("headlessui-portal-root");if(s)return s;if(n===null)return null;let l=n.createElement("div");return l.setAttribute("id","headlessui-portal-root"),n.body.appendChild(l)});return p.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),p.useEffect(()=>{t||r!==null&&i(r.current)},[r,i,t]),o}let ki=p.Fragment,Cf=se(function(e,t){let r=e,n=p.useRef(null),o=be(kc(u=>{n.current=u}),t),i=$t(n),a=Pf(n),[s]=p.useState(()=>{var u;return We.isServer?null:(u=i==null?void 0:i.createElement("div"))!=null?u:null}),l=p.useContext(Sn),f=_t();return ne(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),ne(()=>{if(s&&l)return l.register(s)},[l,s]),Di(()=>{var u;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((u=a.parentElement)==null||u.removeChild(a)))}),f?!a||!s?null:ya.createPortal(fe({ourProps:{ref:o},theirProps:r,slot:{},defaultTag:ki,name:"Portal"}),s):null});function Ff(e,t){let r=be(t),{enabled:n=!0,...o}=e;return n?p.createElement(Cf,{...o,ref:r}):fe({ourProps:{ref:r},theirProps:o,slot:{},defaultTag:ki,name:"Portal"})}let $f=p.Fragment,ji=p.createContext(null);function _f(e,t){let{target:r,...n}=e,o={ref:be(t)};return p.createElement(ji.Provider,{value:r},fe({ourProps:o,theirProps:n,defaultTag:$f,name:"Popover.Group"}))}let Sn=p.createContext(null);function Nf(){let e=p.useContext(Sn),t=p.useRef([]),r=q(i=>(t.current.push(i),e&&e.register(i),()=>n(i))),n=q(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=p.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,p.useMemo(()=>function({children:i}){return p.createElement(Sn.Provider,{value:o},i)},[o])]}let Mf=se(Ff),Bi=se(_f),Rf=Object.assign(Mf,{Group:Bi});function Df(e,t=typeof document<"u"?document.defaultView:null,r){let n=ut(e,"escape");Ni(t,"keydown",o=>{n&&(o.defaultPrevented||o.key===xi.Escape&&r(o))})}function If(){var e;let[t]=p.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=p.useState((e=t==null?void 0:t.matches)!=null?e:!1);return ne(()=>{if(!t)return;function o(i){n(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),r}function Lf({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=$t(r),o=q(()=>{var i,a;let s=[];for(let l of e)l!==null&&(l instanceof HTMLElement?s.push(l):"current"in l&&l.current instanceof HTMLElement&&s.push(l.current));if(t!=null&&t.current)for(let l of t.current)s.push(l);for(let l of(i=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?i:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(r&&(l.contains(r)||l.contains((a=r==null?void 0:r.getRootNode())==null?void 0:a.host))||s.some(f=>l.contains(f))||s.push(l));return s});return{resolveContainers:o,contains:q(i=>o().some(a=>a.contains(i)))}}let Ui=p.createContext(null);function Wi({children:e,node:t}){let[r,n]=p.useState(null),o=Hi(t??r);return p.createElement(Ui.Provider,{value:o},e,o===null&&p.createElement(vn,{features:lr.Hidden,ref:i=>{var a,s;if(i){for(let l of(s=(a=or(i))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(i)){n(l);break}}}}))}function Hi(e=null){var t;return(t=p.useContext(Ui))!=null?t:e}function xn(){let e=p.useRef(!1);return ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Nt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Nt||{});function kf(){let e=p.useRef(0);return $i(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function qi(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let jf="div";var ze=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(ze||{});function Bf(e,t){let r=p.useRef(null),n=be(r,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;_t()||(s=0);let f=$t(r);qf(s,{ownerDocument:f});let u=Vf(s,{ownerDocument:f,container:r,initialFocus:o,initialFocusFallback:i});zf(s,{ownerDocument:f,container:r,containers:a,previousActiveElement:u});let h=kf(),v=q(w=>{let S=r.current;S&&(x=>x())(()=>{$e(h.current,{[Nt.Forwards]:()=>{Ct(S,xe.First,{skipElements:[w.relatedTarget,i]})},[Nt.Backwards]:()=>{Ct(S,xe.Last,{skipElements:[w.relatedTarget,i]})}})})}),g=ut(!!(s&2),"focus-trap#tab-lock"),c=mn(),m=p.useRef(!1),y={ref:n,onKeyDown(w){w.key=="Tab"&&(m.current=!0,c.requestAnimationFrame(()=>{m.current=!1}))},onBlur(w){if(!(s&4))return;let S=qi(a);r.current instanceof HTMLElement&&S.add(r.current);let x=w.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&(Vi(S,x)||(m.current?Ct(r.current,$e(h.current,{[Nt.Forwards]:()=>xe.Next,[Nt.Backwards]:()=>xe.Previous})|xe.WrapAround,{relativeTo:w.target}):w.target instanceof HTMLElement&&Oe(w.target)))}};return p.createElement(p.Fragment,null,g&&p.createElement(vn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:lr.Focusable}),fe({ourProps:y,theirProps:l,defaultTag:jf,name:"FocusTrap"}),g&&p.createElement(vn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:lr.Focusable}))}let Uf=se(Bf),Wf=Object.assign(Uf,{features:ze});function Hf(e=!0){let t=p.useRef(Ne.slice());return En(([r],[n])=>{n===!0&&r===!1&&ir(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=Ne.slice())},[e,Ne,t]),q(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function qf(e,{ownerDocument:t}){let r=!!(e&8),n=Hf(r);En(()=>{r||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&Oe(n())},[r]),Di(()=>{r&&Oe(n())})}function Vf(e,{ownerDocument:t,container:r,initialFocus:n,initialFocusFallback:o}){let i=p.useRef(null),a=ut(!!(e&1),"focus-trap#initial-focus"),s=xn();return En(()=>{if(e===0)return;if(!a){o!=null&&o.current&&Oe(o.current);return}let l=r.current;l&&ir(()=>{if(!s.current)return;let f=t==null?void 0:t.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===f){i.current=f;return}}else if(l.contains(f)){i.current=f;return}if(n!=null&&n.current)Oe(n.current);else{if(e&16){if(Ct(l,xe.First|xe.AutoFocus)!==wn.Error)return}else if(Ct(l,xe.First)!==wn.Error)return;if(o!=null&&o.current&&(Oe(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,a,e]),i}function zf(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:o}){let i=xn(),a=!!(e&4);Ni(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=qi(n);r.current instanceof HTMLElement&&l.add(r.current);let f=o.current;if(!f)return;let u=s.target;u&&u instanceof HTMLElement?Vi(l,u)?(o.current=u,Oe(u)):(s.preventDefault(),s.stopPropagation(),Oe(f)):Oe(o.current)},!0)}function Vi(e,t){for(let r of e)if(r.contains(t))return!0;return!1}function zi(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Ki)!==p.Fragment||p.Children.count(e.children)===1}let dr=p.createContext(null);dr.displayName="TransitionContext";var Gf=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Gf||{});function Kf(){let e=p.useContext(dr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Jf(){let e=p.useContext(pr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let pr=p.createContext(null);pr.displayName="NestingContext";function mr(e){return"children"in e?mr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Gi(e,t){let r=He(e),n=p.useRef([]),o=xn(),i=mn(),a=q((g,c=_e.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===g);m!==-1&&($e(c,{[_e.Unmount](){n.current.splice(m,1)},[_e.Hidden](){n.current[m].state="hidden"}}),i.microTask(()=>{var y;!mr(n)&&o.current&&((y=r.current)==null||y.call(r))}))}),s=q(g=>{let c=n.current.find(({el:m})=>m===g);return c?c.state!=="visible"&&(c.state="visible"):n.current.push({el:g,state:"visible"}),()=>a(g,_e.Unmount)}),l=p.useRef([]),f=p.useRef(Promise.resolve()),u=p.useRef({enter:[],leave:[]}),h=q((g,c,m)=>{l.current.splice(0),t&&(t.chains.current[c]=t.chains.current[c].filter(([y])=>y!==g)),t==null||t.chains.current[c].push([g,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[c].push([g,new Promise(y=>{Promise.all(u.current[c].map(([w,S])=>S)).then(()=>y())})]),c==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(c)):m(c)}),v=q((g,c,m)=>{Promise.all(u.current[c].splice(0).map(([y,w])=>w)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>m(c))});return p.useMemo(()=>({children:n,register:s,unregister:a,onStart:h,onStop:v,wait:f,chains:u}),[s,a,n,h,v,u,f])}let Ki=p.Fragment,Ji=ar.RenderStrategy;function Yf(e,t){var r,n;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:f,enterFrom:u,enterTo:h,entered:v,leave:g,leaveFrom:c,leaveTo:m,...y}=e,[w,S]=p.useState(null),x=p.useRef(null),O=zi(e),T=be(...O?[x,t,S]:t===null?[]:[t]),P=(r=y.unmount)==null||r?_e.Unmount:_e.Hidden,{show:_,appear:j,initial:H}=Kf(),[I,X]=p.useState(_?"visible":"hidden"),Z=Jf(),{register:C,unregister:L}=Z;ne(()=>C(x),[C,x]),ne(()=>{if(P===_e.Hidden&&x.current){if(_&&I!=="visible"){X("visible");return}return $e(I,{hidden:()=>L(x),visible:()=>C(x)})}},[I,x,C,L,_,P]);let K=_t();ne(()=>{if(O&&K&&I==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,I,K,O]);let ce=H&&!j,ye=j&&_&&H,we=p.useRef(!1),re=Gi(()=>{we.current||(X("hidden"),L(x))},Z),U=q(Ke=>{we.current=!0;let Re=Ke?"enter":"leave";re.onStart(x,Re,Ee=>{Ee==="enter"?i==null||i():Ee==="leave"&&(s==null||s())})}),Me=q(Ke=>{let Re=Ke?"enter":"leave";we.current=!1,re.onStop(x,Re,Ee=>{Ee==="enter"?a==null||a():Ee==="leave"&&(l==null||l())}),Re==="leave"&&!mr(re)&&(X("hidden"),L(x))});p.useEffect(()=>{O&&o||(U(_),Me(_))},[_,O,o]);let hr=!(!o||!O||!K||ce),[,ee]=gf(hr,w,_,{start:U,end:Me}),Pn=qe({ref:T,className:((n=yn(y.className,ye&&f,ye&&u,ee.enter&&f,ee.enter&&ee.closed&&u,ee.enter&&!ee.closed&&h,ee.leave&&g,ee.leave&&!ee.closed&&c,ee.leave&&ee.closed&&m,!ee.transition&&_&&v))==null?void 0:n.trim())||void 0,...vf(ee)}),Ge=0;return I==="visible"&&(Ge|=me.Open),I==="hidden"&&(Ge|=me.Closed),ee.enter&&(Ge|=me.Opening),ee.leave&&(Ge|=me.Closing),p.createElement(pr.Provider,{value:re},p.createElement(Sf,{value:Ge},fe({ourProps:Pn,theirProps:y,defaultTag:Ki,features:Ji,visible:I==="visible",name:"Transition.Child"})))}function Xf(e,t){let{show:r,appear:n=!1,unmount:o=!0,...i}=e,a=p.useRef(null),s=zi(e),l=be(...s?[a,t]:t===null?[]:[t]);_t();let f=fr();if(r===void 0&&f!==null&&(r=(f&me.Open)===me.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,h]=p.useState(r?"visible":"hidden"),v=Gi(()=>{r||h("hidden")}),[g,c]=p.useState(!0),m=p.useRef([r]);ne(()=>{g!==!1&&m.current[m.current.length-1]!==r&&(m.current.push(r),c(!1))},[m,r]);let y=p.useMemo(()=>({show:r,appear:n,initial:g}),[r,n,g]);ne(()=>{r?h("visible"):!mr(v)&&a.current!==null&&h("hidden")},[r,v]);let w={unmount:o},S=q(()=>{var O;g&&c(!1),(O=e.beforeEnter)==null||O.call(e)}),x=q(()=>{var O;g&&c(!1),(O=e.beforeLeave)==null||O.call(e)});return p.createElement(pr.Provider,{value:v},p.createElement(dr.Provider,{value:y},fe({ourProps:{...w,as:p.Fragment,children:p.createElement(Yi,{ref:l,...w,...i,beforeEnter:S,beforeLeave:x})},theirProps:{},defaultTag:p.Fragment,features:Ji,visible:u==="visible",name:"Transition"})))}function Qf(e,t){let r=p.useContext(dr)!==null,n=fr()!==null;return p.createElement(p.Fragment,null,!r&&n?p.createElement(On,{ref:t,...e}):p.createElement(Yi,{ref:t,...e}))}let On=se(Xf),Yi=se(Yf),ct=se(Qf),Xi=Object.assign(On,{Child:ct,Root:On});var Zf=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zf||{}),ed=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ed||{});let td={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},An=p.createContext(null);An.displayName="DialogContext";function yr(e){let t=p.useContext(An);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,yr),r}return t}function rd(e,t){return $e(t.type,td,e,t)}let Qi=se(function(e,t){let r=p.useId(),{id:n=`headlessui-dialog-${r}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:f=!1,unmount:u=!1,...h}=e,v=p.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(v.current||(v.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=fr();o===void 0&&g!==null&&(o=(g&me.Open)===me.Open);let c=p.useRef(null),m=be(c,t),y=$t(c),w=o?0:1,[S,x]=p.useReducer(rd,{titleId:null,descriptionId:null,panelRef:p.createRef()}),O=q(()=>i(!1)),T=q(U=>x({type:0,id:U})),P=_t()?w===0:!1,[_,j]=Nf(),H={get current(){var U;return(U=S.panelRef.current)!=null?U:c.current}},I=Hi(),{resolveContainers:X}=Lf({mainTreeNode:I,portals:_,defaultContainers:[H]}),Z=g!==null?(g&me.Closing)===me.Closing:!1;Kc(f||Z?!1:P,{allowed:q(()=>{var U,Me;return[(Me=(U=c.current)==null?void 0:U.closest("[data-headlessui-portal]"))!=null?Me:null]}),disallowed:q(()=>{var U;return[(U=I==null?void 0:I.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),lf(P,X,U=>{U.preventDefault(),O()}),Df(P,y==null?void 0:y.defaultView,U=>{U.preventDefault(),U.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),O()}),mf(f||Z?!1:P,y,X),Jc(P,c,O);let[C,L]=jc(),K=p.useMemo(()=>[{dialogState:w,close:O,setTitleId:T,unmount:u},S],[w,S,O,T,u]),ce=p.useMemo(()=>({open:w===0}),[w]),ye={ref:m,id:n,role:s,tabIndex:-1,"aria-modal":f?void 0:w===0?!0:void 0,"aria-labelledby":S.titleId,"aria-describedby":C,unmount:u},we=!If(),re=ze.None;return P&&!f&&(re|=ze.RestoreFocus,re|=ze.TabLock,l&&(re|=ze.AutoFocus),we&&(re|=ze.InitialFocus)),p.createElement(xf,null,p.createElement(Li,{force:!0},p.createElement(Rf,null,p.createElement(An.Provider,{value:K},p.createElement(Bi,{target:c},p.createElement(Li,{force:!1},p.createElement(L,{slot:ce},p.createElement(j,null,p.createElement(Wf,{initialFocus:a,initialFocusFallback:c,containers:X,features:re},p.createElement(Vc,{value:O},fe({ourProps:ye,theirProps:h,slot:ce,defaultTag:nd,features:od,visible:w===0,name:"Dialog"})))))))))))}),nd="div",od=ar.RenderStrategy|ar.Static;function id(e,t){let{transition:r=!1,open:n,...o}=e,i=fr(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(n!==void 0||r)&&!o.static?p.createElement(Wi,null,p.createElement(Xi,{show:n,transition:r,unmount:o.unmount},p.createElement(Qi,{ref:t,...o}))):p.createElement(Wi,null,p.createElement(Qi,{ref:t,open:n,...o}))}let ad="div";function sd(e,t){let r=p.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:o=!1,...i}=e,[{dialogState:a,unmount:s},l]=yr("Dialog.Panel"),f=be(t,l.panelRef),u=p.useMemo(()=>({open:a===0}),[a]),h=q(g=>{g.stopPropagation()}),v={ref:f,id:n,onClick:h};return p.createElement(o?ct:p.Fragment,{...o?{unmount:s}:{}},fe({ourProps:v,theirProps:i,slot:u,defaultTag:ad,name:"Dialog.Panel"}))}let ld="div";function ud(e,t){let{transition:r=!1,...n}=e,[{dialogState:o,unmount:i}]=yr("Dialog.Backdrop"),a=p.useMemo(()=>({open:o===0}),[o]),s={ref:t,"aria-hidden":!0};return p.createElement(r?ct:p.Fragment,{...r?{unmount:i}:{}},fe({ourProps:s,theirProps:n,slot:a,defaultTag:ld,name:"Dialog.Backdrop"}))}let cd="h2";function fd(e,t){let r=p.useId(),{id:n=`headlessui-dialog-title-${r}`,...o}=e,[{dialogState:i,setTitleId:a}]=yr("Dialog.Title"),s=be(t);p.useEffect(()=>(a(n),()=>a(null)),[n,a]);let l=p.useMemo(()=>({open:i===0}),[i]);return fe({ourProps:{ref:s,id:n},theirProps:o,slot:l,defaultTag:cd,name:"Dialog.Title"})}let dd=se(id),Tn=se(sd);se(ud);let pd=se(fd),md=Object.assign(dd,{Panel:Tn,Title:pd,Description:Hc});function Zi({onClick:e}){return R.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:e,children:[R.jsx("span",{className:"sr-only",children:"Close"}),R.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const yd=({modalContext:e,modalProps:t,children:r})=>R.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:R.jsx("div",{className:nr("im-modal-positioner flex min-h-full justify-center",{"items-start":t.position==="top","items-center":t.position==="center","items-end":t.position==="bottom"}),children:R.jsx(ct,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:e.afterLeave,className:nr("im-modal-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:R.jsxs(Tn,{className:`im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&R.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:R.jsx(Zi,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,modalProps:t}):r]})})})}),hd=({modalContext:e,modalProps:t,children:r})=>R.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:R.jsx("div",{className:nr("im-slideover-positioner flex min-h-full items-center",{"justify-start":t.position==="left","justify-end":t.position==="right"}),children:R.jsx(ct,{enterFrom:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:e.afterLeave,className:nr("im-slideover-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:R.jsxs(Tn,{className:`im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&R.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:R.jsx(Zi,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,modalProps:t}):r]})})})}),ea=p.forwardRef(({name:e,children:t,...r},n)=>{const o=a=>typeof t=="function"?t(a):t,i=p.useRef(null);return p.useImperativeHandle(n,()=>i.current,[i]),R.jsx(dn,{ref:i,name:e,...r,children:({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})=>R.jsx(Xi,{appear:!0,show:h.open??!1,children:R.jsxs(md,{as:"div",className:"im-dialog relative z-20",onClose:()=>v.closeExplicitly?null:s(),"data-inertiaui-modal-id":h.id,"data-inertiaui-modal-index":h.index,children:[h.index===0?R.jsx(ct,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:h.onTopOfStack?R.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):R.jsx("div",{})}):null,h.index>0&&h.onTopOfStack?R.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,v.slideover?R.jsx(hd,{modalContext:h,modalProps:v,children:o({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})}):R.jsx(yd,{modalContext:h,modalProps:v,children:o({afterLeave:a,close:s,emit:l,getChildModal:f,getParentModal:u,modalContext:h,modalProps:v,reload:g})})]})})})});ea.displayName="Modal";const vd=({href:e,method:t="get",data:r={},as:n="a",fragment:o=null,headers:i={},queryStringArrayFormat:a="brackets",onAfterLeave:s=null,onBlur:l=null,onClose:f=null,onError:u=null,onFocus:h=null,onStart:v=null,onSuccess:g=null,children:c,...m})=>{const[y,w]=p.useState(!1),[S,x]=p.useState(null),{stack:O,visit:T}=rr(),P={},_={};Object.keys(m).forEach(C=>{hi.includes(C)||(C.startsWith("on")&&typeof m[C]=="function"?C.toLowerCase()in window?P[C]=m[C]:_[C]=m[C]:P[C]=m[C])}),p.useEffect(()=>{o&&window.location.hash===`#${o}`&&Z()},[o]);const[j,H]=p.useState(!1);p.useEffect(()=>{S&&(S.onTopOfStack&&j?h==null||h():!S.onTopOfStack&&!j&&(l==null||l()),H(!S.onTopOfStack))},[O]);const I=p.useCallback(C=>{o&&C===0&&(window.location.hash=""),f==null||f()},[f,o]),X=p.useCallback(()=>{x(null),s==null||s()},[s]),Z=p.useCallback(C=>{C==null||C.preventDefault(),!y&&(e.startsWith("#")||(w(!0),v==null||v()),T(e,t,r,i,Ks(xo(m,hi)),()=>I(O.length),X,a).then(L=>{x(L),o&&L.index===0&&(window.location.hash=o),L.registerEventListenersFromProps(_),g==null||g()}).catch(L=>{console.error(L),u==null||u(L)}).finally(()=>w(!1)))},[e,t,r,i,a,m,I,X]);return R.jsx(n,{...P,href:e,onClick:Z,children:typeof c=="function"?c({loading:y}):c})};W.HeadlessModal=dn,W.Modal=ea,W.ModalLink=vd,W.ModalRoot=Fc,W.ModalStackProvider=Cc,W.getConfig=Dn,W.putConfig=ba,W.resetConfig=ga,W.useModalIndex=vi,W.useModalStack=rr,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inertiaui/modal-react",
3
3
  "author": "Pascal Baljet <pascal@protone.media>",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -54,9 +54,12 @@ const HeadlessModal = forwardRef(({ name, children, ...props }, ref) => {
54
54
  emit: (...args) => modalContext.emit(...args),
55
55
  getChildModal: () => modalContext.getChildModal(),
56
56
  getParentModal: () => modalContext.getParentModal(),
57
+ index: modalContext?.index,
58
+ isOpen: modalContext?.open,
57
59
  modalContext,
58
60
  modalProps,
59
61
  reload: () => modalContext.reload(),
62
+ setOpen: () => modalContext.setOpen(),
60
63
  }),
61
64
  [modalContext],
62
65
  )
@@ -71,9 +74,12 @@ const HeadlessModal = forwardRef(({ name, children, ...props }, ref) => {
71
74
  emit: modalContext.emit,
72
75
  getChildModal: modalContext.getChildModal,
73
76
  getParentModal: modalContext.getParentModal,
77
+ index: modalContext.index,
78
+ isOpen: modalContext.open,
74
79
  modalContext,
75
80
  modalProps,
76
81
  reload: modalContext.reload,
82
+ setOpen: modalContext.setOpen,
77
83
  })
78
84
  : children}
79
85
 
package/src/ModalRoot.jsx CHANGED
@@ -53,6 +53,14 @@ export const ModalStackProvider = ({ children }) => {
53
53
  })
54
54
  }
55
55
 
56
+ setOpen = (open) => {
57
+ if (open) {
58
+ this.open = true
59
+ } else {
60
+ this.close()
61
+ }
62
+ }
63
+
56
64
  close = () => {
57
65
  this.updateStack((prevStack) =>
58
66
  prevStack.map((modal) => {
@@ -70,6 +78,10 @@ export const ModalStackProvider = ({ children }) => {
70
78
  }
71
79
 
72
80
  afterLeave = () => {
81
+ if (this.open) {
82
+ return
83
+ }
84
+
73
85
  this.updateStack((prevStack) =>
74
86
  prevStack.filter((modal) => {
75
87
  if (modal.id !== this.id) {