@olonjs/core 1.0.72 → 1.0.74

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(Ce,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],N):(Ce=typeof globalThis<"u"?globalThis:Ce||self,N(Ce.OlonJsCore={},Ce.React,Ce.ReactRouterDOM,Ce.z,Ce.ReactDOM))})(this,(function(Ce,N,Ye,Oe,gt){"use strict";function yi(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 _=yi(N),Rr=yi(gt),je={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",REQUEST_CLEAN_HTML:"jsonpages:request-clean-html",SEND_CLEAN_HTML:"jsonpages:send-clean-html",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready"};var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xn={exports:{}};/*!
1
+ (function(Ce,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],N):(Ce=typeof globalThis<"u"?globalThis:Ce||self,N(Ce.OlonJsCore={},Ce.React,Ce.ReactRouterDOM,Ce.z,Ce.ReactDOM))})(this,(function(Ce,N,Ze,Oe,bt){"use strict";function Si(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 _=Si(N),Lr=Si(bt),je={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",REQUEST_CLEAN_HTML:"jsonpages:request-clean-html",SEND_CLEAN_HTML:"jsonpages:send-clean-html",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready"};var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qn={exports:{}};/*!
2
2
 
3
3
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
4
4
  <http://stuartk.com/jszip>
@@ -8,8 +8,8 @@
8
8
 
9
9
  JSZip uses the library pako released under the MIT license :
10
10
  https://github.com/nodeca/pako/blob/main/LICENSE
11
- */var ki;function Mc(){return ki||(ki=1,(function(e,t){(function(r){e.exports=r()})(function(){return(function r(n,o,i){function s(c,d){if(!o[c]){if(!n[c]){var u=typeof Lr=="function"&&Lr;if(!d&&u)return u(c,!0);if(a)return a(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var f=o[c]={exports:{}};n[c][0].call(f.exports,function(w){var h=n[c][1][w];return s(h||w)},f,f.exports,r,n,o,i)}return o[c].exports}for(var a=typeof Lr=="function"&&Lr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(r,n,o){var i=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,d,u,m,f,w,h,b=[],g=0,v=l.length,k=v,S=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,u=S?(c=l[g++],d=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),d=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),m=c>>2,f=(3&c)<<4|d>>4,w=1<k?(15&d)<<2|u>>6:64,h=2<k?63&u:64,b.push(a.charAt(m)+a.charAt(f)+a.charAt(w)+a.charAt(h));return b.join("")},o.decode=function(l){var c,d,u,m,f,w,h=0,b=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);h<l.length;)c=a.indexOf(l.charAt(h++))<<2|(m=a.indexOf(l.charAt(h++)))>>4,d=(15&m)<<4|(f=a.indexOf(l.charAt(h++)))>>2,u=(3&f)<<6|(w=a.indexOf(l.charAt(h++))),v[b++]=c,f!==64&&(v[b++]=d),w!==64&&(v[b++]=u);return v}},{"./support":30,"./utils":32}],2:[function(r,n,o){var i=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,u,m,f,w){this.compressedSize=d,this.uncompressedSize=u,this.crc32=m,this.compression=f,this.compressedContent=w}c.prototype={getContentWorker:function(){var d=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),u=this;return d.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,u,m){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(u.compressWorker(m)).pipe(new l("compressedSize")).withStreamInfo("compression",u)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,o){var i=r("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,o){var i=r("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,d,u,m){var f=s,w=m+u;c^=-1;for(var h=m;h<w;h++)c=c>>>8^f[255&(c^d[h])];return-1^c})(0|l,a,a.length,0):(function(c,d,u,m){var f=s,w=m+u;c^=-1;for(var h=m;h<w;h++)c=c>>>8^f[255&(c^d.charCodeAt(h))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(r,n,o){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=i?"uint8array":"array";function d(u,m){l.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=m,this.meta={}}o.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,u.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(m){u.push({data:m,meta:u.meta})}},o.compressWorker=function(u){return new d("Deflate",u)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,o){function i(f,w){var h,b="";for(h=0;h<w;h++)b+=String.fromCharCode(255&f),f>>>=8;return b}function s(f,w,h,b,g,v){var k,S,C=f.file,T=f.compression,A=v!==c.utf8encode,P=a.transformTo("string",v(C.name)),I=a.transformTo("string",c.utf8encode(C.name)),B=C.comment,F=a.transformTo("string",v(B)),E=a.transformTo("string",c.utf8encode(B)),L=I.length!==C.name.length,y=E.length!==B.length,U="",te="",W="",V=C.dir,H=C.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};w&&!h||(oe.crc32=f.crc32,oe.compressedSize=f.compressedSize,oe.uncompressedSize=f.uncompressedSize);var j=0;w&&(j|=8),A||!L&&!y||(j|=2048);var D=0,Q=0;V&&(D|=16),g==="UNIX"?(Q=798,D|=(function(re,ue){var J=re;return re||(J=ue?16893:33204),(65535&J)<<16})(C.unixPermissions,V)):(Q=20,D|=(function(re){return 63&(re||0)})(C.dosPermissions)),k=H.getUTCHours(),k<<=6,k|=H.getUTCMinutes(),k<<=5,k|=H.getUTCSeconds()/2,S=H.getUTCFullYear()-1980,S<<=4,S|=H.getUTCMonth()+1,S<<=5,S|=H.getUTCDate(),L&&(te=i(1,1)+i(d(P),4)+I,U+="up"+i(te.length,2)+te),y&&(W=i(1,1)+i(d(F),4)+E,U+="uc"+i(W.length,2)+W);var G="";return G+=`
12
- \0`,G+=i(j,2),G+=T.magic,G+=i(k,2),G+=i(S,2),G+=i(oe.crc32,4),G+=i(oe.compressedSize,4),G+=i(oe.uncompressedSize,4),G+=i(P.length,2),G+=i(U.length,2),{fileRecord:u.LOCAL_FILE_HEADER+G+P+U,dirRecord:u.CENTRAL_FILE_HEADER+i(Q,2)+G+i(F.length,2)+"\0\0\0\0"+i(D,4)+i(b,4)+P+U+F}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),u=r("../signature");function m(f,w,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=h,this.encodeFileName=b,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,l),m.prototype.push=function(f){var w=f.meta.percent||0,h=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:h?(w+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var w=this.streamFiles&&!f.file.dir;if(w){var h=s(f,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(f){this.accumulate=!1;var w=this.streamFiles&&!f.file.dir,h=s(f,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),w)this.push({data:(function(b){return u.DATA_DESCRIPTOR+i(b.crc32,4)+i(b.compressedSize,4)+i(b.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var f=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var h=this.bytesWritten-f,b=(function(g,v,k,S,C){var T=a.transformTo("string",C(S));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(T.length,2)+T})(this.dirRecords.length,h,f,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(f){this._sources.push(f);var w=this;return f.on("data",function(h){w.processChunk(h)}),f.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),f.on("error",function(h){w.error(h)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(f){var w=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var h=0;h<w.length;h++)try{w[h].error(f)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,w=0;w<f.length;w++)f[w].lock()},n.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,o){var i=r("../compressions"),s=r("./ZipFileWorker");o.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),u=0;try{a.forEach(function(m,f){u++;var w=(function(v,k){var S=v||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(f.options.compression,l.compression),h=f.options.compressionOptions||l.compressionOptions||{},b=f.dir,g=f.date;f._compressWorker(w,h).withStreamInfo("file",{name:m,dir:b,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(d)}),d.entriesCount=u}catch(m){d.error(m)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=r("./object")).loadAsync=r("./load"),i.support=r("./support"),i.defaults=r("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=r("./external"),n.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,o){var i=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function u(m){return new s.Promise(function(f,w){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){w(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}n.exports=function(m,f){var w=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",m,!0,f.optimizedBinaryString,f.base64).then(function(h){var b=new l(f);return b.load(h),b}).then(function(h){var b=[s.Promise.resolve(h)],g=h.files;if(f.checkCRC32)for(var v=0;v<g.length;v++)b.push(u(g[v]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),g=b.files,v=0;v<g.length;v++){var k=g[v],S=k.fileNameStr,C=i.resolve(k.fileNameStr);w.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(w.file(C).unsafeOriginalName=S)}return b.zipComment.length&&(w.comment=b.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,o){var i=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,o){var i=r("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var d=this;a.on("data",function(u,m){d.push(u)||d._helper.pause(),c&&c(m)}).on("error",function(u){d.emit("error",u)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(r,n,o){function i(C,T,A){var P,I=a.getTypeOf(T),B=a.extend(A||{},d);B.date=B.date||new Date,B.compression!==null&&(B.compression=B.compression.toUpperCase()),typeof B.unixPermissions=="string"&&(B.unixPermissions=parseInt(B.unixPermissions,8)),B.unixPermissions&&16384&B.unixPermissions&&(B.dir=!0),B.dosPermissions&&16&B.dosPermissions&&(B.dir=!0),B.dir&&(C=g(C)),B.createFolders&&(P=b(C))&&v.call(this,P,!0);var F=I==="string"&&B.binary===!1&&B.base64===!1;A&&A.binary!==void 0||(B.binary=!F),(T instanceof u&&T.uncompressedSize===0||B.dir||!T||T.length===0)&&(B.base64=!1,B.binary=!0,T="",B.compression="STORE",I="string");var E=null;E=T instanceof u||T instanceof l?T:w.isNode&&w.isStream(T)?new h(C,T):a.prepareContent(C,T,B.binary,B.optimizedBinaryString,B.base64);var L=new m(C,E,B);this.files[C]=L}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),u=r("./compressedObject"),m=r("./zipObject"),f=r("./generate"),w=r("./nodejsUtils"),h=r("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var T=C.lastIndexOf("/");return 0<T?C.substring(0,T):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,T){return T=T!==void 0?T:d.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:T}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var T,A,P;for(T in this.files)P=this.files[T],(A=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&C(A,P)},filter:function(C){var T=[];return this.forEach(function(A,P){C(A,P)&&T.push(P)}),T},file:function(C,T,A){if(arguments.length!==1)return C=this.root+C,i.call(this,C,T,A),this;if(k(C)){var P=C;return this.filter(function(B,F){return!F.dir&&P.test(B)})}var I=this.files[this.root+C];return I&&!I.dir?I:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(I,B){return B.dir&&C.test(I)});var T=this.root+C,A=v.call(this,T),P=this.clone();return P.root=A.name,P},remove:function(C){C=this.root+C;var T=this.files[C];if(T||(C.slice(-1)!=="/"&&(C+="/"),T=this.files[C]),T&&!T.dir)delete this.files[C];else for(var A=this.filter(function(I,B){return B.name.slice(0,C.length)===C}),P=0;P<A.length;P++)delete this.files[A[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var T,A={};try{if((A=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var P=A.comment||this.comment||"";T=f.generateWorker(this,A,P)}catch(I){(T=new l("error")).error(I)}return new c(T,A.type||"string",A.mimeType)},generateAsync:function(C,T){return this.generateInternalStream(C).accumulate(T)},generateNodeStream:function(C,T){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(T)}};n.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,o){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===d&&this.data[m+3]===u)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&d===m[2]&&u===m[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,o){var i=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,o){var i=r("./Uint8ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,o){var i=r("./ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,o){var i=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(u){var m=i.getTypeOf(u);return i.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new c(u):s.uint8array?new d(i.transformTo("uint8array",u)):new a(i.transformTo("array",u)):new l(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,o){var i=r("./GenericWorker"),s=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,o){var i=r("./GenericWorker"),s=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=i.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=i},{}],29:[function(r,n,o){var i=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),u=null;if(c.nodestream)try{u=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(w,h){return new d.Promise(function(b,g){var v=[],k=w._internalType,S=w._outputType,C=w._mimeType;w.on("data",function(T,A){v.push(T),h&&h(A)}).on("error",function(T){v=[],g(T)}).on("end",function(){try{var T=(function(A,P,I){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",P),I);case"base64":return l.encode(P);default:return i.transformTo(A,P)}})(S,(function(A,P){var I,B=0,F=null,E=0;for(I=0;I<P.length;I++)E+=P[I].length;switch(A){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(F=new Uint8Array(E),I=0;I<P.length;I++)F.set(P[I],B),B+=P[I].length;return F;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,v),C);b(T)}catch(A){g(A)}v=[]}).resume()})}function f(w,h,b){var g=h;switch(h){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=h,this._mimeType=b,i.checkSupport(g),this._worker=w.pipe(new s(g)),w.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(w){return m(this,w)},on:function(w,h){var b=this;return w==="data"?this._worker.on(w,function(g){h.call(b,g.data,g.meta)}):this._worker.on(w,function(){i.delay(h,arguments,b)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},w)}},n.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,o){for(var i=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function u(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(w){var h,b,g,v,k,S=w.length,C=0;for(v=0;v<S;v++)(64512&(b=w.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=w.charCodeAt(v+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),v++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(b=w.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=w.charCodeAt(v+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),v++),b<128?h[k++]=b:(b<2048?h[k++]=192|b>>>6:(b<65536?h[k++]=224|b>>>12:(h[k++]=240|b>>>18,h[k++]=128|b>>>12&63),h[k++]=128|b>>>6&63),h[k++]=128|63&b);return h})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(w){var h,b,g,v,k=w.length,S=new Array(2*k);for(h=b=0;h<k;)if((g=w[h++])<128)S[b++]=g;else if(4<(v=c[g]))S[b++]=65533,h+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&h<k;)g=g<<6|63&w[h++],v--;1<v?S[b++]=65533:g<65536?S[b++]=g:(g-=65536,S[b++]=55296|g>>10&1023,S[b++]=56320|1023&g)}return S.length!==b&&(S.subarray?S=S.subarray(0,b):S.length=b),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(u,l),u.prototype.processChunk=function(f){var w=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=w;(w=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),w.set(h,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var b=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+c[v[S]]>k?S:k})(w),g=w;b!==w.length&&(s.uint8array?(g=w.subarray(0,b),this.leftOver=w.subarray(b,w.length)):(g=w.slice(0,b),this.leftOver=w.slice(b,w.length))),this.push({data:o.utf8decode(g),meta:f.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=u,i.inherits(m,l),m.prototype.processChunk=function(f){this.push({data:o.utf8encode(f.data),meta:f.meta})},o.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,o){var i=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(h){return h}function d(h,b){for(var g=0;g<h.length;++g)b[g]=255&h.charCodeAt(g);return b}r("setimmediate"),o.newBlob=function(h,b){o.checkSupport("blob");try{return new Blob([h],{type:b})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(h),g.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(h,b,g){var v=[],k=0,S=h.length;if(S<=g)return String.fromCharCode.apply(null,h);for(;k<S;)b==="array"||b==="nodebuffer"?v.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+g,S)))):v.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+g,S)))),k+=g;return v.join("")},stringifyByChar:function(h){for(var b="",g=0;g<h.length;g++)b+=String.fromCharCode(h[g]);return b},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(h){var b=65536,g=o.getTypeOf(h),v=!0;if(g==="uint8array"?v=u.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=u.applyCanBeUsed.nodebuffer),v)for(;1<b;)try{return u.stringifyByChunk(h,g,b)}catch{b=Math.floor(b/2)}return u.stringifyByChar(h)}function f(h,b){for(var g=0;g<h.length;g++)b[g]=h[g];return b}o.applyFromCharCode=m;var w={};w.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return w.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},w.array={string:m,array:c,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(h)}},w.arraybuffer={string:function(h){return m(new Uint8Array(h))},array:function(h){return f(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:c,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(new Uint8Array(h))}},w.uint8array={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:c,nodebuffer:function(h){return a.newBufferFrom(h)}},w.nodebuffer={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return w.nodebuffer.uint8array(h).buffer},uint8array:function(h){return f(h,new Uint8Array(h.length))},nodebuffer:c},o.transformTo=function(h,b){if(b=b||"",!h)return b;o.checkSupport(h);var g=o.getTypeOf(b);return w[g][h](b)},o.resolve=function(h){for(var b=h.split("/"),g=[],v=0;v<b.length;v++){var k=b[v];k==="."||k===""&&v!==0&&v!==b.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(h)?"nodebuffer":i.uint8array&&h instanceof Uint8Array?"uint8array":i.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(h){if(!i[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(h){var b,g,v="";for(g=0;g<(h||"").length;g++)v+="\\x"+((b=h.charCodeAt(g))<16?"0":"")+b.toString(16).toUpperCase();return v},o.delay=function(h,b,g){setImmediate(function(){h.apply(g||null,b||[])})},o.inherits=function(h,b){function g(){}g.prototype=b.prototype,h.prototype=new g},o.extend=function(){var h,b,g={};for(h=0;h<arguments.length;h++)for(b in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],b)&&g[b]===void 0&&(g[b]=arguments[h][b]);return g},o.prepareContent=function(h,b,g,v,k){return l.Promise.resolve(b).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,T){var A=new FileReader;A.onload=function(P){C(P.target.result)},A.onerror=function(P){T(P.target.error)},A.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):g&&v!==!0&&(S=(function(T){return d(T,i.uint8array?new Uint8Array(T.length):new Array(T.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(u){this.files=[],this.loadOptions=u}d.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(u)+")")}},isSignature:function(u,m){var f=this.reader.index;this.reader.setIndex(u);var w=this.reader.readString(4)===m;return this.reader.setIndex(f),w},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",f=s.transformTo(m,u);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u,m,f,w=this.zip64EndOfCentralSize-44;0<w;)u=this.reader.readInt(2),m=this.reader.readInt(4),f=this.reader.readData(m),this.zip64ExtensibleData[u]={id:u,length:m,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,m;for(u=0;u<this.files.length;u++)m=this.files[u],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(u=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(u<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(u);var m=u;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(u=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var w=m-f;if(0<w)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(u){this.reader=i(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),u=r("./support");function m(f,w){this.options=f,this.loadOptions=w}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var w,h;if(f.skip(22),this.fileNameLength=f.readInt(2),h=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((w=(function(b){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===b)return d[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,w,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var w=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(w),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var w,h,b,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)w=f.readInt(2),h=f.readInt(2),b=f.readData(h),this.extraFields[w]={id:w,length:h,value:b};f.setIndex(g)},handleUTF8:function(){var f=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var h=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var w=i(f.value);return w.readInt(1)!==1||l(this.fileName)!==w.readInt(4)?null:c.utf8decode(w.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var w=i(f.value);return w.readInt(1)!==1||l(this.fileComment)!==w.readInt(4)?null:c.utf8decode(w.readData(f.length-5))}return null}},n.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,o){function i(w,h,b){this.name=w,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=h,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");i.prototype={internalStream:function(w){var h=null,b="string";try{if(!w)throw new Error("No output type specified.");var g=(b=w.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(h=h.pipe(new l.Utf8EncodeWorker)),!v&&g&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(w,h){return this.internalStream(w).accumulate(h)},nodeStream:function(w,h){return this.internalStream(w||"nodebuffer").toNodejsStream(h)},_compressWorker:function(w,h){if(this._data instanceof c&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,w,h)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<u.length;f++)i.prototype[u[f]]=m;n.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,d=new l(w),u=i.document.createTextNode("");d.observe(u,{characterData:!0}),s=function(){u.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var h=i.document.createElement("script");h.onreadystatechange=function(){w(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(w,0)};else{var m=new i.MessageChannel;m.port1.onmessage=w,s=function(){m.port2.postMessage(0)}}var f=[];function w(){var h,b;a=!0;for(var g=f.length;g;){for(b=f,f=[],h=-1;++h<g;)b[h]();g=f.length}a=!1}n.exports=function(h){f.push(h)!==1||a||s()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,o){var i=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function u(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,g!==s&&h(this,g)}function m(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,v,k){i(function(){var S;try{S=v(k)}catch(C){return a.reject(g,C)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function w(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function h(g,v){var k=!1;function S(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var T=b(function(){v(C,S)});T.status==="error"&&S(T.value)}function b(g,v){var k={};try{k.value=g(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(n.exports=u).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},u.prototype.catch=function(g){return this.then(null,g)},u.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===c?g:v,this.outcome):this.queue.push(new m(k,g,v)),k},m.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},m.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},m.prototype.callRejected=function(g){a.reject(this.promise,g)},m.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,v){var k=b(w,v);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)h(g,S);else{g.state=c,g.outcome=v;for(var C=-1,T=g.queue.length;++C<T;)g.queue[C].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(v);return g},u.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},u.reject=function(g){var v=new this(s);return a.reject(v,g)},u.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),T=0,A=-1,P=new this(s);++A<k;)I(g[A],A);return P;function I(B,F){v.resolve(B).then(function(E){C[F]=E,++T!==k||S||(S=!0,a.resolve(P,C))},function(E){S||(S=!0,a.reject(P,E))})}},u.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,T=new this(s);++C<k;)A=g[C],v.resolve(A).then(function(P){S||(S=!0,a.resolve(T,P))},function(P){S||(S=!0,a.reject(T,P))});var A;return T}},{immediate:36}],38:[function(r,n,o){var i={};(0,r("./lib/utils/common").assign)(i,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,o){var i=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,u=0,m=-1,f=0,w=8;function h(g){if(!(this instanceof h))return new h(g);this.options=s.assign({level:m,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==u)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):d.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==u)throw new Error(l[k]);this._dict_set=!0}}function b(g,v){var k=new h(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(g,v){var k,S,C=this.strm,T=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(T),C.next_out=0,C.avail_out=T),(k=i.deflate(C,S))!==1&&k!==u)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===u):S!==2||(this.onEnd(u),!(C.avail_out=0))},h.prototype.onData=function(g){this.chunks.push(g)},h.prototype.onEnd=function(g){g===u&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=h,o.deflate=b,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,b(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,b(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,o){var i=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),u=r("./zlib/gzheader"),m=Object.prototype.toString;function f(h){if(!(this instanceof f))return new f(h);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},h||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||h&&h.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,b.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function w(h,b){var g=new f(b);if(g.push(h,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(h,b){var g,v,k,S,C,T,A=this.strm,P=this.options.chunkSize,I=this.options.dictionary,B=!1;if(this.ended)return!1;v=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof h=="string"?A.input=a.binstring2buf(h):m.call(h)==="[object ArrayBuffer]"?A.input=new Uint8Array(h):A.input=h,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new s.Buf8(P),A.next_out=0,A.avail_out=P),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&I&&(T=typeof I=="string"?a.string2buf(I):m.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,g=i.inflateSetDictionary(this.strm,T)),g===l.Z_BUF_ERROR&&B===!0&&(g=l.Z_OK,B=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);A.next_out&&(A.avail_out!==0&&g!==l.Z_STREAM_END&&(A.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),S=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=S,A.avail_out=P-S,S&&s.arraySet(A.output,A.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(B=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(h){this.chunks.push(h)},f.prototype.onEnd=function(h){h===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},o.Inflate=f,o.inflate=w,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,w(h,b)},o.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var u in d)d.hasOwnProperty(u)&&(l[u]=d[u])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,u,m){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+u),m);else for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){var c,d,u,m,f,w;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(w=new Uint8Array(u),c=m=0,d=l.length;c<d;c++)f=l[c],w.set(f,m),m+=f.length;return w}},a={arraySet:function(l,c,d,u,m){for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(r,n,o){var i=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(u,m){if(m<65537&&(u.subarray&&a||!u.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(u,m));for(var f="",w=0;w<m;w++)f+=String.fromCharCode(u[w]);return f}l[254]=l[254]=1,o.string2buf=function(u){var m,f,w,h,b,g=u.length,v=0;for(h=0;h<g;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(w=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(w-56320),h++),v+=f<128?1:f<2048?2:f<65536?3:4;for(m=new i.Buf8(v),h=b=0;b<v;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(w=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(w-56320),h++),f<128?m[b++]=f:(f<2048?m[b++]=192|f>>>6:(f<65536?m[b++]=224|f>>>12:(m[b++]=240|f>>>18,m[b++]=128|f>>>12&63),m[b++]=128|f>>>6&63),m[b++]=128|63&f);return m},o.buf2binstring=function(u){return d(u,u.length)},o.binstring2buf=function(u){for(var m=new i.Buf8(u.length),f=0,w=m.length;f<w;f++)m[f]=u.charCodeAt(f);return m},o.buf2string=function(u,m){var f,w,h,b,g=m||u.length,v=new Array(2*g);for(f=w=0;f<g;)if((h=u[f++])<128)v[w++]=h;else if(4<(b=l[h]))v[w++]=65533,f+=b-1;else{for(h&=b===2?31:b===3?15:7;1<b&&f<g;)h=h<<6|63&u[f++],b--;1<b?v[w++]=65533:h<65536?v[w++]=h:(h-=65536,v[w++]=55296|h>>10&1023,v[w++]=56320|1023&h)}return d(v,w)},o.utf8border=function(u,m){var f;for((m=m||u.length)>u.length&&(m=u.length),f=m-1;0<=f&&(192&u[f])==128;)f--;return f<0||f===0?m:f+l[u[f]]>m?f:m}},{"./common":41}],43:[function(r,n,o){n.exports=function(i,s,a,l){for(var c=65535&i|0,d=i>>>16&65535|0,u=0;a!==0;){for(a-=u=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--u;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();n.exports=function(s,a,l,c){var d=i,u=c+l;s^=-1;for(var m=c;m<u;m++)s=s>>>8^d[255&(s^a[m])];return-1^s}},{}],46:[function(r,n,o){var i,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),u=0,m=4,f=0,w=-2,h=-1,b=4,g=2,v=8,k=9,S=286,C=30,T=19,A=2*S+1,P=15,I=3,B=258,F=B+I+1,E=42,L=113,y=1,U=2,te=3,W=4;function V(x,K){return x.msg=d[K],K}function H(x){return(x<<1)-(4<x?9:0)}function oe(x){for(var K=x.length;0<=--K;)x[K]=0}function j(x){var K=x.state,Y=K.pending;Y>x.avail_out&&(Y=x.avail_out),Y!==0&&(s.arraySet(x.output,K.pending_buf,K.pending_out,Y,x.next_out),x.next_out+=Y,K.pending_out+=Y,x.total_out+=Y,x.avail_out-=Y,K.pending-=Y,K.pending===0&&(K.pending_out=0))}function D(x,K){a._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,K),x.block_start=x.strstart,j(x.strm)}function Q(x,K){x.pending_buf[x.pending++]=K}function G(x,K){x.pending_buf[x.pending++]=K>>>8&255,x.pending_buf[x.pending++]=255&K}function re(x,K){var Y,O,z=x.max_chain_length,M=x.strstart,q=x.prev_length,ee=x.nice_match,$=x.strstart>x.w_size-F?x.strstart-(x.w_size-F):0,ne=x.window,ce=x.w_mask,se=x.prev,R=x.strstart+B,Z=ne[M+q-1],X=ne[M+q];x.prev_length>=x.good_match&&(z>>=2),ee>x.lookahead&&(ee=x.lookahead);do if(ne[(Y=K)+q]===X&&ne[Y+q-1]===Z&&ne[Y]===ne[M]&&ne[++Y]===ne[M+1]){M+=2,Y++;do;while(ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&M<R);if(O=B-(R-M),M=R-B,q<O){if(x.match_start=K,ee<=(q=O))break;Z=ne[M+q-1],X=ne[M+q]}}while((K=se[K&ce])>$&&--z!=0);return q<=x.lookahead?q:x.lookahead}function ue(x){var K,Y,O,z,M,q,ee,$,ne,ce,se=x.w_size;do{if(z=x.window_size-x.lookahead-x.strstart,x.strstart>=se+(se-F)){for(s.arraySet(x.window,x.window,se,se,0),x.match_start-=se,x.strstart-=se,x.block_start-=se,K=Y=x.hash_size;O=x.head[--K],x.head[K]=se<=O?O-se:0,--Y;);for(K=Y=se;O=x.prev[--K],x.prev[K]=se<=O?O-se:0,--Y;);z+=se}if(x.strm.avail_in===0)break;if(q=x.strm,ee=x.window,$=x.strstart+x.lookahead,ne=z,ce=void 0,ce=q.avail_in,ne<ce&&(ce=ne),Y=ce===0?0:(q.avail_in-=ce,s.arraySet(ee,q.input,q.next_in,ce,$),q.state.wrap===1?q.adler=l(q.adler,ee,ce,$):q.state.wrap===2&&(q.adler=c(q.adler,ee,ce,$)),q.next_in+=ce,q.total_in+=ce,ce),x.lookahead+=Y,x.lookahead+x.insert>=I)for(M=x.strstart-x.insert,x.ins_h=x.window[M],x.ins_h=(x.ins_h<<x.hash_shift^x.window[M+1])&x.hash_mask;x.insert&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[M+I-1])&x.hash_mask,x.prev[M&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=M,M++,x.insert--,!(x.lookahead+x.insert<I)););}while(x.lookahead<F&&x.strm.avail_in!==0)}function J(x,K){for(var Y,O;;){if(x.lookahead<F){if(ue(x),x.lookahead<F&&K===u)return y;if(x.lookahead===0)break}if(Y=0,x.lookahead>=I&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),Y!==0&&x.strstart-Y<=x.w_size-F&&(x.match_length=re(x,Y)),x.match_length>=I)if(O=a._tr_tally(x,x.strstart-x.match_start,x.match_length-I),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=I){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart,--x.match_length!=0;);x.strstart++}else x.strstart+=x.match_length,x.match_length=0,x.ins_h=x.window[x.strstart],x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+1])&x.hash_mask;else O=a._tr_tally(x,0,x.window[x.strstart]),x.lookahead--,x.strstart++;if(O&&(D(x,!1),x.strm.avail_out===0))return y}return x.insert=x.strstart<I-1?x.strstart:I-1,K===m?(D(x,!0),x.strm.avail_out===0?te:W):x.last_lit&&(D(x,!1),x.strm.avail_out===0)?y:U}function ae(x,K){for(var Y,O,z;;){if(x.lookahead<F){if(ue(x),x.lookahead<F&&K===u)return y;if(x.lookahead===0)break}if(Y=0,x.lookahead>=I&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),x.prev_length=x.match_length,x.prev_match=x.match_start,x.match_length=I-1,Y!==0&&x.prev_length<x.max_lazy_match&&x.strstart-Y<=x.w_size-F&&(x.match_length=re(x,Y),x.match_length<=5&&(x.strategy===1||x.match_length===I&&4096<x.strstart-x.match_start)&&(x.match_length=I-1)),x.prev_length>=I&&x.match_length<=x.prev_length){for(z=x.strstart+x.lookahead-I,O=a._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-I),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=z&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),--x.prev_length!=0;);if(x.match_available=0,x.match_length=I-1,x.strstart++,O&&(D(x,!1),x.strm.avail_out===0))return y}else if(x.match_available){if((O=a._tr_tally(x,0,x.window[x.strstart-1]))&&D(x,!1),x.strstart++,x.lookahead--,x.strm.avail_out===0)return y}else x.match_available=1,x.strstart++,x.lookahead--}return x.match_available&&(O=a._tr_tally(x,0,x.window[x.strstart-1]),x.match_available=0),x.insert=x.strstart<I-1?x.strstart:I-1,K===m?(D(x,!0),x.strm.avail_out===0?te:W):x.last_lit&&(D(x,!1),x.strm.avail_out===0)?y:U}function de(x,K,Y,O,z){this.good_length=x,this.max_lazy=K,this.nice_length=Y,this.max_chain=O,this.func=z}function ie(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*A),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*T+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(P+1),this.heap=new s.Buf16(2*S+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function fe(x){var K;return x&&x.state?(x.total_in=x.total_out=0,x.data_type=g,(K=x.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?E:L,x.adler=K.wrap===2?0:1,K.last_flush=u,a._tr_init(K),f):V(x,w)}function me(x){var K=fe(x);return K===f&&(function(Y){Y.window_size=2*Y.w_size,oe(Y.head),Y.max_lazy_match=i[Y.level].max_lazy,Y.good_match=i[Y.level].good_length,Y.nice_match=i[Y.level].nice_length,Y.max_chain_length=i[Y.level].max_chain,Y.strstart=0,Y.block_start=0,Y.lookahead=0,Y.insert=0,Y.match_length=Y.prev_length=I-1,Y.match_available=0,Y.ins_h=0})(x.state),K}function ye(x,K,Y,O,z,M){if(!x)return w;var q=1;if(K===h&&(K=6),O<0?(q=0,O=-O):15<O&&(q=2,O-=16),z<1||k<z||Y!==v||O<8||15<O||K<0||9<K||M<0||b<M)return V(x,w);O===8&&(O=9);var ee=new ie;return(x.state=ee).strm=x,ee.wrap=q,ee.gzhead=null,ee.w_bits=O,ee.w_size=1<<ee.w_bits,ee.w_mask=ee.w_size-1,ee.hash_bits=z+7,ee.hash_size=1<<ee.hash_bits,ee.hash_mask=ee.hash_size-1,ee.hash_shift=~~((ee.hash_bits+I-1)/I),ee.window=new s.Buf8(2*ee.w_size),ee.head=new s.Buf16(ee.hash_size),ee.prev=new s.Buf16(ee.w_size),ee.lit_bufsize=1<<z+6,ee.pending_buf_size=4*ee.lit_bufsize,ee.pending_buf=new s.Buf8(ee.pending_buf_size),ee.d_buf=1*ee.lit_bufsize,ee.l_buf=3*ee.lit_bufsize,ee.level=K,ee.strategy=M,ee.method=Y,me(x)}i=[new de(0,0,0,0,function(x,K){var Y=65535;for(Y>x.pending_buf_size-5&&(Y=x.pending_buf_size-5);;){if(x.lookahead<=1){if(ue(x),x.lookahead===0&&K===u)return y;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var O=x.block_start+Y;if((x.strstart===0||x.strstart>=O)&&(x.lookahead=x.strstart-O,x.strstart=O,D(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-F&&(D(x,!1),x.strm.avail_out===0))return y}return x.insert=0,K===m?(D(x,!0),x.strm.avail_out===0?te:W):(x.strstart>x.block_start&&(D(x,!1),x.strm.avail_out),y)}),new de(4,4,8,4,J),new de(4,5,16,8,J),new de(4,6,32,32,J),new de(4,4,16,16,ae),new de(8,16,32,32,ae),new de(8,16,128,128,ae),new de(8,32,128,256,ae),new de(32,128,258,1024,ae),new de(32,258,258,4096,ae)],o.deflateInit=function(x,K){return ye(x,K,v,15,8,0)},o.deflateInit2=ye,o.deflateReset=me,o.deflateResetKeep=fe,o.deflateSetHeader=function(x,K){return x&&x.state?x.state.wrap!==2?w:(x.state.gzhead=K,f):w},o.deflate=function(x,K){var Y,O,z,M;if(!x||!x.state||5<K||K<0)return x?V(x,w):w;if(O=x.state,!x.output||!x.input&&x.avail_in!==0||O.status===666&&K!==m)return V(x,x.avail_out===0?-5:w);if(O.strm=x,Y=O.last_flush,O.last_flush=K,O.status===E)if(O.wrap===2)x.adler=0,Q(O,31),Q(O,139),Q(O,8),O.gzhead?(Q(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),Q(O,255&O.gzhead.time),Q(O,O.gzhead.time>>8&255),Q(O,O.gzhead.time>>16&255),Q(O,O.gzhead.time>>24&255),Q(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),Q(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(Q(O,255&O.gzhead.extra.length),Q(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(x.adler=c(x.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(Q(O,0),Q(O,0),Q(O,0),Q(O,0),Q(O,0),Q(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),Q(O,3),O.status=L);else{var q=v+(O.w_bits-8<<4)<<8;q|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(q|=32),q+=31-q%31,O.status=L,G(O,q),O.strstart!==0&&(G(O,x.adler>>>16),G(O,65535&x.adler)),x.adler=1}if(O.status===69)if(O.gzhead.extra){for(z=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending!==O.pending_buf_size));)Q(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){z=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending===O.pending_buf_size)){M=1;break}M=O.gzindex<O.gzhead.name.length?255&O.gzhead.name.charCodeAt(O.gzindex++):0,Q(O,M)}while(M!==0);O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),M===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){z=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending===O.pending_buf_size)){M=1;break}M=O.gzindex<O.gzhead.comment.length?255&O.gzhead.comment.charCodeAt(O.gzindex++):0,Q(O,M)}while(M!==0);O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),M===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&j(x),O.pending+2<=O.pending_buf_size&&(Q(O,255&x.adler),Q(O,x.adler>>8&255),x.adler=0,O.status=L)):O.status=L),O.pending!==0){if(j(x),x.avail_out===0)return O.last_flush=-1,f}else if(x.avail_in===0&&H(K)<=H(Y)&&K!==m)return V(x,-5);if(O.status===666&&x.avail_in!==0)return V(x,-5);if(x.avail_in!==0||O.lookahead!==0||K!==u&&O.status!==666){var ee=O.strategy===2?(function($,ne){for(var ce;;){if($.lookahead===0&&(ue($),$.lookahead===0)){if(ne===u)return y;break}if($.match_length=0,ce=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,ce&&(D($,!1),$.strm.avail_out===0))return y}return $.insert=0,ne===m?(D($,!0),$.strm.avail_out===0?te:W):$.last_lit&&(D($,!1),$.strm.avail_out===0)?y:U})(O,K):O.strategy===3?(function($,ne){for(var ce,se,R,Z,X=$.window;;){if($.lookahead<=B){if(ue($),$.lookahead<=B&&ne===u)return y;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=I&&0<$.strstart&&(se=X[R=$.strstart-1])===X[++R]&&se===X[++R]&&se===X[++R]){Z=$.strstart+B;do;while(se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&R<Z);$.match_length=B-(Z-R),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=I?(ce=a._tr_tally($,1,$.match_length-I),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(ce=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),ce&&(D($,!1),$.strm.avail_out===0))return y}return $.insert=0,ne===m?(D($,!0),$.strm.avail_out===0?te:W):$.last_lit&&(D($,!1),$.strm.avail_out===0)?y:U})(O,K):i[O.level].func(O,K);if(ee!==te&&ee!==W||(O.status=666),ee===y||ee===te)return x.avail_out===0&&(O.last_flush=-1),f;if(ee===U&&(K===1?a._tr_align(O):K!==5&&(a._tr_stored_block(O,0,0,!1),K===3&&(oe(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),j(x),x.avail_out===0))return O.last_flush=-1,f}return K!==m?f:O.wrap<=0?1:(O.wrap===2?(Q(O,255&x.adler),Q(O,x.adler>>8&255),Q(O,x.adler>>16&255),Q(O,x.adler>>24&255),Q(O,255&x.total_in),Q(O,x.total_in>>8&255),Q(O,x.total_in>>16&255),Q(O,x.total_in>>24&255)):(G(O,x.adler>>>16),G(O,65535&x.adler)),j(x),0<O.wrap&&(O.wrap=-O.wrap),O.pending!==0?f:1)},o.deflateEnd=function(x){var K;return x&&x.state?(K=x.state.status)!==E&&K!==69&&K!==73&&K!==91&&K!==103&&K!==L&&K!==666?V(x,w):(x.state=null,K===L?V(x,-3):f):w},o.deflateSetDictionary=function(x,K){var Y,O,z,M,q,ee,$,ne,ce=K.length;if(!x||!x.state||(M=(Y=x.state).wrap)===2||M===1&&Y.status!==E||Y.lookahead)return w;for(M===1&&(x.adler=l(x.adler,K,ce,0)),Y.wrap=0,ce>=Y.w_size&&(M===0&&(oe(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),ne=new s.Buf8(Y.w_size),s.arraySet(ne,K,ce-Y.w_size,Y.w_size,0),K=ne,ce=Y.w_size),q=x.avail_in,ee=x.next_in,$=x.input,x.avail_in=ce,x.next_in=0,x.input=K,ue(Y);Y.lookahead>=I;){for(O=Y.strstart,z=Y.lookahead-(I-1);Y.ins_h=(Y.ins_h<<Y.hash_shift^Y.window[O+I-1])&Y.hash_mask,Y.prev[O&Y.w_mask]=Y.head[Y.ins_h],Y.head[Y.ins_h]=O,O++,--z;);Y.strstart=O,Y.lookahead=I-1,ue(Y)}return Y.strstart+=Y.lookahead,Y.block_start=Y.strstart,Y.insert=Y.lookahead,Y.lookahead=0,Y.match_length=Y.prev_length=I-1,Y.match_available=0,x.next_in=ee,x.input=$,x.avail_in=q,Y.wrap=M,f},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,o){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,o){n.exports=function(i,s){var a,l,c,d,u,m,f,w,h,b,g,v,k,S,C,T,A,P,I,B,F,E,L,y,U;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,U=i.output,u=d-(s-i.avail_out),m=d+(i.avail_out-257),f=a.dmax,w=a.wsize,h=a.whave,b=a.wnext,g=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,T=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),P=S[v&T];t:for(;;){if(v>>>=I=P>>>24,k-=I,(I=P>>>16&255)===0)U[d++]=65535&P;else{if(!(16&I)){if((64&I)==0){P=S[(65535&P)+(v&(1<<I)-1)];continue t}if(32&I){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}B=65535&P,(I&=15)&&(k<I&&(v+=y[l++]<<k,k+=8),B+=v&(1<<I)-1,v>>>=I,k-=I),k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),P=C[v&A];r:for(;;){if(v>>>=I=P>>>24,k-=I,!(16&(I=P>>>16&255))){if((64&I)==0){P=C[(65535&P)+(v&(1<<I)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(F=65535&P,k<(I&=15)&&(v+=y[l++]<<k,(k+=8)<I&&(v+=y[l++]<<k,k+=8)),f<(F+=v&(1<<I)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=I,k-=I,(I=d-u)<F){if(h<(I=F-I)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(L=g,(E=0)===b){if(E+=w-I,I<B){for(B-=I;U[d++]=g[E++],--I;);E=d-F,L=U}}else if(b<I){if(E+=w+b-I,(I-=b)<B){for(B-=I;U[d++]=g[E++],--I;);if(E=0,b<B){for(B-=I=b;U[d++]=g[E++],--I;);E=d-F,L=U}}}else if(E+=b-I,I<B){for(B-=I;U[d++]=g[E++],--I;);E=d-F,L=U}for(;2<B;)U[d++]=L[E++],U[d++]=L[E++],U[d++]=L[E++],B-=3;B&&(U[d++]=L[E++],1<B&&(U[d++]=L[E++]))}else{for(E=d-F;U[d++]=U[E++],U[d++]=U[E++],U[d++]=U[E++],2<(B-=3););B&&(U[d++]=U[E++],1<B&&(U[d++]=U[E++]))}break}}break}}while(l<c&&d<m);l-=B=k>>3,v&=(1<<(k-=B<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=d<m?m-d+257:257-(d-m),a.hold=v,a.bits=k}},{}],49:[function(r,n,o){var i=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,u=2,m=0,f=-2,w=1,h=852,b=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var L;return E&&E.state?(L=E.state,E.total_in=E.total_out=L.total=0,E.msg="",L.wrap&&(E.adler=1&L.wrap),L.mode=w,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(h),L.distcode=L.distdyn=new i.Buf32(b),L.sane=1,L.back=-1,m):f}function S(E){var L;return E&&E.state?((L=E.state).wsize=0,L.whave=0,L.wnext=0,k(E)):f}function C(E,L){var y,U;return E&&E.state?(U=E.state,L<0?(y=0,L=-L):(y=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?f:(U.window!==null&&U.wbits!==L&&(U.window=null),U.wrap=y,U.wbits=L,S(E))):f}function T(E,L){var y,U;return E?(U=new v,(E.state=U).window=null,(y=C(E,L))!==m&&(E.state=null),y):f}var A,P,I=!0;function B(E){if(I){var L;for(A=new i.Buf32(512),P=new i.Buf32(32),L=0;L<144;)E.lens[L++]=8;for(;L<256;)E.lens[L++]=9;for(;L<280;)E.lens[L++]=7;for(;L<288;)E.lens[L++]=8;for(c(d,E.lens,0,288,A,0,E.work,{bits:9}),L=0;L<32;)E.lens[L++]=5;c(u,E.lens,0,32,P,0,E.work,{bits:5}),I=!1}E.lencode=A,E.lenbits=9,E.distcode=P,E.distbits=5}function F(E,L,y,U){var te,W=E.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),U>=W.wsize?(i.arraySet(W.window,L,y-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(U<(te=W.wsize-W.wnext)&&(te=U),i.arraySet(W.window,L,y-U,te,W.wnext),(U-=te)?(i.arraySet(W.window,L,y-U,U,0),W.wnext=U,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=te))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return T(E,15)},o.inflateInit2=T,o.inflate=function(E,L){var y,U,te,W,V,H,oe,j,D,Q,G,re,ue,J,ae,de,ie,fe,me,ye,x,K,Y,O,z=0,M=new i.Buf8(4),q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return f;(y=E.state).mode===12&&(y.mode=13),V=E.next_out,te=E.output,oe=E.avail_out,W=E.next_in,U=E.input,H=E.avail_in,j=y.hold,D=y.bits,Q=H,G=oe,K=m;e:for(;;)switch(y.mode){case w:if(y.wrap===0){y.mode=13;break}for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(2&y.wrap&&j===35615){M[y.check=0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0),D=j=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&j)<<8)+(j>>8))%31){E.msg="incorrect header check",y.mode=30;break}if((15&j)!=8){E.msg="unknown compression method",y.mode=30;break}if(D-=4,x=8+(15&(j>>>=4)),y.wbits===0)y.wbits=x;else if(x>y.wbits){E.msg="invalid window size",y.mode=30;break}y.dmax=1<<x,E.adler=y.check=1,y.mode=512&j?10:12,D=j=0;break;case 2:for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(y.flags=j,(255&y.flags)!=8){E.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){E.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=j>>8&1),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0,y.mode=3;case 3:for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.head&&(y.head.time=j),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,M[2]=j>>>16&255,M[3]=j>>>24&255,y.check=a(y.check,M,4,0)),D=j=0,y.mode=4;case 4:for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.head&&(y.head.xflags=255&j,y.head.os=j>>8),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0,y.mode=5;case 5:if(1024&y.flags){for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.length=j,y.head&&(y.head.extra_len=j),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(H<(re=y.length)&&(re=H),re&&(y.head&&(x=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,U,W,re,x)),512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,y.length-=re),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(H===0)break e;for(re=0;x=U[W+re++],y.head&&x&&y.length<65536&&(y.head.name+=String.fromCharCode(x)),x&&re<H;);if(512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,x)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(H===0)break e;for(re=0;x=U[W+re++],y.head&&x&&y.length<65536&&(y.head.comment+=String.fromCharCode(x)),x&&re<H;);if(512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,x)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j!==(65535&y.check)){E.msg="header crc mismatch",y.mode=30;break}D=j=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),E.adler=y.check=0,y.mode=12;break;case 10:for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}E.adler=y.check=g(j),D=j=0,y.mode=11;case 11:if(y.havedict===0)return E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,2;E.adler=y.check=1,y.mode=12;case 12:if(L===5||L===6)break e;case 13:if(y.last){j>>>=7&D,D-=7&D,y.mode=27;break}for(;D<3;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}switch(y.last=1&j,D-=1,3&(j>>>=1)){case 0:y.mode=14;break;case 1:if(B(y),y.mode=20,L!==6)break;j>>>=2,D-=2;break e;case 2:y.mode=17;break;case 3:E.msg="invalid block type",y.mode=30}j>>>=2,D-=2;break;case 14:for(j>>>=7&D,D-=7&D;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if((65535&j)!=(j>>>16^65535)){E.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&j,D=j=0,y.mode=15,L===6)break e;case 15:y.mode=16;case 16:if(re=y.length){if(H<re&&(re=H),oe<re&&(re=oe),re===0)break e;i.arraySet(te,U,W,re,V),H-=re,W+=re,oe-=re,V+=re,y.length-=re;break}y.mode=12;break;case 17:for(;D<14;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(y.nlen=257+(31&j),j>>>=5,D-=5,y.ndist=1+(31&j),j>>>=5,D-=5,y.ncode=4+(15&j),j>>>=4,D-=4,286<y.nlen||30<y.ndist){E.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;D<3;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.lens[q[y.have++]]=7&j,j>>>=3,D-=3}for(;y.have<19;)y.lens[q[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,Y={bits:y.lenbits},K=c(0,y.lens,0,19,y.lencode,0,y.work,Y),y.lenbits=Y.bits,K){E.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;de=(z=y.lencode[j&(1<<y.lenbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(ie<16)j>>>=ae,D-=ae,y.lens[y.have++]=ie;else{if(ie===16){for(O=ae+2;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j>>>=ae,D-=ae,y.have===0){E.msg="invalid bit length repeat",y.mode=30;break}x=y.lens[y.have-1],re=3+(3&j),j>>>=2,D-=2}else if(ie===17){for(O=ae+3;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}D-=ae,x=0,re=3+(7&(j>>>=ae)),j>>>=3,D-=3}else{for(O=ae+7;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}D-=ae,x=0,re=11+(127&(j>>>=ae)),j>>>=7,D-=7}if(y.have+re>y.nlen+y.ndist){E.msg="invalid bit length repeat",y.mode=30;break}for(;re--;)y.lens[y.have++]=x}}if(y.mode===30)break;if(y.lens[256]===0){E.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,Y={bits:y.lenbits},K=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,Y),y.lenbits=Y.bits,K){E.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,Y={bits:y.distbits},K=c(u,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,Y),y.distbits=Y.bits,K){E.msg="invalid distances set",y.mode=30;break}if(y.mode=20,L===6)break e;case 20:y.mode=21;case 21:if(6<=H&&258<=oe){E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,l(E,G),V=E.next_out,te=E.output,oe=E.avail_out,W=E.next_in,U=E.input,H=E.avail_in,j=y.hold,D=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;de=(z=y.lencode[j&(1<<y.lenbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(de&&(240&de)==0){for(fe=ae,me=de,ye=ie;de=(z=y.lencode[ye+((j&(1<<fe+me)-1)>>fe)])>>>16&255,ie=65535&z,!(fe+(ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}j>>>=fe,D-=fe,y.back+=fe}if(j>>>=ae,D-=ae,y.back+=ae,y.length=ie,de===0){y.mode=26;break}if(32&de){y.back=-1,y.mode=12;break}if(64&de){E.msg="invalid literal/length code",y.mode=30;break}y.extra=15&de,y.mode=22;case 22:if(y.extra){for(O=y.extra;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.length+=j&(1<<y.extra)-1,j>>>=y.extra,D-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;de=(z=y.distcode[j&(1<<y.distbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if((240&de)==0){for(fe=ae,me=de,ye=ie;de=(z=y.distcode[ye+((j&(1<<fe+me)-1)>>fe)])>>>16&255,ie=65535&z,!(fe+(ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}j>>>=fe,D-=fe,y.back+=fe}if(j>>>=ae,D-=ae,y.back+=ae,64&de){E.msg="invalid distance code",y.mode=30;break}y.offset=ie,y.extra=15&de,y.mode=24;case 24:if(y.extra){for(O=y.extra;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.offset+=j&(1<<y.extra)-1,j>>>=y.extra,D-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){E.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(re=G-oe,y.offset>re){if((re=y.offset-re)>y.whave&&y.sane){E.msg="invalid distance too far back",y.mode=30;break}ue=re>y.wnext?(re-=y.wnext,y.wsize-re):y.wnext-re,re>y.length&&(re=y.length),J=y.window}else J=te,ue=V-y.offset,re=y.length;for(oe<re&&(re=oe),oe-=re,y.length-=re;te[V++]=J[ue++],--re;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;te[V++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;D<32;){if(H===0)break e;H--,j|=U[W++]<<D,D+=8}if(G-=oe,E.total_out+=G,y.total+=G,G&&(E.adler=y.check=y.flags?a(y.check,te,G,V-G):s(y.check,te,G,V-G)),G=oe,(y.flags?j:g(j))!==y.check){E.msg="incorrect data check",y.mode=30;break}D=j=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j!==(4294967295&y.total)){E.msg="incorrect length check",y.mode=30;break}D=j=0}y.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;case 32:default:return f}return E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,(y.wsize||G!==E.avail_out&&y.mode<30&&(y.mode<27||L!==4))&&F(E,E.output,E.next_out,G-E.avail_out)?(y.mode=31,-4):(Q-=E.avail_in,G-=E.avail_out,E.total_in+=Q,E.total_out+=G,y.total+=G,y.wrap&&G&&(E.adler=y.check=y.flags?a(y.check,te,G,E.next_out-G):s(y.check,te,G,E.next_out-G)),E.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(Q==0&&G===0||L===4)&&K===m&&(K=-5),K)},o.inflateEnd=function(E){if(!E||!E.state)return f;var L=E.state;return L.window&&(L.window=null),E.state=null,m},o.inflateGetHeader=function(E,L){var y;return E&&E.state?(2&(y=E.state).wrap)==0?f:((y.head=L).done=!1,m):f},o.inflateSetDictionary=function(E,L){var y,U=L.length;return E&&E.state?(y=E.state).wrap!==0&&y.mode!==11?f:y.mode===11&&s(1,L,U,0)!==y.check?-3:F(E,L,U,U)?(y.mode=31,-4):(y.havedict=1,m):f},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,o){var i=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,u,m,f,w,h,b,g){var v,k,S,C,T,A,P,I,B,F=g.bits,E=0,L=0,y=0,U=0,te=0,W=0,V=0,H=0,oe=0,j=0,D=null,Q=0,G=new i.Buf16(16),re=new i.Buf16(16),ue=null,J=0;for(E=0;E<=15;E++)G[E]=0;for(L=0;L<f;L++)G[u[m+L]]++;for(te=F,U=15;1<=U&&G[U]===0;U--);if(U<te&&(te=U),U===0)return w[h++]=20971520,w[h++]=20971520,g.bits=1,0;for(y=1;y<U&&G[y]===0;y++);for(te<y&&(te=y),E=H=1;E<=15;E++)if(H<<=1,(H-=G[E])<0)return-1;if(0<H&&(d===0||U!==1))return-1;for(re[1]=0,E=1;E<15;E++)re[E+1]=re[E]+G[E];for(L=0;L<f;L++)u[m+L]!==0&&(b[re[u[m+L]]++]=L);if(A=d===0?(D=ue=b,19):d===1?(D=s,Q-=257,ue=a,J-=257,256):(D=l,ue=c,-1),E=y,T=h,V=L=j=0,S=-1,C=(oe=1<<(W=te))-1,d===1&&852<oe||d===2&&592<oe)return 1;for(;;){for(P=E-V,B=b[L]<A?(I=0,b[L]):b[L]>A?(I=ue[J+b[L]],D[Q+b[L]]):(I=96,0),v=1<<E-V,y=k=1<<W;w[T+(j>>V)+(k-=v)]=P<<24|I<<16|B|0,k!==0;);for(v=1<<E-1;j&v;)v>>=1;if(v!==0?(j&=v-1,j+=v):j=0,L++,--G[E]==0){if(E===U)break;E=u[m+b[L]]}if(te<E&&(j&C)!==S){for(V===0&&(V=te),T+=y,H=1<<(W=E-V);W+V<U&&!((H-=G[W+V])<=0);)W++,H<<=1;if(oe+=1<<W,d===1&&852<oe||d===2&&592<oe)return 1;w[S=j&C]=te<<24|W<<16|T-h|0}}return j!==0&&(w[T+j]=E-V<<24|64<<16|0),g.bits=te,0}},{"../utils/common":41}],51:[function(r,n,o){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,o){var i=r("../utils/common"),s=0,a=1;function l(z){for(var M=z.length;0<=--M;)z[M]=0}var c=0,d=29,u=256,m=u+1+d,f=30,w=19,h=2*m+1,b=15,g=16,v=7,k=256,S=16,C=17,T=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(m+2));l(F);var E=new Array(2*f);l(E);var L=new Array(512);l(L);var y=new Array(256);l(y);var U=new Array(d);l(U);var te,W,V,H=new Array(f);function oe(z,M,q,ee,$){this.static_tree=z,this.extra_bits=M,this.extra_base=q,this.elems=ee,this.max_length=$,this.has_stree=z&&z.length}function j(z,M){this.dyn_tree=z,this.max_code=0,this.stat_desc=M}function D(z){return z<256?L[z]:L[256+(z>>>7)]}function Q(z,M){z.pending_buf[z.pending++]=255&M,z.pending_buf[z.pending++]=M>>>8&255}function G(z,M,q){z.bi_valid>g-q?(z.bi_buf|=M<<z.bi_valid&65535,Q(z,z.bi_buf),z.bi_buf=M>>g-z.bi_valid,z.bi_valid+=q-g):(z.bi_buf|=M<<z.bi_valid&65535,z.bi_valid+=q)}function re(z,M,q){G(z,q[2*M],q[2*M+1])}function ue(z,M){for(var q=0;q|=1&z,z>>>=1,q<<=1,0<--M;);return q>>>1}function J(z,M,q){var ee,$,ne=new Array(b+1),ce=0;for(ee=1;ee<=b;ee++)ne[ee]=ce=ce+q[ee-1]<<1;for($=0;$<=M;$++){var se=z[2*$+1];se!==0&&(z[2*$]=ue(ne[se]++,se))}}function ae(z){var M;for(M=0;M<m;M++)z.dyn_ltree[2*M]=0;for(M=0;M<f;M++)z.dyn_dtree[2*M]=0;for(M=0;M<w;M++)z.bl_tree[2*M]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function de(z){8<z.bi_valid?Q(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function ie(z,M,q,ee){var $=2*M,ne=2*q;return z[$]<z[ne]||z[$]===z[ne]&&ee[M]<=ee[q]}function fe(z,M,q){for(var ee=z.heap[q],$=q<<1;$<=z.heap_len&&($<z.heap_len&&ie(M,z.heap[$+1],z.heap[$],z.depth)&&$++,!ie(M,ee,z.heap[$],z.depth));)z.heap[q]=z.heap[$],q=$,$<<=1;z.heap[q]=ee}function me(z,M,q){var ee,$,ne,ce,se=0;if(z.last_lit!==0)for(;ee=z.pending_buf[z.d_buf+2*se]<<8|z.pending_buf[z.d_buf+2*se+1],$=z.pending_buf[z.l_buf+se],se++,ee===0?re(z,$,M):(re(z,(ne=y[$])+u+1,M),(ce=A[ne])!==0&&G(z,$-=U[ne],ce),re(z,ne=D(--ee),q),(ce=P[ne])!==0&&G(z,ee-=H[ne],ce)),se<z.last_lit;);re(z,k,M)}function ye(z,M){var q,ee,$,ne=M.dyn_tree,ce=M.stat_desc.static_tree,se=M.stat_desc.has_stree,R=M.stat_desc.elems,Z=-1;for(z.heap_len=0,z.heap_max=h,q=0;q<R;q++)ne[2*q]!==0?(z.heap[++z.heap_len]=Z=q,z.depth[q]=0):ne[2*q+1]=0;for(;z.heap_len<2;)ne[2*($=z.heap[++z.heap_len]=Z<2?++Z:0)]=1,z.depth[$]=0,z.opt_len--,se&&(z.static_len-=ce[2*$+1]);for(M.max_code=Z,q=z.heap_len>>1;1<=q;q--)fe(z,ne,q);for($=R;q=z.heap[1],z.heap[1]=z.heap[z.heap_len--],fe(z,ne,1),ee=z.heap[1],z.heap[--z.heap_max]=q,z.heap[--z.heap_max]=ee,ne[2*$]=ne[2*q]+ne[2*ee],z.depth[$]=(z.depth[q]>=z.depth[ee]?z.depth[q]:z.depth[ee])+1,ne[2*q+1]=ne[2*ee+1]=$,z.heap[1]=$++,fe(z,ne,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(X,le){var be,ge,we,Se,Ne,pt,Ge=le.dyn_tree,Zn=le.max_code,Kn=le.stat_desc.static_tree,vi=le.stat_desc.has_stree,wi=le.stat_desc.extra_bits,Gn=le.stat_desc.extra_base,Te=le.stat_desc.max_length,Re=0;for(Se=0;Se<=b;Se++)X.bl_count[Se]=0;for(Ge[2*X.heap[X.heap_max]+1]=0,be=X.heap_max+1;be<h;be++)Te<(Se=Ge[2*Ge[2*(ge=X.heap[be])+1]+1]+1)&&(Se=Te,Re++),Ge[2*ge+1]=Se,Zn<ge||(X.bl_count[Se]++,Ne=0,Gn<=ge&&(Ne=wi[ge-Gn]),pt=Ge[2*ge],X.opt_len+=pt*(Se+Ne),vi&&(X.static_len+=pt*(Kn[2*ge+1]+Ne)));if(Re!==0){do{for(Se=Te-1;X.bl_count[Se]===0;)Se--;X.bl_count[Se]--,X.bl_count[Se+1]+=2,X.bl_count[Te]--,Re-=2}while(0<Re);for(Se=Te;Se!==0;Se--)for(ge=X.bl_count[Se];ge!==0;)Zn<(we=X.heap[--be])||(Ge[2*we+1]!==Se&&(X.opt_len+=(Se-Ge[2*we+1])*Ge[2*we],Ge[2*we+1]=Se),ge--)}})(z,M),J(ne,Z,z.bl_count)}function x(z,M,q){var ee,$,ne=-1,ce=M[1],se=0,R=7,Z=4;for(ce===0&&(R=138,Z=3),M[2*(q+1)+1]=65535,ee=0;ee<=q;ee++)$=ce,ce=M[2*(ee+1)+1],++se<R&&$===ce||(se<Z?z.bl_tree[2*$]+=se:$!==0?($!==ne&&z.bl_tree[2*$]++,z.bl_tree[2*S]++):se<=10?z.bl_tree[2*C]++:z.bl_tree[2*T]++,ne=$,Z=(se=0)===ce?(R=138,3):$===ce?(R=6,3):(R=7,4))}function K(z,M,q){var ee,$,ne=-1,ce=M[1],se=0,R=7,Z=4;for(ce===0&&(R=138,Z=3),ee=0;ee<=q;ee++)if($=ce,ce=M[2*(ee+1)+1],!(++se<R&&$===ce)){if(se<Z)for(;re(z,$,z.bl_tree),--se!=0;);else $!==0?($!==ne&&(re(z,$,z.bl_tree),se--),re(z,S,z.bl_tree),G(z,se-3,2)):se<=10?(re(z,C,z.bl_tree),G(z,se-3,3)):(re(z,T,z.bl_tree),G(z,se-11,7));ne=$,Z=(se=0)===ce?(R=138,3):$===ce?(R=6,3):(R=7,4)}}l(H);var Y=!1;function O(z,M,q,ee){G(z,(c<<1)+(ee?1:0),3),(function($,ne,ce,se){de($),Q($,ce),Q($,~ce),i.arraySet($.pending_buf,$.window,ne,ce,$.pending),$.pending+=ce})(z,M,q)}o._tr_init=function(z){Y||((function(){var M,q,ee,$,ne,ce=new Array(b+1);for($=ee=0;$<d-1;$++)for(U[$]=ee,M=0;M<1<<A[$];M++)y[ee++]=$;for(y[ee-1]=$,$=ne=0;$<16;$++)for(H[$]=ne,M=0;M<1<<P[$];M++)L[ne++]=$;for(ne>>=7;$<f;$++)for(H[$]=ne<<7,M=0;M<1<<P[$]-7;M++)L[256+ne++]=$;for(q=0;q<=b;q++)ce[q]=0;for(M=0;M<=143;)F[2*M+1]=8,M++,ce[8]++;for(;M<=255;)F[2*M+1]=9,M++,ce[9]++;for(;M<=279;)F[2*M+1]=7,M++,ce[7]++;for(;M<=287;)F[2*M+1]=8,M++,ce[8]++;for(J(F,m+1,ce),M=0;M<f;M++)E[2*M+1]=5,E[2*M]=ue(M,5);te=new oe(F,A,u+1,m,b),W=new oe(E,P,0,f,b),V=new oe(new Array(0),I,0,w,v)})(),Y=!0),z.l_desc=new j(z.dyn_ltree,te),z.d_desc=new j(z.dyn_dtree,W),z.bl_desc=new j(z.bl_tree,V),z.bi_buf=0,z.bi_valid=0,ae(z)},o._tr_stored_block=O,o._tr_flush_block=function(z,M,q,ee){var $,ne,ce=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(se){var R,Z=4093624447;for(R=0;R<=31;R++,Z>>>=1)if(1&Z&&se.dyn_ltree[2*R]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(R=32;R<u;R++)if(se.dyn_ltree[2*R]!==0)return a;return s})(z)),ye(z,z.l_desc),ye(z,z.d_desc),ce=(function(se){var R;for(x(se,se.dyn_ltree,se.l_desc.max_code),x(se,se.dyn_dtree,se.d_desc.max_code),ye(se,se.bl_desc),R=w-1;3<=R&&se.bl_tree[2*B[R]+1]===0;R--);return se.opt_len+=3*(R+1)+5+5+4,R})(z),$=z.opt_len+3+7>>>3,(ne=z.static_len+3+7>>>3)<=$&&($=ne)):$=ne=q+5,q+4<=$&&M!==-1?O(z,M,q,ee):z.strategy===4||ne===$?(G(z,2+(ee?1:0),3),me(z,F,E)):(G(z,4+(ee?1:0),3),(function(se,R,Z,X){var le;for(G(se,R-257,5),G(se,Z-1,5),G(se,X-4,4),le=0;le<X;le++)G(se,se.bl_tree[2*B[le]+1],3);K(se,se.dyn_ltree,R-1),K(se,se.dyn_dtree,Z-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,ce+1),me(z,z.dyn_ltree,z.dyn_dtree)),ae(z),ee&&de(z)},o._tr_tally=function(z,M,q){return z.pending_buf[z.d_buf+2*z.last_lit]=M>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&M,z.pending_buf[z.l_buf+z.last_lit]=255&q,z.last_lit++,M===0?z.dyn_ltree[2*q]++:(z.matches++,M--,z.dyn_ltree[2*(y[q]+u+1)]++,z.dyn_dtree[2*D(M)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){G(z,2,3),re(z,k,F),(function(M){M.bi_valid===16?(Q(M,M.bi_buf),M.bi_buf=0,M.bi_valid=0):8<=M.bi_valid&&(M.pending_buf[M.pending++]=255&M.bi_buf,M.bi_buf>>=8,M.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(r,n,o){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,d,u,m=1,f={},w=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(u+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){d.port2.postMessage(S)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(S){var C=h.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(v,0,S)},b.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),T=0;T<C.length;T++)C[T]=arguments[T+1];var A={callback:S,args:C};return f[m]=A,l(m),m++},b.clearImmediate=g}function g(S){delete f[S]}function v(S){if(w)setTimeout(v,0,S);else{var C=f[S];if(C){w=!0;try{(function(T){var A=T.callback,P=T.args;switch(P.length){case 0:A();break;case 1:A(P[0]);break;case 2:A(P[0],P[1]);break;case 3:A(P[0],P[1],P[2]);break;default:A.apply(a,P)}})(C)}finally{g(S),w=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(u)===0&&v(+S.data.slice(u.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xn)),Xn.exports}var Fc=Mc();const Bc=Lc(Fc);var Mr={exports:{}},Uc=Mr.exports,Si;function Wc(){return Si||(Si=1,(function(e,t){(function(r,n){n()})(Uc,function(){function r(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,d,u){var m=new XMLHttpRequest;m.open("GET",c),m.responseType="blob",m.onload=function(){l(m.response,d,u)},m.onerror=function(){console.error("could not download file")},m.send()}function o(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof bt=="object"&&bt.global===bt?bt:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,d,u){var m=s.URL||s.webkitURL,f=document.createElement("a");d=d||c.name||"download",f.download=d,f.rel="noopener",typeof c=="string"?(f.href=c,f.origin===location.origin?i(f):o(f.href)?n(c,d,u):i(f,f.target="_blank")):(f.href=m.createObjectURL(c),setTimeout(function(){m.revokeObjectURL(f.href)},4e4),setTimeout(function(){i(f)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,u){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,u),d);else if(o(c))n(c,d,u);else{var m=document.createElement("a");m.href=c,m.target="_blank",setTimeout(function(){i(m)})}}:function(c,d,u,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof c=="string")return n(c,d,u);var f=c.type==="application/octet-stream",w=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||f&&w||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var k=b.result;k=h?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=k:location=k,m=null},b.readAsDataURL(c)}else{var g=s.URL||s.webkitURL,v=g.createObjectURL(c);m?m.location=v:location.href=v,m=null,setTimeout(function(){g.revokeObjectURL(v)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Mr)),Mr.exports}var _i=Wc();const Ci=async(e,t)=>{const r=new Bc,n=r.folder("config");n==null||n.file("site.json",JSON.stringify(e.site,null,2)),n==null||n.file("theme.json",JSON.stringify(e.theme,null,2)),n==null||n.file("menu.json",JSON.stringify(e.menu,null,2));const o=r.folder("pages");o==null||o.file(`${t}.json`,JSON.stringify(e.page,null,2));const i=await r.generateAsync({type:"blob"});_i.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},Ei=(e,t,r)=>{const{pages:n,...o}=e.site,i={page:e.page,site:o,menu:e.menu,theme:e.theme},a=`<script id="jp-baked-state" type="application/json">${JSON.stringify(i)}<\/script>`,l=r.replace("</head>",`${a}</head>`),c=new Blob([`<!DOCTYPE html>${l}`],{type:"text/html;charset=utf-8"});_i.saveAs(c,`${t}.html`)};function Ni(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=Ni(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function $c(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ni(e))&&(n&&(n+=" "),n+=t);return n}const Hc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Vc=(e,t)=>({classGroupId:e,validator:t}),zi=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Fr="-",Ai=[],Yc="arbitrary..",Zc=e=>{const t=Gc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Kc(s);const a=s.split(Fr),l=a[0]===""&&a.length>1?1:0;return ji(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Hc(c,l):l:c||Ai}return r[s]||Ai}}},ji=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=ji(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Fr):e.slice(t).join(Fr),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},Kc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Yc+n:void 0})(),Gc=e=>{const{theme:t,classGroups:r}=e;return Xc(r,t)},Xc=(e,t)=>{const r=zi();for(const n in e){const o=e[n];qn(o,r,n,t)}return r},qn=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];qc(s,t,r,n)}},qc=(e,t,r,n)=>{if(typeof e=="string"){Jc(e,t,r);return}if(typeof e=="function"){Qc(e,t,r,n);return}ed(e,t,r,n)},Jc=(e,t,r)=>{const n=e===""?t:Ti(t,e);n.classGroupId=r},Qc=(e,t,r,n)=>{if(td(e)){qn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Vc(r,e))},ed=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];qn(l,Ti(t,a),r,n)}},Ti=(e,t)=>{let r=e;const n=t.split(Fr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=zi(),r.nextPart.set(s,a)),r=a}return r},td=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,rd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},Jn="!",Oi=":",nd=[],Pi=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),od=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let h=0;h<d;h++){const b=o[h];if(s===0&&a===0){if(b===Oi){i.push(o.slice(l,h)),l=h+1;continue}if(b==="/"){c=h;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const u=i.length===0?o:o.slice(l);let m=u,f=!1;u.endsWith(Jn)?(m=u.slice(0,-1),f=!0):u.startsWith(Jn)&&(m=u.slice(1),f=!0);const w=c&&c>l?c-l:void 0;return Pi(i,f,m,w)};if(t){const o=t+Oi,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Pi(nd,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},id=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},sd=e=>({cache:rd(e.cacheSize),parseClassName:od(e),sortModifiers:id(e),...Zc(e)}),ad=/\s+/,ld=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(ad);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:w,maybePostfixModifierPosition:h}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let b=!!h,g=n(b?w.substring(0,h):w);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=n(w),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const v=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=f?v+Jn:v,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(g,b);for(let T=0;T<C.length;++T){const A=C[T];s.push(k+A)}l=d+(l.length>0?" "+l:l)}return l},cd=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ii(r))&&(o&&(o+=" "),o+=n);return o},Ii=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ii(e[n]))&&(r&&(r+=" "),r+=t);return r},dd=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,u)=>u(d),e());return r=sd(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=ld(l,r);return o(l,d),d};return i=s,(...l)=>i(cd(...l))},ud=[],Pe=e=>{const t=r=>r[e]||ud;return t.isThemeGetter=!0,t},Di=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ri=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fd=/^\d+\/\d+$/,hd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,md=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dt=e=>fd.test(e),xe=e=>!!e&&!Number.isNaN(Number(e)),vt=e=>!!e&&Number.isInteger(Number(e)),Qn=e=>e.endsWith("%")&&xe(e.slice(0,-1)),dt=e=>hd.test(e),vd=()=>!0,wd=e=>pd.test(e)&&!md.test(e),Li=()=>!1,xd=e=>gd.test(e),yd=e=>bd.test(e),kd=e=>!he(e)&&!pe(e),Sd=e=>Rt(e,Wi,Li),he=e=>Di.test(e),jt=e=>Rt(e,$i,wd),eo=e=>Rt(e,zd,xe),Mi=e=>Rt(e,Bi,Li),_d=e=>Rt(e,Ui,yd),Br=e=>Rt(e,Hi,xd),pe=e=>Ri.test(e),lr=e=>Lt(e,$i),Cd=e=>Lt(e,Ad),Fi=e=>Lt(e,Bi),Ed=e=>Lt(e,Wi),Nd=e=>Lt(e,Ui),Ur=e=>Lt(e,Hi,!0),Rt=(e,t,r)=>{const n=Di.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lt=(e,t,r=!1)=>{const n=Ri.exec(e);return n?n[1]?t(n[1]):r:!1},Bi=e=>e==="position"||e==="percentage",Ui=e=>e==="image"||e==="url",Wi=e=>e==="length"||e==="size"||e==="bg-size",$i=e=>e==="length",zd=e=>e==="number",Ad=e=>e==="family-name",Hi=e=>e==="shadow",jd=dd(()=>{const e=Pe("color"),t=Pe("font"),r=Pe("text"),n=Pe("font-weight"),o=Pe("tracking"),i=Pe("leading"),s=Pe("breakpoint"),a=Pe("container"),l=Pe("spacing"),c=Pe("radius"),d=Pe("shadow"),u=Pe("inset-shadow"),m=Pe("text-shadow"),f=Pe("drop-shadow"),w=Pe("blur"),h=Pe("perspective"),b=Pe("aspect"),g=Pe("ease"),v=Pe("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),pe,he],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],P=()=>[pe,he,l],I=()=>[Dt,"full","auto",...P()],B=()=>[vt,"none","subgrid",pe,he],F=()=>["auto",{span:["full",vt,pe,he]},vt,pe,he],E=()=>[vt,"auto",pe,he],L=()=>["auto","min","max","fr",pe,he],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...P()],W=()=>[Dt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],V=()=>[e,pe,he],H=()=>[...S(),Fi,Mi,{position:[pe,he]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Ed,Sd,{size:[pe,he]}],D=()=>[Qn,lr,jt],Q=()=>["","none","full",c,pe,he],G=()=>["",xe,lr,jt],re=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[xe,Qn,Fi,Mi],ae=()=>["","none",w,pe,he],de=()=>["none",xe,pe,he],ie=()=>["none",xe,pe,he],fe=()=>[xe,pe,he],me=()=>[Dt,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dt],breakpoint:[dt],color:[vd],container:[dt],"drop-shadow":[dt],ease:["in","out","in-out"],font:[kd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dt],shadow:[dt],spacing:["px",xe],text:[dt],"text-shadow":[dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dt,he,pe,b]}],container:["container"],columns:[{columns:[xe,he,pe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",pe,he]}],basis:[{basis:[Dt,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Dt,"auto","initial","none",he]}],grow:[{grow:["",xe,pe,he]}],shrink:[{shrink:["",xe,pe,he]}],order:[{order:[vt,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,lr,jt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,pe,eo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qn,he]}],"font-family":[{font:[Cd,he,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,pe,he]}],"line-clamp":[{"line-clamp":[xe,"none",pe,eo]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",pe,jt]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[xe,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,pe,he],radial:["",pe,he],conic:[vt,pe,he]},Nd,_d]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,pe,he]}],"outline-w":[{outline:["",xe,lr,jt]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,Ur,Br]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",u,Ur,Br]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[xe,jt]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,Ur,Br]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[xe,pe,he]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:ae()}],brightness:[{brightness:[xe,pe,he]}],contrast:[{contrast:[xe,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Ur,Br]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",xe,pe,he]}],"hue-rotate":[{"hue-rotate":[xe,pe,he]}],invert:[{invert:["",xe,pe,he]}],saturate:[{saturate:[xe,pe,he]}],sepia:[{sepia:["",xe,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[xe,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[xe,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",xe,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[xe,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[xe,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xe,"initial",pe,he]}],ease:[{ease:["linear","initial",g,pe,he]}],delay:[{delay:[xe,pe,he]}],animate:[{animate:["none",v,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,pe,he]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,he]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[xe,lr,jt,eo]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ve(...e){return jd($c(e))}var Wr={exports:{}},cr={};/**
11
+ */var _i;function Uc(){return _i||(_i=1,(function(e,t){(function(r){e.exports=r()})(function(){return(function r(n,o,i){function s(c,d){if(!o[c]){if(!n[c]){var u=typeof Mr=="function"&&Mr;if(!d&&u)return u(c,!0);if(a)return a(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var f=o[c]={exports:{}};n[c][0].call(f.exports,function(w){var h=n[c][1][w];return s(h||w)},f,f.exports,r,n,o,i)}return o[c].exports}for(var a=typeof Mr=="function"&&Mr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(r,n,o){var i=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,d,u,m,f,w,h,b=[],g=0,v=l.length,k=v,S=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,u=S?(c=l[g++],d=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),d=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),m=c>>2,f=(3&c)<<4|d>>4,w=1<k?(15&d)<<2|u>>6:64,h=2<k?63&u:64,b.push(a.charAt(m)+a.charAt(f)+a.charAt(w)+a.charAt(h));return b.join("")},o.decode=function(l){var c,d,u,m,f,w,h=0,b=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);h<l.length;)c=a.indexOf(l.charAt(h++))<<2|(m=a.indexOf(l.charAt(h++)))>>4,d=(15&m)<<4|(f=a.indexOf(l.charAt(h++)))>>2,u=(3&f)<<6|(w=a.indexOf(l.charAt(h++))),v[b++]=c,f!==64&&(v[b++]=d),w!==64&&(v[b++]=u);return v}},{"./support":30,"./utils":32}],2:[function(r,n,o){var i=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,u,m,f,w){this.compressedSize=d,this.uncompressedSize=u,this.crc32=m,this.compression=f,this.compressedContent=w}c.prototype={getContentWorker:function(){var d=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),u=this;return d.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,u,m){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(u.compressWorker(m)).pipe(new l("compressedSize")).withStreamInfo("compression",u)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,o){var i=r("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,o){var i=r("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,d,u,m){var f=s,w=m+u;c^=-1;for(var h=m;h<w;h++)c=c>>>8^f[255&(c^d[h])];return-1^c})(0|l,a,a.length,0):(function(c,d,u,m){var f=s,w=m+u;c^=-1;for(var h=m;h<w;h++)c=c>>>8^f[255&(c^d.charCodeAt(h))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(r,n,o){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=i?"uint8array":"array";function d(u,m){l.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=m,this.meta={}}o.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,u.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(m){u.push({data:m,meta:u.meta})}},o.compressWorker=function(u){return new d("Deflate",u)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,o){function i(f,w){var h,b="";for(h=0;h<w;h++)b+=String.fromCharCode(255&f),f>>>=8;return b}function s(f,w,h,b,g,v){var k,S,C=f.file,T=f.compression,A=v!==c.utf8encode,P=a.transformTo("string",v(C.name)),I=a.transformTo("string",c.utf8encode(C.name)),B=C.comment,F=a.transformTo("string",v(B)),E=a.transformTo("string",c.utf8encode(B)),L=I.length!==C.name.length,y=E.length!==B.length,U="",te="",W="",V=C.dir,H=C.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};w&&!h||(oe.crc32=f.crc32,oe.compressedSize=f.compressedSize,oe.uncompressedSize=f.uncompressedSize);var j=0;w&&(j|=8),A||!L&&!y||(j|=2048);var D=0,Q=0;V&&(D|=16),g==="UNIX"?(Q=798,D|=(function(re,ue){var J=re;return re||(J=ue?16893:33204),(65535&J)<<16})(C.unixPermissions,V)):(Q=20,D|=(function(re){return 63&(re||0)})(C.dosPermissions)),k=H.getUTCHours(),k<<=6,k|=H.getUTCMinutes(),k<<=5,k|=H.getUTCSeconds()/2,S=H.getUTCFullYear()-1980,S<<=4,S|=H.getUTCMonth()+1,S<<=5,S|=H.getUTCDate(),L&&(te=i(1,1)+i(d(P),4)+I,U+="up"+i(te.length,2)+te),y&&(W=i(1,1)+i(d(F),4)+E,U+="uc"+i(W.length,2)+W);var G="";return G+=`
12
+ \0`,G+=i(j,2),G+=T.magic,G+=i(k,2),G+=i(S,2),G+=i(oe.crc32,4),G+=i(oe.compressedSize,4),G+=i(oe.uncompressedSize,4),G+=i(P.length,2),G+=i(U.length,2),{fileRecord:u.LOCAL_FILE_HEADER+G+P+U,dirRecord:u.CENTRAL_FILE_HEADER+i(Q,2)+G+i(F.length,2)+"\0\0\0\0"+i(D,4)+i(b,4)+P+U+F}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),u=r("../signature");function m(f,w,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=h,this.encodeFileName=b,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,l),m.prototype.push=function(f){var w=f.meta.percent||0,h=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:h?(w+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var w=this.streamFiles&&!f.file.dir;if(w){var h=s(f,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(f){this.accumulate=!1;var w=this.streamFiles&&!f.file.dir,h=s(f,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),w)this.push({data:(function(b){return u.DATA_DESCRIPTOR+i(b.crc32,4)+i(b.compressedSize,4)+i(b.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var f=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var h=this.bytesWritten-f,b=(function(g,v,k,S,C){var T=a.transformTo("string",C(S));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(T.length,2)+T})(this.dirRecords.length,h,f,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(f){this._sources.push(f);var w=this;return f.on("data",function(h){w.processChunk(h)}),f.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),f.on("error",function(h){w.error(h)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(f){var w=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var h=0;h<w.length;h++)try{w[h].error(f)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,w=0;w<f.length;w++)f[w].lock()},n.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,o){var i=r("../compressions"),s=r("./ZipFileWorker");o.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),u=0;try{a.forEach(function(m,f){u++;var w=(function(v,k){var S=v||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(f.options.compression,l.compression),h=f.options.compressionOptions||l.compressionOptions||{},b=f.dir,g=f.date;f._compressWorker(w,h).withStreamInfo("file",{name:m,dir:b,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(d)}),d.entriesCount=u}catch(m){d.error(m)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=r("./object")).loadAsync=r("./load"),i.support=r("./support"),i.defaults=r("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=r("./external"),n.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,o){var i=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function u(m){return new s.Promise(function(f,w){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){w(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}n.exports=function(m,f){var w=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",m,!0,f.optimizedBinaryString,f.base64).then(function(h){var b=new l(f);return b.load(h),b}).then(function(h){var b=[s.Promise.resolve(h)],g=h.files;if(f.checkCRC32)for(var v=0;v<g.length;v++)b.push(u(g[v]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),g=b.files,v=0;v<g.length;v++){var k=g[v],S=k.fileNameStr,C=i.resolve(k.fileNameStr);w.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(w.file(C).unsafeOriginalName=S)}return b.zipComment.length&&(w.comment=b.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,o){var i=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,o){var i=r("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var d=this;a.on("data",function(u,m){d.push(u)||d._helper.pause(),c&&c(m)}).on("error",function(u){d.emit("error",u)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(r,n,o){function i(C,T,A){var P,I=a.getTypeOf(T),B=a.extend(A||{},d);B.date=B.date||new Date,B.compression!==null&&(B.compression=B.compression.toUpperCase()),typeof B.unixPermissions=="string"&&(B.unixPermissions=parseInt(B.unixPermissions,8)),B.unixPermissions&&16384&B.unixPermissions&&(B.dir=!0),B.dosPermissions&&16&B.dosPermissions&&(B.dir=!0),B.dir&&(C=g(C)),B.createFolders&&(P=b(C))&&v.call(this,P,!0);var F=I==="string"&&B.binary===!1&&B.base64===!1;A&&A.binary!==void 0||(B.binary=!F),(T instanceof u&&T.uncompressedSize===0||B.dir||!T||T.length===0)&&(B.base64=!1,B.binary=!0,T="",B.compression="STORE",I="string");var E=null;E=T instanceof u||T instanceof l?T:w.isNode&&w.isStream(T)?new h(C,T):a.prepareContent(C,T,B.binary,B.optimizedBinaryString,B.base64);var L=new m(C,E,B);this.files[C]=L}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),u=r("./compressedObject"),m=r("./zipObject"),f=r("./generate"),w=r("./nodejsUtils"),h=r("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var T=C.lastIndexOf("/");return 0<T?C.substring(0,T):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,T){return T=T!==void 0?T:d.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:T}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var T,A,P;for(T in this.files)P=this.files[T],(A=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&C(A,P)},filter:function(C){var T=[];return this.forEach(function(A,P){C(A,P)&&T.push(P)}),T},file:function(C,T,A){if(arguments.length!==1)return C=this.root+C,i.call(this,C,T,A),this;if(k(C)){var P=C;return this.filter(function(B,F){return!F.dir&&P.test(B)})}var I=this.files[this.root+C];return I&&!I.dir?I:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(I,B){return B.dir&&C.test(I)});var T=this.root+C,A=v.call(this,T),P=this.clone();return P.root=A.name,P},remove:function(C){C=this.root+C;var T=this.files[C];if(T||(C.slice(-1)!=="/"&&(C+="/"),T=this.files[C]),T&&!T.dir)delete this.files[C];else for(var A=this.filter(function(I,B){return B.name.slice(0,C.length)===C}),P=0;P<A.length;P++)delete this.files[A[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var T,A={};try{if((A=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var P=A.comment||this.comment||"";T=f.generateWorker(this,A,P)}catch(I){(T=new l("error")).error(I)}return new c(T,A.type||"string",A.mimeType)},generateAsync:function(C,T){return this.generateInternalStream(C).accumulate(T)},generateNodeStream:function(C,T){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(T)}};n.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,o){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===d&&this.data[m+3]===u)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),u=a.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&d===m[2]&&u===m[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,o){var i=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,o){var i=r("./Uint8ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,o){var i=r("./ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,o){var i=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(u){var m=i.getTypeOf(u);return i.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new c(u):s.uint8array?new d(i.transformTo("uint8array",u)):new a(i.transformTo("array",u)):new l(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,o){var i=r("./GenericWorker"),s=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,o){var i=r("./GenericWorker"),s=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=i.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=i},{}],29:[function(r,n,o){var i=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),u=null;if(c.nodestream)try{u=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(w,h){return new d.Promise(function(b,g){var v=[],k=w._internalType,S=w._outputType,C=w._mimeType;w.on("data",function(T,A){v.push(T),h&&h(A)}).on("error",function(T){v=[],g(T)}).on("end",function(){try{var T=(function(A,P,I){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",P),I);case"base64":return l.encode(P);default:return i.transformTo(A,P)}})(S,(function(A,P){var I,B=0,F=null,E=0;for(I=0;I<P.length;I++)E+=P[I].length;switch(A){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(F=new Uint8Array(E),I=0;I<P.length;I++)F.set(P[I],B),B+=P[I].length;return F;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,v),C);b(T)}catch(A){g(A)}v=[]}).resume()})}function f(w,h,b){var g=h;switch(h){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=h,this._mimeType=b,i.checkSupport(g),this._worker=w.pipe(new s(g)),w.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(w){return m(this,w)},on:function(w,h){var b=this;return w==="data"?this._worker.on(w,function(g){h.call(b,g.data,g.meta)}):this._worker.on(w,function(){i.delay(h,arguments,b)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},w)}},n.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,o){for(var i=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function u(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(w){var h,b,g,v,k,S=w.length,C=0;for(v=0;v<S;v++)(64512&(b=w.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=w.charCodeAt(v+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),v++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(b=w.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=w.charCodeAt(v+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),v++),b<128?h[k++]=b:(b<2048?h[k++]=192|b>>>6:(b<65536?h[k++]=224|b>>>12:(h[k++]=240|b>>>18,h[k++]=128|b>>>12&63),h[k++]=128|b>>>6&63),h[k++]=128|63&b);return h})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(w){var h,b,g,v,k=w.length,S=new Array(2*k);for(h=b=0;h<k;)if((g=w[h++])<128)S[b++]=g;else if(4<(v=c[g]))S[b++]=65533,h+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&h<k;)g=g<<6|63&w[h++],v--;1<v?S[b++]=65533:g<65536?S[b++]=g:(g-=65536,S[b++]=55296|g>>10&1023,S[b++]=56320|1023&g)}return S.length!==b&&(S.subarray?S=S.subarray(0,b):S.length=b),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(u,l),u.prototype.processChunk=function(f){var w=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=w;(w=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),w.set(h,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var b=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+c[v[S]]>k?S:k})(w),g=w;b!==w.length&&(s.uint8array?(g=w.subarray(0,b),this.leftOver=w.subarray(b,w.length)):(g=w.slice(0,b),this.leftOver=w.slice(b,w.length))),this.push({data:o.utf8decode(g),meta:f.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=u,i.inherits(m,l),m.prototype.processChunk=function(f){this.push({data:o.utf8encode(f.data),meta:f.meta})},o.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,o){var i=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(h){return h}function d(h,b){for(var g=0;g<h.length;++g)b[g]=255&h.charCodeAt(g);return b}r("setimmediate"),o.newBlob=function(h,b){o.checkSupport("blob");try{return new Blob([h],{type:b})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(h),g.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(h,b,g){var v=[],k=0,S=h.length;if(S<=g)return String.fromCharCode.apply(null,h);for(;k<S;)b==="array"||b==="nodebuffer"?v.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+g,S)))):v.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+g,S)))),k+=g;return v.join("")},stringifyByChar:function(h){for(var b="",g=0;g<h.length;g++)b+=String.fromCharCode(h[g]);return b},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(h){var b=65536,g=o.getTypeOf(h),v=!0;if(g==="uint8array"?v=u.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=u.applyCanBeUsed.nodebuffer),v)for(;1<b;)try{return u.stringifyByChunk(h,g,b)}catch{b=Math.floor(b/2)}return u.stringifyByChar(h)}function f(h,b){for(var g=0;g<h.length;g++)b[g]=h[g];return b}o.applyFromCharCode=m;var w={};w.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return w.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},w.array={string:m,array:c,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(h)}},w.arraybuffer={string:function(h){return m(new Uint8Array(h))},array:function(h){return f(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:c,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(new Uint8Array(h))}},w.uint8array={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:c,nodebuffer:function(h){return a.newBufferFrom(h)}},w.nodebuffer={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return w.nodebuffer.uint8array(h).buffer},uint8array:function(h){return f(h,new Uint8Array(h.length))},nodebuffer:c},o.transformTo=function(h,b){if(b=b||"",!h)return b;o.checkSupport(h);var g=o.getTypeOf(b);return w[g][h](b)},o.resolve=function(h){for(var b=h.split("/"),g=[],v=0;v<b.length;v++){var k=b[v];k==="."||k===""&&v!==0&&v!==b.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(h)?"nodebuffer":i.uint8array&&h instanceof Uint8Array?"uint8array":i.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(h){if(!i[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(h){var b,g,v="";for(g=0;g<(h||"").length;g++)v+="\\x"+((b=h.charCodeAt(g))<16?"0":"")+b.toString(16).toUpperCase();return v},o.delay=function(h,b,g){setImmediate(function(){h.apply(g||null,b||[])})},o.inherits=function(h,b){function g(){}g.prototype=b.prototype,h.prototype=new g},o.extend=function(){var h,b,g={};for(h=0;h<arguments.length;h++)for(b in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],b)&&g[b]===void 0&&(g[b]=arguments[h][b]);return g},o.prepareContent=function(h,b,g,v,k){return l.Promise.resolve(b).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,T){var A=new FileReader;A.onload=function(P){C(P.target.result)},A.onerror=function(P){T(P.target.error)},A.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):g&&v!==!0&&(S=(function(T){return d(T,i.uint8array?new Uint8Array(T.length):new Array(T.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(u){this.files=[],this.loadOptions=u}d.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(u)+")")}},isSignature:function(u,m){var f=this.reader.index;this.reader.setIndex(u);var w=this.reader.readString(4)===m;return this.reader.setIndex(f),w},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",f=s.transformTo(m,u);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u,m,f,w=this.zip64EndOfCentralSize-44;0<w;)u=this.reader.readInt(2),m=this.reader.readInt(4),f=this.reader.readData(m),this.zip64ExtensibleData[u]={id:u,length:m,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,m;for(u=0;u<this.files.length;u++)m=this.files[u],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(u=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(u<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(u);var m=u;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(u=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var w=m-f;if(0<w)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(u){this.reader=i(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),u=r("./support");function m(f,w){this.options=f,this.loadOptions=w}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var w,h;if(f.skip(22),this.fileNameLength=f.readInt(2),h=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((w=(function(b){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===b)return d[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,w,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var w=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(w),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var w,h,b,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)w=f.readInt(2),h=f.readInt(2),b=f.readData(h),this.extraFields[w]={id:w,length:h,value:b};f.setIndex(g)},handleUTF8:function(){var f=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var h=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var w=i(f.value);return w.readInt(1)!==1||l(this.fileName)!==w.readInt(4)?null:c.utf8decode(w.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var w=i(f.value);return w.readInt(1)!==1||l(this.fileComment)!==w.readInt(4)?null:c.utf8decode(w.readData(f.length-5))}return null}},n.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,o){function i(w,h,b){this.name=w,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=h,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");i.prototype={internalStream:function(w){var h=null,b="string";try{if(!w)throw new Error("No output type specified.");var g=(b=w.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(h=h.pipe(new l.Utf8EncodeWorker)),!v&&g&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(w,h){return this.internalStream(w).accumulate(h)},nodeStream:function(w,h){return this.internalStream(w||"nodebuffer").toNodejsStream(h)},_compressWorker:function(w,h){if(this._data instanceof c&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,w,h)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<u.length;f++)i.prototype[u[f]]=m;n.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,d=new l(w),u=i.document.createTextNode("");d.observe(u,{characterData:!0}),s=function(){u.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var h=i.document.createElement("script");h.onreadystatechange=function(){w(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(w,0)};else{var m=new i.MessageChannel;m.port1.onmessage=w,s=function(){m.port2.postMessage(0)}}var f=[];function w(){var h,b;a=!0;for(var g=f.length;g;){for(b=f,f=[],h=-1;++h<g;)b[h]();g=f.length}a=!1}n.exports=function(h){f.push(h)!==1||a||s()}}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,o){var i=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function u(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,g!==s&&h(this,g)}function m(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,v,k){i(function(){var S;try{S=v(k)}catch(C){return a.reject(g,C)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function w(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function h(g,v){var k=!1;function S(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var T=b(function(){v(C,S)});T.status==="error"&&S(T.value)}function b(g,v){var k={};try{k.value=g(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(n.exports=u).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},u.prototype.catch=function(g){return this.then(null,g)},u.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===c?g:v,this.outcome):this.queue.push(new m(k,g,v)),k},m.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},m.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},m.prototype.callRejected=function(g){a.reject(this.promise,g)},m.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,v){var k=b(w,v);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)h(g,S);else{g.state=c,g.outcome=v;for(var C=-1,T=g.queue.length;++C<T;)g.queue[C].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(v);return g},u.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},u.reject=function(g){var v=new this(s);return a.reject(v,g)},u.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),T=0,A=-1,P=new this(s);++A<k;)I(g[A],A);return P;function I(B,F){v.resolve(B).then(function(E){C[F]=E,++T!==k||S||(S=!0,a.resolve(P,C))},function(E){S||(S=!0,a.reject(P,E))})}},u.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,T=new this(s);++C<k;)A=g[C],v.resolve(A).then(function(P){S||(S=!0,a.resolve(T,P))},function(P){S||(S=!0,a.reject(T,P))});var A;return T}},{immediate:36}],38:[function(r,n,o){var i={};(0,r("./lib/utils/common").assign)(i,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,o){var i=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,u=0,m=-1,f=0,w=8;function h(g){if(!(this instanceof h))return new h(g);this.options=s.assign({level:m,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==u)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):d.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==u)throw new Error(l[k]);this._dict_set=!0}}function b(g,v){var k=new h(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(g,v){var k,S,C=this.strm,T=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(T),C.next_out=0,C.avail_out=T),(k=i.deflate(C,S))!==1&&k!==u)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===u):S!==2||(this.onEnd(u),!(C.avail_out=0))},h.prototype.onData=function(g){this.chunks.push(g)},h.prototype.onEnd=function(g){g===u&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=h,o.deflate=b,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,b(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,b(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,o){var i=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),u=r("./zlib/gzheader"),m=Object.prototype.toString;function f(h){if(!(this instanceof f))return new f(h);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},h||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||h&&h.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,b.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function w(h,b){var g=new f(b);if(g.push(h,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(h,b){var g,v,k,S,C,T,A=this.strm,P=this.options.chunkSize,I=this.options.dictionary,B=!1;if(this.ended)return!1;v=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof h=="string"?A.input=a.binstring2buf(h):m.call(h)==="[object ArrayBuffer]"?A.input=new Uint8Array(h):A.input=h,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new s.Buf8(P),A.next_out=0,A.avail_out=P),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&I&&(T=typeof I=="string"?a.string2buf(I):m.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,g=i.inflateSetDictionary(this.strm,T)),g===l.Z_BUF_ERROR&&B===!0&&(g=l.Z_OK,B=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);A.next_out&&(A.avail_out!==0&&g!==l.Z_STREAM_END&&(A.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),S=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=S,A.avail_out=P-S,S&&s.arraySet(A.output,A.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(B=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(h){this.chunks.push(h)},f.prototype.onEnd=function(h){h===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},o.Inflate=f,o.inflate=w,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,w(h,b)},o.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var u in d)d.hasOwnProperty(u)&&(l[u]=d[u])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,u,m){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+u),m);else for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){var c,d,u,m,f,w;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(w=new Uint8Array(u),c=m=0,d=l.length;c<d;c++)f=l[c],w.set(f,m),m+=f.length;return w}},a={arraySet:function(l,c,d,u,m){for(var f=0;f<u;f++)l[m+f]=c[d+f]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(r,n,o){var i=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(u,m){if(m<65537&&(u.subarray&&a||!u.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(u,m));for(var f="",w=0;w<m;w++)f+=String.fromCharCode(u[w]);return f}l[254]=l[254]=1,o.string2buf=function(u){var m,f,w,h,b,g=u.length,v=0;for(h=0;h<g;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(w=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(w-56320),h++),v+=f<128?1:f<2048?2:f<65536?3:4;for(m=new i.Buf8(v),h=b=0;b<v;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(w=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(w-56320),h++),f<128?m[b++]=f:(f<2048?m[b++]=192|f>>>6:(f<65536?m[b++]=224|f>>>12:(m[b++]=240|f>>>18,m[b++]=128|f>>>12&63),m[b++]=128|f>>>6&63),m[b++]=128|63&f);return m},o.buf2binstring=function(u){return d(u,u.length)},o.binstring2buf=function(u){for(var m=new i.Buf8(u.length),f=0,w=m.length;f<w;f++)m[f]=u.charCodeAt(f);return m},o.buf2string=function(u,m){var f,w,h,b,g=m||u.length,v=new Array(2*g);for(f=w=0;f<g;)if((h=u[f++])<128)v[w++]=h;else if(4<(b=l[h]))v[w++]=65533,f+=b-1;else{for(h&=b===2?31:b===3?15:7;1<b&&f<g;)h=h<<6|63&u[f++],b--;1<b?v[w++]=65533:h<65536?v[w++]=h:(h-=65536,v[w++]=55296|h>>10&1023,v[w++]=56320|1023&h)}return d(v,w)},o.utf8border=function(u,m){var f;for((m=m||u.length)>u.length&&(m=u.length),f=m-1;0<=f&&(192&u[f])==128;)f--;return f<0||f===0?m:f+l[u[f]]>m?f:m}},{"./common":41}],43:[function(r,n,o){n.exports=function(i,s,a,l){for(var c=65535&i|0,d=i>>>16&65535|0,u=0;a!==0;){for(a-=u=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--u;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();n.exports=function(s,a,l,c){var d=i,u=c+l;s^=-1;for(var m=c;m<u;m++)s=s>>>8^d[255&(s^a[m])];return-1^s}},{}],46:[function(r,n,o){var i,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),u=0,m=4,f=0,w=-2,h=-1,b=4,g=2,v=8,k=9,S=286,C=30,T=19,A=2*S+1,P=15,I=3,B=258,F=B+I+1,E=42,L=113,y=1,U=2,te=3,W=4;function V(x,K){return x.msg=d[K],K}function H(x){return(x<<1)-(4<x?9:0)}function oe(x){for(var K=x.length;0<=--K;)x[K]=0}function j(x){var K=x.state,Y=K.pending;Y>x.avail_out&&(Y=x.avail_out),Y!==0&&(s.arraySet(x.output,K.pending_buf,K.pending_out,Y,x.next_out),x.next_out+=Y,K.pending_out+=Y,x.total_out+=Y,x.avail_out-=Y,K.pending-=Y,K.pending===0&&(K.pending_out=0))}function D(x,K){a._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,K),x.block_start=x.strstart,j(x.strm)}function Q(x,K){x.pending_buf[x.pending++]=K}function G(x,K){x.pending_buf[x.pending++]=K>>>8&255,x.pending_buf[x.pending++]=255&K}function re(x,K){var Y,O,z=x.max_chain_length,M=x.strstart,q=x.prev_length,ee=x.nice_match,$=x.strstart>x.w_size-F?x.strstart-(x.w_size-F):0,ne=x.window,ce=x.w_mask,se=x.prev,R=x.strstart+B,Z=ne[M+q-1],X=ne[M+q];x.prev_length>=x.good_match&&(z>>=2),ee>x.lookahead&&(ee=x.lookahead);do if(ne[(Y=K)+q]===X&&ne[Y+q-1]===Z&&ne[Y]===ne[M]&&ne[++Y]===ne[M+1]){M+=2,Y++;do;while(ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&ne[++M]===ne[++Y]&&M<R);if(O=B-(R-M),M=R-B,q<O){if(x.match_start=K,ee<=(q=O))break;Z=ne[M+q-1],X=ne[M+q]}}while((K=se[K&ce])>$&&--z!=0);return q<=x.lookahead?q:x.lookahead}function ue(x){var K,Y,O,z,M,q,ee,$,ne,ce,se=x.w_size;do{if(z=x.window_size-x.lookahead-x.strstart,x.strstart>=se+(se-F)){for(s.arraySet(x.window,x.window,se,se,0),x.match_start-=se,x.strstart-=se,x.block_start-=se,K=Y=x.hash_size;O=x.head[--K],x.head[K]=se<=O?O-se:0,--Y;);for(K=Y=se;O=x.prev[--K],x.prev[K]=se<=O?O-se:0,--Y;);z+=se}if(x.strm.avail_in===0)break;if(q=x.strm,ee=x.window,$=x.strstart+x.lookahead,ne=z,ce=void 0,ce=q.avail_in,ne<ce&&(ce=ne),Y=ce===0?0:(q.avail_in-=ce,s.arraySet(ee,q.input,q.next_in,ce,$),q.state.wrap===1?q.adler=l(q.adler,ee,ce,$):q.state.wrap===2&&(q.adler=c(q.adler,ee,ce,$)),q.next_in+=ce,q.total_in+=ce,ce),x.lookahead+=Y,x.lookahead+x.insert>=I)for(M=x.strstart-x.insert,x.ins_h=x.window[M],x.ins_h=(x.ins_h<<x.hash_shift^x.window[M+1])&x.hash_mask;x.insert&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[M+I-1])&x.hash_mask,x.prev[M&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=M,M++,x.insert--,!(x.lookahead+x.insert<I)););}while(x.lookahead<F&&x.strm.avail_in!==0)}function J(x,K){for(var Y,O;;){if(x.lookahead<F){if(ue(x),x.lookahead<F&&K===u)return y;if(x.lookahead===0)break}if(Y=0,x.lookahead>=I&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),Y!==0&&x.strstart-Y<=x.w_size-F&&(x.match_length=re(x,Y)),x.match_length>=I)if(O=a._tr_tally(x,x.strstart-x.match_start,x.match_length-I),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=I){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart,--x.match_length!=0;);x.strstart++}else x.strstart+=x.match_length,x.match_length=0,x.ins_h=x.window[x.strstart],x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+1])&x.hash_mask;else O=a._tr_tally(x,0,x.window[x.strstart]),x.lookahead--,x.strstart++;if(O&&(D(x,!1),x.strm.avail_out===0))return y}return x.insert=x.strstart<I-1?x.strstart:I-1,K===m?(D(x,!0),x.strm.avail_out===0?te:W):x.last_lit&&(D(x,!1),x.strm.avail_out===0)?y:U}function ae(x,K){for(var Y,O,z;;){if(x.lookahead<F){if(ue(x),x.lookahead<F&&K===u)return y;if(x.lookahead===0)break}if(Y=0,x.lookahead>=I&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),x.prev_length=x.match_length,x.prev_match=x.match_start,x.match_length=I-1,Y!==0&&x.prev_length<x.max_lazy_match&&x.strstart-Y<=x.w_size-F&&(x.match_length=re(x,Y),x.match_length<=5&&(x.strategy===1||x.match_length===I&&4096<x.strstart-x.match_start)&&(x.match_length=I-1)),x.prev_length>=I&&x.match_length<=x.prev_length){for(z=x.strstart+x.lookahead-I,O=a._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-I),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=z&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+I-1])&x.hash_mask,Y=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),--x.prev_length!=0;);if(x.match_available=0,x.match_length=I-1,x.strstart++,O&&(D(x,!1),x.strm.avail_out===0))return y}else if(x.match_available){if((O=a._tr_tally(x,0,x.window[x.strstart-1]))&&D(x,!1),x.strstart++,x.lookahead--,x.strm.avail_out===0)return y}else x.match_available=1,x.strstart++,x.lookahead--}return x.match_available&&(O=a._tr_tally(x,0,x.window[x.strstart-1]),x.match_available=0),x.insert=x.strstart<I-1?x.strstart:I-1,K===m?(D(x,!0),x.strm.avail_out===0?te:W):x.last_lit&&(D(x,!1),x.strm.avail_out===0)?y:U}function de(x,K,Y,O,z){this.good_length=x,this.max_lazy=K,this.nice_length=Y,this.max_chain=O,this.func=z}function ie(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*A),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*T+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(P+1),this.heap=new s.Buf16(2*S+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function fe(x){var K;return x&&x.state?(x.total_in=x.total_out=0,x.data_type=g,(K=x.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?E:L,x.adler=K.wrap===2?0:1,K.last_flush=u,a._tr_init(K),f):V(x,w)}function me(x){var K=fe(x);return K===f&&(function(Y){Y.window_size=2*Y.w_size,oe(Y.head),Y.max_lazy_match=i[Y.level].max_lazy,Y.good_match=i[Y.level].good_length,Y.nice_match=i[Y.level].nice_length,Y.max_chain_length=i[Y.level].max_chain,Y.strstart=0,Y.block_start=0,Y.lookahead=0,Y.insert=0,Y.match_length=Y.prev_length=I-1,Y.match_available=0,Y.ins_h=0})(x.state),K}function ye(x,K,Y,O,z,M){if(!x)return w;var q=1;if(K===h&&(K=6),O<0?(q=0,O=-O):15<O&&(q=2,O-=16),z<1||k<z||Y!==v||O<8||15<O||K<0||9<K||M<0||b<M)return V(x,w);O===8&&(O=9);var ee=new ie;return(x.state=ee).strm=x,ee.wrap=q,ee.gzhead=null,ee.w_bits=O,ee.w_size=1<<ee.w_bits,ee.w_mask=ee.w_size-1,ee.hash_bits=z+7,ee.hash_size=1<<ee.hash_bits,ee.hash_mask=ee.hash_size-1,ee.hash_shift=~~((ee.hash_bits+I-1)/I),ee.window=new s.Buf8(2*ee.w_size),ee.head=new s.Buf16(ee.hash_size),ee.prev=new s.Buf16(ee.w_size),ee.lit_bufsize=1<<z+6,ee.pending_buf_size=4*ee.lit_bufsize,ee.pending_buf=new s.Buf8(ee.pending_buf_size),ee.d_buf=1*ee.lit_bufsize,ee.l_buf=3*ee.lit_bufsize,ee.level=K,ee.strategy=M,ee.method=Y,me(x)}i=[new de(0,0,0,0,function(x,K){var Y=65535;for(Y>x.pending_buf_size-5&&(Y=x.pending_buf_size-5);;){if(x.lookahead<=1){if(ue(x),x.lookahead===0&&K===u)return y;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var O=x.block_start+Y;if((x.strstart===0||x.strstart>=O)&&(x.lookahead=x.strstart-O,x.strstart=O,D(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-F&&(D(x,!1),x.strm.avail_out===0))return y}return x.insert=0,K===m?(D(x,!0),x.strm.avail_out===0?te:W):(x.strstart>x.block_start&&(D(x,!1),x.strm.avail_out),y)}),new de(4,4,8,4,J),new de(4,5,16,8,J),new de(4,6,32,32,J),new de(4,4,16,16,ae),new de(8,16,32,32,ae),new de(8,16,128,128,ae),new de(8,32,128,256,ae),new de(32,128,258,1024,ae),new de(32,258,258,4096,ae)],o.deflateInit=function(x,K){return ye(x,K,v,15,8,0)},o.deflateInit2=ye,o.deflateReset=me,o.deflateResetKeep=fe,o.deflateSetHeader=function(x,K){return x&&x.state?x.state.wrap!==2?w:(x.state.gzhead=K,f):w},o.deflate=function(x,K){var Y,O,z,M;if(!x||!x.state||5<K||K<0)return x?V(x,w):w;if(O=x.state,!x.output||!x.input&&x.avail_in!==0||O.status===666&&K!==m)return V(x,x.avail_out===0?-5:w);if(O.strm=x,Y=O.last_flush,O.last_flush=K,O.status===E)if(O.wrap===2)x.adler=0,Q(O,31),Q(O,139),Q(O,8),O.gzhead?(Q(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),Q(O,255&O.gzhead.time),Q(O,O.gzhead.time>>8&255),Q(O,O.gzhead.time>>16&255),Q(O,O.gzhead.time>>24&255),Q(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),Q(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(Q(O,255&O.gzhead.extra.length),Q(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(x.adler=c(x.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(Q(O,0),Q(O,0),Q(O,0),Q(O,0),Q(O,0),Q(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),Q(O,3),O.status=L);else{var q=v+(O.w_bits-8<<4)<<8;q|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&(q|=32),q+=31-q%31,O.status=L,G(O,q),O.strstart!==0&&(G(O,x.adler>>>16),G(O,65535&x.adler)),x.adler=1}if(O.status===69)if(O.gzhead.extra){for(z=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending!==O.pending_buf_size));)Q(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){z=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending===O.pending_buf_size)){M=1;break}M=O.gzindex<O.gzhead.name.length?255&O.gzhead.name.charCodeAt(O.gzindex++):0,Q(O,M)}while(M!==0);O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),M===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){z=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),j(x),z=O.pending,O.pending===O.pending_buf_size)){M=1;break}M=O.gzindex<O.gzhead.comment.length?255&O.gzhead.comment.charCodeAt(O.gzindex++):0,Q(O,M)}while(M!==0);O.gzhead.hcrc&&O.pending>z&&(x.adler=c(x.adler,O.pending_buf,O.pending-z,z)),M===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&j(x),O.pending+2<=O.pending_buf_size&&(Q(O,255&x.adler),Q(O,x.adler>>8&255),x.adler=0,O.status=L)):O.status=L),O.pending!==0){if(j(x),x.avail_out===0)return O.last_flush=-1,f}else if(x.avail_in===0&&H(K)<=H(Y)&&K!==m)return V(x,-5);if(O.status===666&&x.avail_in!==0)return V(x,-5);if(x.avail_in!==0||O.lookahead!==0||K!==u&&O.status!==666){var ee=O.strategy===2?(function($,ne){for(var ce;;){if($.lookahead===0&&(ue($),$.lookahead===0)){if(ne===u)return y;break}if($.match_length=0,ce=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,ce&&(D($,!1),$.strm.avail_out===0))return y}return $.insert=0,ne===m?(D($,!0),$.strm.avail_out===0?te:W):$.last_lit&&(D($,!1),$.strm.avail_out===0)?y:U})(O,K):O.strategy===3?(function($,ne){for(var ce,se,R,Z,X=$.window;;){if($.lookahead<=B){if(ue($),$.lookahead<=B&&ne===u)return y;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=I&&0<$.strstart&&(se=X[R=$.strstart-1])===X[++R]&&se===X[++R]&&se===X[++R]){Z=$.strstart+B;do;while(se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&se===X[++R]&&R<Z);$.match_length=B-(Z-R),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=I?(ce=a._tr_tally($,1,$.match_length-I),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(ce=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),ce&&(D($,!1),$.strm.avail_out===0))return y}return $.insert=0,ne===m?(D($,!0),$.strm.avail_out===0?te:W):$.last_lit&&(D($,!1),$.strm.avail_out===0)?y:U})(O,K):i[O.level].func(O,K);if(ee!==te&&ee!==W||(O.status=666),ee===y||ee===te)return x.avail_out===0&&(O.last_flush=-1),f;if(ee===U&&(K===1?a._tr_align(O):K!==5&&(a._tr_stored_block(O,0,0,!1),K===3&&(oe(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),j(x),x.avail_out===0))return O.last_flush=-1,f}return K!==m?f:O.wrap<=0?1:(O.wrap===2?(Q(O,255&x.adler),Q(O,x.adler>>8&255),Q(O,x.adler>>16&255),Q(O,x.adler>>24&255),Q(O,255&x.total_in),Q(O,x.total_in>>8&255),Q(O,x.total_in>>16&255),Q(O,x.total_in>>24&255)):(G(O,x.adler>>>16),G(O,65535&x.adler)),j(x),0<O.wrap&&(O.wrap=-O.wrap),O.pending!==0?f:1)},o.deflateEnd=function(x){var K;return x&&x.state?(K=x.state.status)!==E&&K!==69&&K!==73&&K!==91&&K!==103&&K!==L&&K!==666?V(x,w):(x.state=null,K===L?V(x,-3):f):w},o.deflateSetDictionary=function(x,K){var Y,O,z,M,q,ee,$,ne,ce=K.length;if(!x||!x.state||(M=(Y=x.state).wrap)===2||M===1&&Y.status!==E||Y.lookahead)return w;for(M===1&&(x.adler=l(x.adler,K,ce,0)),Y.wrap=0,ce>=Y.w_size&&(M===0&&(oe(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),ne=new s.Buf8(Y.w_size),s.arraySet(ne,K,ce-Y.w_size,Y.w_size,0),K=ne,ce=Y.w_size),q=x.avail_in,ee=x.next_in,$=x.input,x.avail_in=ce,x.next_in=0,x.input=K,ue(Y);Y.lookahead>=I;){for(O=Y.strstart,z=Y.lookahead-(I-1);Y.ins_h=(Y.ins_h<<Y.hash_shift^Y.window[O+I-1])&Y.hash_mask,Y.prev[O&Y.w_mask]=Y.head[Y.ins_h],Y.head[Y.ins_h]=O,O++,--z;);Y.strstart=O,Y.lookahead=I-1,ue(Y)}return Y.strstart+=Y.lookahead,Y.block_start=Y.strstart,Y.insert=Y.lookahead,Y.lookahead=0,Y.match_length=Y.prev_length=I-1,Y.match_available=0,x.next_in=ee,x.input=$,x.avail_in=q,Y.wrap=M,f},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,o){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,o){n.exports=function(i,s){var a,l,c,d,u,m,f,w,h,b,g,v,k,S,C,T,A,P,I,B,F,E,L,y,U;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,U=i.output,u=d-(s-i.avail_out),m=d+(i.avail_out-257),f=a.dmax,w=a.wsize,h=a.whave,b=a.wnext,g=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,T=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),P=S[v&T];t:for(;;){if(v>>>=I=P>>>24,k-=I,(I=P>>>16&255)===0)U[d++]=65535&P;else{if(!(16&I)){if((64&I)==0){P=S[(65535&P)+(v&(1<<I)-1)];continue t}if(32&I){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}B=65535&P,(I&=15)&&(k<I&&(v+=y[l++]<<k,k+=8),B+=v&(1<<I)-1,v>>>=I,k-=I),k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),P=C[v&A];r:for(;;){if(v>>>=I=P>>>24,k-=I,!(16&(I=P>>>16&255))){if((64&I)==0){P=C[(65535&P)+(v&(1<<I)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(F=65535&P,k<(I&=15)&&(v+=y[l++]<<k,(k+=8)<I&&(v+=y[l++]<<k,k+=8)),f<(F+=v&(1<<I)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=I,k-=I,(I=d-u)<F){if(h<(I=F-I)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(L=g,(E=0)===b){if(E+=w-I,I<B){for(B-=I;U[d++]=g[E++],--I;);E=d-F,L=U}}else if(b<I){if(E+=w+b-I,(I-=b)<B){for(B-=I;U[d++]=g[E++],--I;);if(E=0,b<B){for(B-=I=b;U[d++]=g[E++],--I;);E=d-F,L=U}}}else if(E+=b-I,I<B){for(B-=I;U[d++]=g[E++],--I;);E=d-F,L=U}for(;2<B;)U[d++]=L[E++],U[d++]=L[E++],U[d++]=L[E++],B-=3;B&&(U[d++]=L[E++],1<B&&(U[d++]=L[E++]))}else{for(E=d-F;U[d++]=U[E++],U[d++]=U[E++],U[d++]=U[E++],2<(B-=3););B&&(U[d++]=U[E++],1<B&&(U[d++]=U[E++]))}break}}break}}while(l<c&&d<m);l-=B=k>>3,v&=(1<<(k-=B<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=d<m?m-d+257:257-(d-m),a.hold=v,a.bits=k}},{}],49:[function(r,n,o){var i=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,u=2,m=0,f=-2,w=1,h=852,b=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var L;return E&&E.state?(L=E.state,E.total_in=E.total_out=L.total=0,E.msg="",L.wrap&&(E.adler=1&L.wrap),L.mode=w,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(h),L.distcode=L.distdyn=new i.Buf32(b),L.sane=1,L.back=-1,m):f}function S(E){var L;return E&&E.state?((L=E.state).wsize=0,L.whave=0,L.wnext=0,k(E)):f}function C(E,L){var y,U;return E&&E.state?(U=E.state,L<0?(y=0,L=-L):(y=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?f:(U.window!==null&&U.wbits!==L&&(U.window=null),U.wrap=y,U.wbits=L,S(E))):f}function T(E,L){var y,U;return E?(U=new v,(E.state=U).window=null,(y=C(E,L))!==m&&(E.state=null),y):f}var A,P,I=!0;function B(E){if(I){var L;for(A=new i.Buf32(512),P=new i.Buf32(32),L=0;L<144;)E.lens[L++]=8;for(;L<256;)E.lens[L++]=9;for(;L<280;)E.lens[L++]=7;for(;L<288;)E.lens[L++]=8;for(c(d,E.lens,0,288,A,0,E.work,{bits:9}),L=0;L<32;)E.lens[L++]=5;c(u,E.lens,0,32,P,0,E.work,{bits:5}),I=!1}E.lencode=A,E.lenbits=9,E.distcode=P,E.distbits=5}function F(E,L,y,U){var te,W=E.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),U>=W.wsize?(i.arraySet(W.window,L,y-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(U<(te=W.wsize-W.wnext)&&(te=U),i.arraySet(W.window,L,y-U,te,W.wnext),(U-=te)?(i.arraySet(W.window,L,y-U,U,0),W.wnext=U,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=te))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return T(E,15)},o.inflateInit2=T,o.inflate=function(E,L){var y,U,te,W,V,H,oe,j,D,Q,G,re,ue,J,ae,de,ie,fe,me,ye,x,K,Y,O,z=0,M=new i.Buf8(4),q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return f;(y=E.state).mode===12&&(y.mode=13),V=E.next_out,te=E.output,oe=E.avail_out,W=E.next_in,U=E.input,H=E.avail_in,j=y.hold,D=y.bits,Q=H,G=oe,K=m;e:for(;;)switch(y.mode){case w:if(y.wrap===0){y.mode=13;break}for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(2&y.wrap&&j===35615){M[y.check=0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0),D=j=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&j)<<8)+(j>>8))%31){E.msg="incorrect header check",y.mode=30;break}if((15&j)!=8){E.msg="unknown compression method",y.mode=30;break}if(D-=4,x=8+(15&(j>>>=4)),y.wbits===0)y.wbits=x;else if(x>y.wbits){E.msg="invalid window size",y.mode=30;break}y.dmax=1<<x,E.adler=y.check=1,y.mode=512&j?10:12,D=j=0;break;case 2:for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(y.flags=j,(255&y.flags)!=8){E.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){E.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=j>>8&1),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0,y.mode=3;case 3:for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.head&&(y.head.time=j),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,M[2]=j>>>16&255,M[3]=j>>>24&255,y.check=a(y.check,M,4,0)),D=j=0,y.mode=4;case 4:for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.head&&(y.head.xflags=255&j,y.head.os=j>>8),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0,y.mode=5;case 5:if(1024&y.flags){for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.length=j,y.head&&(y.head.extra_len=j),512&y.flags&&(M[0]=255&j,M[1]=j>>>8&255,y.check=a(y.check,M,2,0)),D=j=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(H<(re=y.length)&&(re=H),re&&(y.head&&(x=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,U,W,re,x)),512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,y.length-=re),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(H===0)break e;for(re=0;x=U[W+re++],y.head&&x&&y.length<65536&&(y.head.name+=String.fromCharCode(x)),x&&re<H;);if(512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,x)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(H===0)break e;for(re=0;x=U[W+re++],y.head&&x&&y.length<65536&&(y.head.comment+=String.fromCharCode(x)),x&&re<H;);if(512&y.flags&&(y.check=a(y.check,U,re,W)),H-=re,W+=re,x)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;D<16;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j!==(65535&y.check)){E.msg="header crc mismatch",y.mode=30;break}D=j=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),E.adler=y.check=0,y.mode=12;break;case 10:for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}E.adler=y.check=g(j),D=j=0,y.mode=11;case 11:if(y.havedict===0)return E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,2;E.adler=y.check=1,y.mode=12;case 12:if(L===5||L===6)break e;case 13:if(y.last){j>>>=7&D,D-=7&D,y.mode=27;break}for(;D<3;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}switch(y.last=1&j,D-=1,3&(j>>>=1)){case 0:y.mode=14;break;case 1:if(B(y),y.mode=20,L!==6)break;j>>>=2,D-=2;break e;case 2:y.mode=17;break;case 3:E.msg="invalid block type",y.mode=30}j>>>=2,D-=2;break;case 14:for(j>>>=7&D,D-=7&D;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if((65535&j)!=(j>>>16^65535)){E.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&j,D=j=0,y.mode=15,L===6)break e;case 15:y.mode=16;case 16:if(re=y.length){if(H<re&&(re=H),oe<re&&(re=oe),re===0)break e;i.arraySet(te,U,W,re,V),H-=re,W+=re,oe-=re,V+=re,y.length-=re;break}y.mode=12;break;case 17:for(;D<14;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(y.nlen=257+(31&j),j>>>=5,D-=5,y.ndist=1+(31&j),j>>>=5,D-=5,y.ncode=4+(15&j),j>>>=4,D-=4,286<y.nlen||30<y.ndist){E.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;D<3;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.lens[q[y.have++]]=7&j,j>>>=3,D-=3}for(;y.have<19;)y.lens[q[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,Y={bits:y.lenbits},K=c(0,y.lens,0,19,y.lencode,0,y.work,Y),y.lenbits=Y.bits,K){E.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;de=(z=y.lencode[j&(1<<y.lenbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(ie<16)j>>>=ae,D-=ae,y.lens[y.have++]=ie;else{if(ie===16){for(O=ae+2;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j>>>=ae,D-=ae,y.have===0){E.msg="invalid bit length repeat",y.mode=30;break}x=y.lens[y.have-1],re=3+(3&j),j>>>=2,D-=2}else if(ie===17){for(O=ae+3;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}D-=ae,x=0,re=3+(7&(j>>>=ae)),j>>>=3,D-=3}else{for(O=ae+7;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}D-=ae,x=0,re=11+(127&(j>>>=ae)),j>>>=7,D-=7}if(y.have+re>y.nlen+y.ndist){E.msg="invalid bit length repeat",y.mode=30;break}for(;re--;)y.lens[y.have++]=x}}if(y.mode===30)break;if(y.lens[256]===0){E.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,Y={bits:y.lenbits},K=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,Y),y.lenbits=Y.bits,K){E.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,Y={bits:y.distbits},K=c(u,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,Y),y.distbits=Y.bits,K){E.msg="invalid distances set",y.mode=30;break}if(y.mode=20,L===6)break e;case 20:y.mode=21;case 21:if(6<=H&&258<=oe){E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,l(E,G),V=E.next_out,te=E.output,oe=E.avail_out,W=E.next_in,U=E.input,H=E.avail_in,j=y.hold,D=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;de=(z=y.lencode[j&(1<<y.lenbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(de&&(240&de)==0){for(fe=ae,me=de,ye=ie;de=(z=y.lencode[ye+((j&(1<<fe+me)-1)>>fe)])>>>16&255,ie=65535&z,!(fe+(ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}j>>>=fe,D-=fe,y.back+=fe}if(j>>>=ae,D-=ae,y.back+=ae,y.length=ie,de===0){y.mode=26;break}if(32&de){y.back=-1,y.mode=12;break}if(64&de){E.msg="invalid literal/length code",y.mode=30;break}y.extra=15&de,y.mode=22;case 22:if(y.extra){for(O=y.extra;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.length+=j&(1<<y.extra)-1,j>>>=y.extra,D-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;de=(z=y.distcode[j&(1<<y.distbits)-1])>>>16&255,ie=65535&z,!((ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if((240&de)==0){for(fe=ae,me=de,ye=ie;de=(z=y.distcode[ye+((j&(1<<fe+me)-1)>>fe)])>>>16&255,ie=65535&z,!(fe+(ae=z>>>24)<=D);){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}j>>>=fe,D-=fe,y.back+=fe}if(j>>>=ae,D-=ae,y.back+=ae,64&de){E.msg="invalid distance code",y.mode=30;break}y.offset=ie,y.extra=15&de,y.mode=24;case 24:if(y.extra){for(O=y.extra;D<O;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}y.offset+=j&(1<<y.extra)-1,j>>>=y.extra,D-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){E.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(re=G-oe,y.offset>re){if((re=y.offset-re)>y.whave&&y.sane){E.msg="invalid distance too far back",y.mode=30;break}ue=re>y.wnext?(re-=y.wnext,y.wsize-re):y.wnext-re,re>y.length&&(re=y.length),J=y.window}else J=te,ue=V-y.offset,re=y.length;for(oe<re&&(re=oe),oe-=re,y.length-=re;te[V++]=J[ue++],--re;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;te[V++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;D<32;){if(H===0)break e;H--,j|=U[W++]<<D,D+=8}if(G-=oe,E.total_out+=G,y.total+=G,G&&(E.adler=y.check=y.flags?a(y.check,te,G,V-G):s(y.check,te,G,V-G)),G=oe,(y.flags?j:g(j))!==y.check){E.msg="incorrect data check",y.mode=30;break}D=j=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;D<32;){if(H===0)break e;H--,j+=U[W++]<<D,D+=8}if(j!==(4294967295&y.total)){E.msg="incorrect length check",y.mode=30;break}D=j=0}y.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;case 32:default:return f}return E.next_out=V,E.avail_out=oe,E.next_in=W,E.avail_in=H,y.hold=j,y.bits=D,(y.wsize||G!==E.avail_out&&y.mode<30&&(y.mode<27||L!==4))&&F(E,E.output,E.next_out,G-E.avail_out)?(y.mode=31,-4):(Q-=E.avail_in,G-=E.avail_out,E.total_in+=Q,E.total_out+=G,y.total+=G,y.wrap&&G&&(E.adler=y.check=y.flags?a(y.check,te,G,E.next_out-G):s(y.check,te,G,E.next_out-G)),E.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(Q==0&&G===0||L===4)&&K===m&&(K=-5),K)},o.inflateEnd=function(E){if(!E||!E.state)return f;var L=E.state;return L.window&&(L.window=null),E.state=null,m},o.inflateGetHeader=function(E,L){var y;return E&&E.state?(2&(y=E.state).wrap)==0?f:((y.head=L).done=!1,m):f},o.inflateSetDictionary=function(E,L){var y,U=L.length;return E&&E.state?(y=E.state).wrap!==0&&y.mode!==11?f:y.mode===11&&s(1,L,U,0)!==y.check?-3:F(E,L,U,U)?(y.mode=31,-4):(y.havedict=1,m):f},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,o){var i=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,u,m,f,w,h,b,g){var v,k,S,C,T,A,P,I,B,F=g.bits,E=0,L=0,y=0,U=0,te=0,W=0,V=0,H=0,oe=0,j=0,D=null,Q=0,G=new i.Buf16(16),re=new i.Buf16(16),ue=null,J=0;for(E=0;E<=15;E++)G[E]=0;for(L=0;L<f;L++)G[u[m+L]]++;for(te=F,U=15;1<=U&&G[U]===0;U--);if(U<te&&(te=U),U===0)return w[h++]=20971520,w[h++]=20971520,g.bits=1,0;for(y=1;y<U&&G[y]===0;y++);for(te<y&&(te=y),E=H=1;E<=15;E++)if(H<<=1,(H-=G[E])<0)return-1;if(0<H&&(d===0||U!==1))return-1;for(re[1]=0,E=1;E<15;E++)re[E+1]=re[E]+G[E];for(L=0;L<f;L++)u[m+L]!==0&&(b[re[u[m+L]]++]=L);if(A=d===0?(D=ue=b,19):d===1?(D=s,Q-=257,ue=a,J-=257,256):(D=l,ue=c,-1),E=y,T=h,V=L=j=0,S=-1,C=(oe=1<<(W=te))-1,d===1&&852<oe||d===2&&592<oe)return 1;for(;;){for(P=E-V,B=b[L]<A?(I=0,b[L]):b[L]>A?(I=ue[J+b[L]],D[Q+b[L]]):(I=96,0),v=1<<E-V,y=k=1<<W;w[T+(j>>V)+(k-=v)]=P<<24|I<<16|B|0,k!==0;);for(v=1<<E-1;j&v;)v>>=1;if(v!==0?(j&=v-1,j+=v):j=0,L++,--G[E]==0){if(E===U)break;E=u[m+b[L]]}if(te<E&&(j&C)!==S){for(V===0&&(V=te),T+=y,H=1<<(W=E-V);W+V<U&&!((H-=G[W+V])<=0);)W++,H<<=1;if(oe+=1<<W,d===1&&852<oe||d===2&&592<oe)return 1;w[S=j&C]=te<<24|W<<16|T-h|0}}return j!==0&&(w[T+j]=E-V<<24|64<<16|0),g.bits=te,0}},{"../utils/common":41}],51:[function(r,n,o){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,o){var i=r("../utils/common"),s=0,a=1;function l(z){for(var M=z.length;0<=--M;)z[M]=0}var c=0,d=29,u=256,m=u+1+d,f=30,w=19,h=2*m+1,b=15,g=16,v=7,k=256,S=16,C=17,T=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(m+2));l(F);var E=new Array(2*f);l(E);var L=new Array(512);l(L);var y=new Array(256);l(y);var U=new Array(d);l(U);var te,W,V,H=new Array(f);function oe(z,M,q,ee,$){this.static_tree=z,this.extra_bits=M,this.extra_base=q,this.elems=ee,this.max_length=$,this.has_stree=z&&z.length}function j(z,M){this.dyn_tree=z,this.max_code=0,this.stat_desc=M}function D(z){return z<256?L[z]:L[256+(z>>>7)]}function Q(z,M){z.pending_buf[z.pending++]=255&M,z.pending_buf[z.pending++]=M>>>8&255}function G(z,M,q){z.bi_valid>g-q?(z.bi_buf|=M<<z.bi_valid&65535,Q(z,z.bi_buf),z.bi_buf=M>>g-z.bi_valid,z.bi_valid+=q-g):(z.bi_buf|=M<<z.bi_valid&65535,z.bi_valid+=q)}function re(z,M,q){G(z,q[2*M],q[2*M+1])}function ue(z,M){for(var q=0;q|=1&z,z>>>=1,q<<=1,0<--M;);return q>>>1}function J(z,M,q){var ee,$,ne=new Array(b+1),ce=0;for(ee=1;ee<=b;ee++)ne[ee]=ce=ce+q[ee-1]<<1;for($=0;$<=M;$++){var se=z[2*$+1];se!==0&&(z[2*$]=ue(ne[se]++,se))}}function ae(z){var M;for(M=0;M<m;M++)z.dyn_ltree[2*M]=0;for(M=0;M<f;M++)z.dyn_dtree[2*M]=0;for(M=0;M<w;M++)z.bl_tree[2*M]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function de(z){8<z.bi_valid?Q(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function ie(z,M,q,ee){var $=2*M,ne=2*q;return z[$]<z[ne]||z[$]===z[ne]&&ee[M]<=ee[q]}function fe(z,M,q){for(var ee=z.heap[q],$=q<<1;$<=z.heap_len&&($<z.heap_len&&ie(M,z.heap[$+1],z.heap[$],z.depth)&&$++,!ie(M,ee,z.heap[$],z.depth));)z.heap[q]=z.heap[$],q=$,$<<=1;z.heap[q]=ee}function me(z,M,q){var ee,$,ne,ce,se=0;if(z.last_lit!==0)for(;ee=z.pending_buf[z.d_buf+2*se]<<8|z.pending_buf[z.d_buf+2*se+1],$=z.pending_buf[z.l_buf+se],se++,ee===0?re(z,$,M):(re(z,(ne=y[$])+u+1,M),(ce=A[ne])!==0&&G(z,$-=U[ne],ce),re(z,ne=D(--ee),q),(ce=P[ne])!==0&&G(z,ee-=H[ne],ce)),se<z.last_lit;);re(z,k,M)}function ye(z,M){var q,ee,$,ne=M.dyn_tree,ce=M.stat_desc.static_tree,se=M.stat_desc.has_stree,R=M.stat_desc.elems,Z=-1;for(z.heap_len=0,z.heap_max=h,q=0;q<R;q++)ne[2*q]!==0?(z.heap[++z.heap_len]=Z=q,z.depth[q]=0):ne[2*q+1]=0;for(;z.heap_len<2;)ne[2*($=z.heap[++z.heap_len]=Z<2?++Z:0)]=1,z.depth[$]=0,z.opt_len--,se&&(z.static_len-=ce[2*$+1]);for(M.max_code=Z,q=z.heap_len>>1;1<=q;q--)fe(z,ne,q);for($=R;q=z.heap[1],z.heap[1]=z.heap[z.heap_len--],fe(z,ne,1),ee=z.heap[1],z.heap[--z.heap_max]=q,z.heap[--z.heap_max]=ee,ne[2*$]=ne[2*q]+ne[2*ee],z.depth[$]=(z.depth[q]>=z.depth[ee]?z.depth[q]:z.depth[ee])+1,ne[2*q+1]=ne[2*ee+1]=$,z.heap[1]=$++,fe(z,ne,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(X,le){var be,ge,we,Se,Ne,mt,Xe=le.dyn_tree,Kn=le.max_code,Gn=le.stat_desc.static_tree,xi=le.stat_desc.has_stree,yi=le.stat_desc.extra_bits,Xn=le.stat_desc.extra_base,Te=le.stat_desc.max_length,Re=0;for(Se=0;Se<=b;Se++)X.bl_count[Se]=0;for(Xe[2*X.heap[X.heap_max]+1]=0,be=X.heap_max+1;be<h;be++)Te<(Se=Xe[2*Xe[2*(ge=X.heap[be])+1]+1]+1)&&(Se=Te,Re++),Xe[2*ge+1]=Se,Kn<ge||(X.bl_count[Se]++,Ne=0,Xn<=ge&&(Ne=yi[ge-Xn]),mt=Xe[2*ge],X.opt_len+=mt*(Se+Ne),xi&&(X.static_len+=mt*(Gn[2*ge+1]+Ne)));if(Re!==0){do{for(Se=Te-1;X.bl_count[Se]===0;)Se--;X.bl_count[Se]--,X.bl_count[Se+1]+=2,X.bl_count[Te]--,Re-=2}while(0<Re);for(Se=Te;Se!==0;Se--)for(ge=X.bl_count[Se];ge!==0;)Kn<(we=X.heap[--be])||(Xe[2*we+1]!==Se&&(X.opt_len+=(Se-Xe[2*we+1])*Xe[2*we],Xe[2*we+1]=Se),ge--)}})(z,M),J(ne,Z,z.bl_count)}function x(z,M,q){var ee,$,ne=-1,ce=M[1],se=0,R=7,Z=4;for(ce===0&&(R=138,Z=3),M[2*(q+1)+1]=65535,ee=0;ee<=q;ee++)$=ce,ce=M[2*(ee+1)+1],++se<R&&$===ce||(se<Z?z.bl_tree[2*$]+=se:$!==0?($!==ne&&z.bl_tree[2*$]++,z.bl_tree[2*S]++):se<=10?z.bl_tree[2*C]++:z.bl_tree[2*T]++,ne=$,Z=(se=0)===ce?(R=138,3):$===ce?(R=6,3):(R=7,4))}function K(z,M,q){var ee,$,ne=-1,ce=M[1],se=0,R=7,Z=4;for(ce===0&&(R=138,Z=3),ee=0;ee<=q;ee++)if($=ce,ce=M[2*(ee+1)+1],!(++se<R&&$===ce)){if(se<Z)for(;re(z,$,z.bl_tree),--se!=0;);else $!==0?($!==ne&&(re(z,$,z.bl_tree),se--),re(z,S,z.bl_tree),G(z,se-3,2)):se<=10?(re(z,C,z.bl_tree),G(z,se-3,3)):(re(z,T,z.bl_tree),G(z,se-11,7));ne=$,Z=(se=0)===ce?(R=138,3):$===ce?(R=6,3):(R=7,4)}}l(H);var Y=!1;function O(z,M,q,ee){G(z,(c<<1)+(ee?1:0),3),(function($,ne,ce,se){de($),Q($,ce),Q($,~ce),i.arraySet($.pending_buf,$.window,ne,ce,$.pending),$.pending+=ce})(z,M,q)}o._tr_init=function(z){Y||((function(){var M,q,ee,$,ne,ce=new Array(b+1);for($=ee=0;$<d-1;$++)for(U[$]=ee,M=0;M<1<<A[$];M++)y[ee++]=$;for(y[ee-1]=$,$=ne=0;$<16;$++)for(H[$]=ne,M=0;M<1<<P[$];M++)L[ne++]=$;for(ne>>=7;$<f;$++)for(H[$]=ne<<7,M=0;M<1<<P[$]-7;M++)L[256+ne++]=$;for(q=0;q<=b;q++)ce[q]=0;for(M=0;M<=143;)F[2*M+1]=8,M++,ce[8]++;for(;M<=255;)F[2*M+1]=9,M++,ce[9]++;for(;M<=279;)F[2*M+1]=7,M++,ce[7]++;for(;M<=287;)F[2*M+1]=8,M++,ce[8]++;for(J(F,m+1,ce),M=0;M<f;M++)E[2*M+1]=5,E[2*M]=ue(M,5);te=new oe(F,A,u+1,m,b),W=new oe(E,P,0,f,b),V=new oe(new Array(0),I,0,w,v)})(),Y=!0),z.l_desc=new j(z.dyn_ltree,te),z.d_desc=new j(z.dyn_dtree,W),z.bl_desc=new j(z.bl_tree,V),z.bi_buf=0,z.bi_valid=0,ae(z)},o._tr_stored_block=O,o._tr_flush_block=function(z,M,q,ee){var $,ne,ce=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(se){var R,Z=4093624447;for(R=0;R<=31;R++,Z>>>=1)if(1&Z&&se.dyn_ltree[2*R]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(R=32;R<u;R++)if(se.dyn_ltree[2*R]!==0)return a;return s})(z)),ye(z,z.l_desc),ye(z,z.d_desc),ce=(function(se){var R;for(x(se,se.dyn_ltree,se.l_desc.max_code),x(se,se.dyn_dtree,se.d_desc.max_code),ye(se,se.bl_desc),R=w-1;3<=R&&se.bl_tree[2*B[R]+1]===0;R--);return se.opt_len+=3*(R+1)+5+5+4,R})(z),$=z.opt_len+3+7>>>3,(ne=z.static_len+3+7>>>3)<=$&&($=ne)):$=ne=q+5,q+4<=$&&M!==-1?O(z,M,q,ee):z.strategy===4||ne===$?(G(z,2+(ee?1:0),3),me(z,F,E)):(G(z,4+(ee?1:0),3),(function(se,R,Z,X){var le;for(G(se,R-257,5),G(se,Z-1,5),G(se,X-4,4),le=0;le<X;le++)G(se,se.bl_tree[2*B[le]+1],3);K(se,se.dyn_ltree,R-1),K(se,se.dyn_dtree,Z-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,ce+1),me(z,z.dyn_ltree,z.dyn_dtree)),ae(z),ee&&de(z)},o._tr_tally=function(z,M,q){return z.pending_buf[z.d_buf+2*z.last_lit]=M>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&M,z.pending_buf[z.l_buf+z.last_lit]=255&q,z.last_lit++,M===0?z.dyn_ltree[2*q]++:(z.matches++,M--,z.dyn_ltree[2*(y[q]+u+1)]++,z.dyn_dtree[2*D(M)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){G(z,2,3),re(z,k,F),(function(M){M.bi_valid===16?(Q(M,M.bi_buf),M.bi_buf=0,M.bi_valid=0):8<=M.bi_valid&&(M.pending_buf[M.pending++]=255&M.bi_buf,M.bi_buf>>=8,M.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(r,n,o){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,d,u,m=1,f={},w=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(u+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){d.port2.postMessage(S)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(S){var C=h.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(v,0,S)},b.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),T=0;T<C.length;T++)C[T]=arguments[T+1];var A={callback:S,args:C};return f[m]=A,l(m),m++},b.clearImmediate=g}function g(S){delete f[S]}function v(S){if(w)setTimeout(v,0,S);else{var C=f[S];if(C){w=!0;try{(function(T){var A=T.callback,P=T.args;switch(P.length){case 0:A();break;case 1:A(P[0]);break;case 2:A(P[0],P[1]);break;case 3:A(P[0],P[1],P[2]);break;default:A.apply(a,P)}})(C)}finally{g(S),w=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(u)===0&&v(+S.data.slice(u.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(qn)),qn.exports}var Wc=Uc();const $c=Bc(Wc);var Fr={exports:{}},Hc=Fr.exports,Ci;function Vc(){return Ci||(Ci=1,(function(e,t){(function(r,n){n()})(Hc,function(){function r(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,d,u){var m=new XMLHttpRequest;m.open("GET",c),m.responseType="blob",m.onload=function(){l(m.response,d,u)},m.onerror=function(){console.error("could not download file")},m.send()}function o(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof vt=="object"&&vt.global===vt?vt:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,d,u){var m=s.URL||s.webkitURL,f=document.createElement("a");d=d||c.name||"download",f.download=d,f.rel="noopener",typeof c=="string"?(f.href=c,f.origin===location.origin?i(f):o(f.href)?n(c,d,u):i(f,f.target="_blank")):(f.href=m.createObjectURL(c),setTimeout(function(){m.revokeObjectURL(f.href)},4e4),setTimeout(function(){i(f)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,u){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,u),d);else if(o(c))n(c,d,u);else{var m=document.createElement("a");m.href=c,m.target="_blank",setTimeout(function(){i(m)})}}:function(c,d,u,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof c=="string")return n(c,d,u);var f=c.type==="application/octet-stream",w=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||f&&w||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var k=b.result;k=h?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=k:location=k,m=null},b.readAsDataURL(c)}else{var g=s.URL||s.webkitURL,v=g.createObjectURL(c);m?m.location=v:location.href=v,m=null,setTimeout(function(){g.revokeObjectURL(v)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Fr)),Fr.exports}var Ei=Vc();const Ni=async(e,t)=>{const r=new $c,n=r.folder("config");n==null||n.file("site.json",JSON.stringify(e.site,null,2)),n==null||n.file("theme.json",JSON.stringify(e.theme,null,2)),n==null||n.file("menu.json",JSON.stringify(e.menu,null,2));const o=r.folder("pages");o==null||o.file(`${t}.json`,JSON.stringify(e.page,null,2));const i=await r.generateAsync({type:"blob"});Ei.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},zi=(e,t,r)=>{const{pages:n,...o}=e.site,i={page:e.page,site:o,menu:e.menu,theme:e.theme},a=`<script id="jp-baked-state" type="application/json">${JSON.stringify(i)}<\/script>`,l=r.replace("</head>",`${a}</head>`),c=new Blob([`<!DOCTYPE html>${l}`],{type:"text/html;charset=utf-8"});Ei.saveAs(c,`${t}.html`)};function Ai(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=Ai(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Yc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ai(e))&&(n&&(n+=" "),n+=t);return n}const Zc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Kc=(e,t)=>({classGroupId:e,validator:t}),ji=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Br="-",Ti=[],Gc="arbitrary..",Xc=e=>{const t=Jc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return qc(s);const a=s.split(Br),l=a[0]===""&&a.length>1?1:0;return Oi(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Zc(c,l):l:c||Ti}return r[s]||Ti}}},Oi=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Oi(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Br):e.slice(t).join(Br),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},qc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Gc+n:void 0})(),Jc=e=>{const{theme:t,classGroups:r}=e;return Qc(r,t)},Qc=(e,t)=>{const r=ji();for(const n in e){const o=e[n];Jn(o,r,n,t)}return r},Jn=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];ed(s,t,r,n)}},ed=(e,t,r,n)=>{if(typeof e=="string"){td(e,t,r);return}if(typeof e=="function"){rd(e,t,r,n);return}nd(e,t,r,n)},td=(e,t,r)=>{const n=e===""?t:Pi(t,e);n.classGroupId=r},rd=(e,t,r,n)=>{if(od(e)){Jn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Kc(r,e))},nd=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Jn(l,Pi(t,a),r,n)}},Pi=(e,t)=>{let r=e;const n=t.split(Br),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=ji(),r.nextPart.set(s,a)),r=a}return r},od=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,id=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},Qn="!",Ii=":",sd=[],Di=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),ad=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let h=0;h<d;h++){const b=o[h];if(s===0&&a===0){if(b===Ii){i.push(o.slice(l,h)),l=h+1;continue}if(b==="/"){c=h;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const u=i.length===0?o:o.slice(l);let m=u,f=!1;u.endsWith(Qn)?(m=u.slice(0,-1),f=!0):u.startsWith(Qn)&&(m=u.slice(1),f=!0);const w=c&&c>l?c-l:void 0;return Di(i,f,m,w)};if(t){const o=t+Ii,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Di(sd,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},ld=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},cd=e=>({cache:id(e.cacheSize),parseClassName:ad(e),sortModifiers:ld(e),...Xc(e)}),dd=/\s+/,ud=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(dd);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:w,maybePostfixModifierPosition:h}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let b=!!h,g=n(b?w.substring(0,h):w);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=n(w),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const v=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=f?v+Qn:v,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(g,b);for(let T=0;T<C.length;++T){const A=C[T];s.push(k+A)}l=d+(l.length>0?" "+l:l)}return l},fd=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ri(r))&&(o&&(o+=" "),o+=n);return o},Ri=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ri(e[n]))&&(r&&(r+=" "),r+=t);return r},hd=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,u)=>u(d),e());return r=cd(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=ud(l,r);return o(l,d),d};return i=s,(...l)=>i(fd(...l))},pd=[],Pe=e=>{const t=r=>r[e]||pd;return t.isThemeGetter=!0,t},Li=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,md=/^\d+\/\d+$/,gd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=e=>md.test(e),xe=e=>!!e&&!Number.isNaN(Number(e)),wt=e=>!!e&&Number.isInteger(Number(e)),eo=e=>e.endsWith("%")&&xe(e.slice(0,-1)),ut=e=>gd.test(e),yd=()=>!0,kd=e=>bd.test(e)&&!vd.test(e),Fi=()=>!1,Sd=e=>wd.test(e),_d=e=>xd.test(e),Cd=e=>!he(e)&&!pe(e),Ed=e=>Lt(e,Hi,Fi),he=e=>Li.test(e),Tt=e=>Lt(e,Vi,kd),to=e=>Lt(e,Td,xe),Bi=e=>Lt(e,Wi,Fi),Nd=e=>Lt(e,$i,_d),Ur=e=>Lt(e,Yi,Sd),pe=e=>Mi.test(e),cr=e=>Mt(e,Vi),zd=e=>Mt(e,Od),Ui=e=>Mt(e,Wi),Ad=e=>Mt(e,Hi),jd=e=>Mt(e,$i),Wr=e=>Mt(e,Yi,!0),Lt=(e,t,r)=>{const n=Li.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Mt=(e,t,r=!1)=>{const n=Mi.exec(e);return n?n[1]?t(n[1]):r:!1},Wi=e=>e==="position"||e==="percentage",$i=e=>e==="image"||e==="url",Hi=e=>e==="length"||e==="size"||e==="bg-size",Vi=e=>e==="length",Td=e=>e==="number",Od=e=>e==="family-name",Yi=e=>e==="shadow",Pd=hd(()=>{const e=Pe("color"),t=Pe("font"),r=Pe("text"),n=Pe("font-weight"),o=Pe("tracking"),i=Pe("leading"),s=Pe("breakpoint"),a=Pe("container"),l=Pe("spacing"),c=Pe("radius"),d=Pe("shadow"),u=Pe("inset-shadow"),m=Pe("text-shadow"),f=Pe("drop-shadow"),w=Pe("blur"),h=Pe("perspective"),b=Pe("aspect"),g=Pe("ease"),v=Pe("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),pe,he],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],P=()=>[pe,he,l],I=()=>[Rt,"full","auto",...P()],B=()=>[wt,"none","subgrid",pe,he],F=()=>["auto",{span:["full",wt,pe,he]},wt,pe,he],E=()=>[wt,"auto",pe,he],L=()=>["auto","min","max","fr",pe,he],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...P()],W=()=>[Rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],V=()=>[e,pe,he],H=()=>[...S(),Ui,Bi,{position:[pe,he]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Ad,Ed,{size:[pe,he]}],D=()=>[eo,cr,Tt],Q=()=>["","none","full",c,pe,he],G=()=>["",xe,cr,Tt],re=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[xe,eo,Ui,Bi],ae=()=>["","none",w,pe,he],de=()=>["none",xe,pe,he],ie=()=>["none",xe,pe,he],fe=()=>[xe,pe,he],me=()=>[Rt,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ut],breakpoint:[ut],color:[yd],container:[ut],"drop-shadow":[ut],ease:["in","out","in-out"],font:[Cd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ut],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ut],shadow:[ut],spacing:["px",xe],text:[ut],"text-shadow":[ut],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rt,he,pe,b]}],container:["container"],columns:[{columns:[xe,he,pe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[wt,"auto",pe,he]}],basis:[{basis:[Rt,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Rt,"auto","initial","none",he]}],grow:[{grow:["",xe,pe,he]}],shrink:[{shrink:["",xe,pe,he]}],order:[{order:[wt,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,cr,Tt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,pe,to]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eo,he]}],"font-family":[{font:[zd,he,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,pe,he]}],"line-clamp":[{"line-clamp":[xe,"none",pe,to]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",pe,Tt]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[xe,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wt,pe,he],radial:["",pe,he],conic:[wt,pe,he]},jd,Nd]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,pe,he]}],"outline-w":[{outline:["",xe,cr,Tt]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,Wr,Ur]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",u,Wr,Ur]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[xe,Tt]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,Wr,Ur]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[xe,pe,he]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:ae()}],brightness:[{brightness:[xe,pe,he]}],contrast:[{contrast:[xe,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Wr,Ur]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",xe,pe,he]}],"hue-rotate":[{"hue-rotate":[xe,pe,he]}],invert:[{invert:["",xe,pe,he]}],saturate:[{saturate:[xe,pe,he]}],sepia:[{sepia:["",xe,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[xe,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[xe,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",xe,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[xe,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[xe,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xe,"initial",pe,he]}],ease:[{ease:["linear","initial",g,pe,he]}],delay:[{delay:[xe,pe,he]}],animate:[{animate:["none",v,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,pe,he]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,he]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[xe,cr,Tt,to]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ve(...e){return Pd(Yc(e))}var $r={exports:{}},dr={};/**
13
13
  * @license React
14
14
  * react-jsx-runtime.production.js
15
15
  *
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * This source code is licensed under the MIT license found in the
19
19
  * LICENSE file in the root directory of this source tree.
20
- */var Vi;function Td(){if(Vi)return cr;Vi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return cr.Fragment=t,cr.jsx=r,cr.jsxs=r,cr}var dr={};/**
20
+ */var Zi;function Id(){if(Zi)return dr;Zi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return dr.Fragment=t,dr.jsx=r,dr.jsxs=r,dr}var ur={};/**
21
21
  * @license React
22
22
  * react-jsx-runtime.development.js
23
23
  *
@@ -25,196 +25,196 @@
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */var Yi;function Od(){return Yi||(Yi=1,process.env.NODE_ENV!=="production"&&(function(){function e(j){if(j==null)return null;if(typeof j=="function")return j.$$typeof===F?null:j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case b:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof j=="object")switch(typeof j.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case h:return"Portal";case S:return j.displayName||"Context";case k:return(j._context.displayName||"Context")+".Consumer";case C:var D=j.render;return j=j.displayName,j||(j=D.displayName||D.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case P:return D=j.displayName||null,D!==null?D:e(j.type)||"Memo";case I:D=j._payload,j=j._init;try{return e(j(D))}catch{}}return null}function t(j){return""+j}function r(j){try{t(j);var D=!1}catch{D=!0}if(D){D=console;var Q=D.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return Q.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(j)}}function n(j){if(j===b)return"<>";if(typeof j=="object"&&j!==null&&j.$$typeof===I)return"<...>";try{var D=e(j);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function o(){var j=E.A;return j===null?null:j.getOwner()}function i(){return Error("react-stack-top-frame")}function s(j){if(L.call(j,"key")){var D=Object.getOwnPropertyDescriptor(j,"key").get;if(D&&D.isReactWarning)return!1}return j.key!==void 0}function a(j,D){function Q(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}Q.isReactWarning=!0,Object.defineProperty(j,"key",{get:Q,configurable:!0})}function l(){var j=e(this.type);return W[j]||(W[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function c(j,D,Q,G,re,ue){var J=Q.ref;return j={$$typeof:w,type:j,key:D,props:Q,_owner:G},(J!==void 0?J:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:l}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function d(j,D,Q,G,re,ue){var J=D.children;if(J!==void 0)if(G)if(y(J)){for(G=0;G<J.length;G++)u(J[G]);Object.freeze&&Object.freeze(J)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(J);if(L.call(D,"key")){J=e(j);var ae=Object.keys(D).filter(function(ie){return ie!=="key"});G=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",oe[J+G]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
28
+ */var Ki;function Dd(){return Ki||(Ki=1,process.env.NODE_ENV!=="production"&&(function(){function e(j){if(j==null)return null;if(typeof j=="function")return j.$$typeof===F?null:j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case b:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof j=="object")switch(typeof j.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case h:return"Portal";case S:return j.displayName||"Context";case k:return(j._context.displayName||"Context")+".Consumer";case C:var D=j.render;return j=j.displayName,j||(j=D.displayName||D.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case P:return D=j.displayName||null,D!==null?D:e(j.type)||"Memo";case I:D=j._payload,j=j._init;try{return e(j(D))}catch{}}return null}function t(j){return""+j}function r(j){try{t(j);var D=!1}catch{D=!0}if(D){D=console;var Q=D.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return Q.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(j)}}function n(j){if(j===b)return"<>";if(typeof j=="object"&&j!==null&&j.$$typeof===I)return"<...>";try{var D=e(j);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function o(){var j=E.A;return j===null?null:j.getOwner()}function i(){return Error("react-stack-top-frame")}function s(j){if(L.call(j,"key")){var D=Object.getOwnPropertyDescriptor(j,"key").get;if(D&&D.isReactWarning)return!1}return j.key!==void 0}function a(j,D){function Q(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}Q.isReactWarning=!0,Object.defineProperty(j,"key",{get:Q,configurable:!0})}function l(){var j=e(this.type);return W[j]||(W[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function c(j,D,Q,G,re,ue){var J=Q.ref;return j={$$typeof:w,type:j,key:D,props:Q,_owner:G},(J!==void 0?J:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:l}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function d(j,D,Q,G,re,ue){var J=D.children;if(J!==void 0)if(G)if(y(J)){for(G=0;G<J.length;G++)u(J[G]);Object.freeze&&Object.freeze(J)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(J);if(L.call(D,"key")){J=e(j);var ae=Object.keys(D).filter(function(ie){return ie!=="key"});G=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",oe[J+G]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
29
29
  let props = %s;
30
30
  <%s {...props} />
31
31
  React keys must be passed directly to JSX without using spread:
32
32
  let props = %s;
33
- <%s key={someKey} {...props} />`,G,J,ae,J),oe[J+G]=!0)}if(J=null,Q!==void 0&&(r(Q),J=""+Q),s(D)&&(r(D.key),J=""+D.key),"key"in D){Q={};for(var de in D)de!=="key"&&(Q[de]=D[de])}else Q=D;return J&&a(Q,typeof j=="function"?j.displayName||j.name||"Unknown":j),c(j,J,Q,o(),re,ue)}function u(j){m(j)?j._store&&(j._store.validated=1):typeof j=="object"&&j!==null&&j.$$typeof===I&&(j._payload.status==="fulfilled"?m(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function m(j){return typeof j=="object"&&j!==null&&j.$$typeof===w}var f=N,w=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),E=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,y=Array.isArray,U=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(j){return j()}};var te,W={},V=f.react_stack_bottom_frame.bind(f,i)(),H=U(n(i)),oe={};dr.Fragment=b,dr.jsx=function(j,D,Q){var G=1e4>E.recentlyCreatedOwnerStacks++;return d(j,D,Q,!1,G?Error("react-stack-top-frame"):V,G?U(n(j)):H)},dr.jsxs=function(j,D,Q){var G=1e4>E.recentlyCreatedOwnerStacks++;return d(j,D,Q,!0,G?Error("react-stack-top-frame"):V,G?U(n(j)):H)}})()),dr}var Zi;function Pd(){return Zi||(Zi=1,process.env.NODE_ENV==="production"?Wr.exports=Td():Wr.exports=Od()),Wr.exports}var p=Pd();const Ki=N.createContext(void 0),Gi=({config:e,children:t})=>p.jsx(Ki.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function ur(){const e=N.useContext(Ki);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Xi=N.createContext(void 0),$r=({mode:e,children:t})=>(N.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),p.jsx(Xi.Provider,{value:{mode:e},children:t})),qi=()=>{const e=N.useContext(Xi);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
33
+ <%s key={someKey} {...props} />`,G,J,ae,J),oe[J+G]=!0)}if(J=null,Q!==void 0&&(r(Q),J=""+Q),s(D)&&(r(D.key),J=""+D.key),"key"in D){Q={};for(var de in D)de!=="key"&&(Q[de]=D[de])}else Q=D;return J&&a(Q,typeof j=="function"?j.displayName||j.name||"Unknown":j),c(j,J,Q,o(),re,ue)}function u(j){m(j)?j._store&&(j._store.validated=1):typeof j=="object"&&j!==null&&j.$$typeof===I&&(j._payload.status==="fulfilled"?m(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function m(j){return typeof j=="object"&&j!==null&&j.$$typeof===w}var f=N,w=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),E=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,y=Array.isArray,U=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(j){return j()}};var te,W={},V=f.react_stack_bottom_frame.bind(f,i)(),H=U(n(i)),oe={};ur.Fragment=b,ur.jsx=function(j,D,Q){var G=1e4>E.recentlyCreatedOwnerStacks++;return d(j,D,Q,!1,G?Error("react-stack-top-frame"):V,G?U(n(j)):H)},ur.jsxs=function(j,D,Q){var G=1e4>E.recentlyCreatedOwnerStacks++;return d(j,D,Q,!0,G?Error("react-stack-top-frame"):V,G?U(n(j)):H)}})()),ur}var Gi;function Rd(){return Gi||(Gi=1,process.env.NODE_ENV==="production"?$r.exports=Id():$r.exports=Dd()),$r.exports}var p=Rd();const Xi=N.createContext(void 0),qi=({config:e,children:t})=>p.jsx(Xi.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function fr(){const e=N.useContext(Xi);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Ji=N.createContext(void 0),Hr=({mode:e,children:t})=>(N.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),p.jsx(Ji.Provider,{value:{mode:e},children:t})),Qi=()=>{const e=N.useContext(Ji);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
34
34
  * @license lucide-react v0.474.0 - ISC
35
35
  *
36
36
  * This source code is licensed under the ISC license.
37
37
  * See the LICENSE file in the root directory of this source tree.
38
- */const Id=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ji=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
38
+ */const Ld=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),es=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
39
39
  * @license lucide-react v0.474.0 - ISC
40
40
  *
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
- */var Dd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
43
+ */var Md={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
44
44
  * @license lucide-react v0.474.0 - ISC
45
45
  *
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
- */const Rd=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>N.createElement("svg",{ref:l,...Dd,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ji("lucide",o),...a},[...s.map(([c,d])=>N.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
48
+ */const Fd=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>N.createElement("svg",{ref:l,...Md,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:es("lucide",o),...a},[...s.map(([c,d])=>N.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
49
49
  * @license lucide-react v0.474.0 - ISC
50
50
  *
51
51
  * This source code is licensed under the ISC license.
52
52
  * See the LICENSE file in the root directory of this source tree.
53
- */const Ee=(e,t)=>{const r=N.forwardRef(({className:n,...o},i)=>N.createElement(Rd,{ref:i,iconNode:t,className:Ji(`lucide-${Id(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
53
+ */const Ee=(e,t)=>{const r=N.forwardRef(({className:n,...o},i)=>N.createElement(Fd,{ref:i,iconNode:t,className:es(`lucide-${Ld(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
54
54
  * @license lucide-react v0.474.0 - ISC
55
55
  *
56
56
  * This source code is licensed under the ISC license.
57
57
  * See the LICENSE file in the root directory of this source tree.
58
- */const Ld=Ee("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
58
+ */const Bd=Ee("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
59
59
  * @license lucide-react v0.474.0 - ISC
60
60
  *
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
- */const Md=Ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
63
+ */const Ud=Ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
64
64
  * @license lucide-react v0.474.0 - ISC
65
65
  *
66
66
  * This source code is licensed under the ISC license.
67
67
  * See the LICENSE file in the root directory of this source tree.
68
- */const Fd=Ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
68
+ */const Wd=Ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
69
69
  * @license lucide-react v0.474.0 - ISC
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const Bd=Ee("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
73
+ */const $d=Ee("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
74
74
  * @license lucide-react v0.474.0 - ISC
75
75
  *
76
76
  * This source code is licensed under the ISC license.
77
77
  * See the LICENSE file in the root directory of this source tree.
78
- */const to=Ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
78
+ */const ro=Ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
79
79
  * @license lucide-react v0.474.0 - ISC
80
80
  *
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
83
- */const Hr=Ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
83
+ */const Vr=Ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
84
84
  * @license lucide-react v0.474.0 - ISC
85
85
  *
86
86
  * This source code is licensed under the ISC license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
- */const Ud=Ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
88
+ */const Hd=Ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
89
89
  * @license lucide-react v0.474.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
- */const ro=Ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
93
+ */const no=Ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
94
94
  * @license lucide-react v0.474.0 - ISC
95
95
  *
96
96
  * This source code is licensed under the ISC license.
97
97
  * See the LICENSE file in the root directory of this source tree.
98
- */const Wd=Ee("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
98
+ */const Vd=Ee("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
99
99
  * @license lucide-react v0.474.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
- */const $d=Ee("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
103
+ */const Yd=Ee("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
104
104
  * @license lucide-react v0.474.0 - ISC
105
105
  *
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
- */const Hd=Ee("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
108
+ */const Zd=Ee("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
109
109
  * @license lucide-react v0.474.0 - ISC
110
110
  *
111
111
  * This source code is licensed under the ISC license.
112
112
  * See the LICENSE file in the root directory of this source tree.
113
- */const Vd=Ee("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
113
+ */const Kd=Ee("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
114
114
  * @license lucide-react v0.474.0 - ISC
115
115
  *
116
116
  * This source code is licensed under the ISC license.
117
117
  * See the LICENSE file in the root directory of this source tree.
118
- */const Yd=Ee("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
118
+ */const Gd=Ee("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
119
119
  * @license lucide-react v0.474.0 - ISC
120
120
  *
121
121
  * This source code is licensed under the ISC license.
122
122
  * See the LICENSE file in the root directory of this source tree.
123
- */const Qi=Ee("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
123
+ */const ts=Ee("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
124
124
  * @license lucide-react v0.474.0 - ISC
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const Vr=Ee("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
128
+ */const Yr=Ee("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
129
129
  * @license lucide-react v0.474.0 - ISC
130
130
  *
131
131
  * This source code is licensed under the ISC license.
132
132
  * See the LICENSE file in the root directory of this source tree.
133
- */const no=Ee("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
133
+ */const oo=Ee("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
134
134
  * @license lucide-react v0.474.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
- */const es=Ee("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
138
+ */const rs=Ee("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
139
139
  * @license lucide-react v0.474.0 - ISC
140
140
  *
141
141
  * This source code is licensed under the ISC license.
142
142
  * See the LICENSE file in the root directory of this source tree.
143
- */const Zd=Ee("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
143
+ */const Xd=Ee("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
144
144
  * @license lucide-react v0.474.0 - ISC
145
145
  *
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
- */const Kd=Ee("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
148
+ */const qd=Ee("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
149
149
  * @license lucide-react v0.474.0 - ISC
150
150
  *
151
151
  * This source code is licensed under the ISC license.
152
152
  * See the LICENSE file in the root directory of this source tree.
153
- */const oo=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
153
+ */const io=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
154
154
  * @license lucide-react v0.474.0 - ISC
155
155
  *
156
156
  * This source code is licensed under the ISC license.
157
157
  * See the LICENSE file in the root directory of this source tree.
158
- */const ts=Ee("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
158
+ */const ns=Ee("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
159
159
  * @license lucide-react v0.474.0 - ISC
160
160
  *
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
- */const Gd=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
163
+ */const Jd=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
164
164
  * @license lucide-react v0.474.0 - ISC
165
165
  *
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
- */const Xd=Ee("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
168
+ */const Qd=Ee("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
169
169
  * @license lucide-react v0.474.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
- */const qd=Ee("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
173
+ */const eu=Ee("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
174
174
  * @license lucide-react v0.474.0 - ISC
175
175
  *
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
- */const Jd=Ee("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
178
+ */const tu=Ee("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
179
179
  * @license lucide-react v0.474.0 - ISC
180
180
  *
181
181
  * This source code is licensed under the ISC license.
182
182
  * See the LICENSE file in the root directory of this source tree.
183
- */const Qd=Ee("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
183
+ */const ru=Ee("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
184
184
  * @license lucide-react v0.474.0 - ISC
185
185
  *
186
186
  * This source code is licensed under the ISC license.
187
187
  * See the LICENSE file in the root directory of this source tree.
188
- */const Yr=Ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
188
+ */const Zr=Ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
189
189
  * @license lucide-react v0.474.0 - ISC
190
190
  *
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
- */const eu=Ee("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
193
+ */const nu=Ee("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
194
194
  * @license lucide-react v0.474.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
- */const rs=Ee("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
198
+ */const os=Ee("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
199
199
  * @license lucide-react v0.474.0 - ISC
200
200
  *
201
201
  * This source code is licensed under the ISC license.
202
202
  * See the LICENSE file in the root directory of this source tree.
203
- */const Mt=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
203
+ */const Ft=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
204
204
  * @license lucide-react v0.474.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
- */const tu=Ee("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class ru extends N.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?p.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[p.jsx(eu,{className:"text-amber-500",size:32}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),p.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),p.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const nu=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return p.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:ve("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:p.jsxs("div",{className:ve("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&p.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:p.jsx(ro,{size:12,strokeWidth:2.5})}),p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:p.jsx(Hr,{size:12,strokeWidth:2.5})})]}),p.jsx("span",{className:"shrink-0",children:e}),p.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),p.jsx("span",{className:"shrink-0",children:t})]})})},fr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var v,k;const{mode:a}=qi(),{registry:l,overlayDisabledSectionTypes:c}=ur(),d=a==="studio",u=d&&r===e.id,m=l[e.type],f=e.type==="header"||e.type==="footer"?"global":"local",w=Array.isArray(c)?c.includes(e.type):!1,h=e.type==="header"&&((v=e.settings)==null?void 0:v.sticky);if(!m)return p.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[p.jsx("strong",{children:"Missing Component:"})," ",e.type]});const b=()=>{const S=m;return e.type==="header"&&t?p.jsx(S,{data:e.data,settings:e.settings,menu:t}):p.jsx(S,{data:e.data,settings:e.settings})},g=(k=e.data)==null?void 0:k.anchorId;return p.jsxs("div",{id:g||void 0,"data-section-id":d?e.id:void 0,"data-section-type":d?e.type:void 0,"data-section-scope":d?f:void 0,...d&&u?{"data-jp-selected":!0}:{},className:ve("relative w-full",d&&!w&&"group cursor-pointer",d&&h?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",u&&"z-[70]"),children:[p.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:p.jsx(ru,{type:e.type,children:b()})}),d&&!w&&p.jsx(nu,{type:e.type,scope:f,isSelected:!!u,sectionId:n&&f==="local"?e.id:void 0,sectionIndex:n&&f==="local"?o:void 0,totalSections:n&&f==="local"?i:void 0,onReorder:n&&f==="local"?s:void 0})]})},ou=e=>{N.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])},iu="application/json",io=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,g;ou(e.meta);const[a,l]=N.useState(null),c=N.useRef({}),d=N.useRef(s);d.current=s;const u=v=>{var k;(k=d.current)==null||k.call(d,v)};N.useEffect(()=>{if(!i)return;const v=c.current[i];v&&v.scrollIntoView({behavior:"smooth",block:"center"})},[i]),N.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],S=new IntersectionObserver(A=>{A.forEach(P=>{var I;if(P.isIntersecting&&P.intersectionRatio>.5){const B=P.target.getAttribute("data-section-id");B&&((I=d.current)==null||I.call(d,B))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const T=requestAnimationFrame(()=>{C||k.forEach(A=>{const P=c.current[A];P&&S.observe(P)})});return()=>{C=!0,cancelAnimationFrame(T),S.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(g=t.footer)==null?void 0:g.id]);const m=(v,k)=>{v.preventDefault(),v.dataTransfer.dropEffect="move",l(k)},f=()=>{l(null)},w=(v,k)=>{if(v.preventDefault(),l(null),!!o)try{const S=v.dataTransfer.getData(iu),{sectionId:C}=JSON.parse(S);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const v=typeof o=="function",k=e.sections.map((S,C)=>{const T=a===C;return v?p.jsxs("div",{ref:A=>{c.current[S.id]=A},"data-section-id":S.id,style:{position:"relative"},onMouseEnter:()=>u(S.id),children:[p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:T?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:T?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:A=>m(A,C),onDragLeave:f,onDrop:A=>w(A,C)}),p.jsx(fr,{section:S,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},S.id):p.jsx("div",{ref:A=>{c.current[S.id]=A},"data-section-id":S.id,onMouseEnter:()=>u(S.id),children:p.jsx(fr,{section:S,selectedId:n})},S.id)});if(v&&k.length>0){const S=e.sections.length,C=a===S;k.push(p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:C?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:C?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:T=>m(T,S),onDragLeave:f,onDrop:T=>w(T,S)},"jp-drop-after-last"))}return k};return p.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[t.header!=null&&p.jsx("div",{ref:v=>{c.current[t.header.id]=v},"data-section-id":t.header.id,onMouseEnter:()=>u(t.header.id),children:p.jsx(fr,{section:t.header,menu:r.main,selectedId:n})}),p.jsx("main",{className:"flex-1",children:h()}),t.footer!=null&&p.jsx("div",{ref:v=>{c.current[t.footer.id]=v},"data-section-id":t.footer.id,onMouseEnter:()=>u(t.footer.id),children:p.jsx(fr,{section:t.footer,selectedId:n})})]})},Zr=({mode:e,tenantCss:t,adminCss:r,children:n})=>(N.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),p.jsx(p.Fragment,{children:n}));function su(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ft(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function so(e){return"nodeType"in e}function Fe(e){var t,r;return e?Ft(e)?e:so(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ao(e){const{Document:t}=Fe(e);return e instanceof t}function hr(e){return Ft(e)?!1:e instanceof Fe(e).HTMLElement}function ns(e){return e instanceof Fe(e).SVGElement}function Bt(e){return e?Ft(e)?e.document:so(e)?ao(e)?e:hr(e)||ns(e)?e.ownerDocument:document:document:document}const qe=Kr?N.useLayoutEffect:N.useEffect;function Gr(e){const t=N.useRef(e);return qe(()=>{t.current=e}),N.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function au(){const e=N.useRef(null),t=N.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=N.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function pr(e,t){t===void 0&&(t=[e]);const r=N.useRef(e);return qe(()=>{r.current!==e&&(r.current=e)},t),r}function mr(e,t){const r=N.useRef();return N.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Xr(e){const t=Gr(e),r=N.useRef(null),n=N.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function qr(e){const t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function gr(e,t){return N.useMemo(()=>{if(t)return t;const r=lo[e]==null?0:lo[e]+1;return lo[e]=r,e+"-"+r},[e,t])}function os(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Ut=os(1),br=os(-1);function lu(e){return"clientX"in e&&"clientY"in e}function Jr(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function cu(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function Qr(e){if(cu(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return lu(e)?{x:e.clientX,y:e.clientY}:null}const wt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[wt.Translate.toString(e),wt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),is="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function du(e){return e.matches(is)?e:e.querySelector(is)}const uu={display:"none"};function fu(e){let{id:t,value:r}=e;return N.createElement("div",{id:t,style:uu},r)}function hu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return N.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function pu(){const[e,t]=N.useState("");return{announce:N.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ss=N.createContext(null);function mu(e){const t=N.useContext(ss);N.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function gu(){const[e]=N.useState(()=>new Set),t=N.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[N.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const bu={draggable:`
208
+ */const ou=Ee("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class iu extends N.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?p.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[p.jsx(nu,{className:"text-amber-500",size:32}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),p.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),p.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const su=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return p.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:ve("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:p.jsxs("div",{className:ve("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&p.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:p.jsx(no,{size:12,strokeWidth:2.5})}),p.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:p.jsx(Vr,{size:12,strokeWidth:2.5})})]}),p.jsx("span",{className:"shrink-0",children:e}),p.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),p.jsx("span",{className:"shrink-0",children:t})]})})},hr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var v,k;const{mode:a}=Qi(),{registry:l,overlayDisabledSectionTypes:c}=fr(),d=a==="studio",u=d&&r===e.id,m=l[e.type],f=e.type==="header"||e.type==="footer"?"global":"local",w=Array.isArray(c)?c.includes(e.type):!1,h=e.type==="header"&&((v=e.settings)==null?void 0:v.sticky);if(!m)return p.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[p.jsx("strong",{children:"Missing Component:"})," ",e.type]});const b=()=>{const S=m;return e.type==="header"&&t?p.jsx(S,{data:e.data,settings:e.settings,menu:t}):p.jsx(S,{data:e.data,settings:e.settings})},g=(k=e.data)==null?void 0:k.anchorId;return p.jsxs("div",{id:g||void 0,"data-section-id":d?e.id:void 0,"data-section-type":d?e.type:void 0,"data-section-scope":d?f:void 0,...d&&u?{"data-jp-selected":!0}:{},className:ve("relative w-full",d&&!w&&"group cursor-pointer",d&&h?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",u&&"z-[70]"),children:[p.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:p.jsx(iu,{type:e.type,children:b()})}),d&&!w&&p.jsx(su,{type:e.type,scope:f,isSelected:!!u,sectionId:n&&f==="local"?e.id:void 0,sectionIndex:n&&f==="local"?o:void 0,totalSections:n&&f==="local"?i:void 0,onReorder:n&&f==="local"?s:void 0})]})},au=e=>{N.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])},lu="application/json",so=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,g;au(e.meta);const[a,l]=N.useState(null),c=N.useRef({}),d=N.useRef(s);d.current=s;const u=v=>{var k;(k=d.current)==null||k.call(d,v)};N.useEffect(()=>{if(!i)return;const v=c.current[i];v&&v.scrollIntoView({behavior:"smooth",block:"center"})},[i]),N.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],S=new IntersectionObserver(A=>{A.forEach(P=>{var I;if(P.isIntersecting&&P.intersectionRatio>.5){const B=P.target.getAttribute("data-section-id");B&&((I=d.current)==null||I.call(d,B))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const T=requestAnimationFrame(()=>{C||k.forEach(A=>{const P=c.current[A];P&&S.observe(P)})});return()=>{C=!0,cancelAnimationFrame(T),S.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(g=t.footer)==null?void 0:g.id]);const m=(v,k)=>{v.preventDefault(),v.dataTransfer.dropEffect="move",l(k)},f=()=>{l(null)},w=(v,k)=>{if(v.preventDefault(),l(null),!!o)try{const S=v.dataTransfer.getData(lu),{sectionId:C}=JSON.parse(S);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const v=typeof o=="function",k=e.sections.map((S,C)=>{const T=a===C;return v?p.jsxs("div",{ref:A=>{c.current[S.id]=A},"data-section-id":S.id,style:{position:"relative"},onMouseEnter:()=>u(S.id),children:[p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:T?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:T?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:A=>m(A,C),onDragLeave:f,onDrop:A=>w(A,C)}),p.jsx(hr,{section:S,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},S.id):p.jsx("div",{ref:A=>{c.current[S.id]=A},"data-section-id":S.id,onMouseEnter:()=>u(S.id),children:p.jsx(hr,{section:S,selectedId:n})},S.id)});if(v&&k.length>0){const S=e.sections.length,C=a===S;k.push(p.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:C?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:C?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:T=>m(T,S),onDragLeave:f,onDrop:T=>w(T,S)},"jp-drop-after-last"))}return k};return p.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[t.header!=null&&p.jsx("div",{ref:v=>{c.current[t.header.id]=v},"data-section-id":t.header.id,onMouseEnter:()=>u(t.header.id),children:p.jsx(hr,{section:t.header,menu:r.main,selectedId:n})}),p.jsx("main",{className:"flex-1",children:h()}),t.footer!=null&&p.jsx("div",{ref:v=>{c.current[t.footer.id]=v},"data-section-id":t.footer.id,onMouseEnter:()=>u(t.footer.id),children:p.jsx(hr,{section:t.footer,selectedId:n})})]})},Kr=({mode:e,tenantCss:t,adminCss:r,children:n})=>(N.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),p.jsx(p.Fragment,{children:n}));function cu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Gr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ao(e){return"nodeType"in e}function Fe(e){var t,r;return e?Bt(e)?e:ao(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function lo(e){const{Document:t}=Fe(e);return e instanceof t}function pr(e){return Bt(e)?!1:e instanceof Fe(e).HTMLElement}function is(e){return e instanceof Fe(e).SVGElement}function Ut(e){return e?Bt(e)?e.document:ao(e)?lo(e)?e:pr(e)||is(e)?e.ownerDocument:document:document:document}const Je=Gr?N.useLayoutEffect:N.useEffect;function Xr(e){const t=N.useRef(e);return Je(()=>{t.current=e}),N.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function du(){const e=N.useRef(null),t=N.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=N.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function mr(e,t){t===void 0&&(t=[e]);const r=N.useRef(e);return Je(()=>{r.current!==e&&(r.current=e)},t),r}function gr(e,t){const r=N.useRef();return N.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function qr(e){const t=Xr(e),r=N.useRef(null),n=N.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function Jr(e){const t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}let co={};function br(e,t){return N.useMemo(()=>{if(t)return t;const r=co[e]==null?0:co[e]+1;return co[e]=r,e+"-"+r},[e,t])}function ss(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Wt=ss(1),vr=ss(-1);function uu(e){return"clientX"in e&&"clientY"in e}function Qr(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function fu(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function en(e){if(fu(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return uu(e)?{x:e.clientX,y:e.clientY}:null}const xt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[xt.Translate.toString(e),xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),as="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hu(e){return e.matches(as)?e:e.querySelector(as)}const pu={display:"none"};function mu(e){let{id:t,value:r}=e;return N.createElement("div",{id:t,style:pu},r)}function gu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return N.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function bu(){const[e,t]=N.useState("");return{announce:N.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ls=N.createContext(null);function vu(e){const t=N.useContext(ls);N.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function wu(){const[e]=N.useState(()=>new Set),t=N.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[N.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const xu={draggable:`
209
209
  To pick up a draggable item, press the space bar.
210
210
  While dragging, use the arrow keys to move the item.
211
211
  Press space again to drop the item in its new position, or press escape to cancel.
212
- `},vu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function wu(e){let{announcements:t=vu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=bu}=e;const{announce:i,announcement:s}=pu(),a=gr("DndLiveRegion"),[l,c]=N.useState(!1);if(N.useEffect(()=>{c(!0)},[]),mu(N.useMemo(()=>({onDragStart(u){let{active:m}=u;i(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:f}=u;t.onDragMove&&i(t.onDragMove({active:m,over:f}))},onDragOver(u){let{active:m,over:f}=u;i(t.onDragOver({active:m,over:f}))},onDragEnd(u){let{active:m,over:f}=u;i(t.onDragEnd({active:m,over:f}))},onDragCancel(u){let{active:m,over:f}=u;i(t.onDragCancel({active:m,over:f}))}}),[i,t])),!l)return null;const d=N.createElement(N.Fragment,null,N.createElement(fu,{id:n,value:o.draggable}),N.createElement(hu,{id:a,announcement:s}));return r?gt.createPortal(d,r):d}var Ie;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ie||(Ie={}));function en(){}function co(e,t){return N.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function xu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Je=Object.freeze({x:0,y:0});function as(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yu(e,t){const r=Qr(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function ls(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function ku(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function cs(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function ds(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function us(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Su=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=us(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=as(us(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(ls)},_u=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=cs(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=cs(l),d=o.reduce((m,f,w)=>m+as(c[w],f),0),u=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(ls)};function Cu(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,c=e.width*e.height,d=s*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const Eu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=Cu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(ku)};function Nu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function fs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Je}function zu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const Au=zu(1);function hs(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ju(e,t,r){const n=hs(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),c=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const Tu={ignoreTransform:!1};function Wt(e,t){t===void 0&&(t=Tu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Fe(e).getComputedStyle(e);c&&(r=ju(r,c,d))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function ps(e){return Wt(e,{ignoreTransform:!0})}function Ou(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Pu(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function Iu(e,t){t===void 0&&(t=Fe(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function tn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(ao(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!hr(o)||ns(o)||r.includes(o))return r;const i=Fe(e).getComputedStyle(o);return o!==e&&Iu(o,i)&&r.push(o),Pu(o,i)?r:n(o.parentNode)}return e?n(e):r}function ms(e){const[t]=tn(e,1);return t??null}function uo(e){return!Kr||!e?null:Ft(e)?e:so(e)?ao(e)||e===Bt(e).scrollingElement?window:hr(e)?e:null:null}function gs(e){return Ft(e)?e.scrollX:e.scrollLeft}function bs(e){return Ft(e)?e.scrollY:e.scrollTop}function fo(e){return{x:gs(e),y:bs(e)}}var De;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(De||(De={}));function vs(e){return!Kr||!e?!1:e===document.scrollingElement}function ws(e){const t={x:0,y:0},r=vs(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Du={x:.2,y:.2};function Ru(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Du);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=ws(e),f={x:0,y:0},w={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(f.y=De.Backward,w.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(f.y=De.Forward,w.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(f.x=De.Forward,w.x=n*Math.abs((t.right-h.width-a)/h.width)):!u&&s<=t.left+h.width&&(f.x=De.Backward,w.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:f,speed:w}}function Lu(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function xs(e){return e.reduce((t,r)=>Ut(t,fo(r)),Je)}function Mu(e){return e.reduce((t,r)=>t+gs(r),0)}function Fu(e){return e.reduce((t,r)=>t+bs(r),0)}function ys(e,t){if(t===void 0&&(t=Wt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ms(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Bu=[["x",["left","right"],Mu],["y",["top","bottom"],Fu]];class ho{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=tn(r),o=xs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Bu)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(n),d=o[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Uu(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Bt(e)}function po(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ze||(Ze={}));function ks(e){e.preventDefault()}function Wu(e){e.stopPropagation()}var _e;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_e||(_e={}));const Ss={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},$u=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case _e.Right:return{...r,x:r.x+25};case _e.Left:return{...r,x:r.x-25};case _e.Down:return{...r,y:r.y+25};case _e.Up:return{...r,y:r.y-25}}};class mo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new vr(Bt(r)),this.windowListeners=new vr(Fe(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ze.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&ys(n),r(Je)}handleKeyDown(t){if(Jr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=Ss,coordinateGetter:s=$u,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:Je;this.referenceCoordinates||(this.referenceCoordinates=d);const u=s(t,{active:r,context:n.current,currentCoordinates:d});if(u){const m=br(u,d),f={x:0,y:0},{scrollableAncestors:w}=n.current;for(const h of w){const b=t.code,{isTop:g,isRight:v,isLeft:k,isBottom:S,maxScroll:C,minScroll:T}=ws(h),A=Lu(h),P={x:Math.min(b===_e.Right?A.right-A.width/2:A.right,Math.max(b===_e.Right?A.left:A.left+A.width/2,u.x)),y:Math.min(b===_e.Down?A.bottom-A.height/2:A.bottom,Math.max(b===_e.Down?A.top:A.top+A.height/2,u.y))},I=b===_e.Right&&!v||b===_e.Left&&!k,B=b===_e.Down&&!S||b===_e.Up&&!g;if(I&&P.x!==u.x){const F=h.scrollLeft+m.x,E=b===_e.Right&&F<=C.x||b===_e.Left&&F>=T.x;if(E&&!m.y){h.scrollTo({left:F,behavior:a});return}E?f.x=h.scrollLeft-F:f.x=b===_e.Right?h.scrollLeft-C.x:h.scrollLeft-T.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(B&&P.y!==u.y){const F=h.scrollTop+m.y,E=b===_e.Down&&F<=C.y||b===_e.Up&&F>=T.y;if(E&&!m.x){h.scrollTo({top:F,behavior:a});return}E?f.y=h.scrollTop-F:f.y=b===_e.Down?h.scrollTop-C.y:h.scrollTop-T.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Ut(br(u,this.referenceCoordinates),f))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}mo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ss,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function _s(e){return!!(e&&"distance"in e)}function Cs(e){return!!(e&&"delay"in e)}class go{constructor(t,r,n){var o;n===void 0&&(n=Uu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Bt(s),this.documentListeners=new vr(this.document),this.listeners=new vr(n),this.windowListeners=new vr(Fe(s)),this.initialCoordinates=(o=Qr(i))!=null?o:Je,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.DragStart,ks),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,ks),this.documentListeners.add(Ze.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Cs(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(_s(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ze.Click,Wu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ze.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=Qr(t))!=null?r:Je,c=br(o,l);if(!n&&a){if(_s(a)){if(a.tolerance!=null&&po(c,a.tolerance))return this.handleCancel();if(po(c,a.distance))return this.handleStart()}if(Cs(a)&&po(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===_e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Hu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bo extends go{constructor(t){const{event:r}=t,n=Bt(r.target);super(t,Hu,n)}}bo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Vu={move:{name:"mousemove"},end:{name:"mouseup"}};var vo;(function(e){e[e.RightClick=2]="RightClick"})(vo||(vo={}));class Yu extends go{constructor(t){super(t,Vu,Bt(t.event.target))}}Yu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===vo.RightClick?!1:(n==null||n({event:r}),!0)}}];const wo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Es extends go{constructor(t){super(t,wo)}static setup(){return window.addEventListener(wo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wo.move.name,t)};function t(){}}}Es.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var wr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wr||(wr={}));var rn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rn||(rn={}));function Zu(e){let{acceleration:t,activator:r=wr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=rn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e;const f=Gu({delta:u,disabled:!i}),[w,h]=au(),b=N.useRef({x:0,y:0}),g=N.useRef({x:0,y:0}),v=N.useMemo(()=>{switch(r){case wr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case wr.DraggableRect:return o}},[r,o,l]),k=N.useRef(null),S=N.useCallback(()=>{const T=k.current;if(!T)return;const A=b.current.x*g.current.x,P=b.current.y*g.current.y;T.scrollBy(A,P)},[]),C=N.useMemo(()=>a===rn.TreeOrder?[...c].reverse():c,[a,c]);N.useEffect(()=>{if(!i||!c.length||!v){h();return}for(const T of C){if((n==null?void 0:n(T))===!1)continue;const A=c.indexOf(T),P=d[A];if(!P)continue;const{direction:I,speed:B}=Ru(T,P,v,t,m);for(const F of["x","y"])f[F][I[F]]||(B[F]=0,I[F]=0);if(B.x>0||B.y>0){h(),k.current=T,w(S,s),b.current=B,g.current=I;return}}b.current={x:0,y:0},g.current={x:0,y:0},h()},[t,S,n,h,i,s,JSON.stringify(v),JSON.stringify(f),w,c,C,d,JSON.stringify(m)])}const Ku={x:{[De.Backward]:!1,[De.Forward]:!1},y:{[De.Backward]:!1,[De.Forward]:!1}};function Gu(e){let{delta:t,disabled:r}=e;const n=qr(t);return mr(o=>{if(r||!n||!o)return Ku;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[De.Backward]:o.x[De.Backward]||i.x===-1,[De.Forward]:o.x[De.Forward]||i.x===1},y:{[De.Backward]:o.y[De.Backward]||i.y===-1,[De.Forward]:o.y[De.Forward]||i.y===1}}},[r,t,n])}function Xu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return mr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function qu(e,t){return N.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var xr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(xr||(xr={}));var xo;(function(e){e.Optimized="optimized"})(xo||(xo={}));const Ns=new Map;function Ju(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=N.useState(null),{frequency:a,measure:l,strategy:c}=o,d=N.useRef(e),u=b(),m=pr(u),f=N.useCallback(function(g){g===void 0&&(g=[]),!m.current&&s(v=>v===null?g:v.concat(g.filter(k=>!v.includes(k))))},[m]),w=N.useRef(null),h=mr(g=>{if(u&&!r)return Ns;if(!g||g===Ns||d.current!==e||i!=null){const v=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){v.set(k.id,k.rect.current);continue}const S=k.node.current,C=S?new ho(l(S),S):null;k.rect.current=C,C&&v.set(k.id,C)}return v}return g},[e,i,r,u,l]);return N.useEffect(()=>{d.current=e},[e]),N.useEffect(()=>{u||f()},[r,u]),N.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),N.useEffect(()=>{u||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{f(),w.current=null},a))},[a,u,f,...n]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:i!=null};function b(){switch(c){case xr.Always:return!1;case xr.BeforeDragging:return r;default:return!r}}}function yo(e,t){return mr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Qu(e,t){return yo(e,t)}function ef(e){let{callback:t,disabled:r}=e;const n=Gr(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function nn(e){let{callback:t,disabled:r}=e;const n=Gr(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function tf(e){return new ho(Wt(e),e)}function zs(e,t,r){t===void 0&&(t=tf);const[n,o]=N.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=ef({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=nn({callback:i});return qe(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function rf(e){const t=yo(e);return fs(e,t)}const As=[];function nf(e){const t=N.useRef(e),r=mr(n=>e?n&&n!==As&&e&&t.current&&e.parentNode===t.current.parentNode?n:tn(e):As,[e]);return N.useEffect(()=>{t.current=e},[e]),r}function of(e){const[t,r]=N.useState(null),n=N.useRef(e),o=N.useCallback(i=>{const s=uo(i.target);s&&r(a=>a?(a.set(s,fo(s)),new Map(a)):null)},[]);return N.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=uo(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,fo(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=uo(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),N.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ut(i,s),Je):xs(e):Je,[e,t])}function js(e,t){t===void 0&&(t=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},t),N.useEffect(()=>{const n=e!==Je;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?br(e,r.current):Je}function sf(e){N.useEffect(()=>{if(!Kr)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function af(e,t){return N.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Ts(e){return N.useMemo(()=>e?Ou(e):null,[e])}const Os=[];function lf(e,t){t===void 0&&(t=Wt);const[r]=e,n=Ts(r?Fe(r):null),[o,i]=N.useState(Os);function s(){i(()=>e.length?e.map(l=>vs(l)?n:new ho(t(l),l)):Os)}const a=nn({callback:s});return qe(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Ps(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hr(t)?t:e}function cf(e){let{measure:t}=e;const[r,n]=N.useState(null),o=N.useCallback(c=>{for(const{target:d}of c)if(hr(d)){n(u=>{const m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=nn({callback:o}),s=N.useCallback(c=>{const d=Ps(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=Xr(s);return N.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const df=[{sensor:bo,options:{}},{sensor:mo,options:{}}],uf={current:{}},on={draggable:{measure:ps},droppable:{measure:ps,strategy:xr.WhileDragging,frequency:xo.Optimized},dragOverlay:{measure:Wt}};class yr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const ff={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new yr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:en},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:on,measureDroppableContainers:en,windowRect:null,measuringScheduled:!1},Is={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:en,draggableNodes:new Map,over:null,measureDroppableContainers:en},kr=N.createContext(Is),Ds=N.createContext(ff);function hf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yr}}}function pf(e,t){switch(t.type){case Ie.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ie.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ie.DragEnd:case Ie.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ie.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new yr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Ie.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new yr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Ie.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new yr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function mf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=N.useContext(kr),i=qr(n),s=qr(r==null?void 0:r.id);return N.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!Jr(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=du(d);if(u){u.focus();break}}})}},[n,t,o,s,i]),null}function Rs(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function gf(e){return N.useMemo(()=>({draggable:{...on.draggable,...e==null?void 0:e.draggable},droppable:{...on.droppable,...e==null?void 0:e.droppable},dragOverlay:{...on.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function bf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=N.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;qe(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=r(c),u=fs(d,n);if(s||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=ms(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,s,a,n,r])}const sn=N.createContext({...Je,scaleX:1,scaleY:1});var xt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xt||(xt={}));const vf=N.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=df,collisionDetection:u=Eu,measuring:m,modifiers:f,...w}=t;const h=N.useReducer(pf,void 0,hf),[b,g]=h,[v,k]=gu(),[S,C]=N.useState(xt.Uninitialized),T=S===xt.Initialized,{draggable:{active:A,nodes:P,translate:I},droppable:{containers:B}}=b,F=A!=null?P.get(A):null,E=N.useRef({initial:null,translated:null}),L=N.useMemo(()=>{var Te;return A!=null?{id:A,data:(Te=F==null?void 0:F.data)!=null?Te:uf,rect:E}:null},[A,F]),y=N.useRef(null),[U,te]=N.useState(null),[W,V]=N.useState(null),H=pr(w,Object.values(w)),oe=gr("DndDescribedBy",s),j=N.useMemo(()=>B.getEnabled(),[B]),D=gf(m),{droppableRects:Q,measureDroppableContainers:G,measuringScheduled:re}=Ju(j,{dragging:T,dependencies:[I.x,I.y],config:D.droppable}),ue=Xu(P,A),J=N.useMemo(()=>W?Qr(W):null,[W]),ae=Gn(),de=Qu(ue,D.draggable.measure);bf({activeNode:A!=null?P.get(A):null,config:ae.layoutShiftCompensation,initialRect:de,measure:D.draggable.measure});const ie=zs(ue,D.draggable.measure,de),fe=zs(ue?ue.parentElement:null),me=N.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=B.getNodeFor((r=me.current.over)==null?void 0:r.id),x=cf({measure:D.dragOverlay.measure}),K=(n=x.nodeRef.current)!=null?n:ue,Y=T?(o=x.rect)!=null?o:ie:null,O=!!(x.nodeRef.current&&x.rect),z=rf(O?null:ie),M=Ts(K?Fe(K):null),q=nf(T?ye??ue:null),ee=lf(q),$=Rs(f,{transform:{x:I.x-z.x,y:I.y-z.y,scaleX:1,scaleY:1},activatorEvent:W,active:L,activeNodeRect:ie,containerNodeRect:fe,draggingNodeRect:Y,over:me.current.over,overlayNodeRect:x.rect,scrollableAncestors:q,scrollableAncestorRects:ee,windowRect:M}),ne=J?Ut(J,I):null,ce=of(q),se=js(ce),R=js(ce,[ie]),Z=Ut($,se),X=Y?Au(Y,$):null,le=L&&X?u({active:L,collisionRect:X,droppableRects:Q,droppableContainers:j,pointerCoordinates:ne}):null,be=ds(le,"id"),[ge,we]=N.useState(null),Se=O?$:Ut($,R),Ne=Nu(Se,(i=ge==null?void 0:ge.rect)!=null?i:null,ie),pt=N.useRef(null),Ge=N.useCallback((Te,Re)=>{let{sensor:He,options:Nt}=Re;if(y.current==null)return;const Xe=P.get(y.current);if(!Xe)return;const Ve=Te.nativeEvent,lt=new He({active:y.current,activeNode:Xe,event:Ve,options:Nt,context:me,onAbort(Me){if(!P.get(Me))return;const{onDragAbort:ct}=H.current,mt={id:Me};ct==null||ct(mt),v({type:"onDragAbort",event:mt})},onPending(Me,zt,ct,mt){if(!P.get(Me))return;const{onDragPending:Ir}=H.current,At={id:Me,constraint:zt,initialCoordinates:ct,offset:mt};Ir==null||Ir(At),v({type:"onDragPending",event:At})},onStart(Me){const zt=y.current;if(zt==null)return;const ct=P.get(zt);if(!ct)return;const{onDragStart:mt}=H.current,Pr={activatorEvent:Ve,active:{id:zt,data:ct.data,rect:E}};gt.unstable_batchedUpdates(()=>{mt==null||mt(Pr),C(xt.Initializing),g({type:Ie.DragStart,initialCoordinates:Me,active:zt}),v({type:"onDragStart",event:Pr}),te(pt.current),V(Ve)})},onMove(Me){g({type:Ie.DragMove,coordinates:Me})},onEnd:ar(Ie.DragEnd),onCancel:ar(Ie.DragCancel)});pt.current=lt;function ar(Me){return async function(){const{active:ct,collisions:mt,over:Pr,scrollAdjustedTranslate:Ir}=me.current;let At=null;if(ct&&Ir){const{cancelDrop:Dr}=H.current;At={activatorEvent:Ve,active:ct,collisions:mt,delta:Ir,over:Pr},Me===Ie.DragEnd&&typeof Dr=="function"&&await Promise.resolve(Dr(At))&&(Me=Ie.DragCancel)}y.current=null,gt.unstable_batchedUpdates(()=>{g({type:Me}),C(xt.Uninitialized),we(null),te(null),V(null),pt.current=null;const Dr=Me===Ie.DragEnd?"onDragEnd":"onDragCancel";if(At){const xi=H.current[Dr];xi==null||xi(At),v({type:Dr,event:At})}})}}},[P]),Zn=N.useCallback((Te,Re)=>(He,Nt)=>{const Xe=He.nativeEvent,Ve=P.get(Nt);if(y.current!==null||!Ve||Xe.dndKit||Xe.defaultPrevented)return;const lt={active:Ve};Te(He,Re.options,lt)===!0&&(Xe.dndKit={capturedBy:Re.sensor},y.current=Nt,Ge(He,Re))},[P,Ge]),Kn=qu(d,Zn);sf(d),qe(()=>{ie&&S===xt.Initializing&&C(xt.Initialized)},[ie,S]),N.useEffect(()=>{const{onDragMove:Te}=H.current,{active:Re,activatorEvent:He,collisions:Nt,over:Xe}=me.current;if(!Re||!He)return;const Ve={active:Re,activatorEvent:He,collisions:Nt,delta:{x:Z.x,y:Z.y},over:Xe};gt.unstable_batchedUpdates(()=>{Te==null||Te(Ve),v({type:"onDragMove",event:Ve})})},[Z.x,Z.y]),N.useEffect(()=>{const{active:Te,activatorEvent:Re,collisions:He,droppableContainers:Nt,scrollAdjustedTranslate:Xe}=me.current;if(!Te||y.current==null||!Re||!Xe)return;const{onDragOver:Ve}=H.current,lt=Nt.get(be),ar=lt&&lt.rect.current?{id:lt.id,rect:lt.rect.current,data:lt.data,disabled:lt.disabled}:null,Me={active:Te,activatorEvent:Re,collisions:He,delta:{x:Xe.x,y:Xe.y},over:ar};gt.unstable_batchedUpdates(()=>{we(ar),Ve==null||Ve(Me),v({type:"onDragOver",event:Me})})},[be]),qe(()=>{me.current={activatorEvent:W,active:L,activeNode:ue,collisionRect:X,collisions:le,droppableRects:Q,draggableNodes:P,draggingNode:K,draggingNodeRect:Y,droppableContainers:B,over:ge,scrollableAncestors:q,scrollAdjustedTranslate:Z},E.current={initial:Y,translated:X}},[L,ue,le,X,P,K,Y,Q,B,ge,q,Z]),Zu({...ae,delta:I,draggingRect:X,pointerCoordinates:ne,scrollableAncestors:q,scrollableAncestorRects:ee});const vi=N.useMemo(()=>({active:L,activeNode:ue,activeNodeRect:ie,activatorEvent:W,collisions:le,containerNodeRect:fe,dragOverlay:x,draggableNodes:P,droppableContainers:B,droppableRects:Q,over:ge,measureDroppableContainers:G,scrollableAncestors:q,scrollableAncestorRects:ee,measuringConfiguration:D,measuringScheduled:re,windowRect:M}),[L,ue,ie,W,le,fe,x,P,B,Q,ge,G,q,ee,D,re,M]),wi=N.useMemo(()=>({activatorEvent:W,activators:Kn,active:L,activeNodeRect:ie,ariaDescribedById:{draggable:oe},dispatch:g,draggableNodes:P,over:ge,measureDroppableContainers:G}),[W,Kn,L,ie,g,oe,P,ge,G]);return N.createElement(ss.Provider,{value:k},N.createElement(kr.Provider,{value:wi},N.createElement(Ds.Provider,{value:vi},N.createElement(sn.Provider,{value:Ne},c)),N.createElement(mf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),N.createElement(wu,{...a,hiddenTextDescribedById:oe}));function Gn(){const Te=(U==null?void 0:U.autoScrollEnabled)===!1,Re=typeof l=="object"?l.enabled===!1:l===!1,He=T&&!Te&&!Re;return typeof l=="object"?{...l,enabled:He}:{enabled:He}}}),wf=N.createContext(null),Ls="button",xf="Draggable";function yf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=gr(xf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=N.useContext(kr),{role:f=Ls,roleDescription:w="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,g=N.useContext(b?sn:wf),[v,k]=Xr(),[S,C]=Xr(),T=af(s,t),A=pr(r);qe(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:S,data:A}),()=>{const I=u.get(t);I&&I.key===i&&u.delete(t)}),[u,t]);const P=N.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&f===Ls?!0:void 0,"aria-roledescription":w,"aria-describedby":d.draggable}),[n,f,h,b,w,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:P,isDragging:b,listeners:n?void 0:T,node:v,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Ms(){return N.useContext(Ds)}const kf="Droppable",Sf={timeout:25};function _f(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=gr(kf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=N.useContext(kr),d=N.useRef({disabled:r}),u=N.useRef(!1),m=N.useRef(null),f=N.useRef(null),{disabled:w,updateMeasurementsFor:h,timeout:b}={...Sf,...o},g=pr(h??n),v=N.useCallback(()=>{if(!u.current){u.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),f.current=null},b)},[b]),k=nn({callback:v,disabled:w||!s}),S=N.useCallback((P,I)=>{k&&(I&&(k.unobserve(I),u.current=!1),P&&k.observe(P))},[k]),[C,T]=Xr(S),A=pr(t);return N.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),N.useEffect(()=>(a({type:Ie.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:A}}),()=>a({type:Ie.UnregisterDroppable,key:i,id:n})),[n]),N.useEffect(()=>{r!==d.current.disabled&&(a({type:Ie.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:s,rect:m,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:T}}function Cf(e){let{animation:t,children:r}=e;const[n,o]=N.useState(null),[i,s]=N.useState(null),a=qr(r);return!r&&!n&&a&&o(a),qe(()=>{if(!i)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,n,i]),N.createElement(N.Fragment,null,r,n?N.cloneElement(n,{ref:s}):null)}const Ef={x:0,y:0,scaleX:1,scaleY:1};function Nf(e){let{children:t}=e;return N.createElement(kr.Provider,{value:Is},N.createElement(sn.Provider,{value:Ef},t))}const zf={position:"fixed",touchAction:"none"},Af=e=>Jr(e)?"transform 250ms ease":void 0,jf=N.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Af}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},m={...zf,width:a.width,height:a.height,top:a.top,left:a.left,transform:wt.Transform.toString(u),transformOrigin:o&&n?yu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return N.createElement(r,{className:s,style:m,ref:t},i)}),Tf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:wt.Transform.toString(t)},{transform:wt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))r.node.style.setProperty(l,c);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Of(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Gr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Ps(s);if(!c)return;const{transform:d}=Fe(s).getComputedStyle(s),u=hs(d);if(!u)return;const m=typeof t=="function"?t:Pf(t);return ys(l,o.draggable.measure),m({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:u})})}function Pf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Tf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},u={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},m={x:l.x-d.x,y:l.y-d.y,...u},f=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:m}}),[w]=f,h=f[f.length-1];if(JSON.stringify(w)===JSON.stringify(h))return;const b=n==null?void 0:n({active:s,dragOverlay:a,...c}),g=a.node.animate(f,{duration:t,easing:r,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{b==null||b(),v()}})}}let Fs=0;function If(e){return N.useMemo(()=>{if(e!=null)return Fs++,Fs},[e])}const Df=N.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggableNodes:w,droppableContainers:h,dragOverlay:b,over:g,measuringConfiguration:v,scrollableAncestors:k,scrollableAncestorRects:S,windowRect:C}=Ms(),T=N.useContext(sn),A=If(u==null?void 0:u.id),P=Rs(s,{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:S,transform:T,windowRect:C}),I=yo(m),B=Of({config:n,draggableNodes:w,droppableContainers:h,measuringConfiguration:v}),F=I?b.setRef:void 0;return N.createElement(Nf,null,N.createElement(Cf,{animation:B},u&&A?N.createElement(jf,{key:A,id:u.id,ref:F,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:I,style:{zIndex:c,...o},transform:P},r):null))}),Rf=e=>{let{transform:t}=e;return{...t,x:0}};function Bs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Lf(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function an(e){return e!==null&&e>=0}function Mf(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Ff(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Us=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Bs(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},ln={scaleX:1,scaleY:1},Bf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const c=i[s];return c?{x:0,y:r<s?c.top+c.height-(a.top+a.height):c.top-a.top,...ln}:null}const l=Uf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...ln}:o<r&&o>=s?{x:0,y:a.height+l,...ln}:{x:0,y:0,...ln}};function Uf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ws="Sortable",$s=N.createContext({activeIndex:-1,containerId:Ws,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Us,disabled:{draggable:!1,droppable:!1}});function Wf(e){let{children:t,id:r,items:n,strategy:o=Us,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Ms(),u=gr(Ws,r),m=a.rect!==null,f=N.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),w=s!=null,h=s?f.indexOf(s.id):-1,b=c?f.indexOf(c.id):-1,g=N.useRef(f),v=!Mf(f,g.current),k=b!==-1&&h===-1||v,S=Ff(i);qe(()=>{v&&w&&d(f)},[v,f,w,d]),N.useEffect(()=>{g.current=f},[f]);const C=N.useMemo(()=>({activeIndex:h,containerId:u,disabled:S,disableTransforms:k,items:f,overIndex:b,useDragOverlay:m,sortedRects:Lf(f,l),strategy:o}),[h,u,S.draggable,S.droppable,k,f,b,l,m,o]);return N.createElement($s.Provider,{value:C},t)}const $f=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Bs(r,n,o).indexOf(t)},Hf=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Vf={duration:200,easing:"ease"},Hs="transform",Yf=wt.Transition.toString({property:Hs,duration:0,easing:"linear"}),Zf={roleDescription:"sortable"};function Kf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=N.useState(null),a=N.useRef(r);return qe(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Wt(n.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&s(d)}}r!==a.current&&(a.current=r)},[t,r,n,o]),N.useEffect(()=>{i&&s(null)},[i]),i}function Gf(e){let{animateLayoutChanges:t=Hf,attributes:r,disabled:n,data:o,getNewIndex:i=$f,id:s,strategy:a,resizeObserverConfig:l,transition:c=Vf}=e;const{items:d,containerId:u,activeIndex:m,disabled:f,disableTransforms:w,sortedRects:h,overIndex:b,useDragOverlay:g,strategy:v}=N.useContext($s),k=Xf(n,f),S=d.indexOf(s),C=N.useMemo(()=>({sortable:{containerId:u,index:S,items:d},...o}),[u,o,S,d]),T=N.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:A,node:P,isOver:I,setNodeRef:B}=_f({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:F,activatorEvent:E,activeNodeRect:L,attributes:y,setNodeRef:U,listeners:te,isDragging:W,over:V,setActivatorNodeRef:H,transform:oe}=yf({id:s,data:C,attributes:{...Zf,...r},disabled:k.draggable}),j=su(B,U),D=!!F,Q=D&&!w&&an(m)&&an(b),G=!g&&W,re=G&&Q?oe:null,J=Q?re??(a??v)({rects:h,activeNodeRect:L,activeIndex:m,overIndex:b,index:S}):null,ae=an(m)&&an(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):S,de=F==null?void 0:F.id,ie=N.useRef({activeId:de,items:d,newIndex:ae,containerId:u}),fe=d!==ie.current.items,me=t({active:F,containerId:u,isDragging:W,isSorting:D,id:s,index:S,items:d,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:c,wasDragging:ie.current.activeId!=null}),ye=Kf({disabled:!me,index:S,node:P,rect:A});return N.useEffect(()=>{D&&ie.current.newIndex!==ae&&(ie.current.newIndex=ae),u!==ie.current.containerId&&(ie.current.containerId=u),d!==ie.current.items&&(ie.current.items=d)},[D,ae,u,d]),N.useEffect(()=>{if(de===ie.current.activeId)return;if(de!=null&&ie.current.activeId==null){ie.current.activeId=de;return}const K=setTimeout(()=>{ie.current.activeId=de},50);return()=>clearTimeout(K)},[de]),{active:F,activeIndex:m,attributes:y,data:C,rect:A,index:S,newIndex:ae,items:d,isOver:I,isSorting:D,isDragging:W,listeners:te,node:P,overIndex:b,over:V,setNodeRef:j,setActivatorNodeRef:H,setDroppableNodeRef:B,setDraggableNodeRef:U,transform:ye??J,transition:x()};function x(){if(ye||fe&&ie.current.newIndex===S)return Yf;if(!(G&&!Jr(E)||!c)&&(D||me))return wt.Transition.toString({...c,property:Hs})}}function Xf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function cn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const qf=[_e.Down,_e.Right,_e.Up,_e.Left],Jf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(qf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const m=o.get(u.id);if(m)switch(e.code){case _e.Down:n.top<m.top&&l.push(u);break;case _e.Up:n.top>m.top&&l.push(u);break;case _e.Left:n.left>m.left&&l.push(u);break;case _e.Right:n.left<m.left&&l.push(u);break}});const c=_u({collisionRect:n,droppableRects:o,droppableContainers:l});let d=ds(c,"id");if(d===(s==null?void 0:s.id)&&c.length>1&&(d=c[1].id),d!=null){const u=i.get(r.id),m=i.get(d),f=m?o.get(m.id):null,w=m==null?void 0:m.node.current;if(w&&f&&u&&m){const b=tn(w).some((T,A)=>a[A]!==T),g=Vs(u,m),v=Qf(u,m),k=b||!g?{x:0,y:0}:{x:v?n.width-f.width:0,y:v?n.height-f.height:0},S={x:f.left,y:f.top};return k.x&&k.y?S:br(S,k)}}}};function Vs(e,t){return!cn(e)||!cn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Qf(e,t){return!cn(e)||!cn(t)||!Vs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function ko({className:e,type:t,...r}){return p.jsx("input",{type:t,className:ve("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function eh({className:e,...t}){return p.jsx("textarea",{className:ve("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function th({className:e,checked:t,onCheckedChange:r,...n}){return p.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:ve("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Tt({className:e,...t}){return p.jsx("label",{className:ve("text-sm font-medium leading-none select-none",e),...t})}function So(e,[t,r]){return Math.min(r,Math.max(t,e))}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function $t(e,t=[]){let r=[];function n(i,s){const a=_.createContext(s),l=r.length;r=[...r,s];const c=u=>{var g;const{scope:m,children:f,...w}=u,h=((g=m==null?void 0:m[e])==null?void 0:g[l])||a,b=_.useMemo(()=>w,Object.values(w));return p.jsx(h.Provider,{value:b,children:f})};c.displayName=i+"Provider";function d(u,m){var h;const f=((h=m==null?void 0:m[e])==null?void 0:h[l])||a,w=_.useContext(f);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=r.map(s=>_.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,rh(o,...t)]}function rh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...a,...u}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Ys(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Ys(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Ys(e[o],null)}}}}function Ae(...e){return _.useCallback(Zs(...e),e)}function Ht(e){const t=oh(e),r=_.forwardRef((n,o)=>{const{children:i,...s}=n,a=_.Children.toArray(i),l=a.find(sh);if(l){const c=l.props.children,d=a.map(u=>u===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...s,ref:o,children:_.isValidElement(c)?_.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var nh=Ht("Slot");function oh(e){const t=_.forwardRef((r,n)=>{const{children:o,...i}=r;if(_.isValidElement(o)){const s=lh(o),a=ah(i,o.props);return o.type!==_.Fragment&&(a.ref=n?Zs(n,s):s),_.cloneElement(o,a)}return _.Children.count(o)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ks=Symbol("radix.slottable");function ih(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Ks,t}function sh(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ks}function ah(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function lh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ch(e){const t=e+"CollectionProvider",[r,n]=$t(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:g}=h,v=N.useRef(null),k=N.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:v,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Ht(a),c=N.forwardRef((h,b)=>{const{scope:g,children:v}=h,k=i(a,g),S=Ae(b,k.collectionRef);return p.jsx(l,{ref:S,children:v})});c.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=Ht(d),f=N.forwardRef((h,b)=>{const{scope:g,children:v,...k}=h,S=N.useRef(null),C=Ae(b,S),T=i(d,g);return N.useEffect(()=>(T.itemMap.set(S,{ref:S,...k}),()=>void T.itemMap.delete(S))),p.jsx(m,{[u]:"",ref:C,children:v})});f.displayName=d;function w(h){const b=i(e+"CollectionConsumer",h);return N.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((T,A)=>k.indexOf(T.ref.current)-k.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},w,n]}var dh=_.createContext(void 0);function Gs(e){const t=_.useContext(dh);return e||t||"ltr"}var uh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=uh.reduce((e,t)=>{const r=Ht(`Primitive.${t}`),n=_.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fh(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}function Be(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function hh(e,t=globalThis==null?void 0:globalThis.document){const r=Be(e);_.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ph="DismissableLayer",_o="dismissableLayer.update",mh="dismissableLayer.pointerDownOutside",gh="dismissableLayer.focusOutside",Xs,qs=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dn=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=_.useContext(qs),[d,u]=_.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=_.useState({}),w=Ae(t,A=>u(A)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(b),v=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,C=wh(A=>{const P=A.target,I=[...c.branches].some(B=>B.contains(P));!S||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},m),T=xh(A=>{const P=A.target;[...c.branches].some(B=>B.contains(P))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},m);return hh(A=>{v===c.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},m),_.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Xs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Js(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Xs)}},[d,m,r,c]),_.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Js())},[d,c]),_.useEffect(()=>{const A=()=>f({});return document.addEventListener(_o,A),()=>document.removeEventListener(_o,A)},[]),p.jsx(ze.div,{...l,ref:w,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,C.onPointerDownCapture)})});dn.displayName=ph;var bh="DismissableLayerBranch",vh=_.forwardRef((e,t)=>{const r=_.useContext(qs),n=_.useRef(null),o=Ae(t,n);return _.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(ze.div,{...e,ref:o})});vh.displayName=bh;function wh(e,t=globalThis==null?void 0:globalThis.document){const r=Be(e),n=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Qs(mh,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function xh(e,t=globalThis==null?void 0:globalThis.document){const r=Be(e),n=_.useRef(!1);return _.useEffect(()=>{const o=i=>{i.target&&!n.current&&Qs(gh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Js(){const e=new CustomEvent(_o);document.dispatchEvent(e)}function Qs(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?fh(o,i):o.dispatchEvent(i)}var Co=0;function ea(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ta()),document.body.insertAdjacentElement("beforeend",e[1]??ta()),Co++,()=>{Co===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Co--}},[])}function ta(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Eo="focusScope.autoFocusOnMount",No="focusScope.autoFocusOnUnmount",ra={bubbles:!1,cancelable:!0},yh="FocusScope",zo=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=_.useState(null),c=Be(o),d=Be(i),u=_.useRef(null),m=Ae(t,h=>l(h)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(n){let h=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?u.current=S:yt(u.current,{select:!0})},b=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||yt(u.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&yt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),v.disconnect()}}},[n,a,f.paused]),_.useEffect(()=>{if(a){ia.add(f);const h=document.activeElement;if(!a.contains(h)){const g=new CustomEvent(Eo,ra);a.addEventListener(Eo,c),a.dispatchEvent(g),g.defaultPrevented||(kh(Nh(na(a)),{select:!0}),document.activeElement===h&&yt(a))}return()=>{a.removeEventListener(Eo,c),setTimeout(()=>{const g=new CustomEvent(No,ra);a.addEventListener(No,d),a.dispatchEvent(g),g.defaultPrevented||yt(h??document.body,{select:!0}),a.removeEventListener(No,d),ia.remove(f)},0)}}},[a,c,d,f]);const w=_.useCallback(h=>{if(!r&&!n||f.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(b&&g){const v=h.currentTarget,[k,S]=Sh(v);k&&S?!h.shiftKey&&g===S?(h.preventDefault(),r&&yt(k,{select:!0})):h.shiftKey&&g===k&&(h.preventDefault(),r&&yt(S,{select:!0})):g===v&&h.preventDefault()}},[r,n,f.paused]);return p.jsx(ze.div,{tabIndex:-1,...s,ref:m,onKeyDown:w})});zo.displayName=yh;function kh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yt(n,{select:t}),document.activeElement!==r)return}function Sh(e){const t=na(e),r=oa(t,e),n=oa(t.reverse(),e);return[r,n]}function na(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function oa(e,t){for(const r of e)if(!_h(r,{upTo:t}))return r}function _h(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ch(e){return e instanceof HTMLInputElement&&"select"in e}function yt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Ch(e)&&t&&e.select()}}var ia=Eh();function Eh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=sa(e,t),e.unshift(t)},remove(t){var r;e=sa(e,t),(r=e[0])==null||r.resume()}}}function sa(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Nh(e){return e.filter(t=>t.tagName!=="A")}var Le=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},zh=_[" useId ".trim().toString()]||(()=>{}),Ah=0;function Sr(e){const[t,r]=_.useState(zh());return Le(()=>{r(n=>n??String(Ah++))},[e]),t?`radix-${t}`:""}const jh=["top","right","bottom","left"],kt=Math.min,Ue=Math.max,un=Math.round,fn=Math.floor,rt=e=>({x:e,y:e}),Th={left:"right",right:"left",bottom:"top",top:"bottom"},Oh={start:"end",end:"start"};function Ao(e,t,r){return Ue(e,kt(t,r))}function ut(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function Vt(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function To(e){return e==="y"?"height":"width"}const Ph=new Set(["top","bottom"]);function nt(e){return Ph.has(ft(e))?"y":"x"}function Oo(e){return jo(nt(e))}function Ih(e,t,r){r===void 0&&(r=!1);const n=Vt(e),o=Oo(e),i=To(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=hn(s)),[s,hn(s)]}function Dh(e){const t=hn(e);return[Po(e),t,Po(t)]}function Po(e){return e.replace(/start|end/g,t=>Oh[t])}const aa=["left","right"],la=["right","left"],Rh=["top","bottom"],Lh=["bottom","top"];function Mh(e,t,r){switch(e){case"top":case"bottom":return r?t?la:aa:t?aa:la;case"left":case"right":return t?Rh:Lh;default:return[]}}function Fh(e,t,r,n){const o=Vt(e);let i=Mh(ft(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Po)))),i}function hn(e){return e.replace(/left|right|bottom|top/g,t=>Th[t])}function Bh(e){return{top:0,right:0,bottom:0,left:0,...e}}function ca(e){return typeof e!="number"?Bh(e):{top:e,right:e,bottom:e,left:e}}function pn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function da(e,t,r){let{reference:n,floating:o}=e;const i=nt(t),s=Oo(t),a=To(s),l=ft(t),c=i==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:n.y-o.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Vt(t)){case"start":f[s]-=m*(r&&c?-1:1);break;case"end":f[s]+=m*(r&&c?-1:1);break}return f}async function Uh(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=ut(t,e),w=ca(f),b=a[m?u==="floating"?"reference":"floating":u],g=pn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=pn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(g.top-C.top+w.top)/S.y,bottom:(C.bottom-g.bottom+w.bottom)/S.y,left:(g.left-C.left+w.left)/S.x,right:(C.right-g.right+w.right)/S.x}}const Wh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=da(c,n,l),m=n,f={},w=0;for(let b=0;b<a.length;b++){var h;const{name:g,fn:v}=a[b],{x:k,y:S,data:C,reset:T}=await v({x:d,y:u,initialPlacement:n,placement:m,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Uh},elements:{reference:e,floating:t}});d=k??d,u=S??u,f={...f,[g]:{...f[g],...C}},T&&w<=50&&(w++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:d,y:u}=da(c,m,l)),b=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:f}},$h=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ut(e,t)||{};if(c==null)return{};const u=ca(d),m={x:r,y:n},f=Oo(o),w=To(f),h=await s.getDimensions(c),b=f==="y",g=b?"top":"left",v=b?"bottom":"right",k=b?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[f]-m[f]-i.floating[w],C=m[f]-i.reference[f],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=T?T[k]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=a.floating[k]||i.floating[w]);const P=S/2-C/2,I=A/2-h[w]/2-1,B=kt(u[g],I),F=kt(u[v],I),E=B,L=A-h[w]-F,y=A/2-h[w]/2+P,U=Ao(E,y,L),te=!l.arrow&&Vt(o)!=null&&y!==U&&i.reference[w]/2-(y<E?B:F)-h[w]/2<0,W=te?y<E?y-E:y-L:0;return{[f]:m[f]+W,data:{[f]:U,centerOffset:y-U-W,...te&&{alignmentOffset:W}},reset:te}}}),Hh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:h=!0,...b}=ut(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=ft(o),v=nt(a),k=ft(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[hn(a)]:Dh(a)),T=w!=="none";!m&&T&&C.push(...Fh(a,h,w,S));const A=[a,...C],P=await l.detectOverflow(t,b),I=[];let B=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&I.push(P[g]),u){const y=Ih(o,s,S);I.push(P[y[0]],P[y[1]])}if(B=[...B,{placement:o,overflows:I}],!I.every(y=>y<=0)){var F,E;const y=(((F=i.flip)==null?void 0:F.index)||0)+1,U=A[y];if(U&&(!(u==="alignment"?v!==nt(U):!1)||B.every(V=>nt(V.placement)===v?V.overflows[0]>0:!0)))return{data:{index:y,overflows:B},reset:{placement:U}};let te=(E=B.filter(W=>W.overflows[0]<=0).sort((W,V)=>W.overflows[1]-V.overflows[1])[0])==null?void 0:E.placement;if(!te)switch(f){case"bestFit":{var L;const W=(L=B.filter(V=>{if(T){const H=nt(V.placement);return H===v||H==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(H=>H>0).reduce((H,oe)=>H+oe,0)]).sort((V,H)=>V[1]-H[1])[0])==null?void 0:L[0];W&&(te=W);break}case"initialPlacement":te=a;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function ua(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fa(e){return jh.some(t=>e[t]>=0)}const Vh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ut(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ua(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:fa(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ua(s,r.floating);return{data:{escapedOffsets:a,escaped:fa(a)}}}default:return{}}}}},ha=new Set(["left","top"]);async function Yh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ft(r),a=Vt(r),l=nt(r)==="y",c=ha.has(s)?-1:1,d=i&&l?-1:1,u=ut(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof w=="number"&&(f=a==="end"?w*-1:w),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const Zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Yh(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Kh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:k}=g;return{x:v,y:k}}},...c}=ut(e,t),d={x:r,y:n},u=await i.detectOverflow(t,c),m=nt(ft(o)),f=jo(m);let w=d[f],h=d[m];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",k=w+u[g],S=w-u[v];w=Ao(k,w,S)}if(a){const g=m==="y"?"top":"left",v=m==="y"?"bottom":"right",k=h+u[g],S=h-u[v];h=Ao(k,h,S)}const b=l.fn({...t,[f]:w,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[f]:s,[m]:a}}}}}},Gh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ut(e,t),d={x:r,y:n},u=nt(o),m=jo(u);let f=d[m],w=d[u];const h=ut(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",S=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;f<S?f=S:f>C&&(f=C)}if(c){var g,v;const k=m==="y"?"width":"height",S=ha.has(ft(o)),C=i.reference[u]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[u])||0)+(S?0:b.crossAxis),T=i.reference[u]+i.reference[k]+(S?0:((v=s.offset)==null?void 0:v[u])||0)-(S?b.crossAxis:0);w<C?w=C:w>T&&(w=T)}return{[m]:f,[u]:w}}}},Xh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ut(e,t),d=await s.detectOverflow(t,c),u=ft(o),m=Vt(o),f=nt(o)==="y",{width:w,height:h}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=u,b=m==="end"?"top":"bottom");const v=h-d.top-d.bottom,k=w-d.left-d.right,S=kt(h-d[b],v),C=kt(w-d[g],k),T=!t.middlewareData.shift;let A=S,P=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=v),T&&!m){const B=Ue(d.left,0),F=Ue(d.right,0),E=Ue(d.top,0),L=Ue(d.bottom,0);f?P=w-2*(B!==0||F!==0?B+F:Ue(d.left,d.right)):A=h-2*(E!==0||L!==0?E+L:Ue(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:A});const I=await s.getDimensions(a.floating);return w!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Yt(e){return pa(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(pa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pa(e){return mn()?e instanceof Node||e instanceof We(e).Node:!1}function Qe(e){return mn()?e instanceof Element||e instanceof We(e).Element:!1}function it(e){return mn()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function ma(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}const qh=new Set(["inline","contents"]);function _r(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!qh.has(o)}const Jh=new Set(["table","td","th"]);function Qh(e){return Jh.has(Yt(e))}const ep=[":popover-open",":modal"];function gn(e){return ep.some(t=>{try{return e.matches(t)}catch{return!1}})}const tp=["transform","translate","scale","rotate","perspective"],rp=["transform","translate","scale","rotate","perspective","filter"],np=["paint","layout","strict","content"];function Io(e){const t=Do(),r=Qe(e)?et(e):e;return tp.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||rp.some(n=>(r.willChange||"").includes(n))||np.some(n=>(r.contain||"").includes(n))}function op(e){let t=St(e);for(;it(t)&&!Zt(t);){if(Io(t))return t;if(gn(t))return null;t=St(t)}return null}function Do(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ip=new Set(["html","body","#document"]);function Zt(e){return ip.has(Yt(e))}function et(e){return We(e).getComputedStyle(e)}function bn(e){return Qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Yt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ma(e)&&e.host||ot(e);return ma(t)?t.host:t}function ga(e){const t=St(e);return Zt(t)?e.ownerDocument?e.ownerDocument.body:e.body:it(t)&&_r(t)?t:ga(t)}function Cr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ga(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=We(o);if(i){const a=Ro(s);return t.concat(s,s.visualViewport||[],_r(o)?o:[],a&&r?Cr(a):[])}return t.concat(o,Cr(o,[],r))}function Ro(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ba(e){const t=et(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=it(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=un(r)!==i||un(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Lo(e){return Qe(e)?e:e.contextElement}function Kt(e){const t=Lo(e);if(!it(t))return rt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=ba(t);let s=(i?un(r.width):r.width)/n,a=(i?un(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const sp=rt(0);function va(e){const t=We(e);return!Do()||!t.visualViewport?sp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ap(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==We(e)?!1:t}function Ot(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Lo(e);let s=rt(1);t&&(n?Qe(n)&&(s=Kt(n)):s=Kt(e));const a=ap(i,r,n)?va(i):rt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const m=We(i),f=n&&Qe(n)?We(n):n;let w=m,h=Ro(w);for(;h&&n&&f!==w;){const b=Kt(h),g=h.getBoundingClientRect(),v=et(h),k=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*b.x,S=g.top+(h.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=k,c+=S,w=We(h),h=Ro(w)}}return pn({width:d,height:u,x:l,y:c})}function vn(e,t){const r=bn(e).scrollLeft;return t?t.left+r:Ot(ot(e)).left+r}function wa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-vn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function lp(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=ot(n),a=t?gn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=rt(1);const d=rt(0),u=it(n);if((u||!u&&!i)&&((Yt(n)!=="body"||_r(s))&&(l=bn(n)),it(n))){const f=Ot(n);c=Kt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const m=s&&!u&&!i?wa(s,l):rt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function cp(e){return Array.from(e.getClientRects())}function dp(e){const t=ot(e),r=bn(e),n=e.ownerDocument.body,o=Ue(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ue(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+vn(e);const a=-r.scrollTop;return et(n).direction==="rtl"&&(s+=Ue(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const xa=25;function up(e,t){const r=We(e),n=ot(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Do();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=vn(n);if(c<=0){const d=n.ownerDocument,u=d.body,m=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(n.clientWidth-u.clientWidth-f);w<=xa&&(i-=w)}else c<=xa&&(i+=c);return{width:i,height:s,x:a,y:l}}const fp=new Set(["absolute","fixed"]);function hp(e,t){const r=Ot(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=it(e)?Kt(e):rt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function ya(e,t,r){let n;if(t==="viewport")n=up(e,r);else if(t==="document")n=dp(ot(e));else if(Qe(t))n=hp(t,r);else{const o=va(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pn(n)}function ka(e,t){const r=St(e);return r===t||!Qe(r)||Zt(r)?!1:et(r).position==="fixed"||ka(r,t)}function pp(e,t){const r=t.get(e);if(r)return r;let n=Cr(e,[],!1).filter(a=>Qe(a)&&Yt(a)!=="body"),o=null;const i=et(e).position==="fixed";let s=i?St(e):e;for(;Qe(s)&&!Zt(s);){const a=et(s),l=Io(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&fp.has(o.position)||_r(s)&&!l&&ka(e,s))?n=n.filter(d=>d!==s):o=a,s=St(s)}return t.set(e,n),n}function mp(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?gn(t)?[]:pp(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const u=ya(t,d,o);return c.top=Ue(u.top,c.top),c.right=kt(u.right,c.right),c.bottom=kt(u.bottom,c.bottom),c.left=Ue(u.left,c.left),c},ya(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gp(e){const{width:t,height:r}=ba(e);return{width:t,height:r}}function bp(e,t,r){const n=it(t),o=ot(t),i=r==="fixed",s=Ot(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);function c(){l.x=vn(o)}if(n||!n&&!i)if((Yt(t)!=="body"||_r(o))&&(a=bn(t)),n){const f=Ot(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?wa(o,a):rt(0),u=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function Mo(e){return et(e).position==="static"}function Sa(e,t){if(!it(e)||et(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ot(e)===r&&(r=r.ownerDocument.body),r}function _a(e,t){const r=We(e);if(gn(e))return r;if(!it(e)){let o=St(e);for(;o&&!Zt(o);){if(Qe(o)&&!Mo(o))return o;o=St(o)}return r}let n=Sa(e,t);for(;n&&Qh(n)&&Mo(n);)n=Sa(n,t);return n&&Zt(n)&&Mo(n)&&!Io(n)?r:n||op(e)||r}const vp=async function(e){const t=this.getOffsetParent||_a,r=this.getDimensions,n=await r(e.floating);return{reference:bp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wp(e){return et(e).direction==="rtl"}const xp={convertOffsetParentRelativeRectToViewportRelativeRect:lp,getDocumentElement:ot,getClippingRect:mp,getOffsetParent:_a,getElementRects:vp,getClientRects:cp,getDimensions:gp,getScale:Kt,isElement:Qe,isRTL:wp};function Ca(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yp(e,t){let r=null,n;const o=ot(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:f}=c;if(a||t(),!m||!f)return;const w=fn(u),h=fn(o.clientWidth-(d+m)),b=fn(o.clientHeight-(u+f)),g=fn(d),k={rootMargin:-w+"px "+-h+"px "+-b+"px "+-g+"px",threshold:Ue(0,kt(1,l))||1};let S=!0;function C(T){const A=T[0].intersectionRatio;if(A!==l){if(!S)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!Ca(c,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,k)}r.observe(e)}return s(!0),i}function kp(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Lo(e),d=o||i?[...c?Cr(c):[],...Cr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const u=c&&a?yp(c,r):null;let m=-1,f=null;s&&(f=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let w,h=l?Ot(e):null;l&&b();function b(){const g=Ot(e);h&&!Ca(h,g)&&r(),h=g,w=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(w)}}const Sp=Zh,_p=Kh,Cp=Hh,Ep=Xh,Np=Vh,Ea=$h,zp=Gh,Ap=(e,t,r)=>{const n=new Map,o={platform:xp,...r},i={...o.platform,_c:n};return Wh(e,t,{...o,platform:i})};var jp=typeof document<"u",Tp=function(){},wn=jp?N.useLayoutEffect:Tp;function xn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!xn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!xn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Na(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function za(e,t){const r=Na(e);return Math.round(t*r)/r}function Fo(e){const t=_.useRef(e);return wn(()=>{t.current=e}),t}function Op(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=_.useState(n);xn(m,n)||f(n);const[w,h]=_.useState(null),[b,g]=_.useState(null),v=_.useCallback(V=>{V!==T.current&&(T.current=V,h(V))},[]),k=_.useCallback(V=>{V!==A.current&&(A.current=V,g(V))},[]),S=i||w,C=s||b,T=_.useRef(null),A=_.useRef(null),P=_.useRef(d),I=l!=null,B=Fo(l),F=Fo(o),E=Fo(c),L=_.useCallback(()=>{if(!T.current||!A.current)return;const V={placement:t,strategy:r,middleware:m};F.current&&(V.platform=F.current),Ap(T.current,A.current,V).then(H=>{const oe={...H,isPositioned:E.current!==!1};y.current&&!xn(P.current,oe)&&(P.current=oe,Rr.flushSync(()=>{u(oe)}))})},[m,t,r,F,E]);wn(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,u(V=>({...V,isPositioned:!1})))},[c]);const y=_.useRef(!1);wn(()=>(y.current=!0,()=>{y.current=!1}),[]),wn(()=>{if(S&&(T.current=S),C&&(A.current=C),S&&C){if(B.current)return B.current(S,C,L);L()}},[S,C,L,B,I]);const U=_.useMemo(()=>({reference:T,floating:A,setReference:v,setFloating:k}),[v,k]),te=_.useMemo(()=>({reference:S,floating:C}),[S,C]),W=_.useMemo(()=>{const V={position:r,left:0,top:0};if(!te.floating)return V;const H=za(te.floating,d.x),oe=za(te.floating,d.y);return a?{...V,transform:"translate("+H+"px, "+oe+"px)",...Na(te.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:H,top:oe}},[r,a,te.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:L,refs:U,elements:te,floatingStyles:W}),[d,L,U,te,W])}const Pp=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ea({element:n.current,padding:o}).fn(r):{}:n?Ea({element:n,padding:o}).fn(r):{}}}},Ip=(e,t)=>({...Sp(e),options:[e,t]}),Dp=(e,t)=>({..._p(e),options:[e,t]}),Rp=(e,t)=>({...zp(e),options:[e,t]}),Lp=(e,t)=>({...Cp(e),options:[e,t]}),Mp=(e,t)=>({...Ep(e),options:[e,t]}),Fp=(e,t)=>({...Np(e),options:[e,t]}),Bp=(e,t)=>({...Pp(e),options:[e,t]});var Up="Arrow",Aa=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(ze.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Aa.displayName=Up;var Wp=Aa;function $p(e){const[t,r]=_.useState(void 0);return Le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Bo="Popper",[ja,Gt]=$t(Bo),[Hp,Ta]=ja(Bo),Oa=e=>{const{__scopePopper:t,children:r}=e,[n,o]=_.useState(null);return p.jsx(Hp,{scope:t,anchor:n,onAnchorChange:o,children:r})};Oa.displayName=Bo;var Pa="PopperAnchor",Ia=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ta(Pa,r),s=_.useRef(null),a=Ae(t,s),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||s.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:p.jsx(ze.div,{...o,ref:a})});Ia.displayName=Pa;var Uo="PopperContent",[Vp,Yp]=ja(Uo),Da=_.forwardRef((e,t)=>{var J,ae,de,ie,fe,me;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:w,...h}=e,b=Ta(Uo,r),[g,v]=_.useState(null),k=Ae(t,ye=>v(ye)),[S,C]=_.useState(null),T=$p(S),A=(T==null?void 0:T.width)??0,P=(T==null?void 0:T.height)??0,I=n+(i!=="center"?"-"+i:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(c)?c:[c],E=F.length>0,L={padding:B,boundary:F.filter(Kp),altBoundary:E},{refs:y,floatingStyles:U,placement:te,isPositioned:W,middlewareData:V}=Op({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>kp(...ye,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Ip({mainAxis:o+P,alignmentAxis:s}),l&&Dp({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Rp():void 0,...L}),l&&Lp({...L}),Mp({...L,apply:({elements:ye,rects:x,availableWidth:K,availableHeight:Y})=>{const{width:O,height:z}=x.reference,M=ye.floating.style;M.setProperty("--radix-popper-available-width",`${K}px`),M.setProperty("--radix-popper-available-height",`${Y}px`),M.setProperty("--radix-popper-anchor-width",`${O}px`),M.setProperty("--radix-popper-anchor-height",`${z}px`)}}),S&&Bp({element:S,padding:a}),Gp({arrowWidth:A,arrowHeight:P}),m&&Fp({strategy:"referenceHidden",...L})]}),[H,oe]=Ma(te),j=Be(w);Le(()=>{W&&(j==null||j())},[W,j]);const D=(J=V.arrow)==null?void 0:J.x,Q=(ae=V.arrow)==null?void 0:ae.y,G=((de=V.arrow)==null?void 0:de.centerOffset)!==0,[re,ue]=_.useState();return Le(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),p.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ie=V.transformOrigin)==null?void 0:ie.x,(fe=V.transformOrigin)==null?void 0:fe.y].join(" "),...((me=V.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Vp,{scope:r,placedSide:H,onArrowChange:C,arrowX:D,arrowY:Q,shouldHideArrow:G,children:p.jsx(ze.div,{"data-side":H,"data-align":oe,...h,ref:k,style:{...h.style,animation:W?void 0:"none"}})})})});Da.displayName=Uo;var Ra="PopperArrow",Zp={top:"bottom",right:"left",bottom:"top",left:"right"},La=_.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Yp(Ra,n),s=Zp[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Wp,{...o,ref:r,style:{...o.style,display:"block"}})})});La.displayName=Ra;function Kp(e){return e!==null}var Gp=e=>({name:"transformOrigin",options:e,fn(t){var b,g,v;const{placement:r,rects:n,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Ma(r),u={start:"0%",center:"50%",end:"100%"}[d],m=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let w="",h="";return c==="bottom"?(w=s?u:`${m}px`,h=`${-l}px`):c==="top"?(w=s?u:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(w=`${-l}px`,h=s?u:`${f}px`):c==="left"&&(w=`${n.floating.width+l}px`,h=s?u:`${f}px`),{data:{x:w,y:h}}}});function Ma(e){const[t,r="center"]=e.split("-");return[t,r]}var Wo=Oa,yn=Ia,$o=Da,Ho=La,Xp="Portal",kn=_.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=_.useState(!1);Le(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?gt.createPortal(p.jsx(ze.div,{...n,ref:t}),s):null});kn.displayName=Xp;var qp=_[" useInsertionEffect ".trim().toString()]||Le;function Sn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Jp({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=_.useRef(e!==void 0);_.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const c=_.useCallback(d=>{var u;if(a){const m=Qp(d)?d(e):d;m!==e&&((u=s.current)==null||u.call(s,m))}else i(d)},[a,e,i,s]);return[l,c]}function Jp({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),o=_.useRef(r),i=_.useRef(t);return qp(()=>{i.current=t},[t]),_.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Qp(e){return typeof e=="function"}function em(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fa=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tm="VisuallyHidden",Ba=_.forwardRef((e,t)=>p.jsx(ze.span,{...e,ref:t,style:{...Fa,...e.style}}));Ba.displayName=tm;var rm=Ba,nm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xt=new WeakMap,_n=new WeakMap,Cn={},Vo=0,Ua=function(e){return e&&(e.host||Ua(e.parentNode))},om=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ua(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},im=function(e,t,r,n){var o=om(t,Array.isArray(e)?e:[e]);Cn[r]||(Cn[r]=new WeakMap);var i=Cn[r],s=[],a=new Set,l=new Set(o),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(m){if(a.has(m))d(m);else try{var f=m.getAttribute(n),w=f!==null&&f!=="false",h=(Xt.get(m)||0)+1,b=(i.get(m)||0)+1;Xt.set(m,h),i.set(m,b),s.push(m),h===1&&w&&_n.set(m,!0),b===1&&m.setAttribute(r,"true"),w||m.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return d(t),a.clear(),Vo++,function(){s.forEach(function(u){var m=Xt.get(u)-1,f=i.get(u)-1;Xt.set(u,m),i.set(u,f),m||(_n.has(u)||u.removeAttribute(n),_n.delete(u)),f||u.removeAttribute(r)}),Vo--,Vo||(Xt=new WeakMap,Xt=new WeakMap,_n=new WeakMap,Cn={})}},Wa=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=nm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),im(n,o,r,"aria-hidden")):function(){return null}},st=function(){return st=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},st.apply(this,arguments)};function $a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function sm(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var En="right-scroll-bar-position",Nn="width-before-scroll-bar",am="with-scroll-bars-hidden",lm="--removed-body-scroll-bar-size";function Yo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cm(e,t){var r=N.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var dm=typeof window<"u"?_.useLayoutEffect:_.useEffect,Ha=new WeakMap;function um(e,t){var r=cm(null,function(n){return e.forEach(function(o){return Yo(o,n)})});return dm(function(){var n=Ha.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Yo(a,null)}),i.forEach(function(a){o.has(a)||Yo(a,s)})}Ha.set(r,e)},[e]),r}function fm(e){return e}function hm(e,t){t===void 0&&(t=fm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),r}}}};return o}function pm(e){e===void 0&&(e={});var t=hm(null);return t.options=st({async:!0,ssr:!1},e),t}var Va=function(e){var t=e.sideCar,r=$a(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return _.createElement(n,st({},r))};Va.isSideCarExport=!0;function mm(e,t){return e.useMedium(t),Va}var Ya=pm(),Zo=function(){},zn=_.forwardRef(function(e,t){var r=_.useRef(null),n=_.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,m=e.sideCar,f=e.noRelative,w=e.noIsolation,h=e.inert,b=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,k=e.gapMode,S=$a(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,T=um([r,t]),A=st(st({},S),o);return _.createElement(_.Fragment,null,d&&_.createElement(C,{sideCar:Ya,removeScrollBar:c,shards:u,noRelative:f,noIsolation:w,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?_.cloneElement(_.Children.only(a),st(st({},A),{ref:T})):_.createElement(v,st({},A,{className:l,ref:T}),a))});zn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},zn.classNames={fullWidth:Nn,zeroRight:En};var gm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gm();return t&&e.setAttribute("nonce",t),e}function vm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=bm())&&(vm(t,r),wm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ym=function(){var e=xm();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Za=function(){var e=ym(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},km={left:0,top:0,right:0,gap:0},Ko=function(e){return parseInt(e||"",10)||0},Sm=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ko(r),Ko(n),Ko(o)]},_m=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return km;var t=Sm(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Cm=Za(),qt="data-scroll-locked",Em=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
213
- .`.concat(am,` {
212
+ `},yu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ku(e){let{announcements:t=yu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=xu}=e;const{announce:i,announcement:s}=bu(),a=br("DndLiveRegion"),[l,c]=N.useState(!1);if(N.useEffect(()=>{c(!0)},[]),vu(N.useMemo(()=>({onDragStart(u){let{active:m}=u;i(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:f}=u;t.onDragMove&&i(t.onDragMove({active:m,over:f}))},onDragOver(u){let{active:m,over:f}=u;i(t.onDragOver({active:m,over:f}))},onDragEnd(u){let{active:m,over:f}=u;i(t.onDragEnd({active:m,over:f}))},onDragCancel(u){let{active:m,over:f}=u;i(t.onDragCancel({active:m,over:f}))}}),[i,t])),!l)return null;const d=N.createElement(N.Fragment,null,N.createElement(mu,{id:n,value:o.draggable}),N.createElement(gu,{id:a,announcement:s}));return r?bt.createPortal(d,r):d}var Ie;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ie||(Ie={}));function tn(){}function uo(e,t){return N.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Su(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Qe=Object.freeze({x:0,y:0});function cs(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _u(e,t){const r=en(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function ds(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Cu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function us(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function fs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function hs(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Eu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=hs(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=cs(hs(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(ds)},Nu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=us(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=us(l),d=o.reduce((m,f,w)=>m+cs(c[w],f),0),u=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(ds)};function zu(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,c=e.width*e.height,d=s*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const Au=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=zu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(Cu)};function ju(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ps(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Qe}function Tu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const Ou=Tu(1);function ms(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Pu(e,t,r){const n=ms(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),c=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const Iu={ignoreTransform:!1};function $t(e,t){t===void 0&&(t=Iu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Fe(e).getComputedStyle(e);c&&(r=Pu(r,c,d))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function gs(e){return $t(e,{ignoreTransform:!0})}function Du(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ru(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function Lu(e,t){t===void 0&&(t=Fe(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function rn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(lo(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!pr(o)||is(o)||r.includes(o))return r;const i=Fe(e).getComputedStyle(o);return o!==e&&Lu(o,i)&&r.push(o),Ru(o,i)?r:n(o.parentNode)}return e?n(e):r}function bs(e){const[t]=rn(e,1);return t??null}function fo(e){return!Gr||!e?null:Bt(e)?e:ao(e)?lo(e)||e===Ut(e).scrollingElement?window:pr(e)?e:null:null}function vs(e){return Bt(e)?e.scrollX:e.scrollLeft}function ws(e){return Bt(e)?e.scrollY:e.scrollTop}function ho(e){return{x:vs(e),y:ws(e)}}var De;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(De||(De={}));function xs(e){return!Gr||!e?!1:e===document.scrollingElement}function ys(e){const t={x:0,y:0},r=xs(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Mu={x:.2,y:.2};function Fu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Mu);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=ys(e),f={x:0,y:0},w={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(f.y=De.Backward,w.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(f.y=De.Forward,w.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(f.x=De.Forward,w.x=n*Math.abs((t.right-h.width-a)/h.width)):!u&&s<=t.left+h.width&&(f.x=De.Backward,w.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:f,speed:w}}function Bu(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ks(e){return e.reduce((t,r)=>Wt(t,ho(r)),Qe)}function Uu(e){return e.reduce((t,r)=>t+vs(r),0)}function Wu(e){return e.reduce((t,r)=>t+ws(r),0)}function Ss(e,t){if(t===void 0&&(t=$t),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);bs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $u=[["x",["left","right"],Uu],["y",["top","bottom"],Wu]];class po{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=rn(r),o=ks(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of $u)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(n),d=o[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Hu(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Ut(e)}function mo(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ke;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ke||(Ke={}));function _s(e){e.preventDefault()}function Vu(e){e.stopPropagation()}var _e;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_e||(_e={}));const Cs={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},Yu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case _e.Right:return{...r,x:r.x+25};case _e.Left:return{...r,x:r.x-25};case _e.Down:return{...r,y:r.y+25};case _e.Up:return{...r,y:r.y-25}}};class go{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new wr(Ut(r)),this.windowListeners=new wr(Fe(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ke.Resize,this.handleCancel),this.windowListeners.add(Ke.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ke.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Ss(n),r(Qe)}handleKeyDown(t){if(Qr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=Cs,coordinateGetter:s=Yu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:Qe;this.referenceCoordinates||(this.referenceCoordinates=d);const u=s(t,{active:r,context:n.current,currentCoordinates:d});if(u){const m=vr(u,d),f={x:0,y:0},{scrollableAncestors:w}=n.current;for(const h of w){const b=t.code,{isTop:g,isRight:v,isLeft:k,isBottom:S,maxScroll:C,minScroll:T}=ys(h),A=Bu(h),P={x:Math.min(b===_e.Right?A.right-A.width/2:A.right,Math.max(b===_e.Right?A.left:A.left+A.width/2,u.x)),y:Math.min(b===_e.Down?A.bottom-A.height/2:A.bottom,Math.max(b===_e.Down?A.top:A.top+A.height/2,u.y))},I=b===_e.Right&&!v||b===_e.Left&&!k,B=b===_e.Down&&!S||b===_e.Up&&!g;if(I&&P.x!==u.x){const F=h.scrollLeft+m.x,E=b===_e.Right&&F<=C.x||b===_e.Left&&F>=T.x;if(E&&!m.y){h.scrollTo({left:F,behavior:a});return}E?f.x=h.scrollLeft-F:f.x=b===_e.Right?h.scrollLeft-C.x:h.scrollLeft-T.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(B&&P.y!==u.y){const F=h.scrollTop+m.y,E=b===_e.Down&&F<=C.y||b===_e.Up&&F>=T.y;if(E&&!m.x){h.scrollTo({top:F,behavior:a});return}E?f.y=h.scrollTop-F:f.y=b===_e.Down?h.scrollTop-C.y:h.scrollTop-T.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Wt(vr(u,this.referenceCoordinates),f))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}go.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Cs,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Es(e){return!!(e&&"distance"in e)}function Ns(e){return!!(e&&"delay"in e)}class bo{constructor(t,r,n){var o;n===void 0&&(n=Hu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Ut(s),this.documentListeners=new wr(this.document),this.listeners=new wr(n),this.windowListeners=new wr(Fe(s)),this.initialCoordinates=(o=en(i))!=null?o:Qe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ke.Resize,this.handleCancel),this.windowListeners.add(Ke.DragStart,_s),this.windowListeners.add(Ke.VisibilityChange,this.handleCancel),this.windowListeners.add(Ke.ContextMenu,_s),this.documentListeners.add(Ke.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ns(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Es(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ke.Click,Vu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ke.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=en(t))!=null?r:Qe,c=vr(o,l);if(!n&&a){if(Es(a)){if(a.tolerance!=null&&mo(c,a.tolerance))return this.handleCancel();if(mo(c,a.distance))return this.handleStart()}if(Ns(a)&&mo(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===_e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Zu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class vo extends bo{constructor(t){const{event:r}=t,n=Ut(r.target);super(t,Zu,n)}}vo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Ku={move:{name:"mousemove"},end:{name:"mouseup"}};var wo;(function(e){e[e.RightClick=2]="RightClick"})(wo||(wo={}));class Gu extends bo{constructor(t){super(t,Ku,Ut(t.event.target))}}Gu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===wo.RightClick?!1:(n==null||n({event:r}),!0)}}];const xo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zs extends bo{constructor(t){super(t,xo)}static setup(){return window.addEventListener(xo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(xo.move.name,t)};function t(){}}}zs.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var xr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xr||(xr={}));var nn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nn||(nn={}));function Xu(e){let{acceleration:t,activator:r=xr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=nn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e;const f=Ju({delta:u,disabled:!i}),[w,h]=du(),b=N.useRef({x:0,y:0}),g=N.useRef({x:0,y:0}),v=N.useMemo(()=>{switch(r){case xr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xr.DraggableRect:return o}},[r,o,l]),k=N.useRef(null),S=N.useCallback(()=>{const T=k.current;if(!T)return;const A=b.current.x*g.current.x,P=b.current.y*g.current.y;T.scrollBy(A,P)},[]),C=N.useMemo(()=>a===nn.TreeOrder?[...c].reverse():c,[a,c]);N.useEffect(()=>{if(!i||!c.length||!v){h();return}for(const T of C){if((n==null?void 0:n(T))===!1)continue;const A=c.indexOf(T),P=d[A];if(!P)continue;const{direction:I,speed:B}=Fu(T,P,v,t,m);for(const F of["x","y"])f[F][I[F]]||(B[F]=0,I[F]=0);if(B.x>0||B.y>0){h(),k.current=T,w(S,s),b.current=B,g.current=I;return}}b.current={x:0,y:0},g.current={x:0,y:0},h()},[t,S,n,h,i,s,JSON.stringify(v),JSON.stringify(f),w,c,C,d,JSON.stringify(m)])}const qu={x:{[De.Backward]:!1,[De.Forward]:!1},y:{[De.Backward]:!1,[De.Forward]:!1}};function Ju(e){let{delta:t,disabled:r}=e;const n=Jr(t);return gr(o=>{if(r||!n||!o)return qu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[De.Backward]:o.x[De.Backward]||i.x===-1,[De.Forward]:o.x[De.Forward]||i.x===1},y:{[De.Backward]:o.y[De.Backward]||i.y===-1,[De.Forward]:o.y[De.Forward]||i.y===1}}},[r,t,n])}function Qu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return gr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function ef(e,t){return N.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var yr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var yo;(function(e){e.Optimized="optimized"})(yo||(yo={}));const As=new Map;function tf(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=N.useState(null),{frequency:a,measure:l,strategy:c}=o,d=N.useRef(e),u=b(),m=mr(u),f=N.useCallback(function(g){g===void 0&&(g=[]),!m.current&&s(v=>v===null?g:v.concat(g.filter(k=>!v.includes(k))))},[m]),w=N.useRef(null),h=gr(g=>{if(u&&!r)return As;if(!g||g===As||d.current!==e||i!=null){const v=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){v.set(k.id,k.rect.current);continue}const S=k.node.current,C=S?new po(l(S),S):null;k.rect.current=C,C&&v.set(k.id,C)}return v}return g},[e,i,r,u,l]);return N.useEffect(()=>{d.current=e},[e]),N.useEffect(()=>{u||f()},[r,u]),N.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),N.useEffect(()=>{u||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{f(),w.current=null},a))},[a,u,f,...n]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:i!=null};function b(){switch(c){case yr.Always:return!1;case yr.BeforeDragging:return r;default:return!r}}}function ko(e,t){return gr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function rf(e,t){return ko(e,t)}function nf(e){let{callback:t,disabled:r}=e;const n=Xr(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function on(e){let{callback:t,disabled:r}=e;const n=Xr(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function of(e){return new po($t(e),e)}function js(e,t,r){t===void 0&&(t=of);const[n,o]=N.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=nf({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=on({callback:i});return Je(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function sf(e){const t=ko(e);return ps(e,t)}const Ts=[];function af(e){const t=N.useRef(e),r=gr(n=>e?n&&n!==Ts&&e&&t.current&&e.parentNode===t.current.parentNode?n:rn(e):Ts,[e]);return N.useEffect(()=>{t.current=e},[e]),r}function lf(e){const[t,r]=N.useState(null),n=N.useRef(e),o=N.useCallback(i=>{const s=fo(i.target);s&&r(a=>a?(a.set(s,ho(s)),new Map(a)):null)},[]);return N.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=fo(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,ho(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=fo(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),N.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Wt(i,s),Qe):ks(e):Qe,[e,t])}function Os(e,t){t===void 0&&(t=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},t),N.useEffect(()=>{const n=e!==Qe;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?vr(e,r.current):Qe}function cf(e){N.useEffect(()=>{if(!Gr)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function df(e,t){return N.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Ps(e){return N.useMemo(()=>e?Du(e):null,[e])}const Is=[];function uf(e,t){t===void 0&&(t=$t);const[r]=e,n=Ps(r?Fe(r):null),[o,i]=N.useState(Is);function s(){i(()=>e.length?e.map(l=>xs(l)?n:new po(t(l),l)):Is)}const a=on({callback:s});return Je(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Ds(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return pr(t)?t:e}function ff(e){let{measure:t}=e;const[r,n]=N.useState(null),o=N.useCallback(c=>{for(const{target:d}of c)if(pr(d)){n(u=>{const m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=on({callback:o}),s=N.useCallback(c=>{const d=Ds(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=qr(s);return N.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const hf=[{sensor:vo,options:{}},{sensor:go,options:{}}],pf={current:{}},sn={draggable:{measure:gs},droppable:{measure:gs,strategy:yr.WhileDragging,frequency:yo.Optimized},dragOverlay:{measure:$t}};class kr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const mf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sn,measureDroppableContainers:tn,windowRect:null,measuringScheduled:!1},Rs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tn,draggableNodes:new Map,over:null,measureDroppableContainers:tn},Sr=N.createContext(Rs),Ls=N.createContext(mf);function gf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function bf(e,t){switch(t.type){case Ie.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ie.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ie.DragEnd:case Ie.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ie.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new kr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Ie.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new kr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Ie.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new kr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function vf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=N.useContext(Sr),i=Jr(n),s=Jr(r==null?void 0:r.id);return N.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!Qr(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=hu(d);if(u){u.focus();break}}})}},[n,t,o,s,i]),null}function Ms(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function wf(e){return N.useMemo(()=>({draggable:{...sn.draggable,...e==null?void 0:e.draggable},droppable:{...sn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function xf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=N.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Je(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=r(c),u=ps(d,n);if(s||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=bs(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,s,a,n,r])}const an=N.createContext({...Qe,scaleX:1,scaleY:1});var yt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(yt||(yt={}));const yf=N.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=hf,collisionDetection:u=Au,measuring:m,modifiers:f,...w}=t;const h=N.useReducer(bf,void 0,gf),[b,g]=h,[v,k]=wu(),[S,C]=N.useState(yt.Uninitialized),T=S===yt.Initialized,{draggable:{active:A,nodes:P,translate:I},droppable:{containers:B}}=b,F=A!=null?P.get(A):null,E=N.useRef({initial:null,translated:null}),L=N.useMemo(()=>{var Te;return A!=null?{id:A,data:(Te=F==null?void 0:F.data)!=null?Te:pf,rect:E}:null},[A,F]),y=N.useRef(null),[U,te]=N.useState(null),[W,V]=N.useState(null),H=mr(w,Object.values(w)),oe=br("DndDescribedBy",s),j=N.useMemo(()=>B.getEnabled(),[B]),D=wf(m),{droppableRects:Q,measureDroppableContainers:G,measuringScheduled:re}=tf(j,{dragging:T,dependencies:[I.x,I.y],config:D.droppable}),ue=Qu(P,A),J=N.useMemo(()=>W?en(W):null,[W]),ae=Xn(),de=rf(ue,D.draggable.measure);xf({activeNode:A!=null?P.get(A):null,config:ae.layoutShiftCompensation,initialRect:de,measure:D.draggable.measure});const ie=js(ue,D.draggable.measure,de),fe=js(ue?ue.parentElement:null),me=N.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=B.getNodeFor((r=me.current.over)==null?void 0:r.id),x=ff({measure:D.dragOverlay.measure}),K=(n=x.nodeRef.current)!=null?n:ue,Y=T?(o=x.rect)!=null?o:ie:null,O=!!(x.nodeRef.current&&x.rect),z=sf(O?null:ie),M=Ps(K?Fe(K):null),q=af(T?ye??ue:null),ee=uf(q),$=Ms(f,{transform:{x:I.x-z.x,y:I.y-z.y,scaleX:1,scaleY:1},activatorEvent:W,active:L,activeNodeRect:ie,containerNodeRect:fe,draggingNodeRect:Y,over:me.current.over,overlayNodeRect:x.rect,scrollableAncestors:q,scrollableAncestorRects:ee,windowRect:M}),ne=J?Wt(J,I):null,ce=lf(q),se=Os(ce),R=Os(ce,[ie]),Z=Wt($,se),X=Y?Ou(Y,$):null,le=L&&X?u({active:L,collisionRect:X,droppableRects:Q,droppableContainers:j,pointerCoordinates:ne}):null,be=fs(le,"id"),[ge,we]=N.useState(null),Se=O?$:Wt($,R),Ne=ju(Se,(i=ge==null?void 0:ge.rect)!=null?i:null,ie),mt=N.useRef(null),Xe=N.useCallback((Te,Re)=>{let{sensor:Ve,options:zt}=Re;if(y.current==null)return;const qe=P.get(y.current);if(!qe)return;const Ye=Te.nativeEvent,ct=new Ve({active:y.current,activeNode:qe,event:Ye,options:zt,context:me,onAbort(Me){if(!P.get(Me))return;const{onDragAbort:dt}=H.current,gt={id:Me};dt==null||dt(gt),v({type:"onDragAbort",event:gt})},onPending(Me,At,dt,gt){if(!P.get(Me))return;const{onDragPending:Dr}=H.current,jt={id:Me,constraint:At,initialCoordinates:dt,offset:gt};Dr==null||Dr(jt),v({type:"onDragPending",event:jt})},onStart(Me){const At=y.current;if(At==null)return;const dt=P.get(At);if(!dt)return;const{onDragStart:gt}=H.current,Ir={activatorEvent:Ye,active:{id:At,data:dt.data,rect:E}};bt.unstable_batchedUpdates(()=>{gt==null||gt(Ir),C(yt.Initializing),g({type:Ie.DragStart,initialCoordinates:Me,active:At}),v({type:"onDragStart",event:Ir}),te(mt.current),V(Ye)})},onMove(Me){g({type:Ie.DragMove,coordinates:Me})},onEnd:lr(Ie.DragEnd),onCancel:lr(Ie.DragCancel)});mt.current=ct;function lr(Me){return async function(){const{active:dt,collisions:gt,over:Ir,scrollAdjustedTranslate:Dr}=me.current;let jt=null;if(dt&&Dr){const{cancelDrop:Rr}=H.current;jt={activatorEvent:Ye,active:dt,collisions:gt,delta:Dr,over:Ir},Me===Ie.DragEnd&&typeof Rr=="function"&&await Promise.resolve(Rr(jt))&&(Me=Ie.DragCancel)}y.current=null,bt.unstable_batchedUpdates(()=>{g({type:Me}),C(yt.Uninitialized),we(null),te(null),V(null),mt.current=null;const Rr=Me===Ie.DragEnd?"onDragEnd":"onDragCancel";if(jt){const ki=H.current[Rr];ki==null||ki(jt),v({type:Rr,event:jt})}})}}},[P]),Kn=N.useCallback((Te,Re)=>(Ve,zt)=>{const qe=Ve.nativeEvent,Ye=P.get(zt);if(y.current!==null||!Ye||qe.dndKit||qe.defaultPrevented)return;const ct={active:Ye};Te(Ve,Re.options,ct)===!0&&(qe.dndKit={capturedBy:Re.sensor},y.current=zt,Xe(Ve,Re))},[P,Xe]),Gn=ef(d,Kn);cf(d),Je(()=>{ie&&S===yt.Initializing&&C(yt.Initialized)},[ie,S]),N.useEffect(()=>{const{onDragMove:Te}=H.current,{active:Re,activatorEvent:Ve,collisions:zt,over:qe}=me.current;if(!Re||!Ve)return;const Ye={active:Re,activatorEvent:Ve,collisions:zt,delta:{x:Z.x,y:Z.y},over:qe};bt.unstable_batchedUpdates(()=>{Te==null||Te(Ye),v({type:"onDragMove",event:Ye})})},[Z.x,Z.y]),N.useEffect(()=>{const{active:Te,activatorEvent:Re,collisions:Ve,droppableContainers:zt,scrollAdjustedTranslate:qe}=me.current;if(!Te||y.current==null||!Re||!qe)return;const{onDragOver:Ye}=H.current,ct=zt.get(be),lr=ct&&ct.rect.current?{id:ct.id,rect:ct.rect.current,data:ct.data,disabled:ct.disabled}:null,Me={active:Te,activatorEvent:Re,collisions:Ve,delta:{x:qe.x,y:qe.y},over:lr};bt.unstable_batchedUpdates(()=>{we(lr),Ye==null||Ye(Me),v({type:"onDragOver",event:Me})})},[be]),Je(()=>{me.current={activatorEvent:W,active:L,activeNode:ue,collisionRect:X,collisions:le,droppableRects:Q,draggableNodes:P,draggingNode:K,draggingNodeRect:Y,droppableContainers:B,over:ge,scrollableAncestors:q,scrollAdjustedTranslate:Z},E.current={initial:Y,translated:X}},[L,ue,le,X,P,K,Y,Q,B,ge,q,Z]),Xu({...ae,delta:I,draggingRect:X,pointerCoordinates:ne,scrollableAncestors:q,scrollableAncestorRects:ee});const xi=N.useMemo(()=>({active:L,activeNode:ue,activeNodeRect:ie,activatorEvent:W,collisions:le,containerNodeRect:fe,dragOverlay:x,draggableNodes:P,droppableContainers:B,droppableRects:Q,over:ge,measureDroppableContainers:G,scrollableAncestors:q,scrollableAncestorRects:ee,measuringConfiguration:D,measuringScheduled:re,windowRect:M}),[L,ue,ie,W,le,fe,x,P,B,Q,ge,G,q,ee,D,re,M]),yi=N.useMemo(()=>({activatorEvent:W,activators:Gn,active:L,activeNodeRect:ie,ariaDescribedById:{draggable:oe},dispatch:g,draggableNodes:P,over:ge,measureDroppableContainers:G}),[W,Gn,L,ie,g,oe,P,ge,G]);return N.createElement(ls.Provider,{value:k},N.createElement(Sr.Provider,{value:yi},N.createElement(Ls.Provider,{value:xi},N.createElement(an.Provider,{value:Ne},c)),N.createElement(vf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),N.createElement(ku,{...a,hiddenTextDescribedById:oe}));function Xn(){const Te=(U==null?void 0:U.autoScrollEnabled)===!1,Re=typeof l=="object"?l.enabled===!1:l===!1,Ve=T&&!Te&&!Re;return typeof l=="object"?{...l,enabled:Ve}:{enabled:Ve}}}),kf=N.createContext(null),Fs="button",Sf="Draggable";function _f(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=br(Sf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=N.useContext(Sr),{role:f=Fs,roleDescription:w="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,g=N.useContext(b?an:kf),[v,k]=qr(),[S,C]=qr(),T=df(s,t),A=mr(r);Je(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:S,data:A}),()=>{const I=u.get(t);I&&I.key===i&&u.delete(t)}),[u,t]);const P=N.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&f===Fs?!0:void 0,"aria-roledescription":w,"aria-describedby":d.draggable}),[n,f,h,b,w,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:P,isDragging:b,listeners:n?void 0:T,node:v,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Bs(){return N.useContext(Ls)}const Cf="Droppable",Ef={timeout:25};function Nf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=br(Cf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=N.useContext(Sr),d=N.useRef({disabled:r}),u=N.useRef(!1),m=N.useRef(null),f=N.useRef(null),{disabled:w,updateMeasurementsFor:h,timeout:b}={...Ef,...o},g=mr(h??n),v=N.useCallback(()=>{if(!u.current){u.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),f.current=null},b)},[b]),k=on({callback:v,disabled:w||!s}),S=N.useCallback((P,I)=>{k&&(I&&(k.unobserve(I),u.current=!1),P&&k.observe(P))},[k]),[C,T]=qr(S),A=mr(t);return N.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),N.useEffect(()=>(a({type:Ie.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:A}}),()=>a({type:Ie.UnregisterDroppable,key:i,id:n})),[n]),N.useEffect(()=>{r!==d.current.disabled&&(a({type:Ie.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:s,rect:m,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:T}}function zf(e){let{animation:t,children:r}=e;const[n,o]=N.useState(null),[i,s]=N.useState(null),a=Jr(r);return!r&&!n&&a&&o(a),Je(()=>{if(!i)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,n,i]),N.createElement(N.Fragment,null,r,n?N.cloneElement(n,{ref:s}):null)}const Af={x:0,y:0,scaleX:1,scaleY:1};function jf(e){let{children:t}=e;return N.createElement(Sr.Provider,{value:Rs},N.createElement(an.Provider,{value:Af},t))}const Tf={position:"fixed",touchAction:"none"},Of=e=>Qr(e)?"transform 250ms ease":void 0,Pf=N.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Of}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},m={...Tf,width:a.width,height:a.height,top:a.top,left:a.left,transform:xt.Transform.toString(u),transformOrigin:o&&n?_u(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return N.createElement(r,{className:s,style:m,ref:t},i)}),If={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:xt.Transform.toString(t)},{transform:xt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))r.node.style.setProperty(l,c);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Df(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Xr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Ds(s);if(!c)return;const{transform:d}=Fe(s).getComputedStyle(s),u=ms(d);if(!u)return;const m=typeof t=="function"?t:Rf(t);return Ss(l,o.draggable.measure),m({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:u})})}function Rf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...If,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},u={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},m={x:l.x-d.x,y:l.y-d.y,...u},f=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:m}}),[w]=f,h=f[f.length-1];if(JSON.stringify(w)===JSON.stringify(h))return;const b=n==null?void 0:n({active:s,dragOverlay:a,...c}),g=a.node.animate(f,{duration:t,easing:r,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{b==null||b(),v()}})}}let Us=0;function Lf(e){return N.useMemo(()=>{if(e!=null)return Us++,Us},[e])}const Mf=N.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggableNodes:w,droppableContainers:h,dragOverlay:b,over:g,measuringConfiguration:v,scrollableAncestors:k,scrollableAncestorRects:S,windowRect:C}=Bs(),T=N.useContext(an),A=Lf(u==null?void 0:u.id),P=Ms(s,{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:S,transform:T,windowRect:C}),I=ko(m),B=Df({config:n,draggableNodes:w,droppableContainers:h,measuringConfiguration:v}),F=I?b.setRef:void 0;return N.createElement(jf,null,N.createElement(zf,{animation:B},u&&A?N.createElement(Pf,{key:A,id:u.id,ref:F,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:I,style:{zIndex:c,...o},transform:P},r):null))}),Ff=e=>{let{transform:t}=e;return{...t,x:0}};function Ws(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Bf(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function ln(e){return e!==null&&e>=0}function Uf(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Wf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const $s=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ws(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},cn={scaleX:1,scaleY:1},$f=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const c=i[s];return c?{x:0,y:r<s?c.top+c.height-(a.top+a.height):c.top-a.top,...cn}:null}const l=Hf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...cn}:o<r&&o>=s?{x:0,y:a.height+l,...cn}:{x:0,y:0,...cn}};function Hf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Hs="Sortable",Vs=N.createContext({activeIndex:-1,containerId:Hs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$s,disabled:{draggable:!1,droppable:!1}});function Vf(e){let{children:t,id:r,items:n,strategy:o=$s,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Bs(),u=br(Hs,r),m=a.rect!==null,f=N.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),w=s!=null,h=s?f.indexOf(s.id):-1,b=c?f.indexOf(c.id):-1,g=N.useRef(f),v=!Uf(f,g.current),k=b!==-1&&h===-1||v,S=Wf(i);Je(()=>{v&&w&&d(f)},[v,f,w,d]),N.useEffect(()=>{g.current=f},[f]);const C=N.useMemo(()=>({activeIndex:h,containerId:u,disabled:S,disableTransforms:k,items:f,overIndex:b,useDragOverlay:m,sortedRects:Bf(f,l),strategy:o}),[h,u,S.draggable,S.droppable,k,f,b,l,m,o]);return N.createElement(Vs.Provider,{value:C},t)}const Yf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ws(r,n,o).indexOf(t)},Zf=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Kf={duration:200,easing:"ease"},Ys="transform",Gf=xt.Transition.toString({property:Ys,duration:0,easing:"linear"}),Xf={roleDescription:"sortable"};function qf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=N.useState(null),a=N.useRef(r);return Je(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=$t(n.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&s(d)}}r!==a.current&&(a.current=r)},[t,r,n,o]),N.useEffect(()=>{i&&s(null)},[i]),i}function Jf(e){let{animateLayoutChanges:t=Zf,attributes:r,disabled:n,data:o,getNewIndex:i=Yf,id:s,strategy:a,resizeObserverConfig:l,transition:c=Kf}=e;const{items:d,containerId:u,activeIndex:m,disabled:f,disableTransforms:w,sortedRects:h,overIndex:b,useDragOverlay:g,strategy:v}=N.useContext(Vs),k=Qf(n,f),S=d.indexOf(s),C=N.useMemo(()=>({sortable:{containerId:u,index:S,items:d},...o}),[u,o,S,d]),T=N.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:A,node:P,isOver:I,setNodeRef:B}=Nf({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:F,activatorEvent:E,activeNodeRect:L,attributes:y,setNodeRef:U,listeners:te,isDragging:W,over:V,setActivatorNodeRef:H,transform:oe}=_f({id:s,data:C,attributes:{...Xf,...r},disabled:k.draggable}),j=cu(B,U),D=!!F,Q=D&&!w&&ln(m)&&ln(b),G=!g&&W,re=G&&Q?oe:null,J=Q?re??(a??v)({rects:h,activeNodeRect:L,activeIndex:m,overIndex:b,index:S}):null,ae=ln(m)&&ln(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):S,de=F==null?void 0:F.id,ie=N.useRef({activeId:de,items:d,newIndex:ae,containerId:u}),fe=d!==ie.current.items,me=t({active:F,containerId:u,isDragging:W,isSorting:D,id:s,index:S,items:d,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:c,wasDragging:ie.current.activeId!=null}),ye=qf({disabled:!me,index:S,node:P,rect:A});return N.useEffect(()=>{D&&ie.current.newIndex!==ae&&(ie.current.newIndex=ae),u!==ie.current.containerId&&(ie.current.containerId=u),d!==ie.current.items&&(ie.current.items=d)},[D,ae,u,d]),N.useEffect(()=>{if(de===ie.current.activeId)return;if(de!=null&&ie.current.activeId==null){ie.current.activeId=de;return}const K=setTimeout(()=>{ie.current.activeId=de},50);return()=>clearTimeout(K)},[de]),{active:F,activeIndex:m,attributes:y,data:C,rect:A,index:S,newIndex:ae,items:d,isOver:I,isSorting:D,isDragging:W,listeners:te,node:P,overIndex:b,over:V,setNodeRef:j,setActivatorNodeRef:H,setDroppableNodeRef:B,setDraggableNodeRef:U,transform:ye??J,transition:x()};function x(){if(ye||fe&&ie.current.newIndex===S)return Gf;if(!(G&&!Qr(E)||!c)&&(D||me))return xt.Transition.toString({...c,property:Ys})}}function Qf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function dn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const eh=[_e.Down,_e.Right,_e.Up,_e.Left],th=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(eh.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const m=o.get(u.id);if(m)switch(e.code){case _e.Down:n.top<m.top&&l.push(u);break;case _e.Up:n.top>m.top&&l.push(u);break;case _e.Left:n.left>m.left&&l.push(u);break;case _e.Right:n.left<m.left&&l.push(u);break}});const c=Nu({collisionRect:n,droppableRects:o,droppableContainers:l});let d=fs(c,"id");if(d===(s==null?void 0:s.id)&&c.length>1&&(d=c[1].id),d!=null){const u=i.get(r.id),m=i.get(d),f=m?o.get(m.id):null,w=m==null?void 0:m.node.current;if(w&&f&&u&&m){const b=rn(w).some((T,A)=>a[A]!==T),g=Zs(u,m),v=rh(u,m),k=b||!g?{x:0,y:0}:{x:v?n.width-f.width:0,y:v?n.height-f.height:0},S={x:f.left,y:f.top};return k.x&&k.y?S:vr(S,k)}}}};function Zs(e,t){return!dn(e)||!dn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function rh(e,t){return!dn(e)||!dn(t)||!Zs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function So({className:e,type:t,...r}){return p.jsx("input",{type:t,className:ve("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function nh({className:e,...t}){return p.jsx("textarea",{className:ve("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function oh({className:e,checked:t,onCheckedChange:r,...n}){return p.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:ve("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Ot({className:e,...t}){return p.jsx("label",{className:ve("text-sm font-medium leading-none select-none",e),...t})}function _o(e,[t,r]){return Math.min(r,Math.max(t,e))}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ht(e,t=[]){let r=[];function n(i,s){const a=_.createContext(s),l=r.length;r=[...r,s];const c=u=>{var g;const{scope:m,children:f,...w}=u,h=((g=m==null?void 0:m[e])==null?void 0:g[l])||a,b=_.useMemo(()=>w,Object.values(w));return p.jsx(h.Provider,{value:b,children:f})};c.displayName=i+"Provider";function d(u,m){var h;const f=((h=m==null?void 0:m[e])==null?void 0:h[l])||a,w=_.useContext(f);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=r.map(s=>_.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,ih(o,...t)]}function ih(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...a,...u}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Ks(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Ks(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Ks(e[o],null)}}}}function Ae(...e){return _.useCallback(Gs(...e),e)}function Vt(e){const t=ah(e),r=_.forwardRef((n,o)=>{const{children:i,...s}=n,a=_.Children.toArray(i),l=a.find(ch);if(l){const c=l.props.children,d=a.map(u=>u===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...s,ref:o,children:_.isValidElement(c)?_.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var sh=Vt("Slot");function ah(e){const t=_.forwardRef((r,n)=>{const{children:o,...i}=r;if(_.isValidElement(o)){const s=uh(o),a=dh(i,o.props);return o.type!==_.Fragment&&(a.ref=n?Gs(n,s):s),_.cloneElement(o,a)}return _.Children.count(o)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xs=Symbol("radix.slottable");function lh(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Xs,t}function ch(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xs}function dh(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function uh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function fh(e){const t=e+"CollectionProvider",[r,n]=Ht(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:g}=h,v=N.useRef(null),k=N.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:v,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Vt(a),c=N.forwardRef((h,b)=>{const{scope:g,children:v}=h,k=i(a,g),S=Ae(b,k.collectionRef);return p.jsx(l,{ref:S,children:v})});c.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=Vt(d),f=N.forwardRef((h,b)=>{const{scope:g,children:v,...k}=h,S=N.useRef(null),C=Ae(b,S),T=i(d,g);return N.useEffect(()=>(T.itemMap.set(S,{ref:S,...k}),()=>void T.itemMap.delete(S))),p.jsx(m,{[u]:"",ref:C,children:v})});f.displayName=d;function w(h){const b=i(e+"CollectionConsumer",h);return N.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((T,A)=>k.indexOf(T.ref.current)-k.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},w,n]}var hh=_.createContext(void 0);function qs(e){const t=_.useContext(hh);return e||t||"ltr"}var ph=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=ph.reduce((e,t)=>{const r=Vt(`Primitive.${t}`),n=_.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function mh(e,t){e&&Lr.flushSync(()=>e.dispatchEvent(t))}function Ue(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function gh(e,t=globalThis==null?void 0:globalThis.document){const r=Ue(e);_.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var bh="DismissableLayer",Co="dismissableLayer.update",vh="dismissableLayer.pointerDownOutside",wh="dismissableLayer.focusOutside",Js,Qs=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),un=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=_.useContext(Qs),[d,u]=_.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=_.useState({}),w=Ae(t,A=>u(A)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(b),v=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,C=kh(A=>{const P=A.target,I=[...c.branches].some(B=>B.contains(P));!S||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},m),T=Sh(A=>{const P=A.target;[...c.branches].some(B=>B.contains(P))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},m);return gh(A=>{v===c.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},m),_.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Js=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),ea(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Js)}},[d,m,r,c]),_.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),ea())},[d,c]),_.useEffect(()=>{const A=()=>f({});return document.addEventListener(Co,A),()=>document.removeEventListener(Co,A)},[]),p.jsx(ze.div,{...l,ref:w,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,C.onPointerDownCapture)})});un.displayName=bh;var xh="DismissableLayerBranch",yh=_.forwardRef((e,t)=>{const r=_.useContext(Qs),n=_.useRef(null),o=Ae(t,n);return _.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(ze.div,{...e,ref:o})});yh.displayName=xh;function kh(e,t=globalThis==null?void 0:globalThis.document){const r=Ue(e),n=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){ta(vh,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Sh(e,t=globalThis==null?void 0:globalThis.document){const r=Ue(e),n=_.useRef(!1);return _.useEffect(()=>{const o=i=>{i.target&&!n.current&&ta(wh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ea(){const e=new CustomEvent(Co);document.dispatchEvent(e)}function ta(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?mh(o,i):o.dispatchEvent(i)}var Eo=0;function ra(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??na()),document.body.insertAdjacentElement("beforeend",e[1]??na()),Eo++,()=>{Eo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Eo--}},[])}function na(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var No="focusScope.autoFocusOnMount",zo="focusScope.autoFocusOnUnmount",oa={bubbles:!1,cancelable:!0},_h="FocusScope",Ao=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=_.useState(null),c=Ue(o),d=Ue(i),u=_.useRef(null),m=Ae(t,h=>l(h)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(n){let h=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?u.current=S:kt(u.current,{select:!0})},b=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||kt(u.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&kt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),v.disconnect()}}},[n,a,f.paused]),_.useEffect(()=>{if(a){aa.add(f);const h=document.activeElement;if(!a.contains(h)){const g=new CustomEvent(No,oa);a.addEventListener(No,c),a.dispatchEvent(g),g.defaultPrevented||(Ch(jh(ia(a)),{select:!0}),document.activeElement===h&&kt(a))}return()=>{a.removeEventListener(No,c),setTimeout(()=>{const g=new CustomEvent(zo,oa);a.addEventListener(zo,d),a.dispatchEvent(g),g.defaultPrevented||kt(h??document.body,{select:!0}),a.removeEventListener(zo,d),aa.remove(f)},0)}}},[a,c,d,f]);const w=_.useCallback(h=>{if(!r&&!n||f.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(b&&g){const v=h.currentTarget,[k,S]=Eh(v);k&&S?!h.shiftKey&&g===S?(h.preventDefault(),r&&kt(k,{select:!0})):h.shiftKey&&g===k&&(h.preventDefault(),r&&kt(S,{select:!0})):g===v&&h.preventDefault()}},[r,n,f.paused]);return p.jsx(ze.div,{tabIndex:-1,...s,ref:m,onKeyDown:w})});Ao.displayName=_h;function Ch(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(kt(n,{select:t}),document.activeElement!==r)return}function Eh(e){const t=ia(e),r=sa(t,e),n=sa(t.reverse(),e);return[r,n]}function ia(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function sa(e,t){for(const r of e)if(!Nh(r,{upTo:t}))return r}function Nh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function zh(e){return e instanceof HTMLInputElement&&"select"in e}function kt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&zh(e)&&t&&e.select()}}var aa=Ah();function Ah(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=la(e,t),e.unshift(t)},remove(t){var r;e=la(e,t),(r=e[0])==null||r.resume()}}}function la(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function jh(e){return e.filter(t=>t.tagName!=="A")}var Le=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Th=_[" useId ".trim().toString()]||(()=>{}),Oh=0;function _r(e){const[t,r]=_.useState(Th());return Le(()=>{r(n=>n??String(Oh++))},[e]),t?`radix-${t}`:""}const Ph=["top","right","bottom","left"],St=Math.min,We=Math.max,fn=Math.round,hn=Math.floor,nt=e=>({x:e,y:e}),Ih={left:"right",right:"left",bottom:"top",top:"bottom"},Dh={start:"end",end:"start"};function jo(e,t,r){return We(e,St(t,r))}function ft(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function Yt(e){return e.split("-")[1]}function To(e){return e==="x"?"y":"x"}function Oo(e){return e==="y"?"height":"width"}const Rh=new Set(["top","bottom"]);function ot(e){return Rh.has(ht(e))?"y":"x"}function Po(e){return To(ot(e))}function Lh(e,t,r){r===void 0&&(r=!1);const n=Yt(e),o=Po(e),i=Oo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pn(s)),[s,pn(s)]}function Mh(e){const t=pn(e);return[Io(e),t,Io(t)]}function Io(e){return e.replace(/start|end/g,t=>Dh[t])}const ca=["left","right"],da=["right","left"],Fh=["top","bottom"],Bh=["bottom","top"];function Uh(e,t,r){switch(e){case"top":case"bottom":return r?t?da:ca:t?ca:da;case"left":case"right":return t?Fh:Bh;default:return[]}}function Wh(e,t,r,n){const o=Yt(e);let i=Uh(ht(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Io)))),i}function pn(e){return e.replace(/left|right|bottom|top/g,t=>Ih[t])}function $h(e){return{top:0,right:0,bottom:0,left:0,...e}}function ua(e){return typeof e!="number"?$h(e):{top:e,right:e,bottom:e,left:e}}function mn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function fa(e,t,r){let{reference:n,floating:o}=e;const i=ot(t),s=Po(t),a=Oo(s),l=ht(t),c=i==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:n.y-o.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Yt(t)){case"start":f[s]-=m*(r&&c?-1:1);break;case"end":f[s]+=m*(r&&c?-1:1);break}return f}async function Hh(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=ft(t,e),w=ua(f),b=a[m?u==="floating"?"reference":"floating":u],g=mn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},C=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(g.top-C.top+w.top)/S.y,bottom:(C.bottom-g.bottom+w.bottom)/S.y,left:(g.left-C.left+w.left)/S.x,right:(C.right-g.right+w.right)/S.x}}const Vh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=fa(c,n,l),m=n,f={},w=0;for(let b=0;b<a.length;b++){var h;const{name:g,fn:v}=a[b],{x:k,y:S,data:C,reset:T}=await v({x:d,y:u,initialPlacement:n,placement:m,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Hh},elements:{reference:e,floating:t}});d=k??d,u=S??u,f={...f,[g]:{...f[g],...C}},T&&w<=50&&(w++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:d,y:u}=fa(c,m,l)),b=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:f}},Yh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ft(e,t)||{};if(c==null)return{};const u=ua(d),m={x:r,y:n},f=Po(o),w=Oo(f),h=await s.getDimensions(c),b=f==="y",g=b?"top":"left",v=b?"bottom":"right",k=b?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[f]-m[f]-i.floating[w],C=m[f]-i.reference[f],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=T?T[k]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=a.floating[k]||i.floating[w]);const P=S/2-C/2,I=A/2-h[w]/2-1,B=St(u[g],I),F=St(u[v],I),E=B,L=A-h[w]-F,y=A/2-h[w]/2+P,U=jo(E,y,L),te=!l.arrow&&Yt(o)!=null&&y!==U&&i.reference[w]/2-(y<E?B:F)-h[w]/2<0,W=te?y<E?y-E:y-L:0;return{[f]:m[f]+W,data:{[f]:U,centerOffset:y-U-W,...te&&{alignmentOffset:W}},reset:te}}}),Zh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:h=!0,...b}=ft(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=ht(o),v=ot(a),k=ht(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[pn(a)]:Mh(a)),T=w!=="none";!m&&T&&C.push(...Wh(a,h,w,S));const A=[a,...C],P=await l.detectOverflow(t,b),I=[];let B=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&I.push(P[g]),u){const y=Lh(o,s,S);I.push(P[y[0]],P[y[1]])}if(B=[...B,{placement:o,overflows:I}],!I.every(y=>y<=0)){var F,E;const y=(((F=i.flip)==null?void 0:F.index)||0)+1,U=A[y];if(U&&(!(u==="alignment"?v!==ot(U):!1)||B.every(V=>ot(V.placement)===v?V.overflows[0]>0:!0)))return{data:{index:y,overflows:B},reset:{placement:U}};let te=(E=B.filter(W=>W.overflows[0]<=0).sort((W,V)=>W.overflows[1]-V.overflows[1])[0])==null?void 0:E.placement;if(!te)switch(f){case"bestFit":{var L;const W=(L=B.filter(V=>{if(T){const H=ot(V.placement);return H===v||H==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(H=>H>0).reduce((H,oe)=>H+oe,0)]).sort((V,H)=>V[1]-H[1])[0])==null?void 0:L[0];W&&(te=W);break}case"initialPlacement":te=a;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function ha(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pa(e){return Ph.some(t=>e[t]>=0)}const Kh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ft(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ha(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:pa(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ha(s,r.floating);return{data:{escapedOffsets:a,escaped:pa(a)}}}default:return{}}}}},ma=new Set(["left","top"]);async function Gh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ht(r),a=Yt(r),l=ot(r)==="y",c=ma.has(s)?-1:1,d=i&&l?-1:1,u=ft(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof w=="number"&&(f=a==="end"?w*-1:w),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const Xh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Gh(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},qh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:k}=g;return{x:v,y:k}}},...c}=ft(e,t),d={x:r,y:n},u=await i.detectOverflow(t,c),m=ot(ht(o)),f=To(m);let w=d[f],h=d[m];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",k=w+u[g],S=w-u[v];w=jo(k,w,S)}if(a){const g=m==="y"?"top":"left",v=m==="y"?"bottom":"right",k=h+u[g],S=h-u[v];h=jo(k,h,S)}const b=l.fn({...t,[f]:w,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[f]:s,[m]:a}}}}}},Jh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ft(e,t),d={x:r,y:n},u=ot(o),m=To(u);let f=d[m],w=d[u];const h=ft(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",S=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;f<S?f=S:f>C&&(f=C)}if(c){var g,v;const k=m==="y"?"width":"height",S=ma.has(ht(o)),C=i.reference[u]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[u])||0)+(S?0:b.crossAxis),T=i.reference[u]+i.reference[k]+(S?0:((v=s.offset)==null?void 0:v[u])||0)-(S?b.crossAxis:0);w<C?w=C:w>T&&(w=T)}return{[m]:f,[u]:w}}}},Qh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ft(e,t),d=await s.detectOverflow(t,c),u=ht(o),m=Yt(o),f=ot(o)==="y",{width:w,height:h}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=u,b=m==="end"?"top":"bottom");const v=h-d.top-d.bottom,k=w-d.left-d.right,S=St(h-d[b],v),C=St(w-d[g],k),T=!t.middlewareData.shift;let A=S,P=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=v),T&&!m){const B=We(d.left,0),F=We(d.right,0),E=We(d.top,0),L=We(d.bottom,0);f?P=w-2*(B!==0||F!==0?B+F:We(d.left,d.right)):A=h-2*(E!==0||L!==0?E+L:We(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:A});const I=await s.getDimensions(a.floating);return w!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function gn(){return typeof window<"u"}function Zt(e){return ga(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function it(e){var t;return(t=(ga(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ga(e){return gn()?e instanceof Node||e instanceof $e(e).Node:!1}function et(e){return gn()?e instanceof Element||e instanceof $e(e).Element:!1}function st(e){return gn()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function ba(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}const ep=new Set(["inline","contents"]);function Cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ep.has(o)}const tp=new Set(["table","td","th"]);function rp(e){return tp.has(Zt(e))}const np=[":popover-open",":modal"];function bn(e){return np.some(t=>{try{return e.matches(t)}catch{return!1}})}const op=["transform","translate","scale","rotate","perspective"],ip=["transform","translate","scale","rotate","perspective","filter"],sp=["paint","layout","strict","content"];function Do(e){const t=Ro(),r=et(e)?tt(e):e;return op.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||ip.some(n=>(r.willChange||"").includes(n))||sp.some(n=>(r.contain||"").includes(n))}function ap(e){let t=_t(e);for(;st(t)&&!Kt(t);){if(Do(t))return t;if(bn(t))return null;t=_t(t)}return null}function Ro(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lp=new Set(["html","body","#document"]);function Kt(e){return lp.has(Zt(e))}function tt(e){return $e(e).getComputedStyle(e)}function vn(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(Zt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ba(e)&&e.host||it(e);return ba(t)?t.host:t}function va(e){const t=_t(e);return Kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Cr(t)?t:va(t)}function Er(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=va(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=$e(o);if(i){const a=Lo(s);return t.concat(s,s.visualViewport||[],Cr(o)?o:[],a&&r?Er(a):[])}return t.concat(o,Er(o,[],r))}function Lo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wa(e){const t=tt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=st(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=fn(r)!==i||fn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Mo(e){return et(e)?e:e.contextElement}function Gt(e){const t=Mo(e);if(!st(t))return nt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=wa(t);let s=(i?fn(r.width):r.width)/n,a=(i?fn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cp=nt(0);function xa(e){const t=$e(e);return!Ro()||!t.visualViewport?cp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dp(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$e(e)?!1:t}function Pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Mo(e);let s=nt(1);t&&(n?et(n)&&(s=Gt(n)):s=Gt(e));const a=dp(i,r,n)?xa(i):nt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const m=$e(i),f=n&&et(n)?$e(n):n;let w=m,h=Lo(w);for(;h&&n&&f!==w;){const b=Gt(h),g=h.getBoundingClientRect(),v=tt(h),k=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*b.x,S=g.top+(h.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=k,c+=S,w=$e(h),h=Lo(w)}}return mn({width:d,height:u,x:l,y:c})}function wn(e,t){const r=vn(e).scrollLeft;return t?t.left+r:Pt(it(e)).left+r}function ya(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-wn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function up(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=it(n),a=t?bn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=nt(1);const d=nt(0),u=st(n);if((u||!u&&!i)&&((Zt(n)!=="body"||Cr(s))&&(l=vn(n)),st(n))){const f=Pt(n);c=Gt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const m=s&&!u&&!i?ya(s,l):nt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function fp(e){return Array.from(e.getClientRects())}function hp(e){const t=it(e),r=vn(e),n=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=We(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+wn(e);const a=-r.scrollTop;return tt(n).direction==="rtl"&&(s+=We(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ka=25;function pp(e,t){const r=$e(e),n=it(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Ro();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wn(n);if(c<=0){const d=n.ownerDocument,u=d.body,m=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(n.clientWidth-u.clientWidth-f);w<=ka&&(i-=w)}else c<=ka&&(i+=c);return{width:i,height:s,x:a,y:l}}const mp=new Set(["absolute","fixed"]);function gp(e,t){const r=Pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=st(e)?Gt(e):nt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function Sa(e,t,r){let n;if(t==="viewport")n=pp(e,r);else if(t==="document")n=hp(it(e));else if(et(t))n=gp(t,r);else{const o=xa(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mn(n)}function _a(e,t){const r=_t(e);return r===t||!et(r)||Kt(r)?!1:tt(r).position==="fixed"||_a(r,t)}function bp(e,t){const r=t.get(e);if(r)return r;let n=Er(e,[],!1).filter(a=>et(a)&&Zt(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?_t(e):e;for(;et(s)&&!Kt(s);){const a=tt(s),l=Do(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&mp.has(o.position)||Cr(s)&&!l&&_a(e,s))?n=n.filter(d=>d!==s):o=a,s=_t(s)}return t.set(e,n),n}function vp(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?bn(t)?[]:bp(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const u=Sa(t,d,o);return c.top=We(u.top,c.top),c.right=St(u.right,c.right),c.bottom=St(u.bottom,c.bottom),c.left=We(u.left,c.left),c},Sa(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function wp(e){const{width:t,height:r}=wa(e);return{width:t,height:r}}function xp(e,t,r){const n=st(t),o=it(t),i=r==="fixed",s=Pt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=nt(0);function c(){l.x=wn(o)}if(n||!n&&!i)if((Zt(t)!=="body"||Cr(o))&&(a=vn(t)),n){const f=Pt(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?ya(o,a):nt(0),u=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function Fo(e){return tt(e).position==="static"}function Ca(e,t){if(!st(e)||tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return it(e)===r&&(r=r.ownerDocument.body),r}function Ea(e,t){const r=$e(e);if(bn(e))return r;if(!st(e)){let o=_t(e);for(;o&&!Kt(o);){if(et(o)&&!Fo(o))return o;o=_t(o)}return r}let n=Ca(e,t);for(;n&&rp(n)&&Fo(n);)n=Ca(n,t);return n&&Kt(n)&&Fo(n)&&!Do(n)?r:n||ap(e)||r}const yp=async function(e){const t=this.getOffsetParent||Ea,r=this.getDimensions,n=await r(e.floating);return{reference:xp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function kp(e){return tt(e).direction==="rtl"}const Sp={convertOffsetParentRelativeRectToViewportRelativeRect:up,getDocumentElement:it,getClippingRect:vp,getOffsetParent:Ea,getElementRects:yp,getClientRects:fp,getDimensions:wp,getScale:Gt,isElement:et,isRTL:kp};function Na(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _p(e,t){let r=null,n;const o=it(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:f}=c;if(a||t(),!m||!f)return;const w=hn(u),h=hn(o.clientWidth-(d+m)),b=hn(o.clientHeight-(u+f)),g=hn(d),k={rootMargin:-w+"px "+-h+"px "+-b+"px "+-g+"px",threshold:We(0,St(1,l))||1};let S=!0;function C(T){const A=T[0].intersectionRatio;if(A!==l){if(!S)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!Na(c,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,k)}r.observe(e)}return s(!0),i}function Cp(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Mo(e),d=o||i?[...c?Er(c):[],...Er(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const u=c&&a?_p(c,r):null;let m=-1,f=null;s&&(f=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let w,h=l?Pt(e):null;l&&b();function b(){const g=Pt(e);h&&!Na(h,g)&&r(),h=g,w=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(w)}}const Ep=Xh,Np=qh,zp=Zh,Ap=Qh,jp=Kh,za=Yh,Tp=Jh,Op=(e,t,r)=>{const n=new Map,o={platform:Sp,...r},i={...o.platform,_c:n};return Vh(e,t,{...o,platform:i})};var Pp=typeof document<"u",Ip=function(){},xn=Pp?N.useLayoutEffect:Ip;function yn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!yn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!yn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ja(e,t){const r=Aa(e);return Math.round(t*r)/r}function Bo(e){const t=_.useRef(e);return xn(()=>{t.current=e}),t}function Dp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=_.useState(n);yn(m,n)||f(n);const[w,h]=_.useState(null),[b,g]=_.useState(null),v=_.useCallback(V=>{V!==T.current&&(T.current=V,h(V))},[]),k=_.useCallback(V=>{V!==A.current&&(A.current=V,g(V))},[]),S=i||w,C=s||b,T=_.useRef(null),A=_.useRef(null),P=_.useRef(d),I=l!=null,B=Bo(l),F=Bo(o),E=Bo(c),L=_.useCallback(()=>{if(!T.current||!A.current)return;const V={placement:t,strategy:r,middleware:m};F.current&&(V.platform=F.current),Op(T.current,A.current,V).then(H=>{const oe={...H,isPositioned:E.current!==!1};y.current&&!yn(P.current,oe)&&(P.current=oe,Lr.flushSync(()=>{u(oe)}))})},[m,t,r,F,E]);xn(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,u(V=>({...V,isPositioned:!1})))},[c]);const y=_.useRef(!1);xn(()=>(y.current=!0,()=>{y.current=!1}),[]),xn(()=>{if(S&&(T.current=S),C&&(A.current=C),S&&C){if(B.current)return B.current(S,C,L);L()}},[S,C,L,B,I]);const U=_.useMemo(()=>({reference:T,floating:A,setReference:v,setFloating:k}),[v,k]),te=_.useMemo(()=>({reference:S,floating:C}),[S,C]),W=_.useMemo(()=>{const V={position:r,left:0,top:0};if(!te.floating)return V;const H=ja(te.floating,d.x),oe=ja(te.floating,d.y);return a?{...V,transform:"translate("+H+"px, "+oe+"px)",...Aa(te.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:H,top:oe}},[r,a,te.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:L,refs:U,elements:te,floatingStyles:W}),[d,L,U,te,W])}const Rp=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?za({element:n.current,padding:o}).fn(r):{}:n?za({element:n,padding:o}).fn(r):{}}}},Lp=(e,t)=>({...Ep(e),options:[e,t]}),Mp=(e,t)=>({...Np(e),options:[e,t]}),Fp=(e,t)=>({...Tp(e),options:[e,t]}),Bp=(e,t)=>({...zp(e),options:[e,t]}),Up=(e,t)=>({...Ap(e),options:[e,t]}),Wp=(e,t)=>({...jp(e),options:[e,t]}),$p=(e,t)=>({...Rp(e),options:[e,t]});var Hp="Arrow",Ta=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(ze.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ta.displayName=Hp;var Vp=Ta;function Yp(e){const[t,r]=_.useState(void 0);return Le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Uo="Popper",[Oa,Xt]=Ht(Uo),[Zp,Pa]=Oa(Uo),Ia=e=>{const{__scopePopper:t,children:r}=e,[n,o]=_.useState(null);return p.jsx(Zp,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ia.displayName=Uo;var Da="PopperAnchor",Ra=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Pa(Da,r),s=_.useRef(null),a=Ae(t,s),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||s.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:p.jsx(ze.div,{...o,ref:a})});Ra.displayName=Da;var Wo="PopperContent",[Kp,Gp]=Oa(Wo),La=_.forwardRef((e,t)=>{var J,ae,de,ie,fe,me;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:w,...h}=e,b=Pa(Wo,r),[g,v]=_.useState(null),k=Ae(t,ye=>v(ye)),[S,C]=_.useState(null),T=Yp(S),A=(T==null?void 0:T.width)??0,P=(T==null?void 0:T.height)??0,I=n+(i!=="center"?"-"+i:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(c)?c:[c],E=F.length>0,L={padding:B,boundary:F.filter(qp),altBoundary:E},{refs:y,floatingStyles:U,placement:te,isPositioned:W,middlewareData:V}=Dp({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>Cp(...ye,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Lp({mainAxis:o+P,alignmentAxis:s}),l&&Mp({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Fp():void 0,...L}),l&&Bp({...L}),Up({...L,apply:({elements:ye,rects:x,availableWidth:K,availableHeight:Y})=>{const{width:O,height:z}=x.reference,M=ye.floating.style;M.setProperty("--radix-popper-available-width",`${K}px`),M.setProperty("--radix-popper-available-height",`${Y}px`),M.setProperty("--radix-popper-anchor-width",`${O}px`),M.setProperty("--radix-popper-anchor-height",`${z}px`)}}),S&&$p({element:S,padding:a}),Jp({arrowWidth:A,arrowHeight:P}),m&&Wp({strategy:"referenceHidden",...L})]}),[H,oe]=Ba(te),j=Ue(w);Le(()=>{W&&(j==null||j())},[W,j]);const D=(J=V.arrow)==null?void 0:J.x,Q=(ae=V.arrow)==null?void 0:ae.y,G=((de=V.arrow)==null?void 0:de.centerOffset)!==0,[re,ue]=_.useState();return Le(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),p.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ie=V.transformOrigin)==null?void 0:ie.x,(fe=V.transformOrigin)==null?void 0:fe.y].join(" "),...((me=V.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Kp,{scope:r,placedSide:H,onArrowChange:C,arrowX:D,arrowY:Q,shouldHideArrow:G,children:p.jsx(ze.div,{"data-side":H,"data-align":oe,...h,ref:k,style:{...h.style,animation:W?void 0:"none"}})})})});La.displayName=Wo;var Ma="PopperArrow",Xp={top:"bottom",right:"left",bottom:"top",left:"right"},Fa=_.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Gp(Ma,n),s=Xp[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(Vp,{...o,ref:r,style:{...o.style,display:"block"}})})});Fa.displayName=Ma;function qp(e){return e!==null}var Jp=e=>({name:"transformOrigin",options:e,fn(t){var b,g,v;const{placement:r,rects:n,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Ba(r),u={start:"0%",center:"50%",end:"100%"}[d],m=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let w="",h="";return c==="bottom"?(w=s?u:`${m}px`,h=`${-l}px`):c==="top"?(w=s?u:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(w=`${-l}px`,h=s?u:`${f}px`):c==="left"&&(w=`${n.floating.width+l}px`,h=s?u:`${f}px`),{data:{x:w,y:h}}}});function Ba(e){const[t,r="center"]=e.split("-");return[t,r]}var $o=Ia,kn=Ra,Ho=La,Vo=Fa,Qp="Portal",Sn=_.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=_.useState(!1);Le(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bt.createPortal(p.jsx(ze.div,{...n,ref:t}),s):null});Sn.displayName=Qp;var em=_[" useInsertionEffect ".trim().toString()]||Le;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=tm({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=_.useRef(e!==void 0);_.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const c=_.useCallback(d=>{var u;if(a){const m=rm(d)?d(e):d;m!==e&&((u=s.current)==null||u.call(s,m))}else i(d)},[a,e,i,s]);return[l,c]}function tm({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),o=_.useRef(r),i=_.useRef(t);return em(()=>{i.current=t},[t]),_.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function rm(e){return typeof e=="function"}function nm(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ua=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),om="VisuallyHidden",Wa=_.forwardRef((e,t)=>p.jsx(ze.span,{...e,ref:t,style:{...Ua,...e.style}}));Wa.displayName=om;var im=Wa,sm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qt=new WeakMap,Cn=new WeakMap,En={},Yo=0,$a=function(e){return e&&(e.host||$a(e.parentNode))},am=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=$a(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},lm=function(e,t,r,n){var o=am(t,Array.isArray(e)?e:[e]);En[r]||(En[r]=new WeakMap);var i=En[r],s=[],a=new Set,l=new Set(o),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(m){if(a.has(m))d(m);else try{var f=m.getAttribute(n),w=f!==null&&f!=="false",h=(qt.get(m)||0)+1,b=(i.get(m)||0)+1;qt.set(m,h),i.set(m,b),s.push(m),h===1&&w&&Cn.set(m,!0),b===1&&m.setAttribute(r,"true"),w||m.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return d(t),a.clear(),Yo++,function(){s.forEach(function(u){var m=qt.get(u)-1,f=i.get(u)-1;qt.set(u,m),i.set(u,f),m||(Cn.has(u)||u.removeAttribute(n),Cn.delete(u)),f||u.removeAttribute(r)}),Yo--,Yo||(qt=new WeakMap,qt=new WeakMap,Cn=new WeakMap,En={})}},Ha=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=sm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),lm(n,o,r,"aria-hidden")):function(){return null}},at=function(){return at=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},at.apply(this,arguments)};function Va(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function cm(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Nn="right-scroll-bar-position",zn="width-before-scroll-bar",dm="with-scroll-bars-hidden",um="--removed-body-scroll-bar-size";function Zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fm(e,t){var r=N.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var hm=typeof window<"u"?_.useLayoutEffect:_.useEffect,Ya=new WeakMap;function pm(e,t){var r=fm(null,function(n){return e.forEach(function(o){return Zo(o,n)})});return hm(function(){var n=Ya.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Zo(a,null)}),i.forEach(function(a){o.has(a)||Zo(a,s)})}Ya.set(r,e)},[e]),r}function mm(e){return e}function gm(e,t){t===void 0&&(t=mm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),r}}}};return o}function bm(e){e===void 0&&(e={});var t=gm(null);return t.options=at({async:!0,ssr:!1},e),t}var Za=function(e){var t=e.sideCar,r=Va(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return _.createElement(n,at({},r))};Za.isSideCarExport=!0;function vm(e,t){return e.useMedium(t),Za}var Ka=bm(),Ko=function(){},An=_.forwardRef(function(e,t){var r=_.useRef(null),n=_.useState({onScrollCapture:Ko,onWheelCapture:Ko,onTouchMoveCapture:Ko}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,m=e.sideCar,f=e.noRelative,w=e.noIsolation,h=e.inert,b=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,k=e.gapMode,S=Va(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,T=pm([r,t]),A=at(at({},S),o);return _.createElement(_.Fragment,null,d&&_.createElement(C,{sideCar:Ka,removeScrollBar:c,shards:u,noRelative:f,noIsolation:w,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?_.cloneElement(_.Children.only(a),at(at({},A),{ref:T})):_.createElement(v,at({},A,{className:l,ref:T}),a))});An.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},An.classNames={fullWidth:zn,zeroRight:Nn};var wm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wm();return t&&e.setAttribute("nonce",t),e}function ym(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function km(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=xm())&&(ym(t,r),km(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_m=function(){var e=Sm();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ga=function(){var e=_m(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},Cm={left:0,top:0,right:0,gap:0},Go=function(e){return parseInt(e||"",10)||0},Em=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Go(r),Go(n),Go(o)]},Nm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cm;var t=Em(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},zm=Ga(),Jt="data-scroll-locked",Am=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
213
+ .`.concat(dm,` {
214
214
  overflow: hidden `).concat(n,`;
215
215
  padding-right: `).concat(a,"px ").concat(n,`;
216
216
  }
217
- body[`).concat(qt,`] {
217
+ body[`).concat(Jt,`] {
218
218
  overflow: hidden `).concat(n,`;
219
219
  overscroll-behavior: contain;
220
220
  `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
@@ -227,26 +227,26 @@ React keys must be passed directly to JSX without using spread:
227
227
  `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
228
228
  }
229
229
 
230
- .`).concat(En,` {
230
+ .`).concat(Nn,` {
231
231
  right: `).concat(a,"px ").concat(n,`;
232
232
  }
233
233
 
234
- .`).concat(Nn,` {
234
+ .`).concat(zn,` {
235
235
  margin-right: `).concat(a,"px ").concat(n,`;
236
236
  }
237
237
 
238
- .`).concat(En," .").concat(En,` {
238
+ .`).concat(Nn," .").concat(Nn,` {
239
239
  right: 0 `).concat(n,`;
240
240
  }
241
241
 
242
- .`).concat(Nn," .").concat(Nn,` {
242
+ .`).concat(zn," .").concat(zn,` {
243
243
  margin-right: 0 `).concat(n,`;
244
244
  }
245
245
 
246
- body[`).concat(qt,`] {
247
- `).concat(lm,": ").concat(a,`px;
246
+ body[`).concat(Jt,`] {
247
+ `).concat(um,": ").concat(a,`px;
248
248
  }
249
- `)},Ka=function(){var e=parseInt(document.body.getAttribute(qt)||"0",10);return isFinite(e)?e:0},Nm=function(){_.useEffect(function(){return document.body.setAttribute(qt,(Ka()+1).toString()),function(){var e=Ka()-1;e<=0?document.body.removeAttribute(qt):document.body.setAttribute(qt,e.toString())}},[])},zm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Nm();var i=_.useMemo(function(){return _m(o)},[o]);return _.createElement(Cm,{styles:Em(i,!t,o,r?"":"!important")})},Go=!1;if(typeof window<"u")try{var An=Object.defineProperty({},"passive",{get:function(){return Go=!0,!0}});window.addEventListener("test",An,An),window.removeEventListener("test",An,An)}catch{Go=!1}var Jt=Go?{passive:!1}:!1,Am=function(e){return e.tagName==="TEXTAREA"},Ga=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Am(e)&&r[t]==="visible")},jm=function(e){return Ga(e,"overflowY")},Tm=function(e){return Ga(e,"overflowX")},Xa=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=qa(e,n);if(o){var i=Ja(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Om=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Pm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},qa=function(e,t){return e==="v"?jm(t):Tm(t)},Ja=function(e,t){return e==="v"?Om(t):Pm(t)},Im=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dm=function(e,t,r,n,o){var i=Im(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),c=!1,d=s>0,u=0,m=0;do{if(!a)break;var f=Ja(e,a),w=f[0],h=f[1],b=f[2],g=h-b-i*w;(w||g)&&qa(e,a)&&(u+=g,m+=w);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(u)<1||!d&&Math.abs(m)<1)&&(c=!0),c},jn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qa=function(e){return[e.deltaX,e.deltaY]},el=function(e){return e&&"current"in e?e.current:e},Rm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lm=function(e){return`
249
+ `)},Xa=function(){var e=parseInt(document.body.getAttribute(Jt)||"0",10);return isFinite(e)?e:0},jm=function(){_.useEffect(function(){return document.body.setAttribute(Jt,(Xa()+1).toString()),function(){var e=Xa()-1;e<=0?document.body.removeAttribute(Jt):document.body.setAttribute(Jt,e.toString())}},[])},Tm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;jm();var i=_.useMemo(function(){return Nm(o)},[o]);return _.createElement(zm,{styles:Am(i,!t,o,r?"":"!important")})},Xo=!1;if(typeof window<"u")try{var jn=Object.defineProperty({},"passive",{get:function(){return Xo=!0,!0}});window.addEventListener("test",jn,jn),window.removeEventListener("test",jn,jn)}catch{Xo=!1}var Qt=Xo?{passive:!1}:!1,Om=function(e){return e.tagName==="TEXTAREA"},qa=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Om(e)&&r[t]==="visible")},Pm=function(e){return qa(e,"overflowY")},Im=function(e){return qa(e,"overflowX")},Ja=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Qa(e,n);if(o){var i=el(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Dm=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Rm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Qa=function(e,t){return e==="v"?Pm(t):Im(t)},el=function(e,t){return e==="v"?Dm(t):Rm(t)},Lm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Mm=function(e,t,r,n,o){var i=Lm(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),c=!1,d=s>0,u=0,m=0;do{if(!a)break;var f=el(e,a),w=f[0],h=f[1],b=f[2],g=h-b-i*w;(w||g)&&Qa(e,a)&&(u+=g,m+=w);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(u)<1||!d&&Math.abs(m)<1)&&(c=!0),c},Tn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tl=function(e){return[e.deltaX,e.deltaY]},rl=function(e){return e&&"current"in e?e.current:e},Fm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Bm=function(e){return`
250
250
  .block-interactivity-`.concat(e,` {pointer-events: none;}
251
251
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
252
- `)},Mm=0,Qt=[];function Fm(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),o=_.useState(Mm++)[0],i=_.useState(Za)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=sm([e.lockRef.current],(e.shards||[]).map(el),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var g=jn(h),v=r.current,k="deltaX"in h?h.deltaX:v[0]-g[0],S="deltaY"in h?h.deltaY:v[1]-g[1],C,T=h.target,A=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in h&&A==="h"&&T.type==="range")return!1;var P=window.getSelection(),I=P&&P.anchorNode,B=I?I===T||I.contains(T):!1;if(B)return!1;var F=Xa(A,T);if(!F)return!0;if(F?C=A:(C=A==="v"?"h":"v",F=Xa(A,T)),!F)return!1;if(!n.current&&"changedTouches"in h&&(k||S)&&(n.current=C),!C)return!0;var E=n.current||C;return Dm(E,b,h,E==="h"?k:S)},[]),l=_.useCallback(function(h){var b=h;if(!(!Qt.length||Qt[Qt.length-1]!==i)){var g="deltaY"in b?Qa(b):jn(b),v=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Rm(C.delta,g)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var k=(s.current.shards||[]).map(el).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=k.length>0?a(b,k[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=_.useCallback(function(h,b,g,v){var k={name:h,delta:b,target:g,should:v,shadowParent:Bm(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=_.useCallback(function(h){r.current=jn(h),n.current=void 0},[]),u=_.useCallback(function(h){c(h.type,Qa(h),h.target,a(h,e.lockRef.current))},[]),m=_.useCallback(function(h){c(h.type,jn(h),h.target,a(h,e.lockRef.current))},[]);_.useEffect(function(){return Qt.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Jt),document.addEventListener("touchmove",l,Jt),document.addEventListener("touchstart",d,Jt),function(){Qt=Qt.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,Jt),document.removeEventListener("touchmove",l,Jt),document.removeEventListener("touchstart",d,Jt)}},[]);var f=e.removeScrollBar,w=e.inert;return _.createElement(_.Fragment,null,w?_.createElement(i,{styles:Lm(o)}):null,f?_.createElement(zm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Um=mm(Ya,Fm);var Xo=_.forwardRef(function(e,t){return _.createElement(zn,st({},e,{ref:t,sideCar:Um}))});Xo.classNames=zn.classNames;var Wm=[" ","Enter","ArrowUp","ArrowDown"],$m=[" ","Enter"],Pt="Select",[Tn,On,Hm]=ch(Pt),[er]=$t(Pt,[Hm,Gt]),Pn=Gt(),[Vm,_t]=er(Pt),[Ym,Zm]=er(Pt),tl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:m,required:f,form:w}=e,h=Pn(t),[b,g]=_.useState(null),[v,k]=_.useState(null),[S,C]=_.useState(!1),T=Gs(c),[A,P]=Sn({prop:n,defaultProp:o??!1,onChange:i,caller:Pt}),[I,B]=Sn({prop:s,defaultProp:a,onChange:l,caller:Pt}),F=_.useRef(null),E=b?w||!!b.closest("form"):!0,[L,y]=_.useState(new Set),U=Array.from(L).map(te=>te.props.value).join(";");return p.jsx(Wo,{...h,children:p.jsxs(Vm,{required:f,scope:t,trigger:b,onTriggerChange:g,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Sr(),value:I,onValueChange:B,open:A,onOpenChange:P,dir:T,triggerPointerDownPosRef:F,disabled:m,children:[p.jsx(Tn.Provider,{scope:t,children:p.jsx(Ym,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(te=>{y(W=>new Set(W).add(te))},[]),onNativeOptionRemove:_.useCallback(te=>{y(W=>{const V=new Set(W);return V.delete(te),V})},[]),children:r})}),E?p.jsxs(yl,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:I,onChange:te=>B(te.target.value),disabled:m,form:w,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(L)]},U):null]})})};tl.displayName=Pt;var rl="SelectTrigger",nl=_.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=_t(rl,r),a=s.disabled||n,l=Ae(t,s.onTriggerChange),c=On(r),d=_.useRef("touch"),[u,m,f]=Sl(h=>{const b=c().filter(k=>!k.disabled),g=b.find(k=>k.value===s.value),v=_l(b,h,g);v!==void 0&&s.onValueChange(v.value)}),w=h=>{a||(s.onOpenChange(!0),f()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return p.jsx(yn,{asChild:!0,...i,children:p.jsx(ze.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":kl(s.value)?"":void 0,...o,ref:l,onClick:ke(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&w(h)}),onPointerDown:ke(o.onPointerDown,h=>{d.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:ke(o.onKeyDown,h=>{const b=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Wm.includes(h.key)&&(w(),h.preventDefault())})})})});nl.displayName=rl;var ol="SelectValue",il=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=_t(ol,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=Ae(t,l.onValueNodeChange);return Le(()=>{c(d)},[c,d]),p.jsx(ze.span,{...a,ref:u,style:{pointerEvents:"none"},children:kl(l.value)?p.jsx(p.Fragment,{children:s}):i})});il.displayName=ol;var Km="SelectIcon",sl=_.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(ze.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});sl.displayName=Km;var Gm="SelectPortal",al=e=>p.jsx(kn,{asChild:!0,...e});al.displayName=Gm;var It="SelectContent",ll=_.forwardRef((e,t)=>{const r=_t(It,e.__scopeSelect),[n,o]=_.useState();if(Le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Rr.createPortal(p.jsx(cl,{scope:e.__scopeSelect,children:p.jsx(Tn.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(dl,{...e,ref:t})});ll.displayName=It;var tt=10,[cl,Ct]=er(It),Xm="SelectContentImpl",qm=Ht("SelectContent.RemoveScroll"),dl=_.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:w,hideWhenDetached:h,avoidCollisions:b,...g}=e,v=_t(It,r),[k,S]=_.useState(null),[C,T]=_.useState(null),A=Ae(t,J=>S(J)),[P,I]=_.useState(null),[B,F]=_.useState(null),E=On(r),[L,y]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(k)return Wa(k)},[k]),ea();const te=_.useCallback(J=>{const[ae,...de]=E().map(me=>me.ref.current),[ie]=de.slice(-1),fe=document.activeElement;for(const me of J)if(me===fe||(me==null||me.scrollIntoView({block:"nearest"}),me===ae&&C&&(C.scrollTop=0),me===ie&&C&&(C.scrollTop=C.scrollHeight),me==null||me.focus(),document.activeElement!==fe))return},[E,C]),W=_.useCallback(()=>te([P,k]),[te,P,k]);_.useEffect(()=>{L&&W()},[L,W]);const{onOpenChange:V,triggerPointerDownPosRef:H}=v;_.useEffect(()=>{if(k){let J={x:0,y:0};const ae=ie=>{var fe,me;J={x:Math.abs(Math.round(ie.pageX)-(((fe=H.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((me=H.current)==null?void 0:me.y)??0))}},de=ie=>{J.x<=10&&J.y<=10?ie.preventDefault():k.contains(ie.target)||V(!1),document.removeEventListener("pointermove",ae),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,V,H]),_.useEffect(()=>{const J=()=>V(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[V]);const[oe,j]=Sl(J=>{const ae=E().filter(fe=>!fe.disabled),de=ae.find(fe=>fe.ref.current===document.activeElement),ie=_l(ae,J,de);ie&&setTimeout(()=>ie.ref.current.focus())}),D=_.useCallback((J,ae,de)=>{const ie=!U.current&&!de;(v.value!==void 0&&v.value===ae||ie)&&(I(J),ie&&(U.current=!0))},[v.value]),Q=_.useCallback(()=>k==null?void 0:k.focus(),[k]),G=_.useCallback((J,ae,de)=>{const ie=!U.current&&!de;(v.value!==void 0&&v.value===ae||ie)&&F(J)},[v.value]),re=n==="popper"?qo:ul,ue=re===qo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:w,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(cl,{scope:r,content:k,viewport:C,onViewportChange:T,itemRefCallback:D,selectedItem:P,onItemLeave:Q,itemTextRefCallback:G,focusSelectedItem:W,selectedItemText:B,position:n,isPositioned:L,searchRef:oe,children:p.jsx(Xo,{as:qm,allowPinchZoom:!0,children:p.jsx(zo,{asChild:!0,trapped:v.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ke(o,J=>{var ae;(ae=v.trigger)==null||ae.focus({preventScroll:!0}),J.preventDefault()}),children:p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:p.jsx(re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:J=>J.preventDefault(),...g,...ue,onPlaced:()=>y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ke(g.onKeyDown,J=>{const ae=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ae&&J.key.length===1&&j(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ie=E().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const fe=J.target,me=ie.indexOf(fe);ie=ie.slice(me+1)}setTimeout(()=>te(ie)),J.preventDefault()}})})})})})})});dl.displayName=Xm;var Jm="SelectItemAlignedPosition",ul=_.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=_t(It,r),s=Ct(It,r),[a,l]=_.useState(null),[c,d]=_.useState(null),u=Ae(t,A=>d(A)),m=On(r),f=_.useRef(!1),w=_.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:g,focusSelectedItem:v}=s,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&g){const A=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),B=g.getBoundingClientRect();if(i.dir!=="rtl"){const fe=B.left-P.left,me=I.left-fe,ye=A.left-me,x=A.width+ye,K=Math.max(x,P.width),Y=window.innerWidth-tt,O=So(me,[tt,Math.max(tt,Y-K)]);a.style.minWidth=x+"px",a.style.left=O+"px"}else{const fe=P.right-B.right,me=window.innerWidth-I.right-fe,ye=window.innerWidth-A.right-me,x=A.width+ye,K=Math.max(x,P.width),Y=window.innerWidth-tt,O=So(me,[tt,Math.max(tt,Y-K)]);a.style.minWidth=x+"px",a.style.right=O+"px"}const F=m(),E=window.innerHeight-tt*2,L=h.scrollHeight,y=window.getComputedStyle(c),U=parseInt(y.borderTopWidth,10),te=parseInt(y.paddingTop,10),W=parseInt(y.borderBottomWidth,10),V=parseInt(y.paddingBottom,10),H=U+te+L+V+W,oe=Math.min(b.offsetHeight*5,H),j=window.getComputedStyle(h),D=parseInt(j.paddingTop,10),Q=parseInt(j.paddingBottom,10),G=A.top+A.height/2-tt,re=E-G,ue=b.offsetHeight/2,J=b.offsetTop+ue,ae=U+te+J,de=H-ae;if(ae<=G){const fe=F.length>0&&b===F[F.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(re,ue+(fe?Q:0)+me+W),x=ae+ye;a.style.height=x+"px"}else{const fe=F.length>0&&b===F[0].ref.current;a.style.top="0px";const ye=Math.max(G,U+h.offsetTop+(fe?D:0)+ue)+de;a.style.height=ye+"px",h.scrollTop=ae-G+h.offsetTop}a.style.margin=`${tt}px 0`,a.style.minHeight=oe+"px",a.style.maxHeight=E+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,g,i.dir,n]);Le(()=>k(),[k]);const[S,C]=_.useState();Le(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=_.useCallback(A=>{A&&w.current===!0&&(k(),v==null||v(),w.current=!1)},[k,v]);return p.jsx(eg,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:T,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:p.jsx(ze.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ul.displayName=Jm;var Qm="SelectPopperPosition",qo=_.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=tt,...i}=e,s=Pn(r);return p.jsx($o,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qo.displayName=Qm;var[eg,Jo]=er(It,{}),Qo="SelectViewport",fl=_.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Ct(Qo,r),s=Jo(Qo,r),a=Ae(t,i.onViewportChange),l=_.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),p.jsx(Tn.Slot,{scope:r,children:p.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&u){const f=Math.abs(l.current-d.scrollTop);if(f>0){const w=window.innerHeight-tt*2,h=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),g=Math.max(h,b);if(g<w){const v=g+f,k=Math.min(w,v),S=v-k;u.style.height=k+"px",u.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});fl.displayName=Qo;var hl="SelectGroup",[tg,rg]=er(hl),ng=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Sr();return p.jsx(tg,{scope:r,id:o,children:p.jsx(ze.div,{role:"group","aria-labelledby":o,...n,ref:t})})});ng.displayName=hl;var pl="SelectLabel",og=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=rg(pl,r);return p.jsx(ze.div,{id:o.id,...n,ref:t})});og.displayName=pl;var In="SelectItem",[ig,ml]=er(In),gl=_.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=_t(In,r),l=Ct(In,r),c=a.value===n,[d,u]=_.useState(i??""),[m,f]=_.useState(!1),w=Ae(t,v=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,v,n,o)}),h=Sr(),b=_.useRef("touch"),g=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(ig,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:_.useCallback(v=>{u(k=>k||((v==null?void 0:v.textContent)??"").trim())},[]),children:p.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(ze.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:ke(s.onFocus,()=>f(!0)),onBlur:ke(s.onBlur,()=>f(!1)),onClick:ke(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:ke(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:ke(s.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:ke(s.onPointerMove,v=>{var k;b.current=v.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,v=>{var k;v.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:ke(s.onKeyDown,v=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&v.key===" "||($m.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});gl.displayName=In;var Er="SelectItemText",bl=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=_t(Er,r),a=Ct(Er,r),l=ml(Er,r),c=Zm(Er,r),[d,u]=_.useState(null),m=Ae(t,g=>u(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,w=_.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=c;return Le(()=>(h(w),()=>b(w)),[h,b,w]),p.jsxs(p.Fragment,{children:[p.jsx(ze.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Rr.createPortal(i.children,s.valueNode):null]})});bl.displayName=Er;var vl="SelectItemIndicator",wl=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ml(vl,r).isSelected?p.jsx(ze.span,{"aria-hidden":!0,...n,ref:t}):null});wl.displayName=vl;var ei="SelectScrollUpButton",sg=_.forwardRef((e,t)=>{const r=Ct(ei,e.__scopeSelect),n=Jo(ei,e.__scopeSelect),[o,i]=_.useState(!1),s=Ae(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(xl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});sg.displayName=ei;var ti="SelectScrollDownButton",ag=_.forwardRef((e,t)=>{const r=Ct(ti,e.__scopeSelect),n=Jo(ti,e.__scopeSelect),[o,i]=_.useState(!1),s=Ae(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(xl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ag.displayName=ti;var xl=_.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Ct("SelectScrollButton",r),s=_.useRef(null),a=On(r),l=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),Le(()=>{var d;const c=a().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(ze.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:ke(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{l()})})}),lg="SelectSeparator",cg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(ze.div,{"aria-hidden":!0,...n,ref:t})});cg.displayName=lg;var ri="SelectArrow",dg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=_t(ri,r),s=Ct(ri,r);return i.open&&s.position==="popper"?p.jsx(Ho,{...o,...n,ref:t}):null});dg.displayName=ri;var ug="SelectBubbleInput",yl=_.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=_.useRef(null),i=Ae(n,o),s=em(t);return _.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const u=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(u)}},[s,t]),p.jsx(ze.select,{...r,style:{...Fa,...r.style},ref:i,defaultValue:t})});yl.displayName=ug;function kl(e){return e===""||e===void 0}function Sl(e){const t=Be(e),r=_.useRef(""),n=_.useRef(0),o=_.useCallback(s=>{const a=r.current+s;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=_.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function _l(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=fg(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function fg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var hg=tl,Cl=nl,pg=il,mg=sl,gg=al,El=ll,bg=fl,Nl=gl,vg=bl,wg=wl;const xg=hg,yg=pg,zl=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Cl,{ref:n,className:ve("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,p.jsx(mg,{asChild:!0,children:p.jsx(Hr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));zl.displayName=Cl.displayName;const Al=_.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(gg,{children:p.jsx(El,{ref:o,className:ve("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:p.jsx(bg,{className:ve("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Al.displayName=El.displayName;const jl=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Nl,{ref:n,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(wg,{children:p.jsx(to,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(vg,{children:t})]}));jl.displayName=Nl.displayName;const Tl=_.createContext(null);function Ol(){const e=_.useContext(Tl);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Pl({open:e,onOpenChange:t,children:r}){const[n,o]=_.useState(!1),i=e!==void 0,s=i?e:n,a=_.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=_.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(Tl.Provider,{value:l,children:r})}function kg({asChild:e,children:t}){const{onOpenChange:r}=Ol(),n=_.Children.only(t);return e&&_.isValidElement(n)?_.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):p.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Il({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ol();if(_.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return gt.createPortal(p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),p.jsx("div",{role:"dialog","aria-modal":!0,className:ve("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function Dl({className:e,...t}){return p.jsx("div",{className:ve("flex flex-col gap-1.5 pb-4",e),...t})}function Sg({className:e,...t}){return p.jsx("div",{className:ve("flex justify-end gap-2 pt-4",e),...t})}function Rl({className:e,...t}){return p.jsx("h2",{className:ve("text-sm font-semibold text-white",e),...t})}function Ll({className:e,...t}){return p.jsx("p",{className:ve("text-xs text-zinc-400",e),...t})}const $e=_.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?nh:"button";return p.jsx(c,{ref:i,type:"button",className:ve(s,a[t],l[r],e),...o})});$e.displayName="Button";const _g=["library","upload","url"];function Cg({library:e,selectedId:t,onSelect:r}){const[n,o]=N.useState(""),[i,s]=N.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const d=i==="all"||(c.tags??[]).includes(i),u=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return d&&u});return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Gd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),p.jsx(ko,{value:n,onChange:c=>o(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>p.jsx("button",{type:"button",onClick:()=>s(c),className:ve("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?p.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const d=t===c.id;return p.jsxs("button",{type:"button",onClick:()=>r(d?null:c.id),className:ve("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",d?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[p.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:ve("w-full h-full object-cover transition-[filter] duration-150",d?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),p.jsx("div",{className:ve("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",d&&"opacity-100"),children:p.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),d&&p.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:p.jsx(to,{size:14,className:"text-white"})})]},c.id)})}):p.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function Eg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=N.useState(!1),i=N.useRef(null),s=N.useCallback(async d=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:d.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!d.type.startsWith("image/"))return;if(r){try{const m=await r(d);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:m==null?void 0:m.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:d.name,size:d.size,dataUrl:m})}catch{const m=new FileReader;m.onload=f=>{var w;t({name:d.name,size:d.size,dataUrl:(w=f.target)==null?void 0:w.result})},m.readAsDataURL(d)}return}const u=new FileReader;u.onload=m=>{var f;t({name:d.name,size:d.size,dataUrl:(f=m.target)==null?void 0:f.result})},u.readAsDataURL(d)},[t,r]),a=N.useCallback(d=>{var m,f;d.preventDefault(),d.stopPropagation(),o(!1);const u=(f=(m=d.dataTransfer)==null?void 0:m.files)==null?void 0:f[0];u&&s(u)},[s]),l=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=N.useCallback(d=>{var m;const u=(m=d.target.files)==null?void 0:m[0];u&&s(u)},[s]);return p.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:d=>{d.preventDefault(),d.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var d;return!e&&((d=i.current)==null?void 0:d.click())},className:ve("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),p.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),p.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),p.jsx($e,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:d=>{d.stopPropagation(),t(null)},children:p.jsx(Yr,{size:14})})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:p.jsx(rs,{size:22})}),p.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),p.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),p.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),p.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function Ng({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=N.useState(""),[o,i]=N.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx(Tt,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ko,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:ve("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),p.jsx($e,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&p.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?p.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[p.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),p.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[p.jsx(to,{size:14,className:"text-emerald-400"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:p.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[p.jsx(es,{size:32,className:"mb-3 opacity-40"}),p.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const zg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=ur(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=N.useState("library"),[a,l]=N.useState(null),[c,d]=N.useState(null),[u,m]=N.useState(null);N.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),N.useEffect(()=>{if(!e||i!=="upload")return;const g=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",g),()=>window.removeEventListener("beforeunload",g)},[e,i]),N.useEffect(()=>{if(!e||i!=="upload")return;const g=k=>{k.preventDefault()},v={capture:!0};return document.addEventListener("dragover",g,v),document.addEventListener("drop",g,v),window.addEventListener("dragover",g,v),window.addEventListener("drop",g,v),()=>{document.removeEventListener("dragover",g,v),document.removeEventListener("drop",g,v),window.removeEventListener("dragover",g,v),window.removeEventListener("drop",g,v)}},[e,i]);const f=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&u!=null,w=()=>{if(i==="library"&&a){const g=o.find(v=>v.id===a);g&&r({url:g.url,alt:g.alt})}else i==="upload"&&c?r({url:c.dataUrl,alt:c.name}):i==="url"&&u&&r({url:u,alt:""});setTimeout(()=>t(!1),0)},h=i==="library"&&a?"1 immagine selezionata":i==="upload"&&c?c.name:i==="url"&&u?"URL pronto":"Nessuna selezione",b=g=>{g.preventDefault(),g.stopPropagation()};return p.jsx(Pl,{open:e,onOpenChange:t,children:p.jsxs(Il,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(Dl,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:p.jsx(Vr,{size:18})}),p.jsxs("div",{children:[p.jsx(Rl,{children:"Image Picker"}),p.jsx(Ll,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),p.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:p.jsx(Mt,{size:18})})]}),p.jsx("div",{className:"flex border-b border-zinc-800",children:_g.map(g=>p.jsxs("button",{type:"button",onClick:()=>s(g),className:ve("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===g?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[g==="library"&&p.jsx(Vr,{size:14}),g==="upload"&&p.jsx(rs,{size:14}),g==="url"&&p.jsx(es,{size:14}),g==="library"?"Libreria":g==="upload"?"Upload":"URL"]},g))}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&p.jsx(Cg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(Eg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(Ng,{urlPreview:u,onUrlPreviewChange:m})]}),p.jsxs(Sg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:h}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),p.jsx($e,{type:"button",size:"sm",disabled:!f,onClick:w,className:ve(!f&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Ml=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Ag=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=ur(),[i,s]=N.useState(!1),[a,l]=N.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Ml(e.url,o):"",u=f=>{t(f),s(!1)},m=f=>{f.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:ve("space-y-1.5",n),children:[p.jsx(Tt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?p.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:f=>f.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ve("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[p.jsx("img",{src:d,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:f=>{f.target.style.display="none"}}),p.jsx("div",{className:ve("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[p.jsx(Kd,{size:13}),p.jsx("span",{children:"Cambia"})]}),p.jsx($e,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:m,children:p.jsx(Yr,{size:13})})]})}),p.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):p.jsxs("button",{type:"button",onClick:()=>s(!0),className:ve("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[p.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:p.jsx(Vr,{size:18})}),p.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),p.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),p.jsx(zg,{open:i,onOpenChange:s,onSelect:u})]})},Fl=[{name:"layers",Icon:no},{name:"github",Icon:Yd},{name:"arrow-right",Icon:Md},{name:"box",Icon:Bd},{name:"terminal",Icon:Qd},{name:"chevron-right",Icon:Ud},{name:"menu",Icon:Zd},{name:"x",Icon:Mt},{name:"sparkles",Icon:qd},{name:"zap",Icon:tu}],Dn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),tr={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[p.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Dn(e)}),p.jsx(ko,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[p.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Dn(e)}),p.jsx(eh,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>p.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[p.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Dn(e)}),p.jsxs(xg,{value:t||"",onValueChange:r,children:[p.jsx(zl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:p.jsx(yg,{placeholder:"Select..."})}),p.jsx(Al,{className:"dark",children:n.map(o=>p.jsx(jl,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[p.jsx(th,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(Tt,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Dn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return p.jsx("div",{className:"mb-4",children:p.jsx(Ag,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=N.useState(!1),i=Fl.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(Tt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(Pl,{open:n,onOpenChange:o,children:[p.jsx(kg,{asChild:!0,children:p.jsx($e,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?p.jsxs(p.Fragment,{children:[p.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):p.jsxs(p.Fragment,{children:[p.jsx(Vr,{size:16,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),p.jsxs(Il,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(Dl,{children:[p.jsx(Rl,{className:"text-sm",children:"Choose icon"}),p.jsx(Ll,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Fl.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:ve("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:p.jsx(a,{size:20})},s))})]})]})]})}},ni=e=>{if(e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault)return ni(e._def.innerType);if(e instanceof Oe.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=ni(e.shape[r]));return t}return e instanceof Oe.z.ZodArray?[]:e instanceof Oe.z.ZodString?"":e instanceof Oe.z.ZodNumber?0:e instanceof Oe.z.ZodBoolean?!1:e instanceof Oe.z.ZodEnum?e._def.values[0]:null},Rn=e=>e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault||e instanceof Oe.z.ZodNullable?Rn(e._def.innerType):e,Bl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Rn(e);return r!==e?Bl(r):null},Ln=(e,t)=>e&&!t?"opacity-10":"opacity-100",rr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Nr=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(u=>n.includes(u)):Object.keys(s),l=o==null?void 0:o[0],c=(l==null?void 0:l.fieldKey)??null,d=c!=null;return p.jsx("div",{className:"space-y-4",children:a.map(u=>{const m=s[u];if(!m)return null;const f=Rn(m),w=Bl(m)||"ui:text",h=t[u];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&f instanceof Oe.z.ZodObject){const S=rr(c,u),C=tr["ui:image-picker"]||tr["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Ln(d,S)}`,...S?{"data-jp-focused-field":u}:{},children:p.jsx(C,{label:u,value:h,onChange:T=>r({...t,[u]:T})})},u)}if(f instanceof Oe.z.ZodObject){const S=h||{},C=rr(c,u);return p.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Ln(d,C)}`,...C?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),p.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:oi(u)})]}),p.jsx(Nr,{schema:f,data:S,onChange:T=>r({...t,[u]:T}),expandedItemPath:o&&rr(l==null?void 0:l.fieldKey,u)?o.slice(1):void 0})]},u)}if(f instanceof Oe.z.ZodArray){const S=Array.isArray(h)?h:[],C=Rn(f.element),T=(B,F)=>{if(F<0||F>=S.length)return;const E=[...S],[L]=E.splice(B,1);E.splice(F,0,L),r({...t,[u]:E})},A=rr(c,u),I=rr(l==null?void 0:l.fieldKey,u)?l==null?void 0:l.itemId:void 0;return p.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Ln(d,A)}`,...A?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[oi(u)," (",S.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const B=ni(C);r({...t,[u]:[...S,B]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[p.jsx(oo,{size:12})," Add Item"]})]}),p.jsx("div",{className:"space-y-2",children:S.map((B,F)=>{const E=B,L=E.id||`legacy-${F}`,y=(typeof E.title=="string"?E.title:null)||(typeof E.label=="string"?E.label:null)||(typeof E.name=="string"?E.name:null)||(typeof E.content=="string"?E.content:null)||(typeof E.text=="string"?E.text:null)||`${oi(u)} #${F+1}`,U=I,te=String(E.id??L),W=U!=null&&String(U)===te,V=W&&o&&o.length>1?o.slice(1):void 0,H=d&&A&&U!=null&&!W;return p.jsx(jg,{itemId:te,openItemId:U!=null?String(U):void 0,isFaded:H,index:F,isFirst:F===0,isLast:F===S.length-1,label:y,onExpandedChange:i?oe=>i(oe?{fieldKey:u,itemId:te}:null):void 0,onRemove:()=>{const oe=S.filter((j,D)=>D!==F);r({...t,[u]:oe})},onMoveUp:()=>T(F,F-1),onMoveDown:()=>T(F,F+1),children:C instanceof Oe.z.ZodObject?p.jsx(Nr,{schema:C,data:E||{},expandedItemPath:V,onChange:oe=>{const j=[...S];j[F]=oe,r({...t,[u]:j})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},L)})})]},u)}const b=w in tr?w:"ui:text",g=tr[b]||tr["ui:text"],v=f instanceof Oe.z.ZodEnum?f._def.values:void 0,k=rr(c,u);return p.jsx("div",{className:`transition-opacity duration-200 ${Ln(d,k)}`,...k?{"data-jp-focused-field":u}:{},children:p.jsx(g,{label:u,value:h,options:v,onChange:S=>r({...t,[u]:S})})},u)})})},jg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:c,children:d})=>{const u=t!=null&&String(t)===String(e),[m,f]=N.useState(u);N.useEffect(()=>{u&&!m&&f(!0),!u&&m&&f(!1)},[u,m]);const w=()=>{const b=!m;f(b),o==null||o(b)},h=u&&m;return p.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...h?{"data-jp-expanded-item":e}:{},children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[p.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:p.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[m?p.jsx(ro,{size:12,className:"shrink-0"}):p.jsx(Hr,{size:12,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n})]})}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[p.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Fd,{size:12})}),p.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Ld,{size:12})}),p.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),p.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:p.jsx(Yr,{size:12})})]})]}),m&&p.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function Tg(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var ht=e=>{const{present:t,children:r}=e,n=Og(t),o=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),i=Ae(n.ref,Pg(o));return typeof r=="function"||n.isPresent?_.cloneElement(o,{ref:i}):null};ht.displayName="Presence";function Og(e){const[t,r]=_.useState(),n=_.useRef(null),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Tg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Mn(n.current);i.current=a==="mounted"?c:"none"},[a]),Le(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,f=Mn(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Le(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=f=>{const h=Mn(n.current).includes(CSS.escape(f.animationName));if(f.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=f=>{f.target===t&&(i.current=Mn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Mn(e){return(e==null?void 0:e.animationName)||"none"}function Pg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Fn]=$t("Tooltip",[Gt]),Bn=Gt(),Ul="TooltipProvider",Ig=700,ii="tooltip.open",[Dg,si]=Fn(Ul),Wl=e=>{const{__scopeTooltip:t,delayDuration:r=Ig,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Dg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Wl.displayName=Ul;var zr="Tooltip",[Rg,Ar]=Fn(zr),$l=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=si(zr,e.__scopeTooltip),c=Bn(t),[d,u]=_.useState(null),m=Sr(),f=_.useRef(0),w=s??l.disableHoverableContent,h=a??l.delayDuration,b=_.useRef(!1),[g,v]=Sn({prop:n,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ii))):l.onClose(),i==null||i(A)},caller:zr}),k=_.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),S=_.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,v(!0)},[v]),C=_.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),T=_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,v(!0),f.current=0},h)},[h,v]);return _.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx(Wo,{...c,children:p.jsx(Rg,{scope:t,contentId:m,open:g,stateAttribute:k,trigger:d,onTriggerChange:u,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?T():S()},[l.isOpenDelayedRef,T,S]),onTriggerLeave:_.useCallback(()=>{w?C():(window.clearTimeout(f.current),f.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};$l.displayName=zr;var ai="TooltipTrigger",Hl=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Ar(ai,r),i=si(ai,r),s=Bn(r),a=_.useRef(null),l=Ae(t,a,o.onTriggerChange),c=_.useRef(!1),d=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(yn,{asChild:!0,...s,children:p.jsx(ze.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ke(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});Hl.displayName=ai;var li="TooltipPortal",[Lg,Mg]=Fn(li,{forceMount:void 0}),Vl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Ar(li,t);return p.jsx(Lg,{scope:t,forceMount:r,children:p.jsx(ht,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};Vl.displayName=li;var nr="TooltipContent",Yl=_.forwardRef((e,t)=>{const r=Mg(nr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Ar(nr,e.__scopeTooltip);return p.jsx(ht,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Zl,{side:o,...i,ref:t}):p.jsx(Fg,{side:o,...i,ref:t})})}),Fg=_.forwardRef((e,t)=>{const r=Ar(nr,e.__scopeTooltip),n=si(nr,e.__scopeTooltip),o=_.useRef(null),i=Ae(t,o),[s,a]=_.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:u}=n,m=_.useCallback(()=>{a(null),u(!1)},[u]),f=_.useCallback((w,h)=>{const b=w.currentTarget,g={x:w.clientX,y:w.clientY},v=Hg(g,b.getBoundingClientRect()),k=Vg(g,v),S=Yg(h.getBoundingClientRect()),C=Kg([...k,...S]);a(C),u(!0)},[u]);return _.useEffect(()=>()=>m(),[m]),_.useEffect(()=>{if(l&&d){const w=b=>f(b,d),h=b=>f(b,l);return l.addEventListener("pointerleave",w),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",h)}}},[l,d,f,m]),_.useEffect(()=>{if(s){const w=h=>{const b=h.target,g={x:h.clientX,y:h.clientY},v=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!Zg(g,s);v?m():k&&(m(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,d,s,c,m]),p.jsx(Zl,{...e,ref:i})}),[Bg,Ug]=Fn(zr,{isInside:!1}),Wg=ih("TooltipContent"),Zl=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Ar(nr,r),c=Bn(r),{onClose:d}=l;return _.useEffect(()=>(document.addEventListener(ii,d),()=>document.removeEventListener(ii,d)),[d]),_.useEffect(()=>{if(l.trigger){const u=m=>{const f=m.target;f!=null&&f.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:p.jsxs($o,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Wg,{children:n}),p.jsx(Bg,{scope:r,isInside:!0,children:p.jsx(rm,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Yl.displayName=nr;var Kl="TooltipArrow",$g=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Bn(r);return Ug(Kl,r).isInside?null:p.jsx(Ho,{...o,...n,ref:t})});$g.displayName=Kl;function Hg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Vg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Yg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Zg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,d=a.y,u=l.x,m=l.y;d>n!=m>n&&r<(u-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function Kg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Gg(t)}function Gg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Xg=Wl,qg=$l,Jg=Hl,Qg=Vl,Gl=Yl;const e0=Xg,jr=qg,Tr=Jg,or=_.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(Qg,{children:p.jsx(Gl,{ref:n,sideOffset:t,className:ve("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));or.displayName=Gl.displayName;var Un="Popover",[Xl]=$t(Un,[Gt]),Or=Gt(),[t0,Et]=Xl(Un),ql=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Or(t),l=_.useRef(null),[c,d]=_.useState(!1),[u,m]=Sn({prop:n,defaultProp:o??!1,onChange:i,caller:Un});return p.jsx(Wo,{...a,children:p.jsx(t0,{scope:t,contentId:Sr(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(f=>!f),[m]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:s,children:r})})};ql.displayName=Un;var Jl="PopoverAnchor",r0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(Jl,r),i=Or(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return _.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(yn,{...i,...n,ref:t})});r0.displayName=Jl;var Ql="PopoverTrigger",ec=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(Ql,r),i=Or(r),s=Ae(t,o.triggerRef),a=p.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ic(o.open),...n,ref:s,onClick:ke(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(yn,{asChild:!0,...i,children:a})});ec.displayName=Ql;var ci="PopoverPortal",[n0,o0]=Xl(ci,{forceMount:void 0}),tc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Et(ci,t);return p.jsx(n0,{scope:t,forceMount:r,children:p.jsx(ht,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};tc.displayName=ci;var ir="PopoverContent",rc=_.forwardRef((e,t)=>{const r=o0(ir,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Et(ir,e.__scopePopover);return p.jsx(ht,{present:n||i.open,children:i.modal?p.jsx(s0,{...o,ref:t}):p.jsx(a0,{...o,ref:t})})});rc.displayName=ir;var i0=Ht("PopoverContent.RemoveScroll"),s0=_.forwardRef((e,t)=>{const r=Et(ir,e.__scopePopover),n=_.useRef(null),o=Ae(t,n),i=_.useRef(!1);return _.useEffect(()=>{const s=n.current;if(s)return Wa(s)},[]),p.jsx(Xo,{as:i0,allowPinchZoom:!0,children:p.jsx(nc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),a0=_.forwardRef((e,t)=>{const r=Et(ir,e.__scopePopover),n=_.useRef(!1),o=_.useRef(!1);return p.jsx(nc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),nc=_.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,m=Et(ir,r),f=Or(r);return ea(),p.jsx(zo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx($o,{"data-state":ic(m.open),role:"dialog",id:m.contentId,...f,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),oc="PopoverClose",l0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(oc,r);return p.jsx(ze.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>o.onOpenChange(!1))})});l0.displayName=oc;var c0="PopoverArrow",d0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Or(r);return p.jsx(Ho,{...o,...n,ref:t})});d0.displayName=c0;function ic(e){return e?"open":"closed"}var u0=ql,f0=ec,h0=tc,sc=rc;const p0=u0,m0=f0,ac=_.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(h0,{children:p.jsx(sc,{ref:o,align:t,sideOffset:r,className:ve("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));ac.displayName=sc.displayName;const lc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",g0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=N.useState(!1),c=s??lc(t),d=u=>{r(u),l(!1)};return p.jsx("div",{className:ve("mx-3 mt-2 mb-2",i),children:p.jsxs(p0,{open:a,onOpenChange:l,children:[p.jsx(m0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:ve("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[p.jsx(Vd,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),p.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),p.jsx(Hr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),p.jsxs(ac,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(u=>{const m=u===t,f=lc(u);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(u),className:ve("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",m?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[p.jsx("span",{children:f}),n!=null&&p.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},u)}),o!=null&&p.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:p.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[p.jsx(oo,{size:12,"aria-hidden":!0}),p.jsx("span",{children:"New page"})]})})]})]})})};function b0(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var di="ScrollArea",[cc]=$t(di),[v0,Ke]=cc(di),dc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=_.useState(null),[c,d]=_.useState(null),[u,m]=_.useState(null),[f,w]=_.useState(null),[h,b]=_.useState(null),[g,v]=_.useState(0),[k,S]=_.useState(0),[C,T]=_.useState(!1),[A,P]=_.useState(!1),I=Ae(t,F=>l(F)),B=Gs(o);return p.jsx(v0,{scope:r,type:n,dir:B,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:m,scrollbarX:f,onScrollbarXChange:w,scrollbarXEnabled:C,onScrollbarXEnabledChange:T,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:P,onCornerWidthChange:v,onCornerHeightChange:S,children:p.jsx(ze.div,{dir:B,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});dc.displayName=di;var uc="ScrollAreaViewport",fc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ke(uc,r),a=_.useRef(null),l=Ae(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(ze.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});fc.displayName=uc;var at="ScrollAreaScrollbar",hc=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ke(at,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(w0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(x0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(pc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(ui,{...n,ref:t}):null});hc.displayName=at;var w0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ke(at,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(ht,{present:r||i,children:p.jsx(pc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),x0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ke(at,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Vn(()=>l("SCROLL_END"),100),[a,l]=b0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),_.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let u=c[d];const m=()=>{const f=c[d];u!==f&&(l("SCROLL"),s()),u=f};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[o.viewport,i,l,s]),p.jsx(ht,{present:r||a!=="hidden",children:p.jsx(ui,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),pc=_.forwardRef((e,t)=>{const r=Ke(at,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",l=Vn(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?c:d)}},10);return sr(r.viewport,l),sr(r.content,l),p.jsx(ht,{present:n||i,children:p.jsx(ui,{"data-state":i?"visible":"hidden",...o,ref:t})})}),ui=_.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ke(at,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,l]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=wc(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function u(m,f){return E0(m,s.current,a,f)}return r==="horizontal"?p.jsx(y0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,f=xc(m,a,o.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=u(m,o.dir))}}):r==="vertical"?p.jsx(k0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,f=xc(m,a);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=u(m))}}):null}),y0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ke(at,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Ae(t,l,i.onScrollbarXChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(gc,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Hn(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),kc(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:$n(s.paddingLeft),paddingEnd:$n(s.paddingRight)}})}})}),k0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ke(at,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Ae(t,l,i.onScrollbarYChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(gc,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Hn(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),kc(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:$n(s.paddingTop),paddingEnd:$n(s.paddingBottom)}})}})}),[S0,mc]=cc(at),gc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...m}=e,f=Ke(at,r),[w,h]=_.useState(null),b=Ae(t,I=>h(I)),g=_.useRef(null),v=_.useRef(""),k=f.viewport,S=n.content-n.viewport,C=Be(d),T=Be(l),A=Vn(u,10);function P(I){if(g.current){const B=I.clientX-g.current.left,F=I.clientY-g.current.top;c({x:B,y:F})}}return _.useEffect(()=>{const I=B=>{const F=B.target;(w==null?void 0:w.contains(F))&&C(B,S)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[k,w,S,C]),_.useEffect(T,[n,T]),sr(w,A),sr(f.content,A),p.jsx(S0,{scope:r,scrollbar:w,hasThumb:o,onThumbChange:Be(i),onThumbPointerUp:Be(s),onThumbPositionChange:T,onThumbPointerDown:Be(a),children:p.jsx(ze.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),g.current=w.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),P(I))}),onPointerMove:ke(e.onPointerMove,P),onPointerUp:ke(e.onPointerUp,I=>{const B=I.target;B.hasPointerCapture(I.pointerId)&&B.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Wn="ScrollAreaThumb",bc=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=mc(Wn,e.__scopeScrollArea);return p.jsx(ht,{present:r||o.hasThumb,children:p.jsx(_0,{ref:t,...n})})}),_0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ke(Wn,r),s=mc(Wn,r),{onThumbPositionChange:a}=s,l=Ae(t,u=>s.onThumbChange(u)),c=_.useRef(void 0),d=Vn(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const u=i.viewport;if(u){const m=()=>{if(d(),!c.current){const f=N0(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(ze.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ke(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),w=u.clientX-f.left,h=u.clientY-f.top;s.onThumbPointerDown({x:w,y:h})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});bc.displayName=Wn;var fi="ScrollAreaCorner",vc=_.forwardRef((e,t)=>{const r=Ke(fi,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(C0,{...e,ref:t}):null});vc.displayName=fi;var C0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ke(fi,r),[i,s]=_.useState(0),[a,l]=_.useState(0),c=!!(i&&a);return sr(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),sr(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(ze.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $n(e){return e?parseInt(e,10):0}function wc(e,t){const r=e/t;return isNaN(r)?0:r}function Hn(e){const t=wc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function E0(e,t,r,n="ltr"){const o=Hn(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,u=n==="ltr"?[0,d]:[d*-1,0];return yc([l,c],u)(e)}function xc(e,t,r="ltr"){const n=Hn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=So(e,l);return yc([0,s],[0,a])(c)}function yc(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function kc(e,t){return e>0&&e<t}var N0=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,a=r.top!==i.top;(s||a)&&t(),r=i,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function Vn(e,t){const r=Be(e),n=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),_.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function sr(e,t){const r=Be(t);Le(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Sc=dc,z0=fc,A0=hc,j0=bc,T0=vc;const _c=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Sc,{ref:n,className:ve("relative overflow-hidden",e),...r,children:[p.jsx(z0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(A0,{orientation:"vertical",className:"flex touch-none select-none transition-colors h-full w-1.5 border-l border-l-transparent p-px",children:p.jsx(j0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(T0,{})]}));_c.displayName=Sc.displayName;const hi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),Cc=new Set(["ui:editorial-markdown"]),Ec=e=>e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault||e instanceof Oe.z.ZodNullable?Ec(e._def.innerType):e,pi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=Ec(e);return o!==e?pi(o):""},mi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),O0={activationConstraint:{distance:8}},P0={activationConstraint:{delay:200,tolerance:5}};function gi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:c}=t,d=!!r;return p.jsxs("div",{className:ve("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",d?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[d?p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:p.jsx(Qi,{size:12,className:"text-zinc-600"})}):p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:p.jsx(Qi,{size:12,className:"text-zinc-600/50"})}),p.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:ve("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),p.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),p.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx($e,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:u=>{u.stopPropagation(),l(u)},children:p.jsx(Xd,{size:12})})}),p.jsx(or,{children:"Settings"})]}),s&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx($e,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:u=>{u.stopPropagation(),c()},children:p.jsx(Yr,{size:12})})}),p.jsx(or,{children:"Delete section"})]})]})]})}function I0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Gf({id:e.id,disabled:!t.canReorder}),l={transform:wt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:l,className:ve(a&&"z-10"),children:p.jsx(gi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const Nc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:d,onDeleteSection:u,onAddSection:m,hasChanges:f=!1,onSaveToFile:w,onHotSave:h,saveSuccessFeedback:b=!1,hotSaveSuccessFeedback:g=!1,hotSaveInProgress:v=!1,showLegacySave:k=!0,showHotSave:S=!1,onResetToFile:C,showResetToFile:T=!1,pageSlugs:A=[],currentSlug:P="home",onPageChange:I})=>{const{schemas:B}=ur(),[F,E]=N.useState(!0),[L,y]=N.useState(null),[U,te]=N.useState(null),[W,V]=N.useState(null),[H,oe]=N.useState(null),j=N.useRef(null),D=N.useRef(null),Q=xu(co(bo,O0),co(Es,P0),co(mo,{coordinateGetter:Jf})),G=N.useDeferredValue(e),re=e!=null&&(G==null?void 0:G.id)!==e.id,ue=s&&s.length>0?s:W?[W]:null,J=ue!=null&&ue.length?{fieldKey:ue[ue.length-1].fieldKey,itemId:ue[ue.length-1].itemId}:null,ae=N.useRef(s);N.useEffect(()=>{ae.current!=null&&s==null&&V(null),ae.current=s},[s]),N.useEffect(()=>{(e==null?void 0:e.id)!=null&&E(!1)},[e==null?void 0:e.id]);const de=()=>{const R=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Z=j.current;Z&&Z.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(R)},ie=N.useRef(F);N.useEffect(()=>{if(F&&!ie.current){const R=de();return ie.current=F,R}ie.current=F},[F]),N.useEffect(()=>{if(!J)return;const R=j.current;if(!R)return;const Z=requestAnimationFrame(()=>{const X=R.querySelector("[data-jp-expanded-item]")??R.querySelector("[data-jp-focused-field]");X&&X.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(Z)},[J]);const fe=R=>{E(!1),d==null||d(R)},me=()=>{E(R=>{const Z=!R;return Z&&de(),Z})},ye=(R,Z)=>{Z.stopPropagation(),r.length>0&&o?oe(R):(E(!1),d==null||d(R))};N.useEffect(()=>{if(H==null)return;const R=Z=>{Z.key==="Escape"&&oe(null)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[H]);const x=R=>{L===R?(u==null||u(R),y(null)):(y(R),setTimeout(()=>y(null),3e3))},K=N.useMemo(()=>l.filter(R=>R.scope==="local").map(R=>R.id),[l]),Y=!!a&&K.length>0,O=R=>{te(R.active.id)},z=R=>{te(null);const{active:Z,over:X}=R;if(!X||Z.id===X.id||!a)return;const le=l.findIndex(we=>we.id===Z.id),be=l.findIndex(we=>we.id===X.id);if(le===-1||be===-1)return;const ge=le<be?be:be-1;a(Z.id,ge)},M=e?t.sections.find(R=>R.id===e.id):void 0,q=G?t.sections.find(R=>R.id===G.id):void 0,ee=G?B[G.type]:void 0,$=N.useMemo(()=>{if(!ee)return!1;const R=ee.shape,Z=Object.keys(R).filter(X=>!hi.has(X));return Z.length===0?!1:Z.every(X=>Cc.has(pi(R[X])))},[ee]);N.useEffect(()=>{(e==null?void 0:e.id)!=null&&$&&E(!0)},[e==null?void 0:e.id,$]);const ne=l.length>0&&(F||!e),ce=P?P.charAt(0).toUpperCase()+P.slice(1):"Select page",se=N.useMemo(()=>{const R=[];let Z=null;for(const X of l){const le=X.type.toUpperCase(),be=Z!==null&&(Z==="HEADER"&&le!=="HEADER"||Z!=="HEADER"&&Z!=="FOOTER"&&le==="FOOTER");R.push({layer:X,showSeparatorAbove:be}),Z=le}return R},[l]);return p.jsx(e0,{children:p.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),p.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-primary font-bold",children:e.type}),p.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),p.jsx("span",{className:"uppercase",children:e.scope})]}):p.jsxs("span",{className:"text-zinc-600",children:[ce," · ",l.length," sections"]})})]}),p.jsx($e,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Mt,{size:14})})]}),A.length>0&&I&&p.jsx(g0,{pageSlugs:A,currentSlug:P,onPageChange:I,sectionCount:l.length,currentPageLabel:ce}),l.length>0&&p.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[p.jsxs("button",{type:"button",onClick:me,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":ne,"aria-label":ne?"Collapse Page Layers":"Expand Page Layers",children:[p.jsx(no,{size:14,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),p.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),p.jsx(ro,{size:13,className:ve("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!F&&"rotate-180")})]}),m!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx($e,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(oo,{size:14})})}),p.jsx(or,{children:"Add section"})]})]}),p.jsxs(_c,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:j,className:"flex flex-col min-h-0",children:ne&&p.jsxs("div",{className:"py-1",children:[p.jsxs(vf,{sensors:Q,collisionDetection:Su,modifiers:[Rf],onDragStart:O,onDragEnd:z,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:R})=>R?`Posizione ${K.indexOf(String(R.id))+1} di ${K.length}.`:void 0,onDragEnd:({over:R})=>R?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Wf,{items:K,strategy:Bf,children:p.jsx("div",{className:"px-2 space-y-0.5",children:se.map(({layer:R,showSeparatorAbove:Z})=>p.jsxs(N.Fragment,{children:[Z&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),R.scope==="local"&&Y?p.jsx(I0,{layer:R,opts:{isSelected:(e==null?void 0:e.id)===R.id,isActive:c===R.id,isDragging:!1,canReorder:!0,canDelete:!!u,deleteConfirm:L===R.id,onSelect:()=>fe(R.id),onDelete:()=>x(R.id),onOpenSettings:X=>ye(R.id,X)}}):p.jsx("div",{children:p.jsx(gi,{layer:R,opts:{isSelected:(e==null?void 0:e.id)===R.id,isActive:c===R.id,isDragging:!1,canDelete:R.scope==="local"&&!!u,deleteConfirm:L===R.id,onSelect:()=>fe(R.id),onDelete:()=>x(R.id),onOpenSettings:X=>ye(R.id,X)}})})]},R.id))})}),p.jsx(Df,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:U?(()=>{const R=l.find(Z=>Z.id===U);return R?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(gi,{layer:R,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),L&&p.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[p.jsx(Wd,{size:12,className:"text-amber-500 shrink-0"}),p.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),J&&M&&(()=>{const R=M.data||{};let Z;if(ue&&ue.length>0){let X=R;for(const ge of ue){const we=X==null?void 0:X[ge.fieldKey];ge.itemId!=null&&Array.isArray(we)?X=we.find(Ne=>String(Ne==null?void 0:Ne.id)===String(ge.itemId))??null:X=we}const le=X||{},be=J.fieldKey;Z=(typeof le.name=="string"?le.name:null)??(typeof le.title=="string"?le.title:null)??(typeof le.label=="string"?le.label:null)??mi(be)}else{const X=J.fieldKey;if(J.itemId!=null){const ge=(Array.isArray(R[X])?R[X]:[]).find(we=>String(we==null?void 0:we.id)===String(J.itemId))||{};Z=(typeof ge.name=="string"?ge.name:null)??(typeof ge.title=="string"?ge.title:null)??(typeof ge.label=="string"?ge.label:null)??mi(X)}else Z=mi(X)}return p.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[p.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),p.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:Z})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&E(!1),children:e?re?p.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):ee?(()=>{const Z=Object.keys(ee.shape).filter(le=>!hi.has(le)&&!Cc.has(pi(ee.shape[le]))),X=(q==null?void 0:q.data)||{};return Z.length===0?p.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):p.jsx(Nr,{schema:ee,data:X,onChange:le=>n(le),keys:Z,expandedItemPath:ue,onSidebarExpandedItemChange:V})})():p.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(G==null?void 0:G.type)??e.type]}):p.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]}),p.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(k&&w!=null||S&&h!=null||C!=null)&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("div",{className:ve("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",f?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),p.jsx("span",{className:ve("text-sm font-medium transition-colors duration-300 truncate",b||g?"text-emerald-400":f?"text-amber-500":"text-zinc-500"),children:b||g?"Saved":f?"Unsaved Changes":"All Changes Saved"})]}),k&&w!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs($e,{size:"default",disabled:!f,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:R=>{R.preventDefault(),R.stopPropagation(),w()},children:[p.jsx(ts,{size:14}),p.jsx("span",{children:"Save"})]})}),p.jsx(or,{children:"Save (export JSON)"})]}),S&&h!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs($e,{size:"default",disabled:!f||v,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:R=>{R.preventDefault(),R.stopPropagation(),h()},children:[p.jsx(ts,{size:14}),p.jsx("span",{children:v?"Saving...":"Hot Save"})]})}),p.jsx(or,{children:"Hot save to edge"})]}),C!=null&&T&&p.jsx("button",{type:"button",onClick:C,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:p.jsx("span",{children:"Ripristina da file"})})]})}),H!=null&&r.length>0&&o!=null&&(()=>{const R=r.find(Ne=>Ne.id===H),Z=l.find(Ne=>Ne.id===H);if(!R)return null;const X=(Z==null?void 0:Z.scope)==="global"?"global":"local",le=R.type,be=B[le],we=(be?Object.keys(be.shape):[]).filter(Ne=>hi.has(Ne)),Se=R.data??{};return we.length===0?p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>oe(null),children:p.jsxs("div",{ref:D,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:Ne=>Ne.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",le]}),p.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:p.jsx(Mt,{size:18})})]}),p.jsx("div",{className:"p-4",children:p.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:Ne=>Ne.target===Ne.currentTarget&&oe(null),children:p.jsxs("div",{ref:D,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:Ne=>Ne.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",le]}),p.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:p.jsx(Mt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(Nr,{schema:be,data:Se,onChange:Ne=>{const pt={...R.data,...Ne};o(H,X,le,pt)},keys:we})})]})})})()]})})},zc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=N.useRef(null),l=N.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:je.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return N.useEffect(()=>{l()},[l]),N.useEffect(()=>{const c=d=>{d.data.type===je.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),N.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:je.SYNC_SELECTION,selectedId:o},"*")},[o]),N.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:je.REQUEST_SCROLL_TO_SECTION,sectionId:i},"*"),s==null||s())},[i,s]),p.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:p.jsx("iframe",{ref:a,src:`/admin/preview/${n}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},Yn={setTheme:e=>{const t=document.documentElement,{tokens:r}=e,n={"--theme-primary":r.colors.primary,"--theme-secondary":r.colors.secondary,"--theme-accent":r.colors.accent,"--theme-background":r.colors.background,"--theme-surface":r.colors.surface,"--theme-surface-alt":r.colors.surfaceAlt,"--theme-text":r.colors.text,"--theme-text-muted":r.colors.textMuted,"--theme-border":r.colors.border,"--theme-font-primary":r.typography.fontFamily.primary,"--theme-font-mono":r.typography.fontFamily.mono,"--theme-radius-sm":r.borderRadius.sm,"--theme-radius-md":r.borderRadius.md,"--theme-radius-lg":r.borderRadius.lg};Object.entries(n).forEach(([o,i])=>{t.style.setProperty(o,i)})}};function D0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function Ac(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),c=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&c&&r.push({fieldKey:c,itemId:l}),n==null){const d=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");d&&(n=d)}o=o.parentElement}return r.reverse(),D0(r,n)}const R0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',L0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",jc=()=>{var f;const[e,t]=N.useState(null),[r,n]=N.useState(null),[o,i]=N.useState(null),[s,a]=N.useState(null),[l,c]=N.useState(!1);if(N.useEffect(()=>{const w=h=>{if(!(h.origin!==window.location.origin||h.source!==window.parent)){if(h.data.type===je.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Yn.setTheme(h.data.themeConfig)),h.data.type===je.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===je.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===je.REQUEST_INLINE_FLUSH){const b=typeof h.data.requestId=="string"?h.data.requestId:null;window.dispatchEvent(new CustomEvent(je.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:je.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}h.data.type===je.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:je.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))}};return window.addEventListener("message",w),window.parent.postMessage({type:je.STAGE_READY},"*"),()=>window.removeEventListener("message",w)},[]),N.useEffect(()=>{const w=g=>!!g.closest(L0),h=g=>!!(g.closest('[data-jp-ignore-select="true"]')||g.closest(R0)&&!w(g)||g.closest("a[href]")&&!w(g)),b=g=>{var y,U,te;const v=g.target;if(h(v)){v.closest("a[href]")&&g.preventDefault();return}const k=g.clientX,S=g.clientY;let C=null,T=v;for(;T&&T!==document.body;){const W=(y=T.getAttribute)==null?void 0:y.call(T,"data-section-id"),V=(U=T.getAttribute)==null?void 0:U.call(T,"data-section-type"),H=(te=T.getAttribute)==null?void 0:te.call(T,"data-section-scope");if(W&&V&&H){C=T;break}T=T.parentElement}if(!C)return;g.preventDefault(),g.stopPropagation();const A=C.getAttribute("data-section-id"),P=C.getAttribute("data-section-type"),I=C.getAttribute("data-section-scope");if(!A||!P||!I)return;const B={id:A,type:P,scope:I};if(v===C){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}const F=document.elementFromPoint(k,S)??v;if(!F||!C.contains(F)){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}if(F===C){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}let E=Ac(F,C);if(E.length===0&&F){let W=null;const V=H=>{var j,D;const oe=H.getBoundingClientRect();if(oe.left<=k&&k<=oe.right&&oe.top<=S&&S<=oe.bottom){for(let Q=0;Q<H.children.length;Q++)V(H.children[Q]);((j=H.getAttribute)!=null&&j.call(H,"data-jp-item-id")||(D=H.getAttribute)!=null&&D.call(H,"data-jp-field"))&&(W=H)}};V(F),W&&(E=Ac(W,C))}const L={type:je.SECTION_SELECT,section:B};E.length>0&&(L.itemPath=E),window.parent.postMessage(L,"*")};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[]),N.useEffect(()=>{if(!s)return;const w=setTimeout(()=>a(null),600);return()=>clearTimeout(w)},[s]),!e||!r)return p.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const d=(f=r.header)==null?void 0:f.data,u={main:(d==null?void 0:d.links)??[]},m=w=>{window.parent.postMessage({type:je.ACTIVE_SECTION_CHANGED,activeSectionId:w},"*")};return p.jsx($r,{mode:l?"visitor":"studio",children:p.jsx("div",{className:l?"":"jp-ice-active",children:p.jsx(io,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:l?null:o,scrollToSectionId:s,onActiveSectionChange:m})})})};function M0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Tc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(N.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??M0(s);return p.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[p.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),p.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:p.jsx(no,{size:18})}),p.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),p.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:p.jsx(Mt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?p.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):p.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>p.jsx("li",{role:"option",children:p.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:ve("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[p.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),p.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),p.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:p.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},Oc=()=>p.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[p.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),p.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),p.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]}),F0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-blue-900\\/20{--tw-shadow-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-900\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-900)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class B0 extends N.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?p.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[p.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),p.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function bi(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Pc(e,t=""){const r=bi(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return bi(o)||"home"}const Ic=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const s=Ye.useLocation(),a=Pc(s.pathname),[l,c]=N.useState(null);N.useEffect(()=>{const f=document.getElementById("jp-baked-state");if(f!=null&&f.textContent)try{const w=JSON.parse(f.textContent);c(w),Yn.setTheme(w.theme)}catch(w){console.error("Failed to parse baked state",w)}},[]);const d=l?l.page:e[a],u=l?l.site:t,m=l?l.menu:r;return d?p.jsx(Zr,{mode:"tenant",tenantCss:n,adminCss:o,children:p.jsx($r,{mode:"visitor",children:p.jsx(io,{pageConfig:d,siteConfig:u,menuConfig:m})})}):p.jsx(i,{})},Dc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,hotSave:c,showLegacySave:d=!0,showHotSave:u=!1,exportHTML:m})=>{const f=Ye.useLocation(),w=Pc(f.pathname,"admin"),h=Ye.useNavigate(),b=Object.keys(e).sort((R,Z)=>R==="home"?-1:Z==="home"?1:R.localeCompare(Z)),[g,v]=N.useState(null),[k,S]=N.useState(!1),[C,T]=N.useState(!1),[A,P]=N.useState(!1),[I,B]=N.useState(!1),[F,E]=N.useState(()=>{var R;try{const Z=JSON.parse(JSON.stringify(t??{}));Z.identity||(Z.identity={title:"Site"}),Z.pages||(Z.pages=[]);const X=(R=Z.header)==null?void 0:R.data;return X&&(r!=null&&r.main)&&(X.links=JSON.parse(JSON.stringify(r.main))),Z}catch{return{identity:{title:"Site"},pages:[]}}}),[L,y]=N.useState(null),[U,te]=N.useState(null),[W,V]=N.useState(null),[H,oe]=N.useState(null),[j,D]=N.useState(!1),[Q,G]=N.useState(400),re=N.useRef(g),ue=N.useRef(F),J=360,ae=920;N.useEffect(()=>{re.current=g},[g]),N.useEffect(()=>{ue.current=F},[F]);const de=N.useCallback(R=>{R.preventDefault();const Z=R.currentTarget;Z.setPointerCapture(R.pointerId);const X=R.clientX,le=Q,be=we=>{const Se=X-we.clientX,Ne=Math.min(ae,Math.max(J,le+Se));G(Ne)},ge=()=>{Z.releasePointerCapture(R.pointerId),Z.removeEventListener("pointermove",be),Z.removeEventListener("pointerup",ge),Z.removeEventListener("pointercancel",ge),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",Z.addEventListener("pointermove",be),Z.addEventListener("pointerup",ge),Z.addEventListener("pointercancel",ge)},[Q]),ie=g?[...F.header?[{id:F.header.id,type:F.header.type,scope:"global",title:"Header"}]:[],...g.sections.map(R=>{var Z,X;return{id:R.id,type:R.type,scope:"local",title:((Z=R.data)==null?void 0:Z.title)??((X=R.data)==null?void 0:X.titleHighlight)}}),...F.footer?[{id:F.footer.id,type:F.footer.type,scope:"global",title:"Footer"}]:[]]:[];N.useEffect(()=>{const R=e[w];R&&v(JSON.parse(JSON.stringify(R))),y(null),te(null),S(!1)},[w,e]);const fe=N.useCallback(()=>{const R=e[w];R&&v(JSON.parse(JSON.stringify(R))),y(null),te(null),S(!1)},[w,e]),me=N.useCallback((R,Z,X)=>{const le=[...X.sections],be=le.findIndex(Se=>Se.id===R);if(be===-1||Z<0||Z>=le.length)return;const[ge]=le.splice(be,1),we=Z>be?Z-1:Z;le.splice(Math.min(we,le.length),0,ge),v({...X,sections:le}),S(!0)},[]),ye=N.useCallback(R=>{var Z;if(R.origin===window.location.origin){if(R.data.type===je.SECTION_SELECT){y(R.data.section);const X=R.data.itemPath;Array.isArray(X)&&X.length>0?te(X.map(le=>({fieldKey:le.fieldKey,...le.itemId!=null?{itemId:String(le.itemId)}:{}}))):te(null)}if(R.data.type===je.INLINE_FIELD_UPDATE){const X=typeof R.data.sectionId=="string"?R.data.sectionId:null,le=typeof R.data.fieldKey=="string"?R.data.fieldKey:null;X&&le&&(v(be=>{if(!be)return be;const ge={...be,sections:be.sections.map(we=>we.id===X?{...we,data:{...we.data,[le]:R.data.value}}:we)};return re.current=ge,ge}),S(!0))}if(R.data.type===je.ACTIVE_SECTION_CHANGED&&V(R.data.activeSectionId??null),R.data.type==="jsonpages:section-reorder"&&re.current){const{sectionId:X,newIndex:le}=R.data;typeof X=="string"&&typeof le=="number"&&le>=0&&me(X,le,re.current)}if(R.data.type===je.SEND_CLEAN_HTML){if(!re.current)return;const X=(Z=ue.current.header)==null?void 0:Z.data,le={page:re.current,site:ue.current,menu:{main:(X==null?void 0:X.links)??[]},theme:n};m(le,w,R.data.html),S(!1)}}},[w,n,me,m]);N.useEffect(()=>(window.addEventListener("message",ye),()=>window.removeEventListener("message",ye)),[ye]);const x=N.useCallback(R=>{const Z=ie.find(X=>X.id===R);Z&&y({id:Z.id,type:Z.type,scope:Z.scope}),te(null),oe(R)},[ie]),K=N.useCallback(()=>{oe(null)},[]),Y=N.useCallback(R=>{v(Z=>Z&&{...Z,sections:Z.sections.filter(X=>X.id!==R)}),S(!0),y(Z=>(Z==null?void 0:Z.id)===R?null:Z)},[]),O=R=>{if(!(!L||!g))if(S(!0),L.scope==="global")L.type==="header"&&F.header!=null?E({...F,header:{...F.header,data:R}}):L.type==="footer"&&F.footer!=null&&E({...F,footer:{...F.footer,data:R}});else{const Z=g.sections.map(X=>X.id===L.id?{...X,data:R}:X);v({...g,sections:Z})}},z=N.useCallback((R,Z,X,le)=>{var be,ge;if(S(!0),Z==="global")((be=F.header)==null?void 0:be.id)===R?E({...F,header:{...F.header,data:le}}):((ge=F.footer)==null?void 0:ge.id)===R&&E({...F,footer:{...F.footer,data:le}});else if(g){const we=g.sections.map(Se=>Se.id===R?{...Se,data:le}:Se);v({...g,sections:we})}},[g,F]),M=()=>{var Z;const R=document.querySelector("iframe");(Z=R==null?void 0:R.contentWindow)==null||Z.postMessage({type:je.REQUEST_CLEAN_HTML},"*")},q=N.useCallback(async()=>{const R=document.querySelector("iframe");if(!(R!=null&&R.contentWindow))return;const Z=crypto.randomUUID();await new Promise(X=>{var ge;let le=!1;const be=we=>{var Se,Ne;we.origin===window.location.origin&&((Se=we.data)==null?void 0:Se.type)===je.INLINE_FLUSHED&&((Ne=we.data)==null?void 0:Ne.requestId)===Z&&(le=!0,window.removeEventListener("message",be),X())};window.addEventListener("message",be),(ge=R.contentWindow)==null||ge.postMessage({type:je.REQUEST_INLINE_FLUSH,requestId:Z},"*"),window.setTimeout(()=>{le||(window.removeEventListener("message",be),X())},400)})},[]),ee=async()=>{var be;if(!l)return;await q();const R=re.current,Z=ue.current;if(!R)return;const X=(be=Z.header)==null?void 0:be.data,le={page:R,site:Z,menu:{main:(X==null?void 0:X.links)??[]},theme:n};l(le,w).then(()=>{S(!1),T(!0),typeof window<"u"&&window.setTimeout(()=>T(!1),2500)}).catch(ge=>{console.error("[JsonPages] saveToFile failed",ge);const we=ge instanceof Error?ge.message:String(ge);alert(`Save to file failed: ${we}`)})},$=async()=>{var be;if(!c)return;await q();const R=re.current,Z=ue.current;if(!R)return;const X=(be=Z.header)==null?void 0:be.data,le={page:R,site:Z,menu:{main:(X==null?void 0:X.links)??[]},theme:n};B(!0),c(le,w).then(()=>{S(!1),P(!0),typeof window<"u"&&window.setTimeout(()=>P(!1),2500)}).catch(ge=>{console.error("[JsonPages] hotSave failed",ge);const we=ge instanceof Error?ge.message:String(ge);alert(`Hot save failed: ${we}`)}).finally(()=>{B(!1)})},ne=R=>{var le;if(!g)return;const Z=((le=s==null?void 0:s.getDefaultSectionData)==null?void 0:le.call(s,R))??{},X={id:crypto.randomUUID(),type:R,data:Z,settings:void 0};v({...g,sections:[...g.sections,X]}),S(!0),y({id:X.id,type:R,scope:"local"})};if(!g)return p.jsx("div",{children:"Loading Studio..."});const ce=(L==null?void 0:L.scope)==="global"?{sections:[F.header,F.footer].filter(R=>R!=null)}:g,se=[...F.header?[F.header]:[],...g.sections,...F.footer?[F.footer]:[]];return p.jsx(Zr,{mode:"admin",tenantCss:o,adminCss:i,children:p.jsx($r,{mode:"studio",children:p.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[p.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[p.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:p.jsx(zc,{draft:g,globalDraft:F,themeConfig:n,slug:w,selectedId:L==null?void 0:L.id,scrollToSectionId:H,onScrollRequested:K})}),p.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:Q,minWidth:J,maxWidth:ae},children:[p.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:de}),p.jsx(Nc,{selectedSection:L,pageData:ce,allSectionsData:se,onUpdate:O,onUpdateSection:z,onClose:()=>{y(null),te(null)},expandedItemPath:U,onReorderSection:g?(R,Z)=>me(R,Z,g):void 0,allLayers:ie,activeSectionId:W,onRequestScrollToSection:x,onDeleteSection:g?Y:void 0,onAddSection:a.length>0?()=>D(!0):void 0,hasChanges:k,onExportHTML:M,onSaveToFile:l!=null?ee:void 0,saveSuccessFeedback:C,onHotSave:c!=null?$:void 0,hotSaveSuccessFeedback:A,hotSaveInProgress:I,showLegacySave:d,showHotSave:u,onResetToFile:fe,pageSlugs:b,currentSlug:w,onPageChange:b.length>1?R=>{const Z=bi(R);h(Z==="home"?"/admin":`/admin/${Z}`)}:void 0})]})]}),p.jsx(Tc,{open:j,onClose:()=>D(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:ne})]})})})},Rc=({tenantCss:e,adminCss:t})=>p.jsx(Zr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(jc,{})});function U0({config:e}){var b,g,v,k,S,C;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=Oc}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(T=>T!=="header"&&T!=="footer"),u={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??Ci,exportHTML:((g=e.persistence)==null?void 0:g.exportHTML)??Ei,saveToFile:(v=e.persistence)==null?void 0:v.saveToFile,hotSave:(k=e.persistence)==null?void 0:k.hotSave,showLegacySave:((S=e.persistence)==null?void 0:S.showLegacySave)??!0,showHotSave:((C=e.persistence)==null?void 0:C.showHotSave)??!1},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",f=typeof(a==null?void 0:a.admin)=="string"?a.admin:F0,[w,h]=N.useState(!1);return N.useEffect(()=>{try{i!=null&&i.tokens&&Yn.setTheme(i)}catch(T){console.warn("[JsonPages] setTheme failed",T)}h(!0)},[i]),w?p.jsx(B0,{children:p.jsx(Gi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:p.jsx(Ye.BrowserRouter,{children:p.jsxs(Ye.Routes,{children:[p.jsx(Ye.Route,{path:"/",element:p.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(Ye.Route,{path:"/*",element:p.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(Ye.Route,{path:"/admin",element:p.jsx(Dc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,hotSave:u.hotSave,showLegacySave:u.showLegacySave,showHotSave:u.showHotSave,exportHTML:u.exportHTML})}),p.jsx(Ye.Route,{path:"/admin/*",element:p.jsx(Dc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,hotSave:u.hotSave,showLegacySave:u.showLegacySave,showHotSave:u.showHotSave,exportHTML:u.exportHTML})}),p.jsx(Ye.Route,{path:"/admin/preview",element:p.jsx(Rc,{tenantCss:m,adminCss:f})}),p.jsx(Ye.Route,{path:"/admin/preview/*",element:p.jsx(Rc,{tenantCss:m,adminCss:f})}),p.jsx(Ye.Route,{path:"*",element:p.jsx(c,{})})]})})})}):p.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}const W0=({hasChanges:e,onExportJSON:t,onExportHTML:r,onAddSection:n})=>p.jsxs("div",{className:"h-14 border-b border-zinc-800 bg-zinc-950 flex items-center justify-between px-6 shrink-0 z-50 relative",children:[p.jsx("div",{className:"flex items-center gap-3",children:n!=null&&p.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors",title:"Add section","aria-label":"Add section",children:[p.jsx(Jd,{size:14}),p.jsx("span",{children:"Add section"})]})}),p.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 opacity-20 pointer-events-none",children:p.jsx("span",{className:"text-xs font-black tracking-[0.2em] text-zinc-100",children:"JSONPAGES STUDIO"})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium transition-all border bg-zinc-900 border-zinc-700 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",children:[p.jsx($d,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:ve("flex items-center gap-2 px-4 py-1.5 rounded-md text-xs font-bold transition-all shadow-lg",e?"bg-blue-600 text-white hover:bg-blue-500 shadow-blue-900/20":"bg-zinc-900 text-zinc-600 cursor-not-allowed"),children:[p.jsx(Hd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});Ce.AddSectionLibrary=Tc,Ce.AdminSidebar=Nc,Ce.ConfigProvider=Gi,Ce.ControlBar=W0,Ce.DefaultNotFound=Oc,Ce.FormFactory=Nr,Ce.InputWidgets=tr,Ce.JsonPagesEngine=U0,Ce.PageRenderer=io,Ce.PreviewEntry=jc,Ce.STUDIO_EVENTS=je,Ce.SectionRenderer=fr,Ce.StudioProvider=$r,Ce.StudioStage=zc,Ce.ThemeLoader=Zr,Ce.cn=ve,Ce.exportBakedHTML=Ei,Ce.exportProjectJSON=Ci,Ce.resolveAssetUrl=Ml,Ce.themeManager=Yn,Ce.useConfig=ur,Ce.useStudio=qi,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));
252
+ `)},Um=0,er=[];function Wm(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),o=_.useState(Um++)[0],i=_.useState(Ga)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=cm([e.lockRef.current],(e.shards||[]).map(rl),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=_.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var g=Tn(h),v=r.current,k="deltaX"in h?h.deltaX:v[0]-g[0],S="deltaY"in h?h.deltaY:v[1]-g[1],C,T=h.target,A=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in h&&A==="h"&&T.type==="range")return!1;var P=window.getSelection(),I=P&&P.anchorNode,B=I?I===T||I.contains(T):!1;if(B)return!1;var F=Ja(A,T);if(!F)return!0;if(F?C=A:(C=A==="v"?"h":"v",F=Ja(A,T)),!F)return!1;if(!n.current&&"changedTouches"in h&&(k||S)&&(n.current=C),!C)return!0;var E=n.current||C;return Mm(E,b,h,E==="h"?k:S)},[]),l=_.useCallback(function(h){var b=h;if(!(!er.length||er[er.length-1]!==i)){var g="deltaY"in b?tl(b):Tn(b),v=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Fm(C.delta,g)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var k=(s.current.shards||[]).map(rl).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=k.length>0?a(b,k[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=_.useCallback(function(h,b,g,v){var k={name:h,delta:b,target:g,should:v,shadowParent:$m(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=_.useCallback(function(h){r.current=Tn(h),n.current=void 0},[]),u=_.useCallback(function(h){c(h.type,tl(h),h.target,a(h,e.lockRef.current))},[]),m=_.useCallback(function(h){c(h.type,Tn(h),h.target,a(h,e.lockRef.current))},[]);_.useEffect(function(){return er.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Qt),document.addEventListener("touchmove",l,Qt),document.addEventListener("touchstart",d,Qt),function(){er=er.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,Qt),document.removeEventListener("touchmove",l,Qt),document.removeEventListener("touchstart",d,Qt)}},[]);var f=e.removeScrollBar,w=e.inert;return _.createElement(_.Fragment,null,w?_.createElement(i,{styles:Bm(o)}):null,f?_.createElement(Tm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $m(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hm=vm(Ka,Wm);var qo=_.forwardRef(function(e,t){return _.createElement(An,at({},e,{ref:t,sideCar:Hm}))});qo.classNames=An.classNames;var Vm=[" ","Enter","ArrowUp","ArrowDown"],Ym=[" ","Enter"],It="Select",[On,Pn,Zm]=fh(It),[tr]=Ht(It,[Zm,Xt]),In=Xt(),[Km,Ct]=tr(It),[Gm,Xm]=tr(It),nl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:m,required:f,form:w}=e,h=In(t),[b,g]=_.useState(null),[v,k]=_.useState(null),[S,C]=_.useState(!1),T=qs(c),[A,P]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:It}),[I,B]=_n({prop:s,defaultProp:a,onChange:l,caller:It}),F=_.useRef(null),E=b?w||!!b.closest("form"):!0,[L,y]=_.useState(new Set),U=Array.from(L).map(te=>te.props.value).join(";");return p.jsx($o,{...h,children:p.jsxs(Km,{required:f,scope:t,trigger:b,onTriggerChange:g,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:_r(),value:I,onValueChange:B,open:A,onOpenChange:P,dir:T,triggerPointerDownPosRef:F,disabled:m,children:[p.jsx(On.Provider,{scope:t,children:p.jsx(Gm,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(te=>{y(W=>new Set(W).add(te))},[]),onNativeOptionRemove:_.useCallback(te=>{y(W=>{const V=new Set(W);return V.delete(te),V})},[]),children:r})}),E?p.jsxs(Sl,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:I,onChange:te=>B(te.target.value),disabled:m,form:w,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(L)]},U):null]})})};nl.displayName=It;var ol="SelectTrigger",il=_.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=In(r),s=Ct(ol,r),a=s.disabled||n,l=Ae(t,s.onTriggerChange),c=Pn(r),d=_.useRef("touch"),[u,m,f]=Cl(h=>{const b=c().filter(k=>!k.disabled),g=b.find(k=>k.value===s.value),v=El(b,h,g);v!==void 0&&s.onValueChange(v.value)}),w=h=>{a||(s.onOpenChange(!0),f()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return p.jsx(kn,{asChild:!0,...i,children:p.jsx(ze.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":_l(s.value)?"":void 0,...o,ref:l,onClick:ke(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&w(h)}),onPointerDown:ke(o.onPointerDown,h=>{d.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:ke(o.onKeyDown,h=>{const b=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Vm.includes(h.key)&&(w(),h.preventDefault())})})})});il.displayName=ol;var sl="SelectValue",al=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=Ct(sl,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=Ae(t,l.onValueNodeChange);return Le(()=>{c(d)},[c,d]),p.jsx(ze.span,{...a,ref:u,style:{pointerEvents:"none"},children:_l(l.value)?p.jsx(p.Fragment,{children:s}):i})});al.displayName=sl;var qm="SelectIcon",ll=_.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(ze.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});ll.displayName=qm;var Jm="SelectPortal",cl=e=>p.jsx(Sn,{asChild:!0,...e});cl.displayName=Jm;var Dt="SelectContent",dl=_.forwardRef((e,t)=>{const r=Ct(Dt,e.__scopeSelect),[n,o]=_.useState();if(Le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Lr.createPortal(p.jsx(ul,{scope:e.__scopeSelect,children:p.jsx(On.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(fl,{...e,ref:t})});dl.displayName=Dt;var rt=10,[ul,Et]=tr(Dt),Qm="SelectContentImpl",eg=Vt("SelectContent.RemoveScroll"),fl=_.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:w,hideWhenDetached:h,avoidCollisions:b,...g}=e,v=Ct(Dt,r),[k,S]=_.useState(null),[C,T]=_.useState(null),A=Ae(t,J=>S(J)),[P,I]=_.useState(null),[B,F]=_.useState(null),E=Pn(r),[L,y]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(k)return Ha(k)},[k]),ra();const te=_.useCallback(J=>{const[ae,...de]=E().map(me=>me.ref.current),[ie]=de.slice(-1),fe=document.activeElement;for(const me of J)if(me===fe||(me==null||me.scrollIntoView({block:"nearest"}),me===ae&&C&&(C.scrollTop=0),me===ie&&C&&(C.scrollTop=C.scrollHeight),me==null||me.focus(),document.activeElement!==fe))return},[E,C]),W=_.useCallback(()=>te([P,k]),[te,P,k]);_.useEffect(()=>{L&&W()},[L,W]);const{onOpenChange:V,triggerPointerDownPosRef:H}=v;_.useEffect(()=>{if(k){let J={x:0,y:0};const ae=ie=>{var fe,me;J={x:Math.abs(Math.round(ie.pageX)-(((fe=H.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((me=H.current)==null?void 0:me.y)??0))}},de=ie=>{J.x<=10&&J.y<=10?ie.preventDefault():k.contains(ie.target)||V(!1),document.removeEventListener("pointermove",ae),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,V,H]),_.useEffect(()=>{const J=()=>V(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[V]);const[oe,j]=Cl(J=>{const ae=E().filter(fe=>!fe.disabled),de=ae.find(fe=>fe.ref.current===document.activeElement),ie=El(ae,J,de);ie&&setTimeout(()=>ie.ref.current.focus())}),D=_.useCallback((J,ae,de)=>{const ie=!U.current&&!de;(v.value!==void 0&&v.value===ae||ie)&&(I(J),ie&&(U.current=!0))},[v.value]),Q=_.useCallback(()=>k==null?void 0:k.focus(),[k]),G=_.useCallback((J,ae,de)=>{const ie=!U.current&&!de;(v.value!==void 0&&v.value===ae||ie)&&F(J)},[v.value]),re=n==="popper"?Jo:hl,ue=re===Jo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:w,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(ul,{scope:r,content:k,viewport:C,onViewportChange:T,itemRefCallback:D,selectedItem:P,onItemLeave:Q,itemTextRefCallback:G,focusSelectedItem:W,selectedItemText:B,position:n,isPositioned:L,searchRef:oe,children:p.jsx(qo,{as:eg,allowPinchZoom:!0,children:p.jsx(Ao,{asChild:!0,trapped:v.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ke(o,J=>{var ae;(ae=v.trigger)==null||ae.focus({preventScroll:!0}),J.preventDefault()}),children:p.jsx(un,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:p.jsx(re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:J=>J.preventDefault(),...g,...ue,onPlaced:()=>y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ke(g.onKeyDown,J=>{const ae=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ae&&J.key.length===1&&j(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ie=E().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const fe=J.target,me=ie.indexOf(fe);ie=ie.slice(me+1)}setTimeout(()=>te(ie)),J.preventDefault()}})})})})})})});fl.displayName=Qm;var tg="SelectItemAlignedPosition",hl=_.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ct(Dt,r),s=Et(Dt,r),[a,l]=_.useState(null),[c,d]=_.useState(null),u=Ae(t,A=>d(A)),m=Pn(r),f=_.useRef(!1),w=_.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:g,focusSelectedItem:v}=s,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&g){const A=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),B=g.getBoundingClientRect();if(i.dir!=="rtl"){const fe=B.left-P.left,me=I.left-fe,ye=A.left-me,x=A.width+ye,K=Math.max(x,P.width),Y=window.innerWidth-rt,O=_o(me,[rt,Math.max(rt,Y-K)]);a.style.minWidth=x+"px",a.style.left=O+"px"}else{const fe=P.right-B.right,me=window.innerWidth-I.right-fe,ye=window.innerWidth-A.right-me,x=A.width+ye,K=Math.max(x,P.width),Y=window.innerWidth-rt,O=_o(me,[rt,Math.max(rt,Y-K)]);a.style.minWidth=x+"px",a.style.right=O+"px"}const F=m(),E=window.innerHeight-rt*2,L=h.scrollHeight,y=window.getComputedStyle(c),U=parseInt(y.borderTopWidth,10),te=parseInt(y.paddingTop,10),W=parseInt(y.borderBottomWidth,10),V=parseInt(y.paddingBottom,10),H=U+te+L+V+W,oe=Math.min(b.offsetHeight*5,H),j=window.getComputedStyle(h),D=parseInt(j.paddingTop,10),Q=parseInt(j.paddingBottom,10),G=A.top+A.height/2-rt,re=E-G,ue=b.offsetHeight/2,J=b.offsetTop+ue,ae=U+te+J,de=H-ae;if(ae<=G){const fe=F.length>0&&b===F[F.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(re,ue+(fe?Q:0)+me+W),x=ae+ye;a.style.height=x+"px"}else{const fe=F.length>0&&b===F[0].ref.current;a.style.top="0px";const ye=Math.max(G,U+h.offsetTop+(fe?D:0)+ue)+de;a.style.height=ye+"px",h.scrollTop=ae-G+h.offsetTop}a.style.margin=`${rt}px 0`,a.style.minHeight=oe+"px",a.style.maxHeight=E+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,g,i.dir,n]);Le(()=>k(),[k]);const[S,C]=_.useState();Le(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=_.useCallback(A=>{A&&w.current===!0&&(k(),v==null||v(),w.current=!1)},[k,v]);return p.jsx(ng,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:T,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:p.jsx(ze.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hl.displayName=tg;var rg="SelectPopperPosition",Jo=_.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=rt,...i}=e,s=In(r);return p.jsx(Ho,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Jo.displayName=rg;var[ng,Qo]=tr(Dt,{}),ei="SelectViewport",pl=_.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Et(ei,r),s=Qo(ei,r),a=Ae(t,i.onViewportChange),l=_.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),p.jsx(On.Slot,{scope:r,children:p.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&u){const f=Math.abs(l.current-d.scrollTop);if(f>0){const w=window.innerHeight-rt*2,h=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),g=Math.max(h,b);if(g<w){const v=g+f,k=Math.min(w,v),S=v-k;u.style.height=k+"px",u.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});pl.displayName=ei;var ml="SelectGroup",[og,ig]=tr(ml),sg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=_r();return p.jsx(og,{scope:r,id:o,children:p.jsx(ze.div,{role:"group","aria-labelledby":o,...n,ref:t})})});sg.displayName=ml;var gl="SelectLabel",ag=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=ig(gl,r);return p.jsx(ze.div,{id:o.id,...n,ref:t})});ag.displayName=gl;var Dn="SelectItem",[lg,bl]=tr(Dn),vl=_.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=Ct(Dn,r),l=Et(Dn,r),c=a.value===n,[d,u]=_.useState(i??""),[m,f]=_.useState(!1),w=Ae(t,v=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,v,n,o)}),h=_r(),b=_.useRef("touch"),g=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(lg,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:_.useCallback(v=>{u(k=>k||((v==null?void 0:v.textContent)??"").trim())},[]),children:p.jsx(On.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(ze.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:ke(s.onFocus,()=>f(!0)),onBlur:ke(s.onBlur,()=>f(!1)),onClick:ke(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:ke(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:ke(s.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:ke(s.onPointerMove,v=>{var k;b.current=v.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,v=>{var k;v.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:ke(s.onKeyDown,v=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(Ym.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});vl.displayName=Dn;var Nr="SelectItemText",wl=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ct(Nr,r),a=Et(Nr,r),l=bl(Nr,r),c=Xm(Nr,r),[d,u]=_.useState(null),m=Ae(t,g=>u(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,w=_.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=c;return Le(()=>(h(w),()=>b(w)),[h,b,w]),p.jsxs(p.Fragment,{children:[p.jsx(ze.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Lr.createPortal(i.children,s.valueNode):null]})});wl.displayName=Nr;var xl="SelectItemIndicator",yl=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return bl(xl,r).isSelected?p.jsx(ze.span,{"aria-hidden":!0,...n,ref:t}):null});yl.displayName=xl;var ti="SelectScrollUpButton",cg=_.forwardRef((e,t)=>{const r=Et(ti,e.__scopeSelect),n=Qo(ti,e.__scopeSelect),[o,i]=_.useState(!1),s=Ae(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(kl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});cg.displayName=ti;var ri="SelectScrollDownButton",dg=_.forwardRef((e,t)=>{const r=Et(ri,e.__scopeSelect),n=Qo(ri,e.__scopeSelect),[o,i]=_.useState(!1),s=Ae(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?p.jsx(kl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});dg.displayName=ri;var kl=_.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Et("SelectScrollButton",r),s=_.useRef(null),a=Pn(r),l=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),Le(()=>{var d;const c=a().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(ze.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:ke(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{l()})})}),ug="SelectSeparator",fg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(ze.div,{"aria-hidden":!0,...n,ref:t})});fg.displayName=ug;var ni="SelectArrow",hg=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=In(r),i=Ct(ni,r),s=Et(ni,r);return i.open&&s.position==="popper"?p.jsx(Vo,{...o,...n,ref:t}):null});hg.displayName=ni;var pg="SelectBubbleInput",Sl=_.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=_.useRef(null),i=Ae(n,o),s=nm(t);return _.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const u=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(u)}},[s,t]),p.jsx(ze.select,{...r,style:{...Ua,...r.style},ref:i,defaultValue:t})});Sl.displayName=pg;function _l(e){return e===""||e===void 0}function Cl(e){const t=Ue(e),r=_.useRef(""),n=_.useRef(0),o=_.useCallback(s=>{const a=r.current+s;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=_.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function El(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=mg(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function mg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var gg=nl,Nl=il,bg=al,vg=ll,wg=cl,zl=dl,xg=pl,Al=vl,yg=wl,kg=yl;const Sg=gg,_g=bg,jl=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Nl,{ref:n,className:ve("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,p.jsx(vg,{asChild:!0,children:p.jsx(Vr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));jl.displayName=Nl.displayName;const Tl=_.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(wg,{children:p.jsx(zl,{ref:o,className:ve("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:p.jsx(xg,{className:ve("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Tl.displayName=zl.displayName;const Ol=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Al,{ref:n,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(kg,{children:p.jsx(ro,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(yg,{children:t})]}));Ol.displayName=Al.displayName;const Pl=_.createContext(null);function Il(){const e=_.useContext(Pl);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Dl({open:e,onOpenChange:t,children:r}){const[n,o]=_.useState(!1),i=e!==void 0,s=i?e:n,a=_.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=_.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(Pl.Provider,{value:l,children:r})}function Cg({asChild:e,children:t}){const{onOpenChange:r}=Il(),n=_.Children.only(t);return e&&_.isValidElement(n)?_.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):p.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Rl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Il();if(_.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return bt.createPortal(p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),p.jsx("div",{role:"dialog","aria-modal":!0,className:ve("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function Ll({className:e,...t}){return p.jsx("div",{className:ve("flex flex-col gap-1.5 pb-4",e),...t})}function Eg({className:e,...t}){return p.jsx("div",{className:ve("flex justify-end gap-2 pt-4",e),...t})}function Ml({className:e,...t}){return p.jsx("h2",{className:ve("text-sm font-semibold text-white",e),...t})}function Fl({className:e,...t}){return p.jsx("p",{className:ve("text-xs text-zinc-400",e),...t})}const He=_.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?sh:"button";return p.jsx(c,{ref:i,type:"button",className:ve(s,a[t],l[r],e),...o})});He.displayName="Button";const Ng=["library","upload","url"];function zg({library:e,selectedId:t,onSelect:r}){const[n,o]=N.useState(""),[i,s]=N.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const d=i==="all"||(c.tags??[]).includes(i),u=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return d&&u});return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Jd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),p.jsx(So,{value:n,onChange:c=>o(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>p.jsx("button",{type:"button",onClick:()=>s(c),className:ve("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?p.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const d=t===c.id;return p.jsxs("button",{type:"button",onClick:()=>r(d?null:c.id),className:ve("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",d?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[p.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:ve("w-full h-full object-cover transition-[filter] duration-150",d?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),p.jsx("div",{className:ve("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",d&&"opacity-100"),children:p.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),d&&p.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:p.jsx(ro,{size:14,className:"text-white"})})]},c.id)})}):p.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function Ag({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=N.useState(!1),i=N.useRef(null),s=N.useCallback(async d=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:d.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!d.type.startsWith("image/"))return;if(r){try{const m=await r(d);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:m==null?void 0:m.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:d.name,size:d.size,dataUrl:m})}catch{const m=new FileReader;m.onload=f=>{var w;t({name:d.name,size:d.size,dataUrl:(w=f.target)==null?void 0:w.result})},m.readAsDataURL(d)}return}const u=new FileReader;u.onload=m=>{var f;t({name:d.name,size:d.size,dataUrl:(f=m.target)==null?void 0:f.result})},u.readAsDataURL(d)},[t,r]),a=N.useCallback(d=>{var m,f;d.preventDefault(),d.stopPropagation(),o(!1);const u=(f=(m=d.dataTransfer)==null?void 0:m.files)==null?void 0:f[0];u&&s(u)},[s]),l=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=N.useCallback(d=>{var m;const u=(m=d.target.files)==null?void 0:m[0];u&&s(u)},[s]);return p.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:d=>{d.preventDefault(),d.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var d;return!e&&((d=i.current)==null?void 0:d.click())},className:ve("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),p.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),p.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),p.jsx(He,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:d=>{d.stopPropagation(),t(null)},children:p.jsx(Zr,{size:14})})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:p.jsx(os,{size:22})}),p.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),p.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),p.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),p.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function jg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=N.useState(""),[o,i]=N.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx(Ot,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(So,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:ve("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),p.jsx(He,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&p.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?p.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[p.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),p.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[p.jsx(ro,{size:14,className:"text-emerald-400"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:p.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[p.jsx(rs,{size:32,className:"mb-3 opacity-40"}),p.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Tg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=fr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=N.useState("library"),[a,l]=N.useState(null),[c,d]=N.useState(null),[u,m]=N.useState(null);N.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),N.useEffect(()=>{if(!e||i!=="upload")return;const g=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",g),()=>window.removeEventListener("beforeunload",g)},[e,i]),N.useEffect(()=>{if(!e||i!=="upload")return;const g=k=>{k.preventDefault()},v={capture:!0};return document.addEventListener("dragover",g,v),document.addEventListener("drop",g,v),window.addEventListener("dragover",g,v),window.addEventListener("drop",g,v),()=>{document.removeEventListener("dragover",g,v),document.removeEventListener("drop",g,v),window.removeEventListener("dragover",g,v),window.removeEventListener("drop",g,v)}},[e,i]);const f=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&u!=null,w=()=>{if(i==="library"&&a){const g=o.find(v=>v.id===a);g&&r({url:g.url,alt:g.alt})}else i==="upload"&&c?r({url:c.dataUrl,alt:c.name}):i==="url"&&u&&r({url:u,alt:""});setTimeout(()=>t(!1),0)},h=i==="library"&&a?"1 immagine selezionata":i==="upload"&&c?c.name:i==="url"&&u?"URL pronto":"Nessuna selezione",b=g=>{g.preventDefault(),g.stopPropagation()};return p.jsx(Dl,{open:e,onOpenChange:t,children:p.jsxs(Rl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(Ll,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:p.jsx(Yr,{size:18})}),p.jsxs("div",{children:[p.jsx(Ml,{children:"Image Picker"}),p.jsx(Fl,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),p.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:p.jsx(Ft,{size:18})})]}),p.jsx("div",{className:"flex border-b border-zinc-800",children:Ng.map(g=>p.jsxs("button",{type:"button",onClick:()=>s(g),className:ve("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===g?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[g==="library"&&p.jsx(Yr,{size:14}),g==="upload"&&p.jsx(os,{size:14}),g==="url"&&p.jsx(rs,{size:14}),g==="library"?"Libreria":g==="upload"?"Upload":"URL"]},g))}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&p.jsx(zg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(Ag,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(jg,{urlPreview:u,onUrlPreviewChange:m})]}),p.jsxs(Eg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:h}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(He,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),p.jsx(He,{type:"button",size:"sm",disabled:!f,onClick:w,className:ve(!f&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Bl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Og=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=fr(),[i,s]=N.useState(!1),[a,l]=N.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Bl(e.url,o):"",u=f=>{t(f),s(!1)},m=f=>{f.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:ve("space-y-1.5",n),children:[p.jsx(Ot,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?p.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:f=>f.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ve("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[p.jsx("img",{src:d,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:f=>{f.target.style.display="none"}}),p.jsx("div",{className:ve("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[p.jsx(qd,{size:13}),p.jsx("span",{children:"Cambia"})]}),p.jsx(He,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:m,children:p.jsx(Zr,{size:13})})]})}),p.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):p.jsxs("button",{type:"button",onClick:()=>s(!0),className:ve("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[p.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:p.jsx(Yr,{size:18})}),p.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),p.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),p.jsx(Tg,{open:i,onOpenChange:s,onSelect:u})]})},Ul=[{name:"layers",Icon:oo},{name:"github",Icon:Gd},{name:"arrow-right",Icon:Ud},{name:"box",Icon:$d},{name:"terminal",Icon:ru},{name:"chevron-right",Icon:Hd},{name:"menu",Icon:Xd},{name:"x",Icon:Ft},{name:"sparkles",Icon:eu},{name:"zap",Icon:ou}],Rn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),rr={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[p.jsx(Ot,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Rn(e)}),p.jsx(So,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[p.jsx(Ot,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Rn(e)}),p.jsx(nh,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>p.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[p.jsx(Ot,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Rn(e)}),p.jsxs(Sg,{value:t||"",onValueChange:r,children:[p.jsx(jl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:p.jsx(_g,{placeholder:"Select..."})}),p.jsx(Tl,{className:"dark",children:n.map(o=>p.jsx(Ol,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[p.jsx(oh,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(Ot,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Rn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return p.jsx("div",{className:"mb-4",children:p.jsx(Og,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=N.useState(!1),i=Ul.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(Ot,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(Dl,{open:n,onOpenChange:o,children:[p.jsx(Cg,{asChild:!0,children:p.jsx(He,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?p.jsxs(p.Fragment,{children:[p.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):p.jsxs(p.Fragment,{children:[p.jsx(Yr,{size:16,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),p.jsxs(Rl,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(Ll,{children:[p.jsx(Ml,{className:"text-sm",children:"Choose icon"}),p.jsx(Fl,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Ul.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:ve("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:p.jsx(a,{size:20})},s))})]})]})]})}},oi=e=>{if(e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault)return oi(e._def.innerType);if(e instanceof Oe.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=oi(e.shape[r]));return t}return e instanceof Oe.z.ZodArray?[]:e instanceof Oe.z.ZodString?"":e instanceof Oe.z.ZodNumber?0:e instanceof Oe.z.ZodBoolean?!1:e instanceof Oe.z.ZodEnum?e._def.values[0]:null},Ln=e=>e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault||e instanceof Oe.z.ZodNullable?Ln(e._def.innerType):e,Wl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Ln(e);return r!==e?Wl(r):null},Mn=(e,t)=>e&&!t?"opacity-10":"opacity-100",nr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ii=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),zr=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(u=>n.includes(u)):Object.keys(s),l=o==null?void 0:o[0],c=(l==null?void 0:l.fieldKey)??null,d=c!=null;return p.jsx("div",{className:"space-y-4",children:a.map(u=>{const m=s[u];if(!m)return null;const f=Ln(m),w=Wl(m)||"ui:text",h=t[u];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&f instanceof Oe.z.ZodObject){const S=nr(c,u),C=rr["ui:image-picker"]||rr["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Mn(d,S)}`,...S?{"data-jp-focused-field":u}:{},children:p.jsx(C,{label:u,value:h,onChange:T=>r({...t,[u]:T})})},u)}if(f instanceof Oe.z.ZodObject){const S=h||{},C=nr(c,u);return p.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Mn(d,C)}`,...C?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),p.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:ii(u)})]}),p.jsx(zr,{schema:f,data:S,onChange:T=>r({...t,[u]:T}),expandedItemPath:o&&nr(l==null?void 0:l.fieldKey,u)?o.slice(1):void 0})]},u)}if(f instanceof Oe.z.ZodArray){const S=Array.isArray(h)?h:[],C=Ln(f.element),T=(B,F)=>{if(F<0||F>=S.length)return;const E=[...S],[L]=E.splice(B,1);E.splice(F,0,L),r({...t,[u]:E})},A=nr(c,u),I=nr(l==null?void 0:l.fieldKey,u)?l==null?void 0:l.itemId:void 0;return p.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Mn(d,A)}`,...A?{"data-jp-focused-field":u}:{},children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[ii(u)," (",S.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const B=oi(C);r({...t,[u]:[...S,B]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[p.jsx(io,{size:12})," Add Item"]})]}),p.jsx("div",{className:"space-y-2",children:S.map((B,F)=>{const E=B,L=E.id||`legacy-${F}`,y=(typeof E.title=="string"?E.title:null)||(typeof E.label=="string"?E.label:null)||(typeof E.name=="string"?E.name:null)||(typeof E.content=="string"?E.content:null)||(typeof E.text=="string"?E.text:null)||`${ii(u)} #${F+1}`,U=I,te=String(E.id??L),W=U!=null&&String(U)===te,V=W&&o&&o.length>1?o.slice(1):void 0,H=d&&A&&U!=null&&!W;return p.jsx(Pg,{itemId:te,openItemId:U!=null?String(U):void 0,isFaded:H,index:F,isFirst:F===0,isLast:F===S.length-1,label:y,onExpandedChange:i?oe=>i(oe?{fieldKey:u,itemId:te}:null):void 0,onRemove:()=>{const oe=S.filter((j,D)=>D!==F);r({...t,[u]:oe})},onMoveUp:()=>T(F,F-1),onMoveDown:()=>T(F,F+1),children:C instanceof Oe.z.ZodObject?p.jsx(zr,{schema:C,data:E||{},expandedItemPath:V,onChange:oe=>{const j=[...S];j[F]=oe,r({...t,[u]:j})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},L)})})]},u)}const b=w in rr?w:"ui:text",g=rr[b]||rr["ui:text"],v=f instanceof Oe.z.ZodEnum?f._def.values:void 0,k=nr(c,u);return p.jsx("div",{className:`transition-opacity duration-200 ${Mn(d,k)}`,...k?{"data-jp-focused-field":u}:{},children:p.jsx(g,{label:u,value:h,options:v,onChange:S=>r({...t,[u]:S})})},u)})})},Pg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:c,children:d})=>{const u=t!=null&&String(t)===String(e),[m,f]=N.useState(u);N.useEffect(()=>{u&&!m&&f(!0),!u&&m&&f(!1)},[u,m]);const w=()=>{const b=!m;f(b),o==null||o(b)},h=u&&m;return p.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...h?{"data-jp-expanded-item":e}:{},children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[p.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:p.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[m?p.jsx(no,{size:12,className:"shrink-0"}):p.jsx(Vr,{size:12,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n})]})}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[p.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Wd,{size:12})}),p.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:p.jsx(Bd,{size:12})}),p.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),p.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:p.jsx(Zr,{size:12})})]})]}),m&&p.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function Ig(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var pt=e=>{const{present:t,children:r}=e,n=Dg(t),o=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),i=Ae(n.ref,Rg(o));return typeof r=="function"||n.isPresent?_.cloneElement(o,{ref:i}):null};pt.displayName="Presence";function Dg(e){const[t,r]=_.useState(),n=_.useRef(null),o=_.useRef(e),i=_.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ig(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Fn(n.current);i.current=a==="mounted"?c:"none"},[a]),Le(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,f=Fn(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Le(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=f=>{const h=Fn(n.current).includes(CSS.escape(f.animationName));if(f.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=f=>{f.target===t&&(i.current=Fn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Fn(e){return(e==null?void 0:e.animationName)||"none"}function Rg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Bn]=Ht("Tooltip",[Xt]),Un=Xt(),$l="TooltipProvider",Lg=700,si="tooltip.open",[Mg,ai]=Bn($l),Hl=e=>{const{__scopeTooltip:t,delayDuration:r=Lg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Mg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Hl.displayName=$l;var Ar="Tooltip",[Fg,jr]=Bn(Ar),Vl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ai(Ar,e.__scopeTooltip),c=Un(t),[d,u]=_.useState(null),m=_r(),f=_.useRef(0),w=s??l.disableHoverableContent,h=a??l.delayDuration,b=_.useRef(!1),[g,v]=_n({prop:n,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(si))):l.onClose(),i==null||i(A)},caller:Ar}),k=_.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),S=_.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,v(!0)},[v]),C=_.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),T=_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,v(!0),f.current=0},h)},[h,v]);return _.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx($o,{...c,children:p.jsx(Fg,{scope:t,contentId:m,open:g,stateAttribute:k,trigger:d,onTriggerChange:u,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?T():S()},[l.isOpenDelayedRef,T,S]),onTriggerLeave:_.useCallback(()=>{w?C():(window.clearTimeout(f.current),f.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};Vl.displayName=Ar;var li="TooltipTrigger",Yl=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=jr(li,r),i=ai(li,r),s=Un(r),a=_.useRef(null),l=Ae(t,a,o.onTriggerChange),c=_.useRef(!1),d=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(kn,{asChild:!0,...s,children:p.jsx(ze.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ke(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});Yl.displayName=li;var ci="TooltipPortal",[Bg,Ug]=Bn(ci,{forceMount:void 0}),Zl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=jr(ci,t);return p.jsx(Bg,{scope:t,forceMount:r,children:p.jsx(pt,{present:r||i.open,children:p.jsx(Sn,{asChild:!0,container:o,children:n})})})};Zl.displayName=ci;var or="TooltipContent",Kl=_.forwardRef((e,t)=>{const r=Ug(or,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=jr(or,e.__scopeTooltip);return p.jsx(pt,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Gl,{side:o,...i,ref:t}):p.jsx(Wg,{side:o,...i,ref:t})})}),Wg=_.forwardRef((e,t)=>{const r=jr(or,e.__scopeTooltip),n=ai(or,e.__scopeTooltip),o=_.useRef(null),i=Ae(t,o),[s,a]=_.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:u}=n,m=_.useCallback(()=>{a(null),u(!1)},[u]),f=_.useCallback((w,h)=>{const b=w.currentTarget,g={x:w.clientX,y:w.clientY},v=Zg(g,b.getBoundingClientRect()),k=Kg(g,v),S=Gg(h.getBoundingClientRect()),C=qg([...k,...S]);a(C),u(!0)},[u]);return _.useEffect(()=>()=>m(),[m]),_.useEffect(()=>{if(l&&d){const w=b=>f(b,d),h=b=>f(b,l);return l.addEventListener("pointerleave",w),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",h)}}},[l,d,f,m]),_.useEffect(()=>{if(s){const w=h=>{const b=h.target,g={x:h.clientX,y:h.clientY},v=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!Xg(g,s);v?m():k&&(m(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,d,s,c,m]),p.jsx(Gl,{...e,ref:i})}),[$g,Hg]=Bn(Ar,{isInside:!1}),Vg=lh("TooltipContent"),Gl=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=jr(or,r),c=Un(r),{onClose:d}=l;return _.useEffect(()=>(document.addEventListener(si,d),()=>document.removeEventListener(si,d)),[d]),_.useEffect(()=>{if(l.trigger){const u=m=>{const f=m.target;f!=null&&f.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),p.jsx(un,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:p.jsxs(Ho,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Vg,{children:n}),p.jsx($g,{scope:r,isInside:!0,children:p.jsx(im,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Kl.displayName=or;var Xl="TooltipArrow",Yg=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Un(r);return Hg(Xl,r).isInside?null:p.jsx(Vo,{...o,...n,ref:t})});Yg.displayName=Xl;function Zg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Kg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Gg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Xg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,d=a.y,u=l.x,m=l.y;d>n!=m>n&&r<(u-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function qg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Jg(t)}function Jg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Qg=Hl,e0=Vl,t0=Yl,r0=Zl,ql=Kl;const n0=Qg,Tr=e0,Or=t0,ir=_.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(r0,{children:p.jsx(ql,{ref:n,sideOffset:t,className:ve("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));ir.displayName=ql.displayName;var Wn="Popover",[Jl]=Ht(Wn,[Xt]),Pr=Xt(),[o0,Nt]=Jl(Wn),Ql=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Pr(t),l=_.useRef(null),[c,d]=_.useState(!1),[u,m]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Wn});return p.jsx($o,{...a,children:p.jsx(o0,{scope:t,contentId:_r(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(f=>!f),[m]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:s,children:r})})};Ql.displayName=Wn;var ec="PopoverAnchor",i0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(ec,r),i=Pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return _.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(kn,{...i,...n,ref:t})});i0.displayName=ec;var tc="PopoverTrigger",rc=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(tc,r),i=Pr(r),s=Ae(t,o.triggerRef),a=p.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ac(o.open),...n,ref:s,onClick:ke(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(kn,{asChild:!0,...i,children:a})});rc.displayName=tc;var di="PopoverPortal",[s0,a0]=Jl(di,{forceMount:void 0}),nc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Nt(di,t);return p.jsx(s0,{scope:t,forceMount:r,children:p.jsx(pt,{present:r||i.open,children:p.jsx(Sn,{asChild:!0,container:o,children:n})})})};nc.displayName=di;var sr="PopoverContent",oc=_.forwardRef((e,t)=>{const r=a0(sr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Nt(sr,e.__scopePopover);return p.jsx(pt,{present:n||i.open,children:i.modal?p.jsx(c0,{...o,ref:t}):p.jsx(d0,{...o,ref:t})})});oc.displayName=sr;var l0=Vt("PopoverContent.RemoveScroll"),c0=_.forwardRef((e,t)=>{const r=Nt(sr,e.__scopePopover),n=_.useRef(null),o=Ae(t,n),i=_.useRef(!1);return _.useEffect(()=>{const s=n.current;if(s)return Ha(s)},[]),p.jsx(qo,{as:l0,allowPinchZoom:!0,children:p.jsx(ic,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),d0=_.forwardRef((e,t)=>{const r=Nt(sr,e.__scopePopover),n=_.useRef(!1),o=_.useRef(!1);return p.jsx(ic,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ic=_.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,m=Nt(sr,r),f=Pr(r);return ra(),p.jsx(Ao,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(un,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(Ho,{"data-state":ac(m.open),role:"dialog",id:m.contentId,...f,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sc="PopoverClose",u0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(sc,r);return p.jsx(ze.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>o.onOpenChange(!1))})});u0.displayName=sc;var f0="PopoverArrow",h0=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Pr(r);return p.jsx(Vo,{...o,...n,ref:t})});h0.displayName=f0;function ac(e){return e?"open":"closed"}var p0=Ql,m0=rc,g0=nc,lc=oc;const b0=p0,v0=m0,cc=_.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(g0,{children:p.jsx(lc,{ref:o,align:t,sideOffset:r,className:ve("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));cc.displayName=lc.displayName;const dc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",w0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=N.useState(!1),c=s??dc(t),d=u=>{r(u),l(!1)};return p.jsx("div",{className:ve("mx-3 mt-2 mb-2",i),children:p.jsxs(b0,{open:a,onOpenChange:l,children:[p.jsx(v0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:ve("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[p.jsx(Kd,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),p.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),p.jsx(Vr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),p.jsxs(cc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(u=>{const m=u===t,f=dc(u);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(u),className:ve("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",m?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[p.jsx("span",{children:f}),n!=null&&p.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},u)}),o!=null&&p.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:p.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[p.jsx(io,{size:12,"aria-hidden":!0}),p.jsx("span",{children:"New page"})]})})]})]})})};function x0(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var ui="ScrollArea",[uc]=Ht(ui),[y0,Ge]=uc(ui),fc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=_.useState(null),[c,d]=_.useState(null),[u,m]=_.useState(null),[f,w]=_.useState(null),[h,b]=_.useState(null),[g,v]=_.useState(0),[k,S]=_.useState(0),[C,T]=_.useState(!1),[A,P]=_.useState(!1),I=Ae(t,F=>l(F)),B=qs(o);return p.jsx(y0,{scope:r,type:n,dir:B,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:m,scrollbarX:f,onScrollbarXChange:w,scrollbarXEnabled:C,onScrollbarXEnabledChange:T,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:P,onCornerWidthChange:v,onCornerHeightChange:S,children:p.jsx(ze.div,{dir:B,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});fc.displayName=ui;var hc="ScrollAreaViewport",pc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ge(hc,r),a=_.useRef(null),l=Ae(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(ze.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});pc.displayName=hc;var lt="ScrollAreaScrollbar",mc=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ge(lt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return _.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(k0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(S0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(gc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(fi,{...n,ref:t}):null});mc.displayName=lt;var k0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ge(lt,e.__scopeScrollArea),[i,s]=_.useState(!1);return _.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(pt,{present:r||i,children:p.jsx(gc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),S0=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ge(lt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Yn(()=>l("SCROLL_END"),100),[a,l]=x0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),_.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let u=c[d];const m=()=>{const f=c[d];u!==f&&(l("SCROLL"),s()),u=f};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[o.viewport,i,l,s]),p.jsx(pt,{present:r||a!=="hidden",children:p.jsx(fi,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),gc=_.forwardRef((e,t)=>{const r=Ge(lt,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=_.useState(!1),a=e.orientation==="horizontal",l=Yn(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?c:d)}},10);return ar(r.viewport,l),ar(r.content,l),p.jsx(pt,{present:n||i,children:p.jsx(fi,{"data-state":i?"visible":"hidden",...o,ref:t})})}),fi=_.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ge(lt,e.__scopeScrollArea),i=_.useRef(null),s=_.useRef(0),[a,l]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=yc(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function u(m,f){return A0(m,s.current,a,f)}return r==="horizontal"?p.jsx(_0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,f=kc(m,a,o.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=u(m,o.dir))}}):r==="vertical"?p.jsx(C0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,f=kc(m,a);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=u(m))}}):null}),_0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ge(lt,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Ae(t,l,i.onScrollbarXChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(vc,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Vn(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),_c(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Hn(s.paddingLeft),paddingEnd:Hn(s.paddingRight)}})}})}),C0=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ge(lt,e.__scopeScrollArea),[s,a]=_.useState(),l=_.useRef(null),c=Ae(t,l,i.onScrollbarYChange);return _.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(vc,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Vn(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(i.viewport){const m=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),_c(m,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Hn(s.paddingTop),paddingEnd:Hn(s.paddingBottom)}})}})}),[E0,bc]=uc(lt),vc=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...m}=e,f=Ge(lt,r),[w,h]=_.useState(null),b=Ae(t,I=>h(I)),g=_.useRef(null),v=_.useRef(""),k=f.viewport,S=n.content-n.viewport,C=Ue(d),T=Ue(l),A=Yn(u,10);function P(I){if(g.current){const B=I.clientX-g.current.left,F=I.clientY-g.current.top;c({x:B,y:F})}}return _.useEffect(()=>{const I=B=>{const F=B.target;(w==null?void 0:w.contains(F))&&C(B,S)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[k,w,S,C]),_.useEffect(T,[n,T]),ar(w,A),ar(f.content,A),p.jsx(E0,{scope:r,scrollbar:w,hasThumb:o,onThumbChange:Ue(i),onThumbPointerUp:Ue(s),onThumbPositionChange:T,onThumbPointerDown:Ue(a),children:p.jsx(ze.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),g.current=w.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),P(I))}),onPointerMove:ke(e.onPointerMove,P),onPointerUp:ke(e.onPointerUp,I=>{const B=I.target;B.hasPointerCapture(I.pointerId)&&B.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),$n="ScrollAreaThumb",wc=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=bc($n,e.__scopeScrollArea);return p.jsx(pt,{present:r||o.hasThumb,children:p.jsx(N0,{ref:t,...n})})}),N0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ge($n,r),s=bc($n,r),{onThumbPositionChange:a}=s,l=Ae(t,u=>s.onThumbChange(u)),c=_.useRef(void 0),d=Yn(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const u=i.viewport;if(u){const m=()=>{if(d(),!c.current){const f=j0(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(ze.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ke(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),w=u.clientX-f.left,h=u.clientY-f.top;s.onThumbPointerDown({x:w,y:h})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});wc.displayName=$n;var hi="ScrollAreaCorner",xc=_.forwardRef((e,t)=>{const r=Ge(hi,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(z0,{...e,ref:t}):null});xc.displayName=hi;var z0=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ge(hi,r),[i,s]=_.useState(0),[a,l]=_.useState(0),c=!!(i&&a);return ar(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),ar(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(ze.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Hn(e){return e?parseInt(e,10):0}function yc(e,t){const r=e/t;return isNaN(r)?0:r}function Vn(e){const t=yc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function A0(e,t,r,n="ltr"){const o=Vn(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,u=n==="ltr"?[0,d]:[d*-1,0];return Sc([l,c],u)(e)}function kc(e,t,r="ltr"){const n=Vn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=_o(e,l);return Sc([0,s],[0,a])(c)}function Sc(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function _c(e,t){return e>0&&e<t}var j0=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,a=r.top!==i.top;(s||a)&&t(),r=i,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function Yn(e,t){const r=Ue(e),n=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),_.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ar(e,t){const r=Ue(t);Le(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Cc=fc,T0=pc,O0=mc,P0=wc,I0=xc;const Ec=_.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Cc,{ref:n,className:ve("relative overflow-hidden",e),...r,children:[p.jsx(T0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(O0,{orientation:"vertical",className:"flex touch-none select-none transition-colors h-full w-1.5 border-l border-l-transparent p-px",children:p.jsx(P0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(I0,{})]}));Ec.displayName=Cc.displayName;const pi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),Nc=new Set(["ui:editorial-markdown"]),zc=e=>e instanceof Oe.z.ZodOptional||e instanceof Oe.z.ZodDefault||e instanceof Oe.z.ZodNullable?zc(e._def.innerType):e,mi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=zc(e);return o!==e?mi(o):""},gi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),D0={activationConstraint:{distance:8}},R0={activationConstraint:{delay:200,tolerance:5}};function bi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:c}=t,d=!!r;return p.jsxs("div",{className:ve("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",d?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[d?p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:p.jsx(ts,{size:12,className:"text-zinc-600"})}):p.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:p.jsx(ts,{size:12,className:"text-zinc-600/50"})}),p.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:ve("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),p.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),p.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(He,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:u=>{u.stopPropagation(),l(u)},children:p.jsx(Qd,{size:12})})}),p.jsx(ir,{children:"Settings"})]}),s&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(He,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:u=>{u.stopPropagation(),c()},children:p.jsx(Zr,{size:12})})}),p.jsx(ir,{children:"Delete section"})]})]})]})}function L0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Jf({id:e.id,disabled:!t.canReorder}),l={transform:xt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:l,className:ve(a&&"z-10"),children:p.jsx(bi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const Ac=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:d,onDeleteSection:u,onAddSection:m,hasChanges:f=!1,onSaveToFile:w,onHotSave:h,saveSuccessFeedback:b=!1,hotSaveSuccessFeedback:g=!1,hotSaveInProgress:v=!1,showLegacySave:k=!0,showHotSave:S=!1,onResetToFile:C,showResetToFile:T=!1,pageSlugs:A=[],currentSlug:P="home",onPageChange:I})=>{const{schemas:B}=fr(),[F,E]=N.useState(!0),[L,y]=N.useState(null),[U,te]=N.useState(null),[W,V]=N.useState(null),[H,oe]=N.useState(null),j=N.useRef(null),D=N.useRef(null),Q=Su(uo(vo,D0),uo(zs,R0),uo(go,{coordinateGetter:th})),G=N.useDeferredValue(e),re=e!=null&&(G==null?void 0:G.id)!==e.id,ue=s&&s.length>0?s:W?[W]:null,J=ue!=null&&ue.length?{fieldKey:ue[ue.length-1].fieldKey,itemId:ue[ue.length-1].itemId}:null,ae=N.useRef(s);N.useEffect(()=>{ae.current!=null&&s==null&&V(null),ae.current=s},[s]),N.useEffect(()=>{(e==null?void 0:e.id)!=null&&E(!1)},[e==null?void 0:e.id]);const de=()=>{const R=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Z=j.current;Z&&Z.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(R)},ie=N.useRef(F);N.useEffect(()=>{if(F&&!ie.current){const R=de();return ie.current=F,R}ie.current=F},[F]),N.useEffect(()=>{if(!J)return;const R=j.current;if(!R)return;const Z=requestAnimationFrame(()=>{const X=R.querySelector("[data-jp-expanded-item]")??R.querySelector("[data-jp-focused-field]");X&&X.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(Z)},[J]);const fe=R=>{E(!1),d==null||d(R)},me=()=>{E(R=>{const Z=!R;return Z&&de(),Z})},ye=(R,Z)=>{Z.stopPropagation(),r.length>0&&o?oe(R):(E(!1),d==null||d(R))};N.useEffect(()=>{if(H==null)return;const R=Z=>{Z.key==="Escape"&&oe(null)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[H]);const x=R=>{L===R?(u==null||u(R),y(null)):(y(R),setTimeout(()=>y(null),3e3))},K=N.useMemo(()=>l.filter(R=>R.scope==="local").map(R=>R.id),[l]),Y=!!a&&K.length>0,O=R=>{te(R.active.id)},z=R=>{te(null);const{active:Z,over:X}=R;if(!X||Z.id===X.id||!a)return;const le=l.findIndex(we=>we.id===Z.id),be=l.findIndex(we=>we.id===X.id);if(le===-1||be===-1)return;const ge=le<be?be:be-1;a(Z.id,ge)},M=e?t.sections.find(R=>R.id===e.id):void 0,q=G?t.sections.find(R=>R.id===G.id):void 0,ee=G?B[G.type]:void 0,$=N.useMemo(()=>{if(!ee)return!1;const R=ee.shape,Z=Object.keys(R).filter(X=>!pi.has(X));return Z.length===0?!1:Z.every(X=>Nc.has(mi(R[X])))},[ee]);N.useEffect(()=>{(e==null?void 0:e.id)!=null&&$&&E(!0)},[e==null?void 0:e.id,$]);const ne=l.length>0&&(F||!e),ce=P?P.charAt(0).toUpperCase()+P.slice(1):"Select page",se=N.useMemo(()=>{const R=[];let Z=null;for(const X of l){const le=X.type.toUpperCase(),be=Z!==null&&(Z==="HEADER"&&le!=="HEADER"||Z!=="HEADER"&&Z!=="FOOTER"&&le==="FOOTER");R.push({layer:X,showSeparatorAbove:be}),Z=le}return R},[l]);return p.jsx(n0,{children:p.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),p.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-primary font-bold",children:e.type}),p.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),p.jsx("span",{className:"uppercase",children:e.scope})]}):p.jsxs("span",{className:"text-zinc-600",children:[ce," · ",l.length," sections"]})})]}),p.jsx(He,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Ft,{size:14})})]}),A.length>0&&I&&p.jsx(w0,{pageSlugs:A,currentSlug:P,onPageChange:I,sectionCount:l.length,currentPageLabel:ce}),l.length>0&&p.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[p.jsxs("button",{type:"button",onClick:me,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":ne,"aria-label":ne?"Collapse Page Layers":"Expand Page Layers",children:[p.jsx(oo,{size:14,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),p.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),p.jsx(no,{size:13,className:ve("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!F&&"rotate-180")})]}),m!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsx(He,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(io,{size:14})})}),p.jsx(ir,{children:"Add section"})]})]}),p.jsxs(Ec,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:j,className:"flex flex-col min-h-0",children:ne&&p.jsxs("div",{className:"py-1",children:[p.jsxs(yf,{sensors:Q,collisionDetection:Eu,modifiers:[Ff],onDragStart:O,onDragEnd:z,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:R})=>R?`Posizione ${K.indexOf(String(R.id))+1} di ${K.length}.`:void 0,onDragEnd:({over:R})=>R?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Vf,{items:K,strategy:$f,children:p.jsx("div",{className:"px-2 space-y-0.5",children:se.map(({layer:R,showSeparatorAbove:Z})=>p.jsxs(N.Fragment,{children:[Z&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),R.scope==="local"&&Y?p.jsx(L0,{layer:R,opts:{isSelected:(e==null?void 0:e.id)===R.id,isActive:c===R.id,isDragging:!1,canReorder:!0,canDelete:!!u,deleteConfirm:L===R.id,onSelect:()=>fe(R.id),onDelete:()=>x(R.id),onOpenSettings:X=>ye(R.id,X)}}):p.jsx("div",{children:p.jsx(bi,{layer:R,opts:{isSelected:(e==null?void 0:e.id)===R.id,isActive:c===R.id,isDragging:!1,canDelete:R.scope==="local"&&!!u,deleteConfirm:L===R.id,onSelect:()=>fe(R.id),onDelete:()=>x(R.id),onOpenSettings:X=>ye(R.id,X)}})})]},R.id))})}),p.jsx(Mf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:U?(()=>{const R=l.find(Z=>Z.id===U);return R?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(bi,{layer:R,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),L&&p.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[p.jsx(Vd,{size:12,className:"text-amber-500 shrink-0"}),p.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),J&&M&&(()=>{const R=M.data||{};let Z;if(ue&&ue.length>0){let X=R;for(const ge of ue){const we=X==null?void 0:X[ge.fieldKey];ge.itemId!=null&&Array.isArray(we)?X=we.find(Ne=>String(Ne==null?void 0:Ne.id)===String(ge.itemId))??null:X=we}const le=X||{},be=J.fieldKey;Z=(typeof le.name=="string"?le.name:null)??(typeof le.title=="string"?le.title:null)??(typeof le.label=="string"?le.label:null)??gi(be)}else{const X=J.fieldKey;if(J.itemId!=null){const ge=(Array.isArray(R[X])?R[X]:[]).find(we=>String(we==null?void 0:we.id)===String(J.itemId))||{};Z=(typeof ge.name=="string"?ge.name:null)??(typeof ge.title=="string"?ge.title:null)??(typeof ge.label=="string"?ge.label:null)??gi(X)}else Z=gi(X)}return p.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[p.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),p.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:Z})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&E(!1),children:e?re?p.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),p.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):ee?(()=>{const Z=Object.keys(ee.shape).filter(le=>!pi.has(le)&&!Nc.has(mi(ee.shape[le]))),X=(q==null?void 0:q.data)||{};return Z.length===0?p.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):p.jsx(zr,{schema:ee,data:X,onChange:le=>n(le),keys:Z,expandedItemPath:ue,onSidebarExpandedItemChange:V})})():p.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(G==null?void 0:G.type)??e.type]}):p.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]}),p.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(k&&w!=null||S&&h!=null||C!=null)&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("div",{className:ve("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",f?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),p.jsx("span",{className:ve("text-sm font-medium transition-colors duration-300 truncate",b||g?"text-emerald-400":f?"text-amber-500":"text-zinc-500"),children:b||g?"Saved":f?"Unsaved Changes":"All Changes Saved"})]}),k&&w!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsxs(He,{size:"default",disabled:!f,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:R=>{R.preventDefault(),R.stopPropagation(),w()},children:[p.jsx(ns,{size:14}),p.jsx("span",{children:"Save"})]})}),p.jsx(ir,{children:"Save (export JSON)"})]}),S&&h!=null&&p.jsxs(Tr,{children:[p.jsx(Or,{asChild:!0,children:p.jsxs(He,{size:"default",disabled:!f||v,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:R=>{R.preventDefault(),R.stopPropagation(),h()},children:[p.jsx(ns,{size:14}),p.jsx("span",{children:v?"Saving...":"Hot Save"})]})}),p.jsx(ir,{children:"Hot save to edge"})]}),C!=null&&T&&p.jsx("button",{type:"button",onClick:C,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:p.jsx("span",{children:"Ripristina da file"})})]})}),H!=null&&r.length>0&&o!=null&&(()=>{const R=r.find(Ne=>Ne.id===H),Z=l.find(Ne=>Ne.id===H);if(!R)return null;const X=(Z==null?void 0:Z.scope)==="global"?"global":"local",le=R.type,be=B[le],we=(be?Object.keys(be.shape):[]).filter(Ne=>pi.has(Ne)),Se=R.data??{};return we.length===0?p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>oe(null),children:p.jsxs("div",{ref:D,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:Ne=>Ne.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",le]}),p.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:p.jsx(Ft,{size:18})})]}),p.jsx("div",{className:"p-4",children:p.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):p.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:Ne=>Ne.target===Ne.currentTarget&&oe(null),children:p.jsxs("div",{ref:D,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:Ne=>Ne.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[p.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",le]}),p.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:p.jsx(Ft,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(zr,{schema:be,data:Se,onChange:Ne=>{const mt={...R.data,...Ne};o(H,X,le,mt)},keys:we})})]})})})()]})})},jc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=N.useRef(null),l=N.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:je.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return N.useEffect(()=>{l()},[l]),N.useEffect(()=>{const c=d=>{d.data.type===je.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),N.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:je.SYNC_SELECTION,selectedId:o},"*")},[o]),N.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:je.REQUEST_SCROLL_TO_SECTION,sectionId:i},"*"),s==null||s())},[i,s]),p.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:p.jsx("iframe",{ref:a,src:`/admin/preview/${n}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},vi=new Set;function M0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Tc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,M0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&Tc(o,i,r)}),r}function Be(e,t,r,n){n&&(e[t]=`var(${r})`)}function F0(e){const t=Tc(e.tokens),r={...t};return Be(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),Be(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),Be(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),Be(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),Be(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),Be(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),Be(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),Be(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),Be(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),Be(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),Be(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),Be(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),Be(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),Be(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),Be(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const Zn={setTheme:e=>{const t=document.documentElement,r=F0(e);vi.forEach(n=>{t.style.removeProperty(n)}),vi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),vi.add(n)})}};function B0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function Oc(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),c=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&c&&r.push({fieldKey:c,itemId:l}),n==null){const d=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");d&&(n=d)}o=o.parentElement}return r.reverse(),B0(r,n)}const U0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',W0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",Pc=()=>{var f;const[e,t]=N.useState(null),[r,n]=N.useState(null),[o,i]=N.useState(null),[s,a]=N.useState(null),[l,c]=N.useState(!1);if(N.useEffect(()=>{const w=h=>{if(!(h.origin!==window.location.origin||h.source!==window.parent)){if(h.data.type===je.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Zn.setTheme(h.data.themeConfig)),h.data.type===je.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===je.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===je.REQUEST_INLINE_FLUSH){const b=typeof h.data.requestId=="string"?h.data.requestId:null;window.dispatchEvent(new CustomEvent(je.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:je.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}h.data.type===je.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:je.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))}};return window.addEventListener("message",w),window.parent.postMessage({type:je.STAGE_READY},"*"),()=>window.removeEventListener("message",w)},[]),N.useEffect(()=>{const w=g=>!!g.closest(W0),h=g=>!!(g.closest('[data-jp-ignore-select="true"]')||g.closest(U0)&&!w(g)||g.closest("a[href]")&&!w(g)),b=g=>{var y,U,te;const v=g.target;if(h(v)){v.closest("a[href]")&&g.preventDefault();return}const k=g.clientX,S=g.clientY;let C=null,T=v;for(;T&&T!==document.body;){const W=(y=T.getAttribute)==null?void 0:y.call(T,"data-section-id"),V=(U=T.getAttribute)==null?void 0:U.call(T,"data-section-type"),H=(te=T.getAttribute)==null?void 0:te.call(T,"data-section-scope");if(W&&V&&H){C=T;break}T=T.parentElement}if(!C)return;g.preventDefault(),g.stopPropagation();const A=C.getAttribute("data-section-id"),P=C.getAttribute("data-section-type"),I=C.getAttribute("data-section-scope");if(!A||!P||!I)return;const B={id:A,type:P,scope:I};if(v===C){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}const F=document.elementFromPoint(k,S)??v;if(!F||!C.contains(F)){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}if(F===C){window.parent.postMessage({type:je.SECTION_SELECT,section:B},"*");return}let E=Oc(F,C);if(E.length===0&&F){let W=null;const V=H=>{var j,D;const oe=H.getBoundingClientRect();if(oe.left<=k&&k<=oe.right&&oe.top<=S&&S<=oe.bottom){for(let Q=0;Q<H.children.length;Q++)V(H.children[Q]);((j=H.getAttribute)!=null&&j.call(H,"data-jp-item-id")||(D=H.getAttribute)!=null&&D.call(H,"data-jp-field"))&&(W=H)}};V(F),W&&(E=Oc(W,C))}const L={type:je.SECTION_SELECT,section:B};E.length>0&&(L.itemPath=E),window.parent.postMessage(L,"*")};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[]),N.useEffect(()=>{if(!s)return;const w=setTimeout(()=>a(null),600);return()=>clearTimeout(w)},[s]),!e||!r)return p.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const d=(f=r.header)==null?void 0:f.data,u={main:(d==null?void 0:d.links)??[]},m=w=>{window.parent.postMessage({type:je.ACTIVE_SECTION_CHANGED,activeSectionId:w},"*")};return p.jsx(Hr,{mode:l?"visitor":"studio",children:p.jsx("div",{className:l?"":"jp-ice-active",children:p.jsx(so,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:l?null:o,scrollToSectionId:s,onActiveSectionChange:m})})})};function $0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Ic=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(N.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??$0(s);return p.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[p.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),p.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:p.jsx(oo,{size:18})}),p.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),p.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:p.jsx(Ft,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?p.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):p.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>p.jsx("li",{role:"option",children:p.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:ve("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[p.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),p.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),p.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:p.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},Dc=()=>p.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[p.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),p.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),p.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]}),H0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-blue-900\\/20{--tw-shadow-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-900\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-900)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class V0 extends N.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?p.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[p.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),p.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function wi(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Rc(e,t=""){const r=wi(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return wi(o)||"home"}const Lc=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const s=Ze.useLocation(),a=Rc(s.pathname),[l,c]=N.useState(null);N.useEffect(()=>{const f=document.getElementById("jp-baked-state");if(f!=null&&f.textContent)try{const w=JSON.parse(f.textContent);c(w),Zn.setTheme(w.theme)}catch(w){console.error("Failed to parse baked state",w)}},[]);const d=l?l.page:e[a],u=l?l.site:t,m=l?l.menu:r;return d?p.jsx(Kr,{mode:"tenant",tenantCss:n,adminCss:o,children:p.jsx(Hr,{mode:"visitor",children:p.jsx(so,{pageConfig:d,siteConfig:u,menuConfig:m})})}):p.jsx(i,{})},Mc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,hotSave:c,showLegacySave:d=!0,showHotSave:u=!1,exportHTML:m})=>{const f=Ze.useLocation(),w=Rc(f.pathname,"admin"),h=Ze.useNavigate(),b=Object.keys(e).sort((R,Z)=>R==="home"?-1:Z==="home"?1:R.localeCompare(Z)),[g,v]=N.useState(null),[k,S]=N.useState(!1),[C,T]=N.useState(!1),[A,P]=N.useState(!1),[I,B]=N.useState(!1),[F,E]=N.useState(()=>{var R;try{const Z=JSON.parse(JSON.stringify(t??{}));Z.identity||(Z.identity={title:"Site"}),Z.pages||(Z.pages=[]);const X=(R=Z.header)==null?void 0:R.data;return X&&(r!=null&&r.main)&&(X.links=JSON.parse(JSON.stringify(r.main))),Z}catch{return{identity:{title:"Site"},pages:[]}}}),[L,y]=N.useState(null),[U,te]=N.useState(null),[W,V]=N.useState(null),[H,oe]=N.useState(null),[j,D]=N.useState(!1),[Q,G]=N.useState(400),re=N.useRef(g),ue=N.useRef(F),J=360,ae=920;N.useEffect(()=>{re.current=g},[g]),N.useEffect(()=>{ue.current=F},[F]);const de=N.useCallback(R=>{R.preventDefault();const Z=R.currentTarget;Z.setPointerCapture(R.pointerId);const X=R.clientX,le=Q,be=we=>{const Se=X-we.clientX,Ne=Math.min(ae,Math.max(J,le+Se));G(Ne)},ge=()=>{Z.releasePointerCapture(R.pointerId),Z.removeEventListener("pointermove",be),Z.removeEventListener("pointerup",ge),Z.removeEventListener("pointercancel",ge),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",Z.addEventListener("pointermove",be),Z.addEventListener("pointerup",ge),Z.addEventListener("pointercancel",ge)},[Q]),ie=g?[...F.header?[{id:F.header.id,type:F.header.type,scope:"global",title:"Header"}]:[],...g.sections.map(R=>{var Z,X;return{id:R.id,type:R.type,scope:"local",title:((Z=R.data)==null?void 0:Z.title)??((X=R.data)==null?void 0:X.titleHighlight)}}),...F.footer?[{id:F.footer.id,type:F.footer.type,scope:"global",title:"Footer"}]:[]]:[];N.useEffect(()=>{const R=e[w];R&&v(JSON.parse(JSON.stringify(R))),y(null),te(null),S(!1)},[w,e]);const fe=N.useCallback(()=>{const R=e[w];R&&v(JSON.parse(JSON.stringify(R))),y(null),te(null),S(!1)},[w,e]),me=N.useCallback((R,Z,X)=>{const le=[...X.sections],be=le.findIndex(Se=>Se.id===R);if(be===-1||Z<0||Z>=le.length)return;const[ge]=le.splice(be,1),we=Z>be?Z-1:Z;le.splice(Math.min(we,le.length),0,ge),v({...X,sections:le}),S(!0)},[]),ye=N.useCallback(R=>{var Z;if(R.origin===window.location.origin){if(R.data.type===je.SECTION_SELECT){y(R.data.section);const X=R.data.itemPath;Array.isArray(X)&&X.length>0?te(X.map(le=>({fieldKey:le.fieldKey,...le.itemId!=null?{itemId:String(le.itemId)}:{}}))):te(null)}if(R.data.type===je.INLINE_FIELD_UPDATE){const X=typeof R.data.sectionId=="string"?R.data.sectionId:null,le=typeof R.data.fieldKey=="string"?R.data.fieldKey:null;X&&le&&(v(be=>{if(!be)return be;const ge={...be,sections:be.sections.map(we=>we.id===X?{...we,data:{...we.data,[le]:R.data.value}}:we)};return re.current=ge,ge}),S(!0))}if(R.data.type===je.ACTIVE_SECTION_CHANGED&&V(R.data.activeSectionId??null),R.data.type==="jsonpages:section-reorder"&&re.current){const{sectionId:X,newIndex:le}=R.data;typeof X=="string"&&typeof le=="number"&&le>=0&&me(X,le,re.current)}if(R.data.type===je.SEND_CLEAN_HTML){if(!re.current)return;const X=(Z=ue.current.header)==null?void 0:Z.data,le={page:re.current,site:ue.current,menu:{main:(X==null?void 0:X.links)??[]},theme:n};m(le,w,R.data.html),S(!1)}}},[w,n,me,m]);N.useEffect(()=>(window.addEventListener("message",ye),()=>window.removeEventListener("message",ye)),[ye]);const x=N.useCallback(R=>{const Z=ie.find(X=>X.id===R);Z&&y({id:Z.id,type:Z.type,scope:Z.scope}),te(null),oe(R)},[ie]),K=N.useCallback(()=>{oe(null)},[]),Y=N.useCallback(R=>{v(Z=>Z&&{...Z,sections:Z.sections.filter(X=>X.id!==R)}),S(!0),y(Z=>(Z==null?void 0:Z.id)===R?null:Z)},[]),O=R=>{if(!(!L||!g))if(S(!0),L.scope==="global")L.type==="header"&&F.header!=null?E({...F,header:{...F.header,data:R}}):L.type==="footer"&&F.footer!=null&&E({...F,footer:{...F.footer,data:R}});else{const Z=g.sections.map(X=>X.id===L.id?{...X,data:R}:X);v({...g,sections:Z})}},z=N.useCallback((R,Z,X,le)=>{var be,ge;if(S(!0),Z==="global")((be=F.header)==null?void 0:be.id)===R?E({...F,header:{...F.header,data:le}}):((ge=F.footer)==null?void 0:ge.id)===R&&E({...F,footer:{...F.footer,data:le}});else if(g){const we=g.sections.map(Se=>Se.id===R?{...Se,data:le}:Se);v({...g,sections:we})}},[g,F]),M=()=>{var Z;const R=document.querySelector("iframe");(Z=R==null?void 0:R.contentWindow)==null||Z.postMessage({type:je.REQUEST_CLEAN_HTML},"*")},q=N.useCallback(async()=>{const R=document.querySelector("iframe");if(!(R!=null&&R.contentWindow))return;const Z=crypto.randomUUID();await new Promise(X=>{var ge;let le=!1;const be=we=>{var Se,Ne;we.origin===window.location.origin&&((Se=we.data)==null?void 0:Se.type)===je.INLINE_FLUSHED&&((Ne=we.data)==null?void 0:Ne.requestId)===Z&&(le=!0,window.removeEventListener("message",be),X())};window.addEventListener("message",be),(ge=R.contentWindow)==null||ge.postMessage({type:je.REQUEST_INLINE_FLUSH,requestId:Z},"*"),window.setTimeout(()=>{le||(window.removeEventListener("message",be),X())},400)})},[]),ee=async()=>{var be;if(!l)return;await q();const R=re.current,Z=ue.current;if(!R)return;const X=(be=Z.header)==null?void 0:be.data,le={page:R,site:Z,menu:{main:(X==null?void 0:X.links)??[]},theme:n};l(le,w).then(()=>{S(!1),T(!0),typeof window<"u"&&window.setTimeout(()=>T(!1),2500)}).catch(ge=>{console.error("[JsonPages] saveToFile failed",ge);const we=ge instanceof Error?ge.message:String(ge);alert(`Save to file failed: ${we}`)})},$=async()=>{var be;if(!c)return;await q();const R=re.current,Z=ue.current;if(!R)return;const X=(be=Z.header)==null?void 0:be.data,le={page:R,site:Z,menu:{main:(X==null?void 0:X.links)??[]},theme:n};B(!0),c(le,w).then(()=>{S(!1),P(!0),typeof window<"u"&&window.setTimeout(()=>P(!1),2500)}).catch(ge=>{console.error("[JsonPages] hotSave failed",ge);const we=ge instanceof Error?ge.message:String(ge);alert(`Hot save failed: ${we}`)}).finally(()=>{B(!1)})},ne=R=>{var le;if(!g)return;const Z=((le=s==null?void 0:s.getDefaultSectionData)==null?void 0:le.call(s,R))??{},X={id:crypto.randomUUID(),type:R,data:Z,settings:void 0};v({...g,sections:[...g.sections,X]}),S(!0),y({id:X.id,type:R,scope:"local"})};if(!g)return p.jsx("div",{children:"Loading Studio..."});const ce=(L==null?void 0:L.scope)==="global"?{sections:[F.header,F.footer].filter(R=>R!=null)}:g,se=[...F.header?[F.header]:[],...g.sections,...F.footer?[F.footer]:[]];return p.jsx(Kr,{mode:"admin",tenantCss:o,adminCss:i,children:p.jsx(Hr,{mode:"studio",children:p.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[p.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[p.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:p.jsx(jc,{draft:g,globalDraft:F,themeConfig:n,slug:w,selectedId:L==null?void 0:L.id,scrollToSectionId:H,onScrollRequested:K})}),p.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:Q,minWidth:J,maxWidth:ae},children:[p.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:de}),p.jsx(Ac,{selectedSection:L,pageData:ce,allSectionsData:se,onUpdate:O,onUpdateSection:z,onClose:()=>{y(null),te(null)},expandedItemPath:U,onReorderSection:g?(R,Z)=>me(R,Z,g):void 0,allLayers:ie,activeSectionId:W,onRequestScrollToSection:x,onDeleteSection:g?Y:void 0,onAddSection:a.length>0?()=>D(!0):void 0,hasChanges:k,onExportHTML:M,onSaveToFile:l!=null?ee:void 0,saveSuccessFeedback:C,onHotSave:c!=null?$:void 0,hotSaveSuccessFeedback:A,hotSaveInProgress:I,showLegacySave:d,showHotSave:u,onResetToFile:fe,pageSlugs:b,currentSlug:w,onPageChange:b.length>1?R=>{const Z=wi(R);h(Z==="home"?"/admin":`/admin/${Z}`)}:void 0})]})]}),p.jsx(Ic,{open:j,onClose:()=>D(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:ne})]})})})},Fc=({tenantCss:e,adminCss:t})=>p.jsx(Kr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(Pc,{})});function Y0({config:e}){var b,g,v,k,S,C;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=Dc}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(T=>T!=="header"&&T!=="footer"),u={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??Ni,exportHTML:((g=e.persistence)==null?void 0:g.exportHTML)??zi,saveToFile:(v=e.persistence)==null?void 0:v.saveToFile,hotSave:(k=e.persistence)==null?void 0:k.hotSave,showLegacySave:((S=e.persistence)==null?void 0:S.showLegacySave)??!0,showHotSave:((C=e.persistence)==null?void 0:C.showHotSave)??!1},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",f=typeof(a==null?void 0:a.admin)=="string"?a.admin:H0,[w,h]=N.useState(!1);return N.useEffect(()=>{try{i!=null&&i.tokens&&Zn.setTheme(i)}catch(T){console.warn("[JsonPages] setTheme failed",T)}h(!0)},[i]),w?p.jsx(V0,{children:p.jsx(qi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:p.jsx(Ze.BrowserRouter,{children:p.jsxs(Ze.Routes,{children:[p.jsx(Ze.Route,{path:"/",element:p.jsx(Lc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(Ze.Route,{path:"/*",element:p.jsx(Lc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(Ze.Route,{path:"/admin",element:p.jsx(Mc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,hotSave:u.hotSave,showLegacySave:u.showLegacySave,showHotSave:u.showHotSave,exportHTML:u.exportHTML})}),p.jsx(Ze.Route,{path:"/admin/*",element:p.jsx(Mc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,hotSave:u.hotSave,showLegacySave:u.showLegacySave,showHotSave:u.showHotSave,exportHTML:u.exportHTML})}),p.jsx(Ze.Route,{path:"/admin/preview",element:p.jsx(Fc,{tenantCss:m,adminCss:f})}),p.jsx(Ze.Route,{path:"/admin/preview/*",element:p.jsx(Fc,{tenantCss:m,adminCss:f})}),p.jsx(Ze.Route,{path:"*",element:p.jsx(c,{})})]})})})}):p.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}const Z0=({hasChanges:e,onExportJSON:t,onExportHTML:r,onAddSection:n})=>p.jsxs("div",{className:"h-14 border-b border-zinc-800 bg-zinc-950 flex items-center justify-between px-6 shrink-0 z-50 relative",children:[p.jsx("div",{className:"flex items-center gap-3",children:n!=null&&p.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors",title:"Add section","aria-label":"Add section",children:[p.jsx(tu,{size:14}),p.jsx("span",{children:"Add section"})]})}),p.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 opacity-20 pointer-events-none",children:p.jsx("span",{className:"text-xs font-black tracking-[0.2em] text-zinc-100",children:"JSONPAGES STUDIO"})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium transition-all border bg-zinc-900 border-zinc-700 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",children:[p.jsx(Yd,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:ve("flex items-center gap-2 px-4 py-1.5 rounded-md text-xs font-bold transition-all shadow-lg",e?"bg-blue-600 text-white hover:bg-blue-500 shadow-blue-900/20":"bg-zinc-900 text-zinc-600 cursor-not-allowed"),children:[p.jsx(Zd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});Ce.AddSectionLibrary=Ic,Ce.AdminSidebar=Ac,Ce.ConfigProvider=qi,Ce.ControlBar=Z0,Ce.DefaultNotFound=Dc,Ce.FormFactory=zr,Ce.InputWidgets=rr,Ce.JsonPagesEngine=Y0,Ce.PageRenderer=so,Ce.PreviewEntry=Pc,Ce.STUDIO_EVENTS=je,Ce.SectionRenderer=hr,Ce.StudioProvider=Hr,Ce.StudioStage=jc,Ce.ThemeLoader=Kr,Ce.cn=ve,Ce.exportBakedHTML=zi,Ce.exportProjectJSON=Ni,Ce.resolveAssetUrl=Bl,Ce.themeManager=Zn,Ce.useConfig=fr,Ce.useStudio=Qi,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));