@jsonpages/core 1.0.59 → 1.0.60

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(xe,j){typeof exports=="object"&&typeof module<"u"?j(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"],j):(xe=typeof globalThis<"u"?globalThis:xe||self,j(xe.JsonPagesCore={},xe.React,xe.ReactRouterDOM,xe.z,xe.ReactDOM))})(this,(function(xe,j,He,je,ht){"use strict";function vi(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 E=vi(j),Rr=vi(ht),Ce={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 pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(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 Kn={exports:{}};/*!
1
+ (function(ye,j){typeof exports=="object"&&typeof module<"u"?j(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"],j):(ye=typeof globalThis<"u"?globalThis:ye||self,j(ye.JsonPagesCore={},ye.React,ye.ReactRouterDOM,ye.z,ye.ReactDOM))})(this,(function(ye,j,We,ze,ht){"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 E=yi(j),Ir=yi(ht),Ce={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 pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dr(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:{}};/*!
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 wi;function Ic(){return wi||(wi=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(v){var h=n[c][1][v];return s(h||v)},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,v,h,b=[],g=0,x=l.length,k=x,_=i.getTypeOf(l)!=="string";g<l.length;)k=x-g,u=_?(c=l[g++],d=g<x?l[g++]:0,g<x?l[g++]:0):(c=l.charCodeAt(g++),d=g<x?l.charCodeAt(g++):0,g<x?l.charCodeAt(g++):0),m=c>>2,f=(3&c)<<4|d>>4,v=1<k?(15&d)<<2|u>>6:64,h=2<k?63&u:64,b.push(a.charAt(m)+a.charAt(f)+a.charAt(v)+a.charAt(h));return b.join("")},o.decode=function(l){var c,d,u,m,f,v,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 x,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(x=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|(v=a.indexOf(l.charAt(h++))),x[b++]=c,f!==64&&(x[b++]=d),v!==64&&(x[b++]=u);return x}},{"./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,v){this.compressedSize=d,this.uncompressedSize=u,this.crc32=m,this.compression=f,this.compressedContent=v}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,v=m+u;c^=-1;for(var h=m;h<v;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,v=m+u;c^=-1;for(var h=m;h<v;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,v){var h,b="";for(h=0;h<v;h++)b+=String.fromCharCode(255&f),f>>>=8;return b}function s(f,v,h,b,g,x){var k,_,C=f.file,I=f.compression,A=x!==c.utf8encode,D=a.transformTo("string",x(C.name)),R=a.transformTo("string",c.utf8encode(C.name)),F=C.comment,Y=a.transformTo("string",x(F)),N=a.transformTo("string",c.utf8encode(F)),M=R.length!==C.name.length,y=N.length!==F.length,B="",te="",U="",$=C.dir,Z=C.date,ne={crc32:0,compressedSize:0,uncompressedSize:0};v&&!h||(ne.crc32=f.crc32,ne.compressedSize=f.compressedSize,ne.uncompressedSize=f.uncompressedSize);var z=0;v&&(z|=8),A||!M&&!y||(z|=2048);var L=0,K=0;$&&(L|=16),g==="UNIX"?(K=798,L|=(function(ee,ue){var re=ee;return ee||(re=ue?16893:33204),(65535&re)<<16})(C.unixPermissions,$)):(K=20,L|=(function(ee){return 63&(ee||0)})(C.dosPermissions)),k=Z.getUTCHours(),k<<=6,k|=Z.getUTCMinutes(),k<<=5,k|=Z.getUTCSeconds()/2,_=Z.getUTCFullYear()-1980,_<<=4,_|=Z.getUTCMonth()+1,_<<=5,_|=Z.getUTCDate(),M&&(te=i(1,1)+i(d(D),4)+R,B+="up"+i(te.length,2)+te),y&&(U=i(1,1)+i(d(Y),4)+N,B+="uc"+i(U.length,2)+U);var q="";return q+=`
12
- \0`,q+=i(z,2),q+=I.magic,q+=i(k,2),q+=i(_,2),q+=i(ne.crc32,4),q+=i(ne.compressedSize,4),q+=i(ne.uncompressedSize,4),q+=i(D.length,2),q+=i(B.length,2),{fileRecord:u.LOCAL_FILE_HEADER+q+D+B,dirRecord:u.CENTRAL_FILE_HEADER+i(K,2)+q+i(Y.length,2)+"\0\0\0\0"+i(L,4)+i(b,4)+D+B+Y}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),u=r("../signature");function m(f,v,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,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 v=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?(v+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var v=this.streamFiles&&!f.file.dir;if(v){var h=s(f,v,!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 v=this.streamFiles&&!f.file.dir,h=s(f,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),v)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,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var h=this.bytesWritten-f,b=(function(g,x,k,_,C){var I=a.transformTo("string",C(_));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(x,4)+i(k,4)+i(I.length,2)+I})(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 v=this;return f.on("data",function(h){v.processChunk(h)}),f.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),f.on("error",function(h){v.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 v=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var h=0;h<v.length;h++)try{v[h].error(f)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,v=0;v<f.length;v++)f[v].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 v=(function(x,k){var _=x||k,C=i[_];if(!C)throw new Error(_+" 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(v,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,v){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){v(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}n.exports=function(m,f){var v=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 x=0;x<g.length;x++)b.push(u(g[x]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),g=b.files,x=0;x<g.length;x++){var k=g[x],_=k.fileNameStr,C=i.resolve(k.fileNameStr);v.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||(v.file(C).unsafeOriginalName=_)}return b.zipComment.length&&(v.comment=b.zipComment),v})}},{"./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,I,A){var D,R=a.getTypeOf(I),F=a.extend(A||{},d);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(C=g(C)),F.createFolders&&(D=b(C))&&x.call(this,D,!0);var Y=R==="string"&&F.binary===!1&&F.base64===!1;A&&A.binary!==void 0||(F.binary=!Y),(I instanceof u&&I.uncompressedSize===0||F.dir||!I||I.length===0)&&(F.base64=!1,F.binary=!0,I="",F.compression="STORE",R="string");var N=null;N=I instanceof u||I instanceof l?I:v.isNode&&v.isStream(I)?new h(C,I):a.prepareContent(C,I,F.binary,F.optimizedBinaryString,F.base64);var M=new m(C,N,F);this.files[C]=M}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"),v=r("./nodejsUtils"),h=r("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var I=C.lastIndexOf("/");return 0<I?C.substring(0,I):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},x=function(C,I){return I=I!==void 0?I:d.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:I}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var I,A,D;for(I in this.files)D=this.files[I],(A=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&C(A,D)},filter:function(C){var I=[];return this.forEach(function(A,D){C(A,D)&&I.push(D)}),I},file:function(C,I,A){if(arguments.length!==1)return C=this.root+C,i.call(this,C,I,A),this;if(k(C)){var D=C;return this.filter(function(F,Y){return!Y.dir&&D.test(F)})}var R=this.files[this.root+C];return R&&!R.dir?R:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(R,F){return F.dir&&C.test(R)});var I=this.root+C,A=x.call(this,I),D=this.clone();return D.root=A.name,D},remove:function(C){C=this.root+C;var I=this.files[C];if(I||(C.slice(-1)!=="/"&&(C+="/"),I=this.files[C]),I&&!I.dir)delete this.files[C];else for(var A=this.filter(function(R,F){return F.name.slice(0,C.length)===C}),D=0;D<A.length;D++)delete this.files[A[D].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 I,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 D=A.comment||this.comment||"";I=f.generateWorker(this,A,D)}catch(R){(I=new l("error")).error(R)}return new c(I,A.type||"string",A.mimeType)},generateAsync:function(C,I){return this.generateInternalStream(C).accumulate(I)},generateNodeStream:function(C,I){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(I)}};n.exports=_},{"./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(v,h){return new d.Promise(function(b,g){var x=[],k=v._internalType,_=v._outputType,C=v._mimeType;v.on("data",function(I,A){x.push(I),h&&h(A)}).on("error",function(I){x=[],g(I)}).on("end",function(){try{var I=(function(A,D,R){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),R);case"base64":return l.encode(D);default:return i.transformTo(A,D)}})(_,(function(A,D){var R,F=0,Y=null,N=0;for(R=0;R<D.length;R++)N+=D[R].length;switch(A){case"string":return D.join("");case"array":return Array.prototype.concat.apply([],D);case"uint8array":for(Y=new Uint8Array(N),R=0;R<D.length;R++)Y.set(D[R],F),F+=D[R].length;return Y;case"nodebuffer":return Buffer.concat(D);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,x),C);b(I)}catch(A){g(A)}x=[]}).resume()})}function f(v,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=v.pipe(new s(g)),v.lock()}catch(x){this._worker=new a("error"),this._worker.error(x)}}f.prototype={accumulate:function(v){return m(this,v)},on:function(v,h){var b=this;return v==="data"?this._worker.on(v,function(g){h.call(b,g.data,g.meta)}):this._worker.on(v,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(v){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"},v)}},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(v){var h,b,g,x,k,_=v.length,C=0;for(x=0;x<_;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),x=k=0;k<C;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),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(v){var h,b,g,x,k=v.length,_=new Array(2*k);for(h=b=0;h<k;)if((g=v[h++])<128)_[b++]=g;else if(4<(x=c[g]))_[b++]=65533,h+=x-1;else{for(g&=x===2?31:x===3?15:7;1<x&&h<k;)g=g<<6|63&v[h++],x--;1<x?_[b++]=65533:g<65536?_[b++]=g:(g-=65536,_[b++]=55296|g>>10&1023,_[b++]=56320|1023&g)}return _.length!==b&&(_.subarray?_=_.subarray(0,b):_.length=b),i.applyFromCharCode(_)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(u,l),u.prototype.processChunk=function(f){var v=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=v;(v=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),v.set(h,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var b=(function(x,k){var _;for((k=k||x.length)>x.length&&(k=x.length),_=k-1;0<=_&&(192&x[_])==128;)_--;return _<0||_===0?k:_+c[x[_]]>k?_:k})(v),g=v;b!==v.length&&(s.uint8array?(g=v.subarray(0,b),this.leftOver=v.subarray(b,v.length)):(g=v.slice(0,b),this.leftOver=v.slice(b,v.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 x=[],k=0,_=h.length;if(_<=g)return String.fromCharCode.apply(null,h);for(;k<_;)b==="array"||b==="nodebuffer"?x.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+g,_)))):x.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+g,_)))),k+=g;return x.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),x=!0;if(g==="uint8array"?x=u.applyCanBeUsed.uint8array:g==="nodebuffer"&&(x=u.applyCanBeUsed.nodebuffer),x)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 v={};v.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return v.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},v.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)}},v.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))}},v.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)}},v.nodebuffer={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return v.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 v[g][h](b)},o.resolve=function(h){for(var b=h.split("/"),g=[],x=0;x<b.length;x++){var k=b[x];k==="."||k===""&&x!==0&&x!==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,x="";for(g=0;g<(h||"").length;g++)x+="\\x"+((b=h.charCodeAt(g))<16?"0":"")+b.toString(16).toUpperCase();return x},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,x,k){return l.Promise.resolve(b).then(function(_){return i.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,I){var A=new FileReader;A.onload=function(D){C(D.target.result)},A.onerror=function(D){I(D.target.error)},A.readAsArrayBuffer(_)}):_}).then(function(_){var C=o.getTypeOf(_);return C?(C==="arraybuffer"?_=o.transformTo("uint8array",_):C==="string"&&(k?_=s.decode(_):g&&x!==!0&&(_=(function(I){return d(I,i.uint8array?new Uint8Array(I.length):new Array(I.length))})(_))),_):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 v=this.reader.readString(4)===m;return this.reader.setIndex(f),v},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,v=this.zip64EndOfCentralSize-44;0<v;)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 v=m-f;if(0<v)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" 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,v){this.options=f,this.loadOptions=v}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var v,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((v=(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,v,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 v=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(v),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 v,h,b,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)v=f.readInt(2),h=f.readInt(2),b=f.readData(h),this.extraFields[v]={id:v,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 v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;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 v=i(f.value);return v.readInt(1)!==1||l(this.fileName)!==v.readInt(4)?null:c.utf8decode(v.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var v=i(f.value);return v.readInt(1)!==1||l(this.fileComment)!==v.readInt(4)?null:c.utf8decode(v.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(v,h,b){this.name=v,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(v){var h=null,b="string";try{if(!v)throw new Error("No output type specified.");var g=(b=v.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var x=!this._dataBinary;x&&!g&&(h=h.pipe(new l.Utf8EncodeWorker)),!x&&g&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(v,h){return this.internalStream(v).accumulate(h)},nodeStream:function(v,h){return this.internalStream(v||"nodebuffer").toNodejsStream(h)},_compressWorker:function(v,h){if(this._data instanceof c&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,v,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(v),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(){v(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(v,0)};else{var m=new i.MessageChannel;m.port1.onmessage=v,s=function(){m.port2.postMessage(0)}}var f=[];function v(){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 pt<"u"?pt: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,x,k){this.promise=g,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,x,k){i(function(){var _;try{_=x(k)}catch(C){return a.reject(g,C)}_===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,_)})}function v(g){var x=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof x=="function")return function(){x.apply(g,arguments)}}function h(g,x){var k=!1;function _(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var I=b(function(){x(C,_)});I.status==="error"&&_(I.value)}function b(g,x){var k={};try{k.value=g(x),k.status="success"}catch(_){k.status="error",k.value=_}return k}(n.exports=u).prototype.finally=function(g){if(typeof g!="function")return this;var x=this.constructor;return this.then(function(k){return x.resolve(g()).then(function(){return k})},function(k){return x.resolve(g()).then(function(){throw k})})},u.prototype.catch=function(g){return this.then(null,g)},u.prototype.then=function(g,x){if(typeof g!="function"&&this.state===c||typeof x!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===c?g:x,this.outcome):this.queue.push(new m(k,g,x)),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,x){var k=b(v,x);if(k.status==="error")return a.reject(g,k.value);var _=k.value;if(_)h(g,_);else{g.state=c,g.outcome=x;for(var C=-1,I=g.queue.length;++C<I;)g.queue[C].callFulfilled(x)}return g},a.reject=function(g,x){g.state=l,g.outcome=x;for(var k=-1,_=g.queue.length;++k<_;)g.queue[k].callRejected(x);return g},u.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},u.reject=function(g){var x=new this(s);return a.reject(x,g)},u.all=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=new Array(k),I=0,A=-1,D=new this(s);++A<k;)R(g[A],A);return D;function R(F,Y){x.resolve(F).then(function(N){C[Y]=N,++I!==k||_||(_=!0,a.resolve(D,C))},function(N){_||(_=!0,a.reject(D,N))})}},u.race=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=-1,I=new this(s);++C<k;)A=g[C],x.resolve(A).then(function(D){_||(_=!0,a.resolve(I,D))},function(D){_||(_=!0,a.reject(I,D))});var A;return I}},{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,v=8;function h(g){if(!(this instanceof h))return new h(g);this.options=s.assign({level:m,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.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,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(k!==u)throw new Error(l[k]);if(x.header&&i.deflateSetHeader(this.strm,x.header),x.dictionary){var _;if(_=typeof x.dictionary=="string"?a.string2buf(x.dictionary):d.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(k=i.deflateSetDictionary(this.strm,_))!==u)throw new Error(l[k]);this._dict_set=!0}}function b(g,x){var k=new h(x);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(g,x){var k,_,C=this.strm,I=this.options.chunkSize;if(this.ended)return!1;_=x===~~x?x:x===!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(I),C.next_out=0,C.avail_out=I),(k=i.deflate(C,_))!==1&&k!==u)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||_!==4&&_!==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 _===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===u):_!==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,x){return(x=x||{}).raw=!0,b(g,x)},o.gzip=function(g,x){return(x=x||{}).gzip=!0,b(g,x)}},{"./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 v(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,x,k,_,C,I,A=this.strm,D=this.options.chunkSize,R=this.options.dictionary,F=!1;if(this.ended)return!1;x=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(D),A.next_out=0,A.avail_out=D),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(I=typeof R=="string"?a.string2buf(R):m.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,g=i.inflateSetDictionary(this.strm,I)),g===l.Z_BUF_ERROR&&F===!0&&(g=l.Z_OK,F=!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||x!==l.Z_FINISH&&x!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),_=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=_,A.avail_out=D-_,_&&s.arraySet(A.output,A.output,k,_,0),this.onData(C)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(F=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(x=l.Z_FINISH),x===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):x!==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=v,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,v(h,b)},o.ungzip=v},{"./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,v;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(v=new Uint8Array(u),c=m=0,d=l.length;c<d;c++)f=l[c],v.set(f,m),m+=f.length;return v}},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="",v=0;v<m;v++)f+=String.fromCharCode(u[v]);return f}l[254]=l[254]=1,o.string2buf=function(u){var m,f,v,h,b,g=u.length,x=0;for(h=0;h<g;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-56320),h++),x+=f<128?1:f<2048?2:f<65536?3:4;for(m=new i.Buf8(x),h=b=0;b<x;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-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,v=m.length;f<v;f++)m[f]=u.charCodeAt(f);return m},o.buf2string=function(u,m){var f,v,h,b,g=m||u.length,x=new Array(2*g);for(f=v=0;f<g;)if((h=u[f++])<128)x[v++]=h;else if(4<(b=l[h]))x[v++]=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?x[v++]=65533:h<65536?x[v++]=h:(h-=65536,x[v++]=55296|h>>10&1023,x[v++]=56320|1023&h)}return d(x,v)},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,v=-2,h=-1,b=4,g=2,x=8,k=9,_=286,C=30,I=19,A=2*_+1,D=15,R=3,F=258,Y=F+R+1,N=42,M=113,y=1,B=2,te=3,U=4;function $(w,X){return w.msg=d[X],X}function Z(w){return(w<<1)-(4<w?9:0)}function ne(w){for(var X=w.length;0<=--X;)w[X]=0}function z(w){var X=w.state,H=X.pending;H>w.avail_out&&(H=w.avail_out),H!==0&&(s.arraySet(w.output,X.pending_buf,X.pending_out,H,w.next_out),w.next_out+=H,X.pending_out+=H,w.total_out+=H,w.avail_out-=H,X.pending-=H,X.pending===0&&(X.pending_out=0))}function L(w,X){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,X),w.block_start=w.strstart,z(w.strm)}function K(w,X){w.pending_buf[w.pending++]=X}function q(w,X){w.pending_buf[w.pending++]=X>>>8&255,w.pending_buf[w.pending++]=255&X}function ee(w,X){var H,T,S=w.max_chain_length,P=w.strstart,W=w.prev_length,G=w.nice_match,O=w.strstart>w.w_size-Y?w.strstart-(w.w_size-Y):0,V=w.window,J=w.w_mask,Q=w.prev,se=w.strstart+F,pe=V[P+W-1],he=V[P+W];w.prev_length>=w.good_match&&(S>>=2),G>w.lookahead&&(G=w.lookahead);do if(V[(H=X)+W]===he&&V[H+W-1]===pe&&V[H]===V[P]&&V[++H]===V[P+1]){P+=2,H++;do;while(V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&V[++P]===V[++H]&&P<se);if(T=F-(se-P),P=se-F,W<T){if(w.match_start=X,G<=(W=T))break;pe=V[P+W-1],he=V[P+W]}}while((X=Q[X&J])>O&&--S!=0);return W<=w.lookahead?W:w.lookahead}function ue(w){var X,H,T,S,P,W,G,O,V,J,Q=w.w_size;do{if(S=w.window_size-w.lookahead-w.strstart,w.strstart>=Q+(Q-Y)){for(s.arraySet(w.window,w.window,Q,Q,0),w.match_start-=Q,w.strstart-=Q,w.block_start-=Q,X=H=w.hash_size;T=w.head[--X],w.head[X]=Q<=T?T-Q:0,--H;);for(X=H=Q;T=w.prev[--X],w.prev[X]=Q<=T?T-Q:0,--H;);S+=Q}if(w.strm.avail_in===0)break;if(W=w.strm,G=w.window,O=w.strstart+w.lookahead,V=S,J=void 0,J=W.avail_in,V<J&&(J=V),H=J===0?0:(W.avail_in-=J,s.arraySet(G,W.input,W.next_in,J,O),W.state.wrap===1?W.adler=l(W.adler,G,J,O):W.state.wrap===2&&(W.adler=c(W.adler,G,J,O)),W.next_in+=J,W.total_in+=J,J),w.lookahead+=H,w.lookahead+w.insert>=R)for(P=w.strstart-w.insert,w.ins_h=w.window[P],w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+R-1])&w.hash_mask,w.prev[P&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=P,P++,w.insert--,!(w.lookahead+w.insert<R)););}while(w.lookahead<Y&&w.strm.avail_in!==0)}function re(w,X){for(var H,T;;){if(w.lookahead<Y){if(ue(w),w.lookahead<Y&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=R&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),H!==0&&w.strstart-H<=w.w_size-Y&&(w.match_length=ee(w,H)),w.match_length>=R)if(T=a._tr_tally(w,w.strstart-w.match_start,w.match_length-R),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=R){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else T=a._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(T&&(L(w,!1),w.strm.avail_out===0))return y}return w.insert=w.strstart<R-1?w.strstart:R-1,X===m?(L(w,!0),w.strm.avail_out===0?te:U):w.last_lit&&(L(w,!1),w.strm.avail_out===0)?y:B}function ie(w,X){for(var H,T,S;;){if(w.lookahead<Y){if(ue(w),w.lookahead<Y&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=R&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=R-1,H!==0&&w.prev_length<w.max_lazy_match&&w.strstart-H<=w.w_size-Y&&(w.match_length=ee(w,H),w.match_length<=5&&(w.strategy===1||w.match_length===R&&4096<w.strstart-w.match_start)&&(w.match_length=R-1)),w.prev_length>=R&&w.match_length<=w.prev_length){for(S=w.strstart+w.lookahead-R,T=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-R),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=S&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+R-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=R-1,w.strstart++,T&&(L(w,!1),w.strm.avail_out===0))return y}else if(w.match_available){if((T=a._tr_tally(w,0,w.window[w.strstart-1]))&&L(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return y}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(T=a._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<R-1?w.strstart:R-1,X===m?(L(w,!0),w.strm.avail_out===0?te:U):w.last_lit&&(L(w,!1),w.strm.avail_out===0)?y:B}function ae(w,X,H,T,S){this.good_length=w,this.max_lazy=X,this.nice_length=H,this.max_chain=T,this.func=S}function oe(){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=x,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*I+1)),ne(this.dyn_ltree),ne(this.dyn_dtree),ne(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(D+1),this.heap=new s.Buf16(2*_+1),ne(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*_+1),ne(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 le(w){var X;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=g,(X=w.state).pending=0,X.pending_out=0,X.wrap<0&&(X.wrap=-X.wrap),X.status=X.wrap?N:M,w.adler=X.wrap===2?0:1,X.last_flush=u,a._tr_init(X),f):$(w,v)}function fe(w){var X=le(w);return X===f&&(function(H){H.window_size=2*H.w_size,ne(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=R-1,H.match_available=0,H.ins_h=0})(w.state),X}function ve(w,X,H,T,S,P){if(!w)return v;var W=1;if(X===h&&(X=6),T<0?(W=0,T=-T):15<T&&(W=2,T-=16),S<1||k<S||H!==x||T<8||15<T||X<0||9<X||P<0||b<P)return $(w,v);T===8&&(T=9);var G=new oe;return(w.state=G).strm=w,G.wrap=W,G.gzhead=null,G.w_bits=T,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=S+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+R-1)/R),G.window=new s.Buf8(2*G.w_size),G.head=new s.Buf16(G.hash_size),G.prev=new s.Buf16(G.w_size),G.lit_bufsize=1<<S+6,G.pending_buf_size=4*G.lit_bufsize,G.pending_buf=new s.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=X,G.strategy=P,G.method=H,fe(w)}i=[new ae(0,0,0,0,function(w,X){var H=65535;for(H>w.pending_buf_size-5&&(H=w.pending_buf_size-5);;){if(w.lookahead<=1){if(ue(w),w.lookahead===0&&X===u)return y;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var T=w.block_start+H;if((w.strstart===0||w.strstart>=T)&&(w.lookahead=w.strstart-T,w.strstart=T,L(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-Y&&(L(w,!1),w.strm.avail_out===0))return y}return w.insert=0,X===m?(L(w,!0),w.strm.avail_out===0?te:U):(w.strstart>w.block_start&&(L(w,!1),w.strm.avail_out),y)}),new ae(4,4,8,4,re),new ae(4,5,16,8,re),new ae(4,6,32,32,re),new ae(4,4,16,16,ie),new ae(8,16,32,32,ie),new ae(8,16,128,128,ie),new ae(8,32,128,256,ie),new ae(32,128,258,1024,ie),new ae(32,258,258,4096,ie)],o.deflateInit=function(w,X){return ve(w,X,x,15,8,0)},o.deflateInit2=ve,o.deflateReset=fe,o.deflateResetKeep=le,o.deflateSetHeader=function(w,X){return w&&w.state?w.state.wrap!==2?v:(w.state.gzhead=X,f):v},o.deflate=function(w,X){var H,T,S,P;if(!w||!w.state||5<X||X<0)return w?$(w,v):v;if(T=w.state,!w.output||!w.input&&w.avail_in!==0||T.status===666&&X!==m)return $(w,w.avail_out===0?-5:v);if(T.strm=w,H=T.last_flush,T.last_flush=X,T.status===N)if(T.wrap===2)w.adler=0,K(T,31),K(T,139),K(T,8),T.gzhead?(K(T,(T.gzhead.text?1:0)+(T.gzhead.hcrc?2:0)+(T.gzhead.extra?4:0)+(T.gzhead.name?8:0)+(T.gzhead.comment?16:0)),K(T,255&T.gzhead.time),K(T,T.gzhead.time>>8&255),K(T,T.gzhead.time>>16&255),K(T,T.gzhead.time>>24&255),K(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),K(T,255&T.gzhead.os),T.gzhead.extra&&T.gzhead.extra.length&&(K(T,255&T.gzhead.extra.length),K(T,T.gzhead.extra.length>>8&255)),T.gzhead.hcrc&&(w.adler=c(w.adler,T.pending_buf,T.pending,0)),T.gzindex=0,T.status=69):(K(T,0),K(T,0),K(T,0),K(T,0),K(T,0),K(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),K(T,3),T.status=M);else{var W=x+(T.w_bits-8<<4)<<8;W|=(2<=T.strategy||T.level<2?0:T.level<6?1:T.level===6?2:3)<<6,T.strstart!==0&&(W|=32),W+=31-W%31,T.status=M,q(T,W),T.strstart!==0&&(q(T,w.adler>>>16),q(T,65535&w.adler)),w.adler=1}if(T.status===69)if(T.gzhead.extra){for(S=T.pending;T.gzindex<(65535&T.gzhead.extra.length)&&(T.pending!==T.pending_buf_size||(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending!==T.pending_buf_size));)K(T,255&T.gzhead.extra[T.gzindex]),T.gzindex++;T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),T.gzindex===T.gzhead.extra.length&&(T.gzindex=0,T.status=73)}else T.status=73;if(T.status===73)if(T.gzhead.name){S=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending===T.pending_buf_size)){P=1;break}P=T.gzindex<T.gzhead.name.length?255&T.gzhead.name.charCodeAt(T.gzindex++):0,K(T,P)}while(P!==0);T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),P===0&&(T.gzindex=0,T.status=91)}else T.status=91;if(T.status===91)if(T.gzhead.comment){S=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),z(w),S=T.pending,T.pending===T.pending_buf_size)){P=1;break}P=T.gzindex<T.gzhead.comment.length?255&T.gzhead.comment.charCodeAt(T.gzindex++):0,K(T,P)}while(P!==0);T.gzhead.hcrc&&T.pending>S&&(w.adler=c(w.adler,T.pending_buf,T.pending-S,S)),P===0&&(T.status=103)}else T.status=103;if(T.status===103&&(T.gzhead.hcrc?(T.pending+2>T.pending_buf_size&&z(w),T.pending+2<=T.pending_buf_size&&(K(T,255&w.adler),K(T,w.adler>>8&255),w.adler=0,T.status=M)):T.status=M),T.pending!==0){if(z(w),w.avail_out===0)return T.last_flush=-1,f}else if(w.avail_in===0&&Z(X)<=Z(H)&&X!==m)return $(w,-5);if(T.status===666&&w.avail_in!==0)return $(w,-5);if(w.avail_in!==0||T.lookahead!==0||X!==u&&T.status!==666){var G=T.strategy===2?(function(O,V){for(var J;;){if(O.lookahead===0&&(ue(O),O.lookahead===0)){if(V===u)return y;break}if(O.match_length=0,J=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,J&&(L(O,!1),O.strm.avail_out===0))return y}return O.insert=0,V===m?(L(O,!0),O.strm.avail_out===0?te:U):O.last_lit&&(L(O,!1),O.strm.avail_out===0)?y:B})(T,X):T.strategy===3?(function(O,V){for(var J,Q,se,pe,he=O.window;;){if(O.lookahead<=F){if(ue(O),O.lookahead<=F&&V===u)return y;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=R&&0<O.strstart&&(Q=he[se=O.strstart-1])===he[++se]&&Q===he[++se]&&Q===he[++se]){pe=O.strstart+F;do;while(Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&Q===he[++se]&&se<pe);O.match_length=F-(pe-se),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=R?(J=a._tr_tally(O,1,O.match_length-R),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(J=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),J&&(L(O,!1),O.strm.avail_out===0))return y}return O.insert=0,V===m?(L(O,!0),O.strm.avail_out===0?te:U):O.last_lit&&(L(O,!1),O.strm.avail_out===0)?y:B})(T,X):i[T.level].func(T,X);if(G!==te&&G!==U||(T.status=666),G===y||G===te)return w.avail_out===0&&(T.last_flush=-1),f;if(G===B&&(X===1?a._tr_align(T):X!==5&&(a._tr_stored_block(T,0,0,!1),X===3&&(ne(T.head),T.lookahead===0&&(T.strstart=0,T.block_start=0,T.insert=0))),z(w),w.avail_out===0))return T.last_flush=-1,f}return X!==m?f:T.wrap<=0?1:(T.wrap===2?(K(T,255&w.adler),K(T,w.adler>>8&255),K(T,w.adler>>16&255),K(T,w.adler>>24&255),K(T,255&w.total_in),K(T,w.total_in>>8&255),K(T,w.total_in>>16&255),K(T,w.total_in>>24&255)):(q(T,w.adler>>>16),q(T,65535&w.adler)),z(w),0<T.wrap&&(T.wrap=-T.wrap),T.pending!==0?f:1)},o.deflateEnd=function(w){var X;return w&&w.state?(X=w.state.status)!==N&&X!==69&&X!==73&&X!==91&&X!==103&&X!==M&&X!==666?$(w,v):(w.state=null,X===M?$(w,-3):f):v},o.deflateSetDictionary=function(w,X){var H,T,S,P,W,G,O,V,J=X.length;if(!w||!w.state||(P=(H=w.state).wrap)===2||P===1&&H.status!==N||H.lookahead)return v;for(P===1&&(w.adler=l(w.adler,X,J,0)),H.wrap=0,J>=H.w_size&&(P===0&&(ne(H.head),H.strstart=0,H.block_start=0,H.insert=0),V=new s.Buf8(H.w_size),s.arraySet(V,X,J-H.w_size,H.w_size,0),X=V,J=H.w_size),W=w.avail_in,G=w.next_in,O=w.input,w.avail_in=J,w.next_in=0,w.input=X,ue(H);H.lookahead>=R;){for(T=H.strstart,S=H.lookahead-(R-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[T+R-1])&H.hash_mask,H.prev[T&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=T,T++,--S;);H.strstart=T,H.lookahead=R-1,ue(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=R-1,H.match_available=0,w.next_in=G,w.input=O,w.avail_in=W,H.wrap=P,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,v,h,b,g,x,k,_,C,I,A,D,R,F,Y,N,M,y,B;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,B=i.output,u=d-(s-i.avail_out),m=d+(i.avail_out-257),f=a.dmax,v=a.wsize,h=a.whave,b=a.wnext,g=a.window,x=a.hold,k=a.bits,_=a.lencode,C=a.distcode,I=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),D=_[x&I];t:for(;;){if(x>>>=R=D>>>24,k-=R,(R=D>>>16&255)===0)B[d++]=65535&D;else{if(!(16&R)){if((64&R)==0){D=_[(65535&D)+(x&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}F=65535&D,(R&=15)&&(k<R&&(x+=y[l++]<<k,k+=8),F+=x&(1<<R)-1,x>>>=R,k-=R),k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),D=C[x&A];r:for(;;){if(x>>>=R=D>>>24,k-=R,!(16&(R=D>>>16&255))){if((64&R)==0){D=C[(65535&D)+(x&(1<<R)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(Y=65535&D,k<(R&=15)&&(x+=y[l++]<<k,(k+=8)<R&&(x+=y[l++]<<k,k+=8)),f<(Y+=x&(1<<R)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(x>>>=R,k-=R,(R=d-u)<Y){if(h<(R=Y-R)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=g,(N=0)===b){if(N+=v-R,R<F){for(F-=R;B[d++]=g[N++],--R;);N=d-Y,M=B}}else if(b<R){if(N+=v+b-R,(R-=b)<F){for(F-=R;B[d++]=g[N++],--R;);if(N=0,b<F){for(F-=R=b;B[d++]=g[N++],--R;);N=d-Y,M=B}}}else if(N+=b-R,R<F){for(F-=R;B[d++]=g[N++],--R;);N=d-Y,M=B}for(;2<F;)B[d++]=M[N++],B[d++]=M[N++],B[d++]=M[N++],F-=3;F&&(B[d++]=M[N++],1<F&&(B[d++]=M[N++]))}else{for(N=d-Y;B[d++]=B[N++],B[d++]=B[N++],B[d++]=B[N++],2<(F-=3););F&&(B[d++]=B[N++],1<F&&(B[d++]=B[N++]))}break}}break}}while(l<c&&d<m);l-=F=k>>3,x&=(1<<(k-=F<<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=x,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,v=1,h=852,b=592;function g(N){return(N>>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function x(){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(N){var M;return N&&N.state?(M=N.state,N.total_in=N.total_out=M.total=0,N.msg="",M.wrap&&(N.adler=1&M.wrap),M.mode=v,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(h),M.distcode=M.distdyn=new i.Buf32(b),M.sane=1,M.back=-1,m):f}function _(N){var M;return N&&N.state?((M=N.state).wsize=0,M.whave=0,M.wnext=0,k(N)):f}function C(N,M){var y,B;return N&&N.state?(B=N.state,M<0?(y=0,M=-M):(y=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?f:(B.window!==null&&B.wbits!==M&&(B.window=null),B.wrap=y,B.wbits=M,_(N))):f}function I(N,M){var y,B;return N?(B=new x,(N.state=B).window=null,(y=C(N,M))!==m&&(N.state=null),y):f}var A,D,R=!0;function F(N){if(R){var M;for(A=new i.Buf32(512),D=new i.Buf32(32),M=0;M<144;)N.lens[M++]=8;for(;M<256;)N.lens[M++]=9;for(;M<280;)N.lens[M++]=7;for(;M<288;)N.lens[M++]=8;for(c(d,N.lens,0,288,A,0,N.work,{bits:9}),M=0;M<32;)N.lens[M++]=5;c(u,N.lens,0,32,D,0,N.work,{bits:5}),R=!1}N.lencode=A,N.lenbits=9,N.distcode=D,N.distbits=5}function Y(N,M,y,B){var te,U=N.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new i.Buf8(U.wsize)),B>=U.wsize?(i.arraySet(U.window,M,y-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(B<(te=U.wsize-U.wnext)&&(te=B),i.arraySet(U.window,M,y-B,te,U.wnext),(B-=te)?(i.arraySet(U.window,M,y-B,B,0),U.wnext=B,U.whave=U.wsize):(U.wnext+=te,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=te))),0}o.inflateReset=_,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(N){return I(N,15)},o.inflateInit2=I,o.inflate=function(N,M){var y,B,te,U,$,Z,ne,z,L,K,q,ee,ue,re,ie,ae,oe,le,fe,ve,w,X,H,T,S=0,P=new i.Buf8(4),W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return f;(y=N.state).mode===12&&(y.mode=13),$=N.next_out,te=N.output,ne=N.avail_out,U=N.next_in,B=N.input,Z=N.avail_in,z=y.hold,L=y.bits,K=Z,q=ne,X=m;e:for(;;)switch(y.mode){case v:if(y.wrap===0){y.mode=13;break}for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(2&y.wrap&&z===35615){P[y.check=0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0),L=z=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",y.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",y.mode=30;break}if(L-=4,w=8+(15&(z>>>=4)),y.wbits===0)y.wbits=w;else if(w>y.wbits){N.msg="invalid window size",y.mode=30;break}y.dmax=1<<w,N.adler=y.check=1,y.mode=512&z?10:12,L=z=0;break;case 2:for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(y.flags=z,(255&y.flags)!=8){N.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){N.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=z>>8&1),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0,y.mode=3;case 3:for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.head&&(y.head.time=z),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,P[2]=z>>>16&255,P[3]=z>>>24&255,y.check=a(y.check,P,4,0)),L=z=0,y.mode=4;case 4:for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.head&&(y.head.xflags=255&z,y.head.os=z>>8),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0,y.mode=5;case 5:if(1024&y.flags){for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.length=z,y.head&&(y.head.extra_len=z),512&y.flags&&(P[0]=255&z,P[1]=z>>>8&255,y.check=a(y.check,P,2,0)),L=z=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Z<(ee=y.length)&&(ee=Z),ee&&(y.head&&(w=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,B,U,ee,w)),512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,y.length-=ee),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Z===0)break e;for(ee=0;w=B[U+ee++],y.head&&w&&y.length<65536&&(y.head.name+=String.fromCharCode(w)),w&&ee<Z;);if(512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,w)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Z===0)break e;for(ee=0;w=B[U+ee++],y.head&&w&&y.length<65536&&(y.head.comment+=String.fromCharCode(w)),w&&ee<Z;);if(512&y.flags&&(y.check=a(y.check,B,ee,U)),Z-=ee,U+=ee,w)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;L<16;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z!==(65535&y.check)){N.msg="header crc mismatch",y.mode=30;break}L=z=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),N.adler=y.check=0,y.mode=12;break;case 10:for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}N.adler=y.check=g(z),L=z=0,y.mode=11;case 11:if(y.havedict===0)return N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,2;N.adler=y.check=1,y.mode=12;case 12:if(M===5||M===6)break e;case 13:if(y.last){z>>>=7&L,L-=7&L,y.mode=27;break}for(;L<3;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}switch(y.last=1&z,L-=1,3&(z>>>=1)){case 0:y.mode=14;break;case 1:if(F(y),y.mode=20,M!==6)break;z>>>=2,L-=2;break e;case 2:y.mode=17;break;case 3:N.msg="invalid block type",y.mode=30}z>>>=2,L-=2;break;case 14:for(z>>>=7&L,L-=7&L;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if((65535&z)!=(z>>>16^65535)){N.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&z,L=z=0,y.mode=15,M===6)break e;case 15:y.mode=16;case 16:if(ee=y.length){if(Z<ee&&(ee=Z),ne<ee&&(ee=ne),ee===0)break e;i.arraySet(te,B,U,ee,$),Z-=ee,U+=ee,ne-=ee,$+=ee,y.length-=ee;break}y.mode=12;break;case 17:for(;L<14;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(y.nlen=257+(31&z),z>>>=5,L-=5,y.ndist=1+(31&z),z>>>=5,L-=5,y.ncode=4+(15&z),z>>>=4,L-=4,286<y.nlen||30<y.ndist){N.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(;L<3;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.lens[W[y.have++]]=7&z,z>>>=3,L-=3}for(;y.have<19;)y.lens[W[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,H={bits:y.lenbits},X=c(0,y.lens,0,19,y.lencode,0,y.work,H),y.lenbits=H.bits,X){N.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(;ae=(S=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(oe<16)z>>>=ie,L-=ie,y.lens[y.have++]=oe;else{if(oe===16){for(T=ie+2;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z>>>=ie,L-=ie,y.have===0){N.msg="invalid bit length repeat",y.mode=30;break}w=y.lens[y.have-1],ee=3+(3&z),z>>>=2,L-=2}else if(oe===17){for(T=ie+3;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}L-=ie,w=0,ee=3+(7&(z>>>=ie)),z>>>=3,L-=3}else{for(T=ie+7;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}L-=ie,w=0,ee=11+(127&(z>>>=ie)),z>>>=7,L-=7}if(y.have+ee>y.nlen+y.ndist){N.msg="invalid bit length repeat",y.mode=30;break}for(;ee--;)y.lens[y.have++]=w}}if(y.mode===30)break;if(y.lens[256]===0){N.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,H={bits:y.lenbits},X=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,H),y.lenbits=H.bits,X){N.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,H={bits:y.distbits},X=c(u,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,H),y.distbits=H.bits,X){N.msg="invalid distances set",y.mode=30;break}if(y.mode=20,M===6)break e;case 20:y.mode=21;case 21:if(6<=Z&&258<=ne){N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,l(N,q),$=N.next_out,te=N.output,ne=N.avail_out,U=N.next_in,B=N.input,Z=N.avail_in,z=y.hold,L=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ae=(S=y.lencode[z&(1<<y.lenbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(ae&&(240&ae)==0){for(le=ie,fe=ae,ve=oe;ae=(S=y.lencode[ve+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&S,!(le+(ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}z>>>=le,L-=le,y.back+=le}if(z>>>=ie,L-=ie,y.back+=ie,y.length=oe,ae===0){y.mode=26;break}if(32&ae){y.back=-1,y.mode=12;break}if(64&ae){N.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ae,y.mode=22;case 22:if(y.extra){for(T=y.extra;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.length+=z&(1<<y.extra)-1,z>>>=y.extra,L-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ae=(S=y.distcode[z&(1<<y.distbits)-1])>>>16&255,oe=65535&S,!((ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if((240&ae)==0){for(le=ie,fe=ae,ve=oe;ae=(S=y.distcode[ve+((z&(1<<le+fe)-1)>>le)])>>>16&255,oe=65535&S,!(le+(ie=S>>>24)<=L);){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}z>>>=le,L-=le,y.back+=le}if(z>>>=ie,L-=ie,y.back+=ie,64&ae){N.msg="invalid distance code",y.mode=30;break}y.offset=oe,y.extra=15&ae,y.mode=24;case 24:if(y.extra){for(T=y.extra;L<T;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}y.offset+=z&(1<<y.extra)-1,z>>>=y.extra,L-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){N.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(ne===0)break e;if(ee=q-ne,y.offset>ee){if((ee=y.offset-ee)>y.whave&&y.sane){N.msg="invalid distance too far back",y.mode=30;break}ue=ee>y.wnext?(ee-=y.wnext,y.wsize-ee):y.wnext-ee,ee>y.length&&(ee=y.length),re=y.window}else re=te,ue=$-y.offset,ee=y.length;for(ne<ee&&(ee=ne),ne-=ee,y.length-=ee;te[$++]=re[ue++],--ee;);y.length===0&&(y.mode=21);break;case 26:if(ne===0)break e;te[$++]=y.length,ne--,y.mode=21;break;case 27:if(y.wrap){for(;L<32;){if(Z===0)break e;Z--,z|=B[U++]<<L,L+=8}if(q-=ne,N.total_out+=q,y.total+=q,q&&(N.adler=y.check=y.flags?a(y.check,te,q,$-q):s(y.check,te,q,$-q)),q=ne,(y.flags?z:g(z))!==y.check){N.msg="incorrect data check",y.mode=30;break}L=z=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;L<32;){if(Z===0)break e;Z--,z+=B[U++]<<L,L+=8}if(z!==(4294967295&y.total)){N.msg="incorrect length check",y.mode=30;break}L=z=0}y.mode=29;case 29:X=1;break e;case 30:X=-3;break e;case 31:return-4;case 32:default:return f}return N.next_out=$,N.avail_out=ne,N.next_in=U,N.avail_in=Z,y.hold=z,y.bits=L,(y.wsize||q!==N.avail_out&&y.mode<30&&(y.mode<27||M!==4))&&Y(N,N.output,N.next_out,q-N.avail_out)?(y.mode=31,-4):(K-=N.avail_in,q-=N.avail_out,N.total_in+=K,N.total_out+=q,y.total+=q,y.wrap&&q&&(N.adler=y.check=y.flags?a(y.check,te,q,N.next_out-q):s(y.check,te,q,N.next_out-q)),N.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(K==0&&q===0||M===4)&&X===m&&(X=-5),X)},o.inflateEnd=function(N){if(!N||!N.state)return f;var M=N.state;return M.window&&(M.window=null),N.state=null,m},o.inflateGetHeader=function(N,M){var y;return N&&N.state?(2&(y=N.state).wrap)==0?f:((y.head=M).done=!1,m):f},o.inflateSetDictionary=function(N,M){var y,B=M.length;return N&&N.state?(y=N.state).wrap!==0&&y.mode!==11?f:y.mode===11&&s(1,M,B,0)!==y.check?-3:Y(N,M,B,B)?(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,v,h,b,g){var x,k,_,C,I,A,D,R,F,Y=g.bits,N=0,M=0,y=0,B=0,te=0,U=0,$=0,Z=0,ne=0,z=0,L=null,K=0,q=new i.Buf16(16),ee=new i.Buf16(16),ue=null,re=0;for(N=0;N<=15;N++)q[N]=0;for(M=0;M<f;M++)q[u[m+M]]++;for(te=Y,B=15;1<=B&&q[B]===0;B--);if(B<te&&(te=B),B===0)return v[h++]=20971520,v[h++]=20971520,g.bits=1,0;for(y=1;y<B&&q[y]===0;y++);for(te<y&&(te=y),N=Z=1;N<=15;N++)if(Z<<=1,(Z-=q[N])<0)return-1;if(0<Z&&(d===0||B!==1))return-1;for(ee[1]=0,N=1;N<15;N++)ee[N+1]=ee[N]+q[N];for(M=0;M<f;M++)u[m+M]!==0&&(b[ee[u[m+M]]++]=M);if(A=d===0?(L=ue=b,19):d===1?(L=s,K-=257,ue=a,re-=257,256):(L=l,ue=c,-1),N=y,I=h,$=M=z=0,_=-1,C=(ne=1<<(U=te))-1,d===1&&852<ne||d===2&&592<ne)return 1;for(;;){for(D=N-$,F=b[M]<A?(R=0,b[M]):b[M]>A?(R=ue[re+b[M]],L[K+b[M]]):(R=96,0),x=1<<N-$,y=k=1<<U;v[I+(z>>$)+(k-=x)]=D<<24|R<<16|F|0,k!==0;);for(x=1<<N-1;z&x;)x>>=1;if(x!==0?(z&=x-1,z+=x):z=0,M++,--q[N]==0){if(N===B)break;N=u[m+b[M]]}if(te<N&&(z&C)!==_){for($===0&&($=te),I+=y,Z=1<<(U=N-$);U+$<B&&!((Z-=q[U+$])<=0);)U++,Z<<=1;if(ne+=1<<U,d===1&&852<ne||d===2&&592<ne)return 1;v[_=z&C]=te<<24|U<<16|I-h|0}}return z!==0&&(v[I+z]=N-$<<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(S){for(var P=S.length;0<=--P;)S[P]=0}var c=0,d=29,u=256,m=u+1+d,f=30,v=19,h=2*m+1,b=15,g=16,x=7,k=256,_=16,C=17,I=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],D=[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],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=new Array(2*(m+2));l(Y);var N=new Array(2*f);l(N);var M=new Array(512);l(M);var y=new Array(256);l(y);var B=new Array(d);l(B);var te,U,$,Z=new Array(f);function ne(S,P,W,G,O){this.static_tree=S,this.extra_bits=P,this.extra_base=W,this.elems=G,this.max_length=O,this.has_stree=S&&S.length}function z(S,P){this.dyn_tree=S,this.max_code=0,this.stat_desc=P}function L(S){return S<256?M[S]:M[256+(S>>>7)]}function K(S,P){S.pending_buf[S.pending++]=255&P,S.pending_buf[S.pending++]=P>>>8&255}function q(S,P,W){S.bi_valid>g-W?(S.bi_buf|=P<<S.bi_valid&65535,K(S,S.bi_buf),S.bi_buf=P>>g-S.bi_valid,S.bi_valid+=W-g):(S.bi_buf|=P<<S.bi_valid&65535,S.bi_valid+=W)}function ee(S,P,W){q(S,W[2*P],W[2*P+1])}function ue(S,P){for(var W=0;W|=1&S,S>>>=1,W<<=1,0<--P;);return W>>>1}function re(S,P,W){var G,O,V=new Array(b+1),J=0;for(G=1;G<=b;G++)V[G]=J=J+W[G-1]<<1;for(O=0;O<=P;O++){var Q=S[2*O+1];Q!==0&&(S[2*O]=ue(V[Q]++,Q))}}function ie(S){var P;for(P=0;P<m;P++)S.dyn_ltree[2*P]=0;for(P=0;P<f;P++)S.dyn_dtree[2*P]=0;for(P=0;P<v;P++)S.bl_tree[2*P]=0;S.dyn_ltree[2*k]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function ae(S){8<S.bi_valid?K(S,S.bi_buf):0<S.bi_valid&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function oe(S,P,W,G){var O=2*P,V=2*W;return S[O]<S[V]||S[O]===S[V]&&G[P]<=G[W]}function le(S,P,W){for(var G=S.heap[W],O=W<<1;O<=S.heap_len&&(O<S.heap_len&&oe(P,S.heap[O+1],S.heap[O],S.depth)&&O++,!oe(P,G,S.heap[O],S.depth));)S.heap[W]=S.heap[O],W=O,O<<=1;S.heap[W]=G}function fe(S,P,W){var G,O,V,J,Q=0;if(S.last_lit!==0)for(;G=S.pending_buf[S.d_buf+2*Q]<<8|S.pending_buf[S.d_buf+2*Q+1],O=S.pending_buf[S.l_buf+Q],Q++,G===0?ee(S,O,P):(ee(S,(V=y[O])+u+1,P),(J=A[V])!==0&&q(S,O-=B[V],J),ee(S,V=L(--G),W),(J=D[V])!==0&&q(S,G-=Z[V],J)),Q<S.last_lit;);ee(S,k,P)}function ve(S,P){var W,G,O,V=P.dyn_tree,J=P.stat_desc.static_tree,Q=P.stat_desc.has_stree,se=P.stat_desc.elems,pe=-1;for(S.heap_len=0,S.heap_max=h,W=0;W<se;W++)V[2*W]!==0?(S.heap[++S.heap_len]=pe=W,S.depth[W]=0):V[2*W+1]=0;for(;S.heap_len<2;)V[2*(O=S.heap[++S.heap_len]=pe<2?++pe:0)]=1,S.depth[O]=0,S.opt_len--,Q&&(S.static_len-=J[2*O+1]);for(P.max_code=pe,W=S.heap_len>>1;1<=W;W--)le(S,V,W);for(O=se;W=S.heap[1],S.heap[1]=S.heap[S.heap_len--],le(S,V,1),G=S.heap[1],S.heap[--S.heap_max]=W,S.heap[--S.heap_max]=G,V[2*O]=V[2*W]+V[2*G],S.depth[O]=(S.depth[W]>=S.depth[G]?S.depth[W]:S.depth[G])+1,V[2*W+1]=V[2*G+1]=O,S.heap[1]=O++,le(S,V,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],(function(he,Ae){var Se,ze,St,Ee,sr,Pt,Ze=Ae.dyn_tree,Yn=Ae.max_code,Zn=Ae.stat_desc.static_tree,mi=Ae.stat_desc.has_stree,gi=Ae.stat_desc.extra_bits,Gn=Ae.stat_desc.extra_base,Ne=Ae.stat_desc.max_length,Ie=0;for(Ee=0;Ee<=b;Ee++)he.bl_count[Ee]=0;for(Ze[2*he.heap[he.heap_max]+1]=0,Se=he.heap_max+1;Se<h;Se++)Ne<(Ee=Ze[2*Ze[2*(ze=he.heap[Se])+1]+1]+1)&&(Ee=Ne,Ie++),Ze[2*ze+1]=Ee,Yn<ze||(he.bl_count[Ee]++,sr=0,Gn<=ze&&(sr=gi[ze-Gn]),Pt=Ze[2*ze],he.opt_len+=Pt*(Ee+sr),mi&&(he.static_len+=Pt*(Zn[2*ze+1]+sr)));if(Ie!==0){do{for(Ee=Ne-1;he.bl_count[Ee]===0;)Ee--;he.bl_count[Ee]--,he.bl_count[Ee+1]+=2,he.bl_count[Ne]--,Ie-=2}while(0<Ie);for(Ee=Ne;Ee!==0;Ee--)for(ze=he.bl_count[Ee];ze!==0;)Yn<(St=he.heap[--Se])||(Ze[2*St+1]!==Ee&&(he.opt_len+=(Ee-Ze[2*St+1])*Ze[2*St],Ze[2*St+1]=Ee),ze--)}})(S,P),re(V,pe,S.bl_count)}function w(S,P,W){var G,O,V=-1,J=P[1],Q=0,se=7,pe=4;for(J===0&&(se=138,pe=3),P[2*(W+1)+1]=65535,G=0;G<=W;G++)O=J,J=P[2*(G+1)+1],++Q<se&&O===J||(Q<pe?S.bl_tree[2*O]+=Q:O!==0?(O!==V&&S.bl_tree[2*O]++,S.bl_tree[2*_]++):Q<=10?S.bl_tree[2*C]++:S.bl_tree[2*I]++,V=O,pe=(Q=0)===J?(se=138,3):O===J?(se=6,3):(se=7,4))}function X(S,P,W){var G,O,V=-1,J=P[1],Q=0,se=7,pe=4;for(J===0&&(se=138,pe=3),G=0;G<=W;G++)if(O=J,J=P[2*(G+1)+1],!(++Q<se&&O===J)){if(Q<pe)for(;ee(S,O,S.bl_tree),--Q!=0;);else O!==0?(O!==V&&(ee(S,O,S.bl_tree),Q--),ee(S,_,S.bl_tree),q(S,Q-3,2)):Q<=10?(ee(S,C,S.bl_tree),q(S,Q-3,3)):(ee(S,I,S.bl_tree),q(S,Q-11,7));V=O,pe=(Q=0)===J?(se=138,3):O===J?(se=6,3):(se=7,4)}}l(Z);var H=!1;function T(S,P,W,G){q(S,(c<<1)+(G?1:0),3),(function(O,V,J,Q){ae(O),K(O,J),K(O,~J),i.arraySet(O.pending_buf,O.window,V,J,O.pending),O.pending+=J})(S,P,W)}o._tr_init=function(S){H||((function(){var P,W,G,O,V,J=new Array(b+1);for(O=G=0;O<d-1;O++)for(B[O]=G,P=0;P<1<<A[O];P++)y[G++]=O;for(y[G-1]=O,O=V=0;O<16;O++)for(Z[O]=V,P=0;P<1<<D[O];P++)M[V++]=O;for(V>>=7;O<f;O++)for(Z[O]=V<<7,P=0;P<1<<D[O]-7;P++)M[256+V++]=O;for(W=0;W<=b;W++)J[W]=0;for(P=0;P<=143;)Y[2*P+1]=8,P++,J[8]++;for(;P<=255;)Y[2*P+1]=9,P++,J[9]++;for(;P<=279;)Y[2*P+1]=7,P++,J[7]++;for(;P<=287;)Y[2*P+1]=8,P++,J[8]++;for(re(Y,m+1,J),P=0;P<f;P++)N[2*P+1]=5,N[2*P]=ue(P,5);te=new ne(Y,A,u+1,m,b),U=new ne(N,D,0,f,b),$=new ne(new Array(0),R,0,v,x)})(),H=!0),S.l_desc=new z(S.dyn_ltree,te),S.d_desc=new z(S.dyn_dtree,U),S.bl_desc=new z(S.bl_tree,$),S.bi_buf=0,S.bi_valid=0,ie(S)},o._tr_stored_block=T,o._tr_flush_block=function(S,P,W,G){var O,V,J=0;0<S.level?(S.strm.data_type===2&&(S.strm.data_type=(function(Q){var se,pe=4093624447;for(se=0;se<=31;se++,pe>>>=1)if(1&pe&&Q.dyn_ltree[2*se]!==0)return s;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return a;for(se=32;se<u;se++)if(Q.dyn_ltree[2*se]!==0)return a;return s})(S)),ve(S,S.l_desc),ve(S,S.d_desc),J=(function(Q){var se;for(w(Q,Q.dyn_ltree,Q.l_desc.max_code),w(Q,Q.dyn_dtree,Q.d_desc.max_code),ve(Q,Q.bl_desc),se=v-1;3<=se&&Q.bl_tree[2*F[se]+1]===0;se--);return Q.opt_len+=3*(se+1)+5+5+4,se})(S),O=S.opt_len+3+7>>>3,(V=S.static_len+3+7>>>3)<=O&&(O=V)):O=V=W+5,W+4<=O&&P!==-1?T(S,P,W,G):S.strategy===4||V===O?(q(S,2+(G?1:0),3),fe(S,Y,N)):(q(S,4+(G?1:0),3),(function(Q,se,pe,he){var Ae;for(q(Q,se-257,5),q(Q,pe-1,5),q(Q,he-4,4),Ae=0;Ae<he;Ae++)q(Q,Q.bl_tree[2*F[Ae]+1],3);X(Q,Q.dyn_ltree,se-1),X(Q,Q.dyn_dtree,pe-1)})(S,S.l_desc.max_code+1,S.d_desc.max_code+1,J+1),fe(S,S.dyn_ltree,S.dyn_dtree)),ie(S),G&&ae(S)},o._tr_tally=function(S,P,W){return S.pending_buf[S.d_buf+2*S.last_lit]=P>>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&P,S.pending_buf[S.l_buf+S.last_lit]=255&W,S.last_lit++,P===0?S.dyn_ltree[2*W]++:(S.matches++,P--,S.dyn_ltree[2*(y[W]+u+1)]++,S.dyn_dtree[2*L(P)]++),S.last_lit===S.lit_bufsize-1},o._tr_align=function(S){q(S,2,3),ee(S,k,Y),(function(P){P.bi_valid===16?(K(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)})(S)}},{"../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={},v=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(_){process.nextTick(function(){x(_)})}:(function(){if(s.postMessage&&!s.importScripts){var _=!0,C=s.onmessage;return s.onmessage=function(){_=!1},s.postMessage("","*"),s.onmessage=C,_}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(_){s.postMessage(u+_,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){x(_.data)},function(_){d.port2.postMessage(_)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(_){var C=h.createElement("script");C.onreadystatechange=function(){x(_),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(_){setTimeout(x,0,_)},b.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),I=0;I<C.length;I++)C[I]=arguments[I+1];var A={callback:_,args:C};return f[m]=A,l(m),m++},b.clearImmediate=g}function g(_){delete f[_]}function x(_){if(v)setTimeout(x,0,_);else{var C=f[_];if(C){v=!0;try{(function(I){var A=I.callback,D=I.args;switch(D.length){case 0:A();break;case 1:A(D[0]);break;case 2:A(D[0],D[1]);break;case 3:A(D[0],D[1],D[2]);break;default:A.apply(a,D)}})(C)}finally{g(_),v=!1}}}}function k(_){_.source===s&&typeof _.data=="string"&&_.data.indexOf(u)===0&&x(+_.data.slice(u.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof pt<"u"?pt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Kn)),Kn.exports}var Dc=Ic();const Rc=Pc(Dc);var Mr={exports:{}},Lc=Mr.exports,xi;function Mc(){return xi||(xi=1,(function(e,t){(function(r,n){n()})(Lc,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 pt=="object"&&pt.global===pt?pt: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",v=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||f&&v||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,x=g.createObjectURL(c);m?m.location=x:location.href=x,m=null,setTimeout(function(){g.revokeObjectURL(x)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Mr)),Mr.exports}var yi=Mc();const ki=async(e,t)=>{const r=new Rc,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"});yi.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},_i=(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"});yi.saveAs(c,`${t}.html`)};function Si(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=Si(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Si(e))&&(n&&(n+=" "),n+=t);return n}const Bc=(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},Uc=(e,t)=>({classGroupId:e,validator:t}),Ci=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Fr="-",Ei=[],Wc="arbitrary..",$c=e=>{const t=Vc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Hc(s);const a=s.split(Fr),l=a[0]===""&&a.length>1?1:0;return Ni(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Bc(c,l):l:c||Ei}return r[s]||Ei}}},Ni=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Ni(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}},Hc=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?Wc+n:void 0})(),Vc=e=>{const{theme:t,classGroups:r}=e;return Yc(r,t)},Yc=(e,t)=>{const r=Ci();for(const n in e){const o=e[n];Xn(o,r,n,t)}return r},Xn=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Zc(s,t,r,n)}},Zc=(e,t,r,n)=>{if(typeof e=="string"){Gc(e,t,r);return}if(typeof e=="function"){Kc(e,t,r,n);return}Xc(e,t,r,n)},Gc=(e,t,r)=>{const n=e===""?t:Ai(t,e);n.classGroupId=r},Kc=(e,t,r,n)=>{if(qc(e)){Xn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Uc(r,e))},Xc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Xn(l,Ai(t,a),r,n)}},Ai=(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=Ci(),r.nextPart.set(s,a)),r=a}return r},qc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Jc=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="!",zi=":",Qc=[],ji=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),ed=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===zi){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 v=c&&c>l?c-l:void 0;return ji(i,f,m,v)};if(t){const o=t+zi,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):ji(Qc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},td=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}},rd=e=>({cache:Jc(e.cacheSize),parseClassName:ed(e),sortModifiers:td(e),...$c(e)}),nd=/\s+/,od=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(nd);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:h}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let b=!!h,g=n(b?v.substring(0,h):v);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=n(v),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const x=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=f?x+qn:x,_=k+g;if(s.indexOf(_)>-1)continue;s.push(_);const C=o(g,b);for(let I=0;I<C.length;++I){const A=C[I];s.push(k+A)}l=d+(l.length>0?" "+l:l)}return l},id=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ti(r))&&(o&&(o+=" "),o+=n);return o},Ti=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ti(e[n]))&&(r&&(r+=" "),r+=t);return r},sd=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,u)=>u(d),e());return r=rd(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=od(l,r);return o(l,d),d};return i=s,(...l)=>i(id(...l))},ad=[],Te=e=>{const t=r=>r[e]||ad;return t.isThemeGetter=!0,t},Oi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ld=/^\d+\/\d+$/,cd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dd=/\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$/,ud=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>ld.test(e),ge=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),Jn=e=>e.endsWith("%")&&ge(e.slice(0,-1)),lt=e=>cd.test(e),pd=()=>!0,md=e=>dd.test(e)&&!ud.test(e),Ii=()=>!1,gd=e=>fd.test(e),bd=e=>hd.test(e),vd=e=>!ce(e)&&!de(e),wd=e=>Dt(e,Fi,Ii),ce=e=>Oi.test(e),At=e=>Dt(e,Bi,md),Qn=e=>Dt(e,Sd,ge),Di=e=>Dt(e,Li,Ii),xd=e=>Dt(e,Mi,bd),Br=e=>Dt(e,Ui,gd),de=e=>Pi.test(e),lr=e=>Rt(e,Bi),yd=e=>Rt(e,Cd),Ri=e=>Rt(e,Li),kd=e=>Rt(e,Fi),_d=e=>Rt(e,Mi),Ur=e=>Rt(e,Ui,!0),Dt=(e,t,r)=>{const n=Oi.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Rt=(e,t,r=!1)=>{const n=Pi.exec(e);return n?n[1]?t(n[1]):r:!1},Li=e=>e==="position"||e==="percentage",Mi=e=>e==="image"||e==="url",Fi=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",Sd=e=>e==="number",Cd=e=>e==="family-name",Ui=e=>e==="shadow",Ed=sd(()=>{const e=Te("color"),t=Te("font"),r=Te("text"),n=Te("font-weight"),o=Te("tracking"),i=Te("leading"),s=Te("breakpoint"),a=Te("container"),l=Te("spacing"),c=Te("radius"),d=Te("shadow"),u=Te("inset-shadow"),m=Te("text-shadow"),f=Te("drop-shadow"),v=Te("blur"),h=Te("perspective"),b=Te("aspect"),g=Te("ease"),x=Te("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),de,ce],I=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[de,ce,l],R=()=>[It,"full","auto",...D()],F=()=>[mt,"none","subgrid",de,ce],Y=()=>["auto",{span:["full",mt,de,ce]},mt,de,ce],N=()=>[mt,"auto",de,ce],M=()=>["auto","min","max","fr",de,ce],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...D()],U=()=>[It,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],$=()=>[e,de,ce],Z=()=>[..._(),Ri,Di,{position:[de,ce]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",kd,wd,{size:[de,ce]}],L=()=>[Jn,lr,At],K=()=>["","none","full",c,de,ce],q=()=>["",ge,lr,At],ee=()=>["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"],re=()=>[ge,Jn,Ri,Di],ie=()=>["","none",v,de,ce],ae=()=>["none",ge,de,ce],oe=()=>["none",ge,de,ce],le=()=>[ge,de,ce],fe=()=>[It,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[pd],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[vd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",ge],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",It,ce,de,b]}],container:["container"],columns:[{columns:[ge,ce,de,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:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",de,ce]}],basis:[{basis:[It,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ge,It,"auto","initial","none",ce]}],grow:[{grow:["",ge,de,ce]}],shrink:[{shrink:["",ge,de,ce]}],order:[{order:[mt,"first","last","none",de,ce]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],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":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,lr,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,de,Qn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jn,ce]}],"font-family":[{font:[yd,ce,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,de,ce]}],"line-clamp":[{"line-clamp":[ge,"none",de,Qn]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",de,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[ge,"from-font","auto",de,At]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[ge,"auto",de,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ce]}],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",de,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,de,ce],radial:["",de,ce],conic:[mt,de,ce]},_d,xd]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ge,de,ce]}],"outline-w":[{outline:["",ge,lr,At]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,Ur,Br]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",u,Ur,Br]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[ge,At]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,Ur,Br]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[ge,de,ce]}],"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":[ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[de,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ce]}],filter:[{filter:["","none",de,ce]}],blur:[{blur:ie()}],brightness:[{brightness:[ge,de,ce]}],contrast:[{contrast:[ge,de,ce]}],"drop-shadow":[{"drop-shadow":["","none",f,Ur,Br]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",ge,de,ce]}],"hue-rotate":[{"hue-rotate":[ge,de,ce]}],invert:[{invert:["",ge,de,ce]}],saturate:[{saturate:[ge,de,ce]}],sepia:[{sepia:["",ge,de,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ce]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ge,de,ce]}],"backdrop-contrast":[{"backdrop-contrast":[ge,de,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ge,de,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ge,de,ce]}],"backdrop-invert":[{"backdrop-invert":["",ge,de,ce]}],"backdrop-opacity":[{"backdrop-opacity":[ge,de,ce]}],"backdrop-saturate":[{"backdrop-saturate":[ge,de,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",ge,de,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ge,"initial",de,ce]}],ease:[{ease:["linear","initial",g,de,ce]}],delay:[{delay:[ge,de,ce]}],animate:[{animate:["none",x,de,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,de,ce]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[de,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",de,ce]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",de,ce]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[ge,lr,At,Qn]}],stroke:[{stroke:["none",...$()]}],"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 me(...e){return Ed(Fc(e))}var Wr={exports:{}},cr={};/**
11
+ */var ki;function Rc(){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 Dr=="function"&&Dr;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(v){var h=n[c][1][v];return s(h||v)},f,f.exports,r,n,o,i)}return o[c].exports}for(var a=typeof Dr=="function"&&Dr,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,v,h,b=[],g=0,x=l.length,k=x,_=i.getTypeOf(l)!=="string";g<l.length;)k=x-g,u=_?(c=l[g++],d=g<x?l[g++]:0,g<x?l[g++]:0):(c=l.charCodeAt(g++),d=g<x?l.charCodeAt(g++):0,g<x?l.charCodeAt(g++):0),m=c>>2,f=(3&c)<<4|d>>4,v=1<k?(15&d)<<2|u>>6:64,h=2<k?63&u:64,b.push(a.charAt(m)+a.charAt(f)+a.charAt(v)+a.charAt(h));return b.join("")},o.decode=function(l){var c,d,u,m,f,v,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 x,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(x=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|(v=a.indexOf(l.charAt(h++))),x[b++]=c,f!==64&&(x[b++]=d),v!==64&&(x[b++]=u);return x}},{"./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,v){this.compressedSize=d,this.uncompressedSize=u,this.crc32=m,this.compression=f,this.compressedContent=v}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,v=m+u;c^=-1;for(var h=m;h<v;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,v=m+u;c^=-1;for(var h=m;h<v;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,v){var h,b="";for(h=0;h<v;h++)b+=String.fromCharCode(255&f),f>>>=8;return b}function s(f,v,h,b,g,x){var k,_,C=f.file,T=f.compression,A=x!==c.utf8encode,I=a.transformTo("string",x(C.name)),D=a.transformTo("string",c.utf8encode(C.name)),B=C.comment,Z=a.transformTo("string",x(B)),z=a.transformTo("string",c.utf8encode(B)),F=D.length!==C.name.length,y=z.length!==B.length,U="",ee="",W="",V=C.dir,Y=C.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};v&&!h||(oe.crc32=f.crc32,oe.compressedSize=f.compressedSize,oe.uncompressedSize=f.uncompressedSize);var N=0;v&&(N|=8),A||!F&&!y||(N|=2048);var R=0,G=0;V&&(R|=16),g==="UNIX"?(G=798,R|=(function(J,ue){var Q=J;return J||(Q=ue?16893:33204),(65535&Q)<<16})(C.unixPermissions,V)):(G=20,R|=(function(J){return 63&(J||0)})(C.dosPermissions)),k=Y.getUTCHours(),k<<=6,k|=Y.getUTCMinutes(),k<<=5,k|=Y.getUTCSeconds()/2,_=Y.getUTCFullYear()-1980,_<<=4,_|=Y.getUTCMonth()+1,_<<=5,_|=Y.getUTCDate(),F&&(ee=i(1,1)+i(d(I),4)+D,U+="up"+i(ee.length,2)+ee),y&&(W=i(1,1)+i(d(Z),4)+z,U+="uc"+i(W.length,2)+W);var q="";return q+=`
12
+ \0`,q+=i(N,2),q+=T.magic,q+=i(k,2),q+=i(_,2),q+=i(oe.crc32,4),q+=i(oe.compressedSize,4),q+=i(oe.uncompressedSize,4),q+=i(I.length,2),q+=i(U.length,2),{fileRecord:u.LOCAL_FILE_HEADER+q+I+U,dirRecord:u.CENTRAL_FILE_HEADER+i(G,2)+q+i(Z.length,2)+"\0\0\0\0"+i(R,4)+i(b,4)+I+U+Z}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),u=r("../signature");function m(f,v,h,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,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 v=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?(v+100*(h-b-1))/h:100}}))},m.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var v=this.streamFiles&&!f.file.dir;if(v){var h=s(f,v,!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 v=this.streamFiles&&!f.file.dir,h=s(f,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),v)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,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var h=this.bytesWritten-f,b=(function(g,x,k,_,C){var T=a.transformTo("string",C(_));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(x,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 v=this;return f.on("data",function(h){v.processChunk(h)}),f.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),f.on("error",function(h){v.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 v=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var h=0;h<v.length;h++)try{v[h].error(f)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,v=0;v<f.length;v++)f[v].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 v=(function(x,k){var _=x||k,C=i[_];if(!C)throw new Error(_+" 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(v,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,v){var h=m.decompressed.getContentWorker().pipe(new c);h.on("error",function(b){v(b)}).on("end",function(){h.streamInfo.crc32!==m.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}n.exports=function(m,f){var v=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 x=0;x<g.length;x++)b.push(u(g[x]));return s.Promise.all(b)}).then(function(h){for(var b=h.shift(),g=b.files,x=0;x<g.length;x++){var k=g[x],_=k.fileNameStr,C=i.resolve(k.fileNameStr);v.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||(v.file(C).unsafeOriginalName=_)}return b.zipComment.length&&(v.comment=b.zipComment),v})}},{"./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 I,D=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&&(I=b(C))&&x.call(this,I,!0);var Z=D==="string"&&B.binary===!1&&B.base64===!1;A&&A.binary!==void 0||(B.binary=!Z),(T instanceof u&&T.uncompressedSize===0||B.dir||!T||T.length===0)&&(B.base64=!1,B.binary=!0,T="",B.compression="STORE",D="string");var z=null;z=T instanceof u||T instanceof l?T:v.isNode&&v.isStream(T)?new h(C,T):a.prepareContent(C,T,B.binary,B.optimizedBinaryString,B.base64);var F=new m(C,z,B);this.files[C]=F}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"),v=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},x=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 _={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,I;for(T in this.files)I=this.files[T],(A=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&C(A,I)},filter:function(C){var T=[];return this.forEach(function(A,I){C(A,I)&&T.push(I)}),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 I=C;return this.filter(function(B,Z){return!Z.dir&&I.test(B)})}var D=this.files[this.root+C];return D&&!D.dir?D:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(D,B){return B.dir&&C.test(D)});var T=this.root+C,A=x.call(this,T),I=this.clone();return I.root=A.name,I},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(D,B){return B.name.slice(0,C.length)===C}),I=0;I<A.length;I++)delete this.files[A[I].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 I=A.comment||this.comment||"";T=f.generateWorker(this,A,I)}catch(D){(T=new l("error")).error(D)}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=_},{"./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(v,h){return new d.Promise(function(b,g){var x=[],k=v._internalType,_=v._outputType,C=v._mimeType;v.on("data",function(T,A){x.push(T),h&&h(A)}).on("error",function(T){x=[],g(T)}).on("end",function(){try{var T=(function(A,I,D){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),D);case"base64":return l.encode(I);default:return i.transformTo(A,I)}})(_,(function(A,I){var D,B=0,Z=null,z=0;for(D=0;D<I.length;D++)z+=I[D].length;switch(A){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(Z=new Uint8Array(z),D=0;D<I.length;D++)Z.set(I[D],B),B+=I[D].length;return Z;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,x),C);b(T)}catch(A){g(A)}x=[]}).resume()})}function f(v,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=v.pipe(new s(g)),v.lock()}catch(x){this._worker=new a("error"),this._worker.error(x)}}f.prototype={accumulate:function(v){return m(this,v)},on:function(v,h){var b=this;return v==="data"?this._worker.on(v,function(g){h.call(b,g.data,g.meta)}):this._worker.on(v,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(v){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"},v)}},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(v){var h,b,g,x,k,_=v.length,C=0;for(x=0;x<_;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),C+=b<128?1:b<2048?2:b<65536?3:4;for(h=s.uint8array?new Uint8Array(C):new Array(C),x=k=0;k<C;x++)(64512&(b=v.charCodeAt(x)))==55296&&x+1<_&&(64512&(g=v.charCodeAt(x+1)))==56320&&(b=65536+(b-55296<<10)+(g-56320),x++),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(v){var h,b,g,x,k=v.length,_=new Array(2*k);for(h=b=0;h<k;)if((g=v[h++])<128)_[b++]=g;else if(4<(x=c[g]))_[b++]=65533,h+=x-1;else{for(g&=x===2?31:x===3?15:7;1<x&&h<k;)g=g<<6|63&v[h++],x--;1<x?_[b++]=65533:g<65536?_[b++]=g:(g-=65536,_[b++]=55296|g>>10&1023,_[b++]=56320|1023&g)}return _.length!==b&&(_.subarray?_=_.subarray(0,b):_.length=b),i.applyFromCharCode(_)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(u,l),u.prototype.processChunk=function(f){var v=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var h=v;(v=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),v.set(h,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var b=(function(x,k){var _;for((k=k||x.length)>x.length&&(k=x.length),_=k-1;0<=_&&(192&x[_])==128;)_--;return _<0||_===0?k:_+c[x[_]]>k?_:k})(v),g=v;b!==v.length&&(s.uint8array?(g=v.subarray(0,b),this.leftOver=v.subarray(b,v.length)):(g=v.slice(0,b),this.leftOver=v.slice(b,v.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 x=[],k=0,_=h.length;if(_<=g)return String.fromCharCode.apply(null,h);for(;k<_;)b==="array"||b==="nodebuffer"?x.push(String.fromCharCode.apply(null,h.slice(k,Math.min(k+g,_)))):x.push(String.fromCharCode.apply(null,h.subarray(k,Math.min(k+g,_)))),k+=g;return x.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),x=!0;if(g==="uint8array"?x=u.applyCanBeUsed.uint8array:g==="nodebuffer"&&(x=u.applyCanBeUsed.nodebuffer),x)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 v={};v.string={string:c,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return v.string.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:function(h){return d(h,a.allocBuffer(h.length))}},v.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)}},v.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))}},v.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)}},v.nodebuffer={string:m,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return v.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 v[g][h](b)},o.resolve=function(h){for(var b=h.split("/"),g=[],x=0;x<b.length;x++){var k=b[x];k==="."||k===""&&x!==0&&x!==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,x="";for(g=0;g<(h||"").length;g++)x+="\\x"+((b=h.charCodeAt(g))<16?"0":"")+b.toString(16).toUpperCase();return x},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,x,k){return l.Promise.resolve(b).then(function(_){return i.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,T){var A=new FileReader;A.onload=function(I){C(I.target.result)},A.onerror=function(I){T(I.target.error)},A.readAsArrayBuffer(_)}):_}).then(function(_){var C=o.getTypeOf(_);return C?(C==="arraybuffer"?_=o.transformTo("uint8array",_):C==="string"&&(k?_=s.decode(_):g&&x!==!0&&(_=(function(T){return d(T,i.uint8array?new Uint8Array(T.length):new Array(T.length))})(_))),_):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 v=this.reader.readString(4)===m;return this.reader.setIndex(f),v},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,v=this.zip64EndOfCentralSize-44;0<v;)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 v=m-f;if(0<v)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" 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,v){this.options=f,this.loadOptions=v}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var v,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((v=(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,v,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 v=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(v),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 v,h,b,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)v=f.readInt(2),h=f.readInt(2),b=f.readData(h),this.extraFields[v]={id:v,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 v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;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 v=i(f.value);return v.readInt(1)!==1||l(this.fileName)!==v.readInt(4)?null:c.utf8decode(v.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var v=i(f.value);return v.readInt(1)!==1||l(this.fileComment)!==v.readInt(4)?null:c.utf8decode(v.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(v,h,b){this.name=v,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(v){var h=null,b="string";try{if(!v)throw new Error("No output type specified.");var g=(b=v.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),h=this._decompressWorker();var x=!this._dataBinary;x&&!g&&(h=h.pipe(new l.Utf8EncodeWorker)),!x&&g&&(h=h.pipe(new l.Utf8DecodeWorker))}catch(k){(h=new d("error")).error(k)}return new s(h,b,"")},async:function(v,h){return this.internalStream(v).accumulate(h)},nodeStream:function(v,h){return this.internalStream(v||"nodebuffer").toNodejsStream(h)},_compressWorker:function(v,h){if(this._data instanceof c&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(b,v,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(v),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(){v(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},i.document.documentElement.appendChild(h)}:function(){setTimeout(v,0)};else{var m=new i.MessageChannel;m.port1.onmessage=v,s=function(){m.port2.postMessage(0)}}var f=[];function v(){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 pt<"u"?pt: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,x,k){this.promise=g,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,x,k){i(function(){var _;try{_=x(k)}catch(C){return a.reject(g,C)}_===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,_)})}function v(g){var x=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof x=="function")return function(){x.apply(g,arguments)}}function h(g,x){var k=!1;function _(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var T=b(function(){x(C,_)});T.status==="error"&&_(T.value)}function b(g,x){var k={};try{k.value=g(x),k.status="success"}catch(_){k.status="error",k.value=_}return k}(n.exports=u).prototype.finally=function(g){if(typeof g!="function")return this;var x=this.constructor;return this.then(function(k){return x.resolve(g()).then(function(){return k})},function(k){return x.resolve(g()).then(function(){throw k})})},u.prototype.catch=function(g){return this.then(null,g)},u.prototype.then=function(g,x){if(typeof g!="function"&&this.state===c||typeof x!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===c?g:x,this.outcome):this.queue.push(new m(k,g,x)),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,x){var k=b(v,x);if(k.status==="error")return a.reject(g,k.value);var _=k.value;if(_)h(g,_);else{g.state=c,g.outcome=x;for(var C=-1,T=g.queue.length;++C<T;)g.queue[C].callFulfilled(x)}return g},a.reject=function(g,x){g.state=l,g.outcome=x;for(var k=-1,_=g.queue.length;++k<_;)g.queue[k].callRejected(x);return g},u.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},u.reject=function(g){var x=new this(s);return a.reject(x,g)},u.all=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=new Array(k),T=0,A=-1,I=new this(s);++A<k;)D(g[A],A);return I;function D(B,Z){x.resolve(B).then(function(z){C[Z]=z,++T!==k||_||(_=!0,a.resolve(I,C))},function(z){_||(_=!0,a.reject(I,z))})}},u.race=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,_=!1;if(!k)return this.resolve([]);for(var C=-1,T=new this(s);++C<k;)A=g[C],x.resolve(A).then(function(I){_||(_=!0,a.resolve(T,I))},function(I){_||(_=!0,a.reject(T,I))});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,v=8;function h(g){if(!(this instanceof h))return new h(g);this.options=s.assign({level:m,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.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,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(k!==u)throw new Error(l[k]);if(x.header&&i.deflateSetHeader(this.strm,x.header),x.dictionary){var _;if(_=typeof x.dictionary=="string"?a.string2buf(x.dictionary):d.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(k=i.deflateSetDictionary(this.strm,_))!==u)throw new Error(l[k]);this._dict_set=!0}}function b(g,x){var k=new h(x);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}h.prototype.push=function(g,x){var k,_,C=this.strm,T=this.options.chunkSize;if(this.ended)return!1;_=x===~~x?x:x===!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,_))!==1&&k!==u)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||_!==4&&_!==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 _===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===u):_!==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,x){return(x=x||{}).raw=!0,b(g,x)},o.gzip=function(g,x){return(x=x||{}).gzip=!0,b(g,x)}},{"./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 v(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,x,k,_,C,T,A=this.strm,I=this.options.chunkSize,D=this.options.dictionary,B=!1;if(this.ended)return!1;x=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(I),A.next_out=0,A.avail_out=I),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&D&&(T=typeof D=="string"?a.string2buf(D):m.call(D)==="[object ArrayBuffer]"?new Uint8Array(D):D,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||x!==l.Z_FINISH&&x!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),_=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=_,A.avail_out=I-_,_&&s.arraySet(A.output,A.output,k,_,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&&(x=l.Z_FINISH),x===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):x!==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=v,o.inflateRaw=function(h,b){return(b=b||{}).raw=!0,v(h,b)},o.ungzip=v},{"./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,v;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(v=new Uint8Array(u),c=m=0,d=l.length;c<d;c++)f=l[c],v.set(f,m),m+=f.length;return v}},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="",v=0;v<m;v++)f+=String.fromCharCode(u[v]);return f}l[254]=l[254]=1,o.string2buf=function(u){var m,f,v,h,b,g=u.length,x=0;for(h=0;h<g;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-56320),h++),x+=f<128?1:f<2048?2:f<65536?3:4;for(m=new i.Buf8(x),h=b=0;b<x;h++)(64512&(f=u.charCodeAt(h)))==55296&&h+1<g&&(64512&(v=u.charCodeAt(h+1)))==56320&&(f=65536+(f-55296<<10)+(v-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,v=m.length;f<v;f++)m[f]=u.charCodeAt(f);return m},o.buf2string=function(u,m){var f,v,h,b,g=m||u.length,x=new Array(2*g);for(f=v=0;f<g;)if((h=u[f++])<128)x[v++]=h;else if(4<(b=l[h]))x[v++]=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?x[v++]=65533:h<65536?x[v++]=h:(h-=65536,x[v++]=55296|h>>10&1023,x[v++]=56320|1023&h)}return d(x,v)},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,v=-2,h=-1,b=4,g=2,x=8,k=9,_=286,C=30,T=19,A=2*_+1,I=15,D=3,B=258,Z=B+D+1,z=42,F=113,y=1,U=2,ee=3,W=4;function V(w,X){return w.msg=d[X],X}function Y(w){return(w<<1)-(4<w?9:0)}function oe(w){for(var X=w.length;0<=--X;)w[X]=0}function N(w){var X=w.state,H=X.pending;H>w.avail_out&&(H=w.avail_out),H!==0&&(s.arraySet(w.output,X.pending_buf,X.pending_out,H,w.next_out),w.next_out+=H,X.pending_out+=H,w.total_out+=H,w.avail_out-=H,X.pending-=H,X.pending===0&&(X.pending_out=0))}function R(w,X){a._tr_flush_block(w,0<=w.block_start?w.block_start:-1,w.strstart-w.block_start,X),w.block_start=w.strstart,N(w.strm)}function G(w,X){w.pending_buf[w.pending++]=X}function q(w,X){w.pending_buf[w.pending++]=X>>>8&255,w.pending_buf[w.pending++]=255&X}function J(w,X){var H,O,S=w.max_chain_length,P=w.strstart,$=w.prev_length,M=w.nice_match,L=w.strstart>w.w_size-Z?w.strstart-(w.w_size-Z):0,K=w.window,te=w.w_mask,re=w.prev,se=w.strstart+B,he=K[P+$-1],me=K[P+$];w.prev_length>=w.good_match&&(S>>=2),M>w.lookahead&&(M=w.lookahead);do if(K[(H=X)+$]===me&&K[H+$-1]===he&&K[H]===K[P]&&K[++H]===K[P+1]){P+=2,H++;do;while(K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&K[++P]===K[++H]&&P<se);if(O=B-(se-P),P=se-B,$<O){if(w.match_start=X,M<=($=O))break;he=K[P+$-1],me=K[P+$]}}while((X=re[X&te])>L&&--S!=0);return $<=w.lookahead?$:w.lookahead}function ue(w){var X,H,O,S,P,$,M,L,K,te,re=w.w_size;do{if(S=w.window_size-w.lookahead-w.strstart,w.strstart>=re+(re-Z)){for(s.arraySet(w.window,w.window,re,re,0),w.match_start-=re,w.strstart-=re,w.block_start-=re,X=H=w.hash_size;O=w.head[--X],w.head[X]=re<=O?O-re:0,--H;);for(X=H=re;O=w.prev[--X],w.prev[X]=re<=O?O-re:0,--H;);S+=re}if(w.strm.avail_in===0)break;if($=w.strm,M=w.window,L=w.strstart+w.lookahead,K=S,te=void 0,te=$.avail_in,K<te&&(te=K),H=te===0?0:($.avail_in-=te,s.arraySet(M,$.input,$.next_in,te,L),$.state.wrap===1?$.adler=l($.adler,M,te,L):$.state.wrap===2&&($.adler=c($.adler,M,te,L)),$.next_in+=te,$.total_in+=te,te),w.lookahead+=H,w.lookahead+w.insert>=D)for(P=w.strstart-w.insert,w.ins_h=w.window[P],w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+1])&w.hash_mask;w.insert&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[P+D-1])&w.hash_mask,w.prev[P&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=P,P++,w.insert--,!(w.lookahead+w.insert<D)););}while(w.lookahead<Z&&w.strm.avail_in!==0)}function Q(w,X){for(var H,O;;){if(w.lookahead<Z){if(ue(w),w.lookahead<Z&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=D&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+D-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),H!==0&&w.strstart-H<=w.w_size-Z&&(w.match_length=J(w,H)),w.match_length>=D)if(O=a._tr_tally(w,w.strstart-w.match_start,w.match_length-D),w.lookahead-=w.match_length,w.match_length<=w.max_lazy_match&&w.lookahead>=D){for(w.match_length--;w.strstart++,w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+D-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart,--w.match_length!=0;);w.strstart++}else w.strstart+=w.match_length,w.match_length=0,w.ins_h=w.window[w.strstart],w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+1])&w.hash_mask;else O=a._tr_tally(w,0,w.window[w.strstart]),w.lookahead--,w.strstart++;if(O&&(R(w,!1),w.strm.avail_out===0))return y}return w.insert=w.strstart<D-1?w.strstart:D-1,X===m?(R(w,!0),w.strm.avail_out===0?ee:W):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?y:U}function ie(w,X){for(var H,O,S;;){if(w.lookahead<Z){if(ue(w),w.lookahead<Z&&X===u)return y;if(w.lookahead===0)break}if(H=0,w.lookahead>=D&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+D-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),w.prev_length=w.match_length,w.prev_match=w.match_start,w.match_length=D-1,H!==0&&w.prev_length<w.max_lazy_match&&w.strstart-H<=w.w_size-Z&&(w.match_length=J(w,H),w.match_length<=5&&(w.strategy===1||w.match_length===D&&4096<w.strstart-w.match_start)&&(w.match_length=D-1)),w.prev_length>=D&&w.match_length<=w.prev_length){for(S=w.strstart+w.lookahead-D,O=a._tr_tally(w,w.strstart-1-w.prev_match,w.prev_length-D),w.lookahead-=w.prev_length-1,w.prev_length-=2;++w.strstart<=S&&(w.ins_h=(w.ins_h<<w.hash_shift^w.window[w.strstart+D-1])&w.hash_mask,H=w.prev[w.strstart&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=w.strstart),--w.prev_length!=0;);if(w.match_available=0,w.match_length=D-1,w.strstart++,O&&(R(w,!1),w.strm.avail_out===0))return y}else if(w.match_available){if((O=a._tr_tally(w,0,w.window[w.strstart-1]))&&R(w,!1),w.strstart++,w.lookahead--,w.strm.avail_out===0)return y}else w.match_available=1,w.strstart++,w.lookahead--}return w.match_available&&(O=a._tr_tally(w,0,w.window[w.strstart-1]),w.match_available=0),w.insert=w.strstart<D-1?w.strstart:D-1,X===m?(R(w,!0),w.strm.avail_out===0?ee:W):w.last_lit&&(R(w,!1),w.strm.avail_out===0)?y:U}function ae(w,X,H,O,S){this.good_length=w,this.max_lazy=X,this.nice_length=H,this.max_chain=O,this.func=S}function ne(){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=x,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(I+1),this.heap=new s.Buf16(2*_+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*_+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 de(w){var X;return w&&w.state?(w.total_in=w.total_out=0,w.data_type=g,(X=w.state).pending=0,X.pending_out=0,X.wrap<0&&(X.wrap=-X.wrap),X.status=X.wrap?z:F,w.adler=X.wrap===2?0:1,X.last_flush=u,a._tr_init(X),f):V(w,v)}function fe(w){var X=de(w);return X===f&&(function(H){H.window_size=2*H.w_size,oe(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=D-1,H.match_available=0,H.ins_h=0})(w.state),X}function we(w,X,H,O,S,P){if(!w)return v;var $=1;if(X===h&&(X=6),O<0?($=0,O=-O):15<O&&($=2,O-=16),S<1||k<S||H!==x||O<8||15<O||X<0||9<X||P<0||b<P)return V(w,v);O===8&&(O=9);var M=new ne;return(w.state=M).strm=w,M.wrap=$,M.gzhead=null,M.w_bits=O,M.w_size=1<<M.w_bits,M.w_mask=M.w_size-1,M.hash_bits=S+7,M.hash_size=1<<M.hash_bits,M.hash_mask=M.hash_size-1,M.hash_shift=~~((M.hash_bits+D-1)/D),M.window=new s.Buf8(2*M.w_size),M.head=new s.Buf16(M.hash_size),M.prev=new s.Buf16(M.w_size),M.lit_bufsize=1<<S+6,M.pending_buf_size=4*M.lit_bufsize,M.pending_buf=new s.Buf8(M.pending_buf_size),M.d_buf=1*M.lit_bufsize,M.l_buf=3*M.lit_bufsize,M.level=X,M.strategy=P,M.method=H,fe(w)}i=[new ae(0,0,0,0,function(w,X){var H=65535;for(H>w.pending_buf_size-5&&(H=w.pending_buf_size-5);;){if(w.lookahead<=1){if(ue(w),w.lookahead===0&&X===u)return y;if(w.lookahead===0)break}w.strstart+=w.lookahead,w.lookahead=0;var O=w.block_start+H;if((w.strstart===0||w.strstart>=O)&&(w.lookahead=w.strstart-O,w.strstart=O,R(w,!1),w.strm.avail_out===0)||w.strstart-w.block_start>=w.w_size-Z&&(R(w,!1),w.strm.avail_out===0))return y}return w.insert=0,X===m?(R(w,!0),w.strm.avail_out===0?ee:W):(w.strstart>w.block_start&&(R(w,!1),w.strm.avail_out),y)}),new ae(4,4,8,4,Q),new ae(4,5,16,8,Q),new ae(4,6,32,32,Q),new ae(4,4,16,16,ie),new ae(8,16,32,32,ie),new ae(8,16,128,128,ie),new ae(8,32,128,256,ie),new ae(32,128,258,1024,ie),new ae(32,258,258,4096,ie)],o.deflateInit=function(w,X){return we(w,X,x,15,8,0)},o.deflateInit2=we,o.deflateReset=fe,o.deflateResetKeep=de,o.deflateSetHeader=function(w,X){return w&&w.state?w.state.wrap!==2?v:(w.state.gzhead=X,f):v},o.deflate=function(w,X){var H,O,S,P;if(!w||!w.state||5<X||X<0)return w?V(w,v):v;if(O=w.state,!w.output||!w.input&&w.avail_in!==0||O.status===666&&X!==m)return V(w,w.avail_out===0?-5:v);if(O.strm=w,H=O.last_flush,O.last_flush=X,O.status===z)if(O.wrap===2)w.adler=0,G(O,31),G(O,139),G(O,8),O.gzhead?(G(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)),G(O,255&O.gzhead.time),G(O,O.gzhead.time>>8&255),G(O,O.gzhead.time>>16&255),G(O,O.gzhead.time>>24&255),G(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),G(O,255&O.gzhead.os),O.gzhead.extra&&O.gzhead.extra.length&&(G(O,255&O.gzhead.extra.length),G(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(w.adler=c(w.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=69):(G(O,0),G(O,0),G(O,0),G(O,0),G(O,0),G(O,O.level===9?2:2<=O.strategy||O.level<2?4:0),G(O,3),O.status=F);else{var $=x+(O.w_bits-8<<4)<<8;$|=(2<=O.strategy||O.level<2?0:O.level<6?1:O.level===6?2:3)<<6,O.strstart!==0&&($|=32),$+=31-$%31,O.status=F,q(O,$),O.strstart!==0&&(q(O,w.adler>>>16),q(O,65535&w.adler)),w.adler=1}if(O.status===69)if(O.gzhead.extra){for(S=O.pending;O.gzindex<(65535&O.gzhead.extra.length)&&(O.pending!==O.pending_buf_size||(O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),N(w),S=O.pending,O.pending!==O.pending_buf_size));)G(O,255&O.gzhead.extra[O.gzindex]),O.gzindex++;O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),O.gzindex===O.gzhead.extra.length&&(O.gzindex=0,O.status=73)}else O.status=73;if(O.status===73)if(O.gzhead.name){S=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),N(w),S=O.pending,O.pending===O.pending_buf_size)){P=1;break}P=O.gzindex<O.gzhead.name.length?255&O.gzhead.name.charCodeAt(O.gzindex++):0,G(O,P)}while(P!==0);O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),P===0&&(O.gzindex=0,O.status=91)}else O.status=91;if(O.status===91)if(O.gzhead.comment){S=O.pending;do{if(O.pending===O.pending_buf_size&&(O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),N(w),S=O.pending,O.pending===O.pending_buf_size)){P=1;break}P=O.gzindex<O.gzhead.comment.length?255&O.gzhead.comment.charCodeAt(O.gzindex++):0,G(O,P)}while(P!==0);O.gzhead.hcrc&&O.pending>S&&(w.adler=c(w.adler,O.pending_buf,O.pending-S,S)),P===0&&(O.status=103)}else O.status=103;if(O.status===103&&(O.gzhead.hcrc?(O.pending+2>O.pending_buf_size&&N(w),O.pending+2<=O.pending_buf_size&&(G(O,255&w.adler),G(O,w.adler>>8&255),w.adler=0,O.status=F)):O.status=F),O.pending!==0){if(N(w),w.avail_out===0)return O.last_flush=-1,f}else if(w.avail_in===0&&Y(X)<=Y(H)&&X!==m)return V(w,-5);if(O.status===666&&w.avail_in!==0)return V(w,-5);if(w.avail_in!==0||O.lookahead!==0||X!==u&&O.status!==666){var M=O.strategy===2?(function(L,K){for(var te;;){if(L.lookahead===0&&(ue(L),L.lookahead===0)){if(K===u)return y;break}if(L.match_length=0,te=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++,te&&(R(L,!1),L.strm.avail_out===0))return y}return L.insert=0,K===m?(R(L,!0),L.strm.avail_out===0?ee:W):L.last_lit&&(R(L,!1),L.strm.avail_out===0)?y:U})(O,X):O.strategy===3?(function(L,K){for(var te,re,se,he,me=L.window;;){if(L.lookahead<=B){if(ue(L),L.lookahead<=B&&K===u)return y;if(L.lookahead===0)break}if(L.match_length=0,L.lookahead>=D&&0<L.strstart&&(re=me[se=L.strstart-1])===me[++se]&&re===me[++se]&&re===me[++se]){he=L.strstart+B;do;while(re===me[++se]&&re===me[++se]&&re===me[++se]&&re===me[++se]&&re===me[++se]&&re===me[++se]&&re===me[++se]&&re===me[++se]&&se<he);L.match_length=B-(he-se),L.match_length>L.lookahead&&(L.match_length=L.lookahead)}if(L.match_length>=D?(te=a._tr_tally(L,1,L.match_length-D),L.lookahead-=L.match_length,L.strstart+=L.match_length,L.match_length=0):(te=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++),te&&(R(L,!1),L.strm.avail_out===0))return y}return L.insert=0,K===m?(R(L,!0),L.strm.avail_out===0?ee:W):L.last_lit&&(R(L,!1),L.strm.avail_out===0)?y:U})(O,X):i[O.level].func(O,X);if(M!==ee&&M!==W||(O.status=666),M===y||M===ee)return w.avail_out===0&&(O.last_flush=-1),f;if(M===U&&(X===1?a._tr_align(O):X!==5&&(a._tr_stored_block(O,0,0,!1),X===3&&(oe(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),N(w),w.avail_out===0))return O.last_flush=-1,f}return X!==m?f:O.wrap<=0?1:(O.wrap===2?(G(O,255&w.adler),G(O,w.adler>>8&255),G(O,w.adler>>16&255),G(O,w.adler>>24&255),G(O,255&w.total_in),G(O,w.total_in>>8&255),G(O,w.total_in>>16&255),G(O,w.total_in>>24&255)):(q(O,w.adler>>>16),q(O,65535&w.adler)),N(w),0<O.wrap&&(O.wrap=-O.wrap),O.pending!==0?f:1)},o.deflateEnd=function(w){var X;return w&&w.state?(X=w.state.status)!==z&&X!==69&&X!==73&&X!==91&&X!==103&&X!==F&&X!==666?V(w,v):(w.state=null,X===F?V(w,-3):f):v},o.deflateSetDictionary=function(w,X){var H,O,S,P,$,M,L,K,te=X.length;if(!w||!w.state||(P=(H=w.state).wrap)===2||P===1&&H.status!==z||H.lookahead)return v;for(P===1&&(w.adler=l(w.adler,X,te,0)),H.wrap=0,te>=H.w_size&&(P===0&&(oe(H.head),H.strstart=0,H.block_start=0,H.insert=0),K=new s.Buf8(H.w_size),s.arraySet(K,X,te-H.w_size,H.w_size,0),X=K,te=H.w_size),$=w.avail_in,M=w.next_in,L=w.input,w.avail_in=te,w.next_in=0,w.input=X,ue(H);H.lookahead>=D;){for(O=H.strstart,S=H.lookahead-(D-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[O+D-1])&H.hash_mask,H.prev[O&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=O,O++,--S;);H.strstart=O,H.lookahead=D-1,ue(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=D-1,H.match_available=0,w.next_in=M,w.input=L,w.avail_in=$,H.wrap=P,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,v,h,b,g,x,k,_,C,T,A,I,D,B,Z,z,F,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,v=a.wsize,h=a.whave,b=a.wnext,g=a.window,x=a.hold,k=a.bits,_=a.lencode,C=a.distcode,T=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),I=_[x&T];t:for(;;){if(x>>>=D=I>>>24,k-=D,(D=I>>>16&255)===0)U[d++]=65535&I;else{if(!(16&D)){if((64&D)==0){I=_[(65535&I)+(x&(1<<D)-1)];continue t}if(32&D){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}B=65535&I,(D&=15)&&(k<D&&(x+=y[l++]<<k,k+=8),B+=x&(1<<D)-1,x>>>=D,k-=D),k<15&&(x+=y[l++]<<k,k+=8,x+=y[l++]<<k,k+=8),I=C[x&A];r:for(;;){if(x>>>=D=I>>>24,k-=D,!(16&(D=I>>>16&255))){if((64&D)==0){I=C[(65535&I)+(x&(1<<D)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(Z=65535&I,k<(D&=15)&&(x+=y[l++]<<k,(k+=8)<D&&(x+=y[l++]<<k,k+=8)),f<(Z+=x&(1<<D)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(x>>>=D,k-=D,(D=d-u)<Z){if(h<(D=Z-D)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(F=g,(z=0)===b){if(z+=v-D,D<B){for(B-=D;U[d++]=g[z++],--D;);z=d-Z,F=U}}else if(b<D){if(z+=v+b-D,(D-=b)<B){for(B-=D;U[d++]=g[z++],--D;);if(z=0,b<B){for(B-=D=b;U[d++]=g[z++],--D;);z=d-Z,F=U}}}else if(z+=b-D,D<B){for(B-=D;U[d++]=g[z++],--D;);z=d-Z,F=U}for(;2<B;)U[d++]=F[z++],U[d++]=F[z++],U[d++]=F[z++],B-=3;B&&(U[d++]=F[z++],1<B&&(U[d++]=F[z++]))}else{for(z=d-Z;U[d++]=U[z++],U[d++]=U[z++],U[d++]=U[z++],2<(B-=3););B&&(U[d++]=U[z++],1<B&&(U[d++]=U[z++]))}break}}break}}while(l<c&&d<m);l-=B=k>>3,x&=(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=x,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,v=1,h=852,b=592;function g(z){return(z>>>24&255)+(z>>>8&65280)+((65280&z)<<8)+((255&z)<<24)}function x(){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(z){var F;return z&&z.state?(F=z.state,z.total_in=z.total_out=F.total=0,z.msg="",F.wrap&&(z.adler=1&F.wrap),F.mode=v,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new i.Buf32(h),F.distcode=F.distdyn=new i.Buf32(b),F.sane=1,F.back=-1,m):f}function _(z){var F;return z&&z.state?((F=z.state).wsize=0,F.whave=0,F.wnext=0,k(z)):f}function C(z,F){var y,U;return z&&z.state?(U=z.state,F<0?(y=0,F=-F):(y=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?f:(U.window!==null&&U.wbits!==F&&(U.window=null),U.wrap=y,U.wbits=F,_(z))):f}function T(z,F){var y,U;return z?(U=new x,(z.state=U).window=null,(y=C(z,F))!==m&&(z.state=null),y):f}var A,I,D=!0;function B(z){if(D){var F;for(A=new i.Buf32(512),I=new i.Buf32(32),F=0;F<144;)z.lens[F++]=8;for(;F<256;)z.lens[F++]=9;for(;F<280;)z.lens[F++]=7;for(;F<288;)z.lens[F++]=8;for(c(d,z.lens,0,288,A,0,z.work,{bits:9}),F=0;F<32;)z.lens[F++]=5;c(u,z.lens,0,32,I,0,z.work,{bits:5}),D=!1}z.lencode=A,z.lenbits=9,z.distcode=I,z.distbits=5}function Z(z,F,y,U){var ee,W=z.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,F,y-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(U<(ee=W.wsize-W.wnext)&&(ee=U),i.arraySet(W.window,F,y-U,ee,W.wnext),(U-=ee)?(i.arraySet(W.window,F,y-U,U,0),W.wnext=U,W.whave=W.wsize):(W.wnext+=ee,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=ee))),0}o.inflateReset=_,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(z){return T(z,15)},o.inflateInit2=T,o.inflate=function(z,F){var y,U,ee,W,V,Y,oe,N,R,G,q,J,ue,Q,ie,ae,ne,de,fe,we,w,X,H,O,S=0,P=new i.Buf8(4),$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!z||!z.state||!z.output||!z.input&&z.avail_in!==0)return f;(y=z.state).mode===12&&(y.mode=13),V=z.next_out,ee=z.output,oe=z.avail_out,W=z.next_in,U=z.input,Y=z.avail_in,N=y.hold,R=y.bits,G=Y,q=oe,X=m;e:for(;;)switch(y.mode){case v:if(y.wrap===0){y.mode=13;break}for(;R<16;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(2&y.wrap&&N===35615){P[y.check=0]=255&N,P[1]=N>>>8&255,y.check=a(y.check,P,2,0),R=N=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&N)<<8)+(N>>8))%31){z.msg="incorrect header check",y.mode=30;break}if((15&N)!=8){z.msg="unknown compression method",y.mode=30;break}if(R-=4,w=8+(15&(N>>>=4)),y.wbits===0)y.wbits=w;else if(w>y.wbits){z.msg="invalid window size",y.mode=30;break}y.dmax=1<<w,z.adler=y.check=1,y.mode=512&N?10:12,R=N=0;break;case 2:for(;R<16;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(y.flags=N,(255&y.flags)!=8){z.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){z.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=N>>8&1),512&y.flags&&(P[0]=255&N,P[1]=N>>>8&255,y.check=a(y.check,P,2,0)),R=N=0,y.mode=3;case 3:for(;R<32;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.head&&(y.head.time=N),512&y.flags&&(P[0]=255&N,P[1]=N>>>8&255,P[2]=N>>>16&255,P[3]=N>>>24&255,y.check=a(y.check,P,4,0)),R=N=0,y.mode=4;case 4:for(;R<16;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.head&&(y.head.xflags=255&N,y.head.os=N>>8),512&y.flags&&(P[0]=255&N,P[1]=N>>>8&255,y.check=a(y.check,P,2,0)),R=N=0,y.mode=5;case 5:if(1024&y.flags){for(;R<16;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.length=N,y.head&&(y.head.extra_len=N),512&y.flags&&(P[0]=255&N,P[1]=N>>>8&255,y.check=a(y.check,P,2,0)),R=N=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Y<(J=y.length)&&(J=Y),J&&(y.head&&(w=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,J,w)),512&y.flags&&(y.check=a(y.check,U,J,W)),Y-=J,W+=J,y.length-=J),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Y===0)break e;for(J=0;w=U[W+J++],y.head&&w&&y.length<65536&&(y.head.name+=String.fromCharCode(w)),w&&J<Y;);if(512&y.flags&&(y.check=a(y.check,U,J,W)),Y-=J,W+=J,w)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Y===0)break e;for(J=0;w=U[W+J++],y.head&&w&&y.length<65536&&(y.head.comment+=String.fromCharCode(w)),w&&J<Y;);if(512&y.flags&&(y.check=a(y.check,U,J,W)),Y-=J,W+=J,w)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;R<16;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(N!==(65535&y.check)){z.msg="header crc mismatch",y.mode=30;break}R=N=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),z.adler=y.check=0,y.mode=12;break;case 10:for(;R<32;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}z.adler=y.check=g(N),R=N=0,y.mode=11;case 11:if(y.havedict===0)return z.next_out=V,z.avail_out=oe,z.next_in=W,z.avail_in=Y,y.hold=N,y.bits=R,2;z.adler=y.check=1,y.mode=12;case 12:if(F===5||F===6)break e;case 13:if(y.last){N>>>=7&R,R-=7&R,y.mode=27;break}for(;R<3;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}switch(y.last=1&N,R-=1,3&(N>>>=1)){case 0:y.mode=14;break;case 1:if(B(y),y.mode=20,F!==6)break;N>>>=2,R-=2;break e;case 2:y.mode=17;break;case 3:z.msg="invalid block type",y.mode=30}N>>>=2,R-=2;break;case 14:for(N>>>=7&R,R-=7&R;R<32;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if((65535&N)!=(N>>>16^65535)){z.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&N,R=N=0,y.mode=15,F===6)break e;case 15:y.mode=16;case 16:if(J=y.length){if(Y<J&&(J=Y),oe<J&&(J=oe),J===0)break e;i.arraySet(ee,U,W,J,V),Y-=J,W+=J,oe-=J,V+=J,y.length-=J;break}y.mode=12;break;case 17:for(;R<14;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(y.nlen=257+(31&N),N>>>=5,R-=5,y.ndist=1+(31&N),N>>>=5,R-=5,y.ncode=4+(15&N),N>>>=4,R-=4,286<y.nlen||30<y.ndist){z.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(;R<3;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.lens[$[y.have++]]=7&N,N>>>=3,R-=3}for(;y.have<19;)y.lens[$[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,H={bits:y.lenbits},X=c(0,y.lens,0,19,y.lencode,0,y.work,H),y.lenbits=H.bits,X){z.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(;ae=(S=y.lencode[N&(1<<y.lenbits)-1])>>>16&255,ne=65535&S,!((ie=S>>>24)<=R);){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(ne<16)N>>>=ie,R-=ie,y.lens[y.have++]=ne;else{if(ne===16){for(O=ie+2;R<O;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(N>>>=ie,R-=ie,y.have===0){z.msg="invalid bit length repeat",y.mode=30;break}w=y.lens[y.have-1],J=3+(3&N),N>>>=2,R-=2}else if(ne===17){for(O=ie+3;R<O;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}R-=ie,w=0,J=3+(7&(N>>>=ie)),N>>>=3,R-=3}else{for(O=ie+7;R<O;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}R-=ie,w=0,J=11+(127&(N>>>=ie)),N>>>=7,R-=7}if(y.have+J>y.nlen+y.ndist){z.msg="invalid bit length repeat",y.mode=30;break}for(;J--;)y.lens[y.have++]=w}}if(y.mode===30)break;if(y.lens[256]===0){z.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,H={bits:y.lenbits},X=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,H),y.lenbits=H.bits,X){z.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,H={bits:y.distbits},X=c(u,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,H),y.distbits=H.bits,X){z.msg="invalid distances set",y.mode=30;break}if(y.mode=20,F===6)break e;case 20:y.mode=21;case 21:if(6<=Y&&258<=oe){z.next_out=V,z.avail_out=oe,z.next_in=W,z.avail_in=Y,y.hold=N,y.bits=R,l(z,q),V=z.next_out,ee=z.output,oe=z.avail_out,W=z.next_in,U=z.input,Y=z.avail_in,N=y.hold,R=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ae=(S=y.lencode[N&(1<<y.lenbits)-1])>>>16&255,ne=65535&S,!((ie=S>>>24)<=R);){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(ae&&(240&ae)==0){for(de=ie,fe=ae,we=ne;ae=(S=y.lencode[we+((N&(1<<de+fe)-1)>>de)])>>>16&255,ne=65535&S,!(de+(ie=S>>>24)<=R);){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}N>>>=de,R-=de,y.back+=de}if(N>>>=ie,R-=ie,y.back+=ie,y.length=ne,ae===0){y.mode=26;break}if(32&ae){y.back=-1,y.mode=12;break}if(64&ae){z.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ae,y.mode=22;case 22:if(y.extra){for(O=y.extra;R<O;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.length+=N&(1<<y.extra)-1,N>>>=y.extra,R-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ae=(S=y.distcode[N&(1<<y.distbits)-1])>>>16&255,ne=65535&S,!((ie=S>>>24)<=R);){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if((240&ae)==0){for(de=ie,fe=ae,we=ne;ae=(S=y.distcode[we+((N&(1<<de+fe)-1)>>de)])>>>16&255,ne=65535&S,!(de+(ie=S>>>24)<=R);){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}N>>>=de,R-=de,y.back+=de}if(N>>>=ie,R-=ie,y.back+=ie,64&ae){z.msg="invalid distance code",y.mode=30;break}y.offset=ne,y.extra=15&ae,y.mode=24;case 24:if(y.extra){for(O=y.extra;R<O;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}y.offset+=N&(1<<y.extra)-1,N>>>=y.extra,R-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){z.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(J=q-oe,y.offset>J){if((J=y.offset-J)>y.whave&&y.sane){z.msg="invalid distance too far back",y.mode=30;break}ue=J>y.wnext?(J-=y.wnext,y.wsize-J):y.wnext-J,J>y.length&&(J=y.length),Q=y.window}else Q=ee,ue=V-y.offset,J=y.length;for(oe<J&&(J=oe),oe-=J,y.length-=J;ee[V++]=Q[ue++],--J;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;ee[V++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;R<32;){if(Y===0)break e;Y--,N|=U[W++]<<R,R+=8}if(q-=oe,z.total_out+=q,y.total+=q,q&&(z.adler=y.check=y.flags?a(y.check,ee,q,V-q):s(y.check,ee,q,V-q)),q=oe,(y.flags?N:g(N))!==y.check){z.msg="incorrect data check",y.mode=30;break}R=N=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;R<32;){if(Y===0)break e;Y--,N+=U[W++]<<R,R+=8}if(N!==(4294967295&y.total)){z.msg="incorrect length check",y.mode=30;break}R=N=0}y.mode=29;case 29:X=1;break e;case 30:X=-3;break e;case 31:return-4;case 32:default:return f}return z.next_out=V,z.avail_out=oe,z.next_in=W,z.avail_in=Y,y.hold=N,y.bits=R,(y.wsize||q!==z.avail_out&&y.mode<30&&(y.mode<27||F!==4))&&Z(z,z.output,z.next_out,q-z.avail_out)?(y.mode=31,-4):(G-=z.avail_in,q-=z.avail_out,z.total_in+=G,z.total_out+=q,y.total+=q,y.wrap&&q&&(z.adler=y.check=y.flags?a(y.check,ee,q,z.next_out-q):s(y.check,ee,q,z.next_out-q)),z.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(G==0&&q===0||F===4)&&X===m&&(X=-5),X)},o.inflateEnd=function(z){if(!z||!z.state)return f;var F=z.state;return F.window&&(F.window=null),z.state=null,m},o.inflateGetHeader=function(z,F){var y;return z&&z.state?(2&(y=z.state).wrap)==0?f:((y.head=F).done=!1,m):f},o.inflateSetDictionary=function(z,F){var y,U=F.length;return z&&z.state?(y=z.state).wrap!==0&&y.mode!==11?f:y.mode===11&&s(1,F,U,0)!==y.check?-3:Z(z,F,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,v,h,b,g){var x,k,_,C,T,A,I,D,B,Z=g.bits,z=0,F=0,y=0,U=0,ee=0,W=0,V=0,Y=0,oe=0,N=0,R=null,G=0,q=new i.Buf16(16),J=new i.Buf16(16),ue=null,Q=0;for(z=0;z<=15;z++)q[z]=0;for(F=0;F<f;F++)q[u[m+F]]++;for(ee=Z,U=15;1<=U&&q[U]===0;U--);if(U<ee&&(ee=U),U===0)return v[h++]=20971520,v[h++]=20971520,g.bits=1,0;for(y=1;y<U&&q[y]===0;y++);for(ee<y&&(ee=y),z=Y=1;z<=15;z++)if(Y<<=1,(Y-=q[z])<0)return-1;if(0<Y&&(d===0||U!==1))return-1;for(J[1]=0,z=1;z<15;z++)J[z+1]=J[z]+q[z];for(F=0;F<f;F++)u[m+F]!==0&&(b[J[u[m+F]]++]=F);if(A=d===0?(R=ue=b,19):d===1?(R=s,G-=257,ue=a,Q-=257,256):(R=l,ue=c,-1),z=y,T=h,V=F=N=0,_=-1,C=(oe=1<<(W=ee))-1,d===1&&852<oe||d===2&&592<oe)return 1;for(;;){for(I=z-V,B=b[F]<A?(D=0,b[F]):b[F]>A?(D=ue[Q+b[F]],R[G+b[F]]):(D=96,0),x=1<<z-V,y=k=1<<W;v[T+(N>>V)+(k-=x)]=I<<24|D<<16|B|0,k!==0;);for(x=1<<z-1;N&x;)x>>=1;if(x!==0?(N&=x-1,N+=x):N=0,F++,--q[z]==0){if(z===U)break;z=u[m+b[F]]}if(ee<z&&(N&C)!==_){for(V===0&&(V=ee),T+=y,Y=1<<(W=z-V);W+V<U&&!((Y-=q[W+V])<=0);)W++,Y<<=1;if(oe+=1<<W,d===1&&852<oe||d===2&&592<oe)return 1;v[_=N&C]=ee<<24|W<<16|T-h|0}}return N!==0&&(v[T+N]=z-V<<24|64<<16|0),g.bits=ee,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(S){for(var P=S.length;0<=--P;)S[P]=0}var c=0,d=29,u=256,m=u+1+d,f=30,v=19,h=2*m+1,b=15,g=16,x=7,k=256,_=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],I=[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],D=[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],Z=new Array(2*(m+2));l(Z);var z=new Array(2*f);l(z);var F=new Array(512);l(F);var y=new Array(256);l(y);var U=new Array(d);l(U);var ee,W,V,Y=new Array(f);function oe(S,P,$,M,L){this.static_tree=S,this.extra_bits=P,this.extra_base=$,this.elems=M,this.max_length=L,this.has_stree=S&&S.length}function N(S,P){this.dyn_tree=S,this.max_code=0,this.stat_desc=P}function R(S){return S<256?F[S]:F[256+(S>>>7)]}function G(S,P){S.pending_buf[S.pending++]=255&P,S.pending_buf[S.pending++]=P>>>8&255}function q(S,P,$){S.bi_valid>g-$?(S.bi_buf|=P<<S.bi_valid&65535,G(S,S.bi_buf),S.bi_buf=P>>g-S.bi_valid,S.bi_valid+=$-g):(S.bi_buf|=P<<S.bi_valid&65535,S.bi_valid+=$)}function J(S,P,$){q(S,$[2*P],$[2*P+1])}function ue(S,P){for(var $=0;$|=1&S,S>>>=1,$<<=1,0<--P;);return $>>>1}function Q(S,P,$){var M,L,K=new Array(b+1),te=0;for(M=1;M<=b;M++)K[M]=te=te+$[M-1]<<1;for(L=0;L<=P;L++){var re=S[2*L+1];re!==0&&(S[2*L]=ue(K[re]++,re))}}function ie(S){var P;for(P=0;P<m;P++)S.dyn_ltree[2*P]=0;for(P=0;P<f;P++)S.dyn_dtree[2*P]=0;for(P=0;P<v;P++)S.bl_tree[2*P]=0;S.dyn_ltree[2*k]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function ae(S){8<S.bi_valid?G(S,S.bi_buf):0<S.bi_valid&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function ne(S,P,$,M){var L=2*P,K=2*$;return S[L]<S[K]||S[L]===S[K]&&M[P]<=M[$]}function de(S,P,$){for(var M=S.heap[$],L=$<<1;L<=S.heap_len&&(L<S.heap_len&&ne(P,S.heap[L+1],S.heap[L],S.depth)&&L++,!ne(P,M,S.heap[L],S.depth));)S.heap[$]=S.heap[L],$=L,L<<=1;S.heap[$]=M}function fe(S,P,$){var M,L,K,te,re=0;if(S.last_lit!==0)for(;M=S.pending_buf[S.d_buf+2*re]<<8|S.pending_buf[S.d_buf+2*re+1],L=S.pending_buf[S.l_buf+re],re++,M===0?J(S,L,P):(J(S,(K=y[L])+u+1,P),(te=A[K])!==0&&q(S,L-=U[K],te),J(S,K=R(--M),$),(te=I[K])!==0&&q(S,M-=Y[K],te)),re<S.last_lit;);J(S,k,P)}function we(S,P){var $,M,L,K=P.dyn_tree,te=P.stat_desc.static_tree,re=P.stat_desc.has_stree,se=P.stat_desc.elems,he=-1;for(S.heap_len=0,S.heap_max=h,$=0;$<se;$++)K[2*$]!==0?(S.heap[++S.heap_len]=he=$,S.depth[$]=0):K[2*$+1]=0;for(;S.heap_len<2;)K[2*(L=S.heap[++S.heap_len]=he<2?++he:0)]=1,S.depth[L]=0,S.opt_len--,re&&(S.static_len-=te[2*L+1]);for(P.max_code=he,$=S.heap_len>>1;1<=$;$--)de(S,K,$);for(L=se;$=S.heap[1],S.heap[1]=S.heap[S.heap_len--],de(S,K,1),M=S.heap[1],S.heap[--S.heap_max]=$,S.heap[--S.heap_max]=M,K[2*L]=K[2*$]+K[2*M],S.depth[L]=(S.depth[$]>=S.depth[M]?S.depth[$]:S.depth[M])+1,K[2*$+1]=K[2*M+1]=L,S.heap[1]=L++,de(S,K,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],(function(me,ve){var it,Te,St,Ee,ir,Pt,Ye=ve.dyn_tree,Zn=ve.max_code,Kn=ve.stat_desc.static_tree,vi=ve.stat_desc.has_stree,wi=ve.stat_desc.extra_bits,Gn=ve.stat_desc.extra_base,Ne=ve.stat_desc.max_length,Pe=0;for(Ee=0;Ee<=b;Ee++)me.bl_count[Ee]=0;for(Ye[2*me.heap[me.heap_max]+1]=0,it=me.heap_max+1;it<h;it++)Ne<(Ee=Ye[2*Ye[2*(Te=me.heap[it])+1]+1]+1)&&(Ee=Ne,Pe++),Ye[2*Te+1]=Ee,Zn<Te||(me.bl_count[Ee]++,ir=0,Gn<=Te&&(ir=wi[Te-Gn]),Pt=Ye[2*Te],me.opt_len+=Pt*(Ee+ir),vi&&(me.static_len+=Pt*(Kn[2*Te+1]+ir)));if(Pe!==0){do{for(Ee=Ne-1;me.bl_count[Ee]===0;)Ee--;me.bl_count[Ee]--,me.bl_count[Ee+1]+=2,me.bl_count[Ne]--,Pe-=2}while(0<Pe);for(Ee=Ne;Ee!==0;Ee--)for(Te=me.bl_count[Ee];Te!==0;)Zn<(St=me.heap[--it])||(Ye[2*St+1]!==Ee&&(me.opt_len+=(Ee-Ye[2*St+1])*Ye[2*St],Ye[2*St+1]=Ee),Te--)}})(S,P),Q(K,he,S.bl_count)}function w(S,P,$){var M,L,K=-1,te=P[1],re=0,se=7,he=4;for(te===0&&(se=138,he=3),P[2*($+1)+1]=65535,M=0;M<=$;M++)L=te,te=P[2*(M+1)+1],++re<se&&L===te||(re<he?S.bl_tree[2*L]+=re:L!==0?(L!==K&&S.bl_tree[2*L]++,S.bl_tree[2*_]++):re<=10?S.bl_tree[2*C]++:S.bl_tree[2*T]++,K=L,he=(re=0)===te?(se=138,3):L===te?(se=6,3):(se=7,4))}function X(S,P,$){var M,L,K=-1,te=P[1],re=0,se=7,he=4;for(te===0&&(se=138,he=3),M=0;M<=$;M++)if(L=te,te=P[2*(M+1)+1],!(++re<se&&L===te)){if(re<he)for(;J(S,L,S.bl_tree),--re!=0;);else L!==0?(L!==K&&(J(S,L,S.bl_tree),re--),J(S,_,S.bl_tree),q(S,re-3,2)):re<=10?(J(S,C,S.bl_tree),q(S,re-3,3)):(J(S,T,S.bl_tree),q(S,re-11,7));K=L,he=(re=0)===te?(se=138,3):L===te?(se=6,3):(se=7,4)}}l(Y);var H=!1;function O(S,P,$,M){q(S,(c<<1)+(M?1:0),3),(function(L,K,te,re){ae(L),G(L,te),G(L,~te),i.arraySet(L.pending_buf,L.window,K,te,L.pending),L.pending+=te})(S,P,$)}o._tr_init=function(S){H||((function(){var P,$,M,L,K,te=new Array(b+1);for(L=M=0;L<d-1;L++)for(U[L]=M,P=0;P<1<<A[L];P++)y[M++]=L;for(y[M-1]=L,L=K=0;L<16;L++)for(Y[L]=K,P=0;P<1<<I[L];P++)F[K++]=L;for(K>>=7;L<f;L++)for(Y[L]=K<<7,P=0;P<1<<I[L]-7;P++)F[256+K++]=L;for($=0;$<=b;$++)te[$]=0;for(P=0;P<=143;)Z[2*P+1]=8,P++,te[8]++;for(;P<=255;)Z[2*P+1]=9,P++,te[9]++;for(;P<=279;)Z[2*P+1]=7,P++,te[7]++;for(;P<=287;)Z[2*P+1]=8,P++,te[8]++;for(Q(Z,m+1,te),P=0;P<f;P++)z[2*P+1]=5,z[2*P]=ue(P,5);ee=new oe(Z,A,u+1,m,b),W=new oe(z,I,0,f,b),V=new oe(new Array(0),D,0,v,x)})(),H=!0),S.l_desc=new N(S.dyn_ltree,ee),S.d_desc=new N(S.dyn_dtree,W),S.bl_desc=new N(S.bl_tree,V),S.bi_buf=0,S.bi_valid=0,ie(S)},o._tr_stored_block=O,o._tr_flush_block=function(S,P,$,M){var L,K,te=0;0<S.level?(S.strm.data_type===2&&(S.strm.data_type=(function(re){var se,he=4093624447;for(se=0;se<=31;se++,he>>>=1)if(1&he&&re.dyn_ltree[2*se]!==0)return s;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return a;for(se=32;se<u;se++)if(re.dyn_ltree[2*se]!==0)return a;return s})(S)),we(S,S.l_desc),we(S,S.d_desc),te=(function(re){var se;for(w(re,re.dyn_ltree,re.l_desc.max_code),w(re,re.dyn_dtree,re.d_desc.max_code),we(re,re.bl_desc),se=v-1;3<=se&&re.bl_tree[2*B[se]+1]===0;se--);return re.opt_len+=3*(se+1)+5+5+4,se})(S),L=S.opt_len+3+7>>>3,(K=S.static_len+3+7>>>3)<=L&&(L=K)):L=K=$+5,$+4<=L&&P!==-1?O(S,P,$,M):S.strategy===4||K===L?(q(S,2+(M?1:0),3),fe(S,Z,z)):(q(S,4+(M?1:0),3),(function(re,se,he,me){var ve;for(q(re,se-257,5),q(re,he-1,5),q(re,me-4,4),ve=0;ve<me;ve++)q(re,re.bl_tree[2*B[ve]+1],3);X(re,re.dyn_ltree,se-1),X(re,re.dyn_dtree,he-1)})(S,S.l_desc.max_code+1,S.d_desc.max_code+1,te+1),fe(S,S.dyn_ltree,S.dyn_dtree)),ie(S),M&&ae(S)},o._tr_tally=function(S,P,$){return S.pending_buf[S.d_buf+2*S.last_lit]=P>>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&P,S.pending_buf[S.l_buf+S.last_lit]=255&$,S.last_lit++,P===0?S.dyn_ltree[2*$]++:(S.matches++,P--,S.dyn_ltree[2*(y[$]+u+1)]++,S.dyn_dtree[2*R(P)]++),S.last_lit===S.lit_bufsize-1},o._tr_align=function(S){q(S,2,3),J(S,k,Z),(function(P){P.bi_valid===16?(G(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)})(S)}},{"../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={},v=!1,h=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(_){process.nextTick(function(){x(_)})}:(function(){if(s.postMessage&&!s.importScripts){var _=!0,C=s.onmessage;return s.onmessage=function(){_=!1},s.postMessage("","*"),s.onmessage=C,_}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(_){s.postMessage(u+_,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){x(_.data)},function(_){d.port2.postMessage(_)}):h&&"onreadystatechange"in h.createElement("script")?(c=h.documentElement,function(_){var C=h.createElement("script");C.onreadystatechange=function(){x(_),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(_){setTimeout(x,0,_)},b.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),T=0;T<C.length;T++)C[T]=arguments[T+1];var A={callback:_,args:C};return f[m]=A,l(m),m++},b.clearImmediate=g}function g(_){delete f[_]}function x(_){if(v)setTimeout(x,0,_);else{var C=f[_];if(C){v=!0;try{(function(T){var A=T.callback,I=T.args;switch(I.length){case 0:A();break;case 1:A(I[0]);break;case 2:A(I[0],I[1]);break;case 3:A(I[0],I[1],I[2]);break;default:A.apply(a,I)}})(C)}finally{g(_),v=!1}}}}function k(_){_.source===s&&typeof _.data=="string"&&_.data.indexOf(u)===0&&x(+_.data.slice(u.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof pt<"u"?pt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xn)),Xn.exports}var Lc=Rc();const Mc=Dc(Lc);var Rr={exports:{}},Fc=Rr.exports,_i;function Bc(){return _i||(_i=1,(function(e,t){(function(r,n){n()})(Fc,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 pt=="object"&&pt.global===pt?pt: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",v=/constructor/i.test(s.HTMLElement)||s.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||f&&v||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,x=g.createObjectURL(c);m?m.location=x:location.href=x,m=null,setTimeout(function(){g.revokeObjectURL(x)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Rr)),Rr.exports}var Si=Bc();const Ci=async(e,t)=>{const r=new Mc,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"});Si.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"});Si.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 Uc(){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 Wc=(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},$c=(e,t)=>({classGroupId:e,validator:t}),zi=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Lr="-",Ai=[],Hc="arbitrary..",Vc=e=>{const t=Zc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Yc(s);const a=s.split(Lr),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?Wc(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(Lr):e.slice(t).join(Lr),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},Yc=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?Hc+n:void 0})(),Zc=e=>{const{theme:t,classGroups:r}=e;return Kc(r,t)},Kc=(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];Gc(s,t,r,n)}},Gc=(e,t,r,n)=>{if(typeof e=="string"){Xc(e,t,r);return}if(typeof e=="function"){qc(e,t,r,n);return}Jc(e,t,r,n)},Xc=(e,t,r)=>{const n=e===""?t:Ti(t,e);n.classGroupId=r},qc=(e,t,r,n)=>{if(Qc(e)){qn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push($c(r,e))},Jc=(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(Lr),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},Qc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ed=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=":",td=[],Pi=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),rd=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 v=c&&c>l?c-l:void 0;return Pi(i,f,m,v)};if(t){const o=t+Oi,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Pi(td,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},nd=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}},od=e=>({cache:ed(e.cacheSize),parseClassName:rd(e),sortModifiers:nd(e),...Vc(e)}),id=/\s+/,sd=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(id);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:h}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let b=!!h,g=n(b?v.substring(0,h):v);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=n(v),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const x=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=f?x+Jn:x,_=k+g;if(s.indexOf(_)>-1)continue;s.push(_);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},ad=(...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},ld=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,u)=>u(d),e());return r=od(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=sd(l,r);return o(l,d),d};return i=s,(...l)=>i(ad(...l))},cd=[],Ae=e=>{const t=r=>r[e]||cd;return t.isThemeGetter=!0,t},Di=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ri=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dd=/^\d+\/\d+$/,ud=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fd=/\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$/,hd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,md=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>dd.test(e),ge=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),Qn=e=>e.endsWith("%")&&ge(e.slice(0,-1)),lt=e=>ud.test(e),gd=()=>!0,bd=e=>fd.test(e)&&!hd.test(e),Li=()=>!1,vd=e=>pd.test(e),wd=e=>md.test(e),xd=e=>!le(e)&&!ce(e),yd=e=>Dt(e,Wi,Li),le=e=>Di.test(e),zt=e=>Dt(e,$i,bd),eo=e=>Dt(e,Ed,ge),Mi=e=>Dt(e,Bi,Li),kd=e=>Dt(e,Ui,wd),Mr=e=>Dt(e,Hi,vd),ce=e=>Ri.test(e),ar=e=>Rt(e,$i),_d=e=>Rt(e,Nd),Fi=e=>Rt(e,Bi),Sd=e=>Rt(e,Wi),Cd=e=>Rt(e,Ui),Fr=e=>Rt(e,Hi,!0),Dt=(e,t,r)=>{const n=Di.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Rt=(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",Ed=e=>e==="number",Nd=e=>e==="family-name",Hi=e=>e==="shadow",zd=ld(()=>{const e=Ae("color"),t=Ae("font"),r=Ae("text"),n=Ae("font-weight"),o=Ae("tracking"),i=Ae("leading"),s=Ae("breakpoint"),a=Ae("container"),l=Ae("spacing"),c=Ae("radius"),d=Ae("shadow"),u=Ae("inset-shadow"),m=Ae("text-shadow"),f=Ae("drop-shadow"),v=Ae("blur"),h=Ae("perspective"),b=Ae("aspect"),g=Ae("ease"),x=Ae("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),ce,le],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],I=()=>[ce,le,l],D=()=>[It,"full","auto",...I()],B=()=>[mt,"none","subgrid",ce,le],Z=()=>["auto",{span:["full",mt,ce,le]},mt,ce,le],z=()=>[mt,"auto",ce,le],F=()=>["auto","min","max","fr",ce,le],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...I()],W=()=>[It,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],V=()=>[e,ce,le],Y=()=>[..._(),Fi,Mi,{position:[ce,le]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",Sd,yd,{size:[ce,le]}],R=()=>[Qn,ar,zt],G=()=>["","none","full",c,ce,le],q=()=>["",ge,ar,zt],J=()=>["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"],Q=()=>[ge,Qn,Fi,Mi],ie=()=>["","none",v,ce,le],ae=()=>["none",ge,ce,le],ne=()=>["none",ge,ce,le],de=()=>[ge,ce,le],fe=()=>[It,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[gd],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[xd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",ge],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",It,le,ce,b]}],container:["container"],columns:[{columns:[ge,le,ce,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:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",ce,le]}],basis:[{basis:[It,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ge,It,"auto","initial","none",le]}],grow:[{grow:["",ge,ce,le]}],shrink:[{shrink:["",ge,ce,le]}],order:[{order:[mt,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"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:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"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,ar,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ce,eo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qn,le]}],"font-family":[{font:[_d,le,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,ce,le]}],"line-clamp":[{"line-clamp":[ge,"none",ce,eo]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"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:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[ge,"from-font","auto",ce,zt]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[ge,"auto",ce,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,le]}],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",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,ce,le],radial:["",ce,le],conic:[mt,ce,le]},Cd,kd]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"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:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ge,ce,le]}],"outline-w":[{outline:["",ge,ar,zt]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,Fr,Mr]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",u,Fr,Mr]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[ge,zt]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,Fr,Mr]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[ge,ce,le]}],"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":[ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"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":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"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":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"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":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"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":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"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":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"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":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"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:Y()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:ie()}],brightness:[{brightness:[ge,ce,le]}],contrast:[{contrast:[ge,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",f,Fr,Mr]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",ge,ce,le]}],"hue-rotate":[{"hue-rotate":[ge,ce,le]}],invert:[{invert:["",ge,ce,le]}],saturate:[{saturate:[ge,ce,le]}],sepia:[{sepia:["",ge,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ge,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[ge,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ge,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ge,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",ge,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[ge,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[ge,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",ge,ce,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ge,"initial",ce,le]}],ease:[{ease:["linear","initial",g,ce,le]}],delay:[{delay:[ge,ce,le]}],animate:[{animate:["none",x,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ce,le]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"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",ce,le]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",ce,le]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[ge,ar,zt,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 pe(...e){return zd(Uc(e))}var Br={exports:{}},lr={};/**
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 Wi;function Nd(){if(Wi)return cr;Wi=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 Vi;function Ad(){if(Vi)return lr;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 lr.Fragment=t,lr.jsx=r,lr.jsxs=r,lr}var cr={};/**
21
21
  * @license React
22
22
  * react-jsx-runtime.development.js
23
23
  *
@@ -25,192 +25,192 @@
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 $i;function Ad(){return $i||($i=1,process.env.NODE_ENV!=="production"&&(function(){function e(z){if(z==null)return null;if(typeof z=="function")return z.$$typeof===Y?null:z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case b:return"Fragment";case x:return"Profiler";case g:return"StrictMode";case I:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof z=="object")switch(typeof z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case h:return"Portal";case _:return z.displayName||"Context";case k:return(z._context.displayName||"Context")+".Consumer";case C:var L=z.render;return z=z.displayName,z||(z=L.displayName||L.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case D:return L=z.displayName||null,L!==null?L:e(z.type)||"Memo";case R:L=z._payload,z=z._init;try{return e(z(L))}catch{}}return null}function t(z){return""+z}function r(z){try{t(z);var L=!1}catch{L=!0}if(L){L=console;var K=L.error,q=typeof Symbol=="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return K.call(L,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",q),t(z)}}function n(z){if(z===b)return"<>";if(typeof z=="object"&&z!==null&&z.$$typeof===R)return"<...>";try{var L=e(z);return L?"<"+L+">":"<...>"}catch{return"<...>"}}function o(){var z=N.A;return z===null?null:z.getOwner()}function i(){return Error("react-stack-top-frame")}function s(z){if(M.call(z,"key")){var L=Object.getOwnPropertyDescriptor(z,"key").get;if(L&&L.isReactWarning)return!1}return z.key!==void 0}function a(z,L){function K(){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)",L))}K.isReactWarning=!0,Object.defineProperty(z,"key",{get:K,configurable:!0})}function l(){var z=e(this.type);return U[z]||(U[z]=!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.")),z=this.props.ref,z!==void 0?z:null}function c(z,L,K,q,ee,ue){var re=K.ref;return z={$$typeof:v,type:z,key:L,props:K,_owner:q},(re!==void 0?re:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:l}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function d(z,L,K,q,ee,ue){var re=L.children;if(re!==void 0)if(q)if(y(re)){for(q=0;q<re.length;q++)u(re[q]);Object.freeze&&Object.freeze(re)}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(re);if(M.call(L,"key")){re=e(z);var ie=Object.keys(L).filter(function(oe){return oe!=="key"});q=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",ne[re+q]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
28
+ */var Yi;function jd(){return Yi||(Yi=1,process.env.NODE_ENV!=="production"&&(function(){function e(N){if(N==null)return null;if(typeof N=="function")return N.$$typeof===Z?null:N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case b:return"Fragment";case x:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof N=="object")switch(typeof N.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),N.$$typeof){case h:return"Portal";case _:return N.displayName||"Context";case k:return(N._context.displayName||"Context")+".Consumer";case C:var R=N.render;return N=N.displayName,N||(N=R.displayName||R.name||"",N=N!==""?"ForwardRef("+N+")":"ForwardRef"),N;case I:return R=N.displayName||null,R!==null?R:e(N.type)||"Memo";case D:R=N._payload,N=N._init;try{return e(N(R))}catch{}}return null}function t(N){return""+N}function r(N){try{t(N);var R=!1}catch{R=!0}if(R){R=console;var G=R.error,q=typeof Symbol=="function"&&Symbol.toStringTag&&N[Symbol.toStringTag]||N.constructor.name||"Object";return G.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",q),t(N)}}function n(N){if(N===b)return"<>";if(typeof N=="object"&&N!==null&&N.$$typeof===D)return"<...>";try{var R=e(N);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function o(){var N=z.A;return N===null?null:N.getOwner()}function i(){return Error("react-stack-top-frame")}function s(N){if(F.call(N,"key")){var R=Object.getOwnPropertyDescriptor(N,"key").get;if(R&&R.isReactWarning)return!1}return N.key!==void 0}function a(N,R){function G(){ee||(ee=!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)",R))}G.isReactWarning=!0,Object.defineProperty(N,"key",{get:G,configurable:!0})}function l(){var N=e(this.type);return W[N]||(W[N]=!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.")),N=this.props.ref,N!==void 0?N:null}function c(N,R,G,q,J,ue){var Q=G.ref;return N={$$typeof:v,type:N,key:R,props:G,_owner:q},(Q!==void 0?Q:null)!==null?Object.defineProperty(N,"ref",{enumerable:!1,get:l}):Object.defineProperty(N,"ref",{enumerable:!1,value:null}),N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(N,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(N,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(N,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N}function d(N,R,G,q,J,ue){var Q=R.children;if(Q!==void 0)if(q)if(y(Q)){for(q=0;q<Q.length;q++)u(Q[q]);Object.freeze&&Object.freeze(Q)}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(Q);if(F.call(R,"key")){Q=e(N);var ie=Object.keys(R).filter(function(ne){return ne!=="key"});q=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",oe[Q+q]||(ie=0<ie.length?"{"+ie.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} />`,q,re,ie,re),ne[re+q]=!0)}if(re=null,K!==void 0&&(r(K),re=""+K),s(L)&&(r(L.key),re=""+L.key),"key"in L){K={};for(var ae in L)ae!=="key"&&(K[ae]=L[ae])}else K=L;return re&&a(K,typeof z=="function"?z.displayName||z.name||"Unknown":z),c(z,re,K,o(),ee,ue)}function u(z){m(z)?z._store&&(z._store.validated=1):typeof z=="object"&&z!==null&&z.$$typeof===R&&(z._payload.status==="fulfilled"?m(z._payload.value)&&z._payload.value._store&&(z._payload.value._store.validated=1):z._store&&(z._store.validated=1))}function m(z){return typeof z=="object"&&z!==null&&z.$$typeof===v}var f=j,v=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),N=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,y=Array.isArray,B=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(z){return z()}};var te,U={},$=f.react_stack_bottom_frame.bind(f,i)(),Z=B(n(i)),ne={};dr.Fragment=b,dr.jsx=function(z,L,K){var q=1e4>N.recentlyCreatedOwnerStacks++;return d(z,L,K,!1,q?Error("react-stack-top-frame"):$,q?B(n(z)):Z)},dr.jsxs=function(z,L,K){var q=1e4>N.recentlyCreatedOwnerStacks++;return d(z,L,K,!0,q?Error("react-stack-top-frame"):$,q?B(n(z)):Z)}})()),dr}var Hi;function zd(){return Hi||(Hi=1,process.env.NODE_ENV==="production"?Wr.exports=Nd():Wr.exports=Ad()),Wr.exports}var p=zd();const Vi=j.createContext(void 0),Yi=({config:e,children:t})=>p.jsx(Vi.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets},children:t});function ur(){const e=j.useContext(Vi);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Zi=j.createContext(void 0),$r=({mode:e,children:t})=>(j.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(Zi.Provider,{value:{mode:e},children:t})),Gi=()=>{const e=j.useContext(Zi);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
33
+ <%s key={someKey} {...props} />`,q,Q,ie,Q),oe[Q+q]=!0)}if(Q=null,G!==void 0&&(r(G),Q=""+G),s(R)&&(r(R.key),Q=""+R.key),"key"in R){G={};for(var ae in R)ae!=="key"&&(G[ae]=R[ae])}else G=R;return Q&&a(G,typeof N=="function"?N.displayName||N.name||"Unknown":N),c(N,Q,G,o(),J,ue)}function u(N){m(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===D&&(N._payload.status==="fulfilled"?m(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function m(N){return typeof N=="object"&&N!==null&&N.$$typeof===v}var f=j,v=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),z=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,y=Array.isArray,U=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(N){return N()}};var ee,W={},V=f.react_stack_bottom_frame.bind(f,i)(),Y=U(n(i)),oe={};cr.Fragment=b,cr.jsx=function(N,R,G){var q=1e4>z.recentlyCreatedOwnerStacks++;return d(N,R,G,!1,q?Error("react-stack-top-frame"):V,q?U(n(N)):Y)},cr.jsxs=function(N,R,G){var q=1e4>z.recentlyCreatedOwnerStacks++;return d(N,R,G,!0,q?Error("react-stack-top-frame"):V,q?U(n(N)):Y)}})()),cr}var Zi;function Td(){return Zi||(Zi=1,process.env.NODE_ENV==="production"?Br.exports=Ad():Br.exports=jd()),Br.exports}var p=Td();const Ki=j.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},children:t});function dr(){const e=j.useContext(Ki);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Xi=j.createContext(void 0),Ur=({mode:e,children:t})=>(j.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=j.useContext(Xi);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 jd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ki=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
38
+ */const Od=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();/**
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 Td={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 Pd={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 Od=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>j.createElement("svg",{ref:l,...Td,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ki("lucide",o),...a},[...s.map(([c,d])=>j.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
48
+ */const Id=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>j.createElement("svg",{ref:l,...Pd,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ji("lucide",o),...a},[...s.map(([c,d])=>j.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 ye=(e,t)=>{const r=j.forwardRef(({className:n,...o},i)=>j.createElement(Od,{ref:i,iconNode:t,className:Ki(`lucide-${jd(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
53
+ */const ke=(e,t)=>{const r=j.forwardRef(({className:n,...o},i)=>j.createElement(Id,{ref:i,iconNode:t,className:Ji(`lucide-${Od(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 Pd=ye("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
58
+ */const Dd=ke("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 Id=ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
63
+ */const Rd=ke("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 Dd=ye("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
68
+ */const Ld=ke("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 Rd=ye("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 Md=ke("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 eo=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
78
+ */const to=ke("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=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
83
+ */const Wr=ke("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 Ld=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
88
+ */const Fd=ke("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 to=ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
93
+ */const ro=ke("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 Md=ye("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 Bd=ke("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 Xi=ye("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 Ud=ke("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 Fd=ye("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 Wd=ke("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 Bd=ye("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 $d=ke("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 Ud=ye("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 Hd=ke("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=ye("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 Qi=ke("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=ye("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 $r=ke("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 ro=ye("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 no=ke("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 Ji=ye("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 es=ke("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 Wd=ye("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 Vd=ke("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 $d=ye("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 Yd=ke("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 no=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
153
+ */const oo=ke("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 Hd=ye("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 Zd=ke("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 Vd=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
163
+ */const Kd=ke("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 Yd=ye("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 Gd=ke("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 Zd=ye("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 Xd=ke("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 Gd=ye("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 qd=ke("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 Kd=ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
183
+ */const Jd=ke("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=ye("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 Hr=ke("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 Xd=ye("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 Qd=ke("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 Qi=ye("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 ts=ke("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 Lt=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
203
+ */const Lt=ke("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 qd=ye("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 Jd extends j.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(Xd,{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 Qd=({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:me("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:me("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(to,{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 g,x;const{mode:a}=Gi(),{registry:l}=ur(),c=a==="studio",d=c&&r===e.id,u=l[e.type],m=e.type==="header"||e.type==="footer"?"global":"local",f=e.type==="tiptap",v=e.type==="header"&&((g=e.settings)==null?void 0:g.sticky);if(!u)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 h=()=>{const k=u;return e.type==="header"&&t?p.jsx(k,{data:e.data,settings:e.settings,menu:t}):p.jsx(k,{data:e.data,settings:e.settings})},b=(x=e.data)==null?void 0:x.anchorId;return p.jsxs("div",{id:b||void 0,"data-section-id":c?e.id:void 0,"data-section-type":c?e.type:void 0,"data-section-scope":c?m:void 0,...c&&d?{"data-jp-selected":!0}:{},className:me("relative w-full",c&&!f&&"group cursor-pointer",c&&v?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",d&&"z-[70]"),children:[p.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:p.jsx(Jd,{type:e.type,children:h()})}),c&&!f&&p.jsx(Qd,{type:e.type,scope:m,isSelected:!!d,sectionId:n&&m==="local"?e.id:void 0,sectionIndex:n&&m==="local"?o:void 0,totalSections:n&&m==="local"?i:void 0,onReorder:n&&m==="local"?s:void 0})]})},eu=e=>{j.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])},tu="application/json",oo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,g;eu(e.meta);const[a,l]=j.useState(null),c=j.useRef({}),d=j.useRef(s);d.current=s;const u=x=>{var k;(k=d.current)==null||k.call(d,x)};j.useEffect(()=>{if(!i)return;const x=c.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),j.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],_=new IntersectionObserver(A=>{A.forEach(D=>{var R;if(D.isIntersecting&&D.intersectionRatio>.5){const F=D.target.getAttribute("data-section-id");F&&((R=d.current)==null||R.call(d,F))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const I=requestAnimationFrame(()=>{C||k.forEach(A=>{const D=c.current[A];D&&_.observe(D)})});return()=>{C=!0,cancelAnimationFrame(I),_.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(g=t.footer)==null?void 0:g.id]);const m=(x,k)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",l(k)},f=()=>{l(null)},v=(x,k)=>{if(x.preventDefault(),l(null),!!o)try{const _=x.dataTransfer.getData(tu),{sectionId:C}=JSON.parse(_);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const x=typeof o=="function",k=e.sections.map((_,C)=>{const I=a===C;return x?p.jsxs("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,style:{position:"relative"},onMouseEnter:()=>u(_.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:I?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:I?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:A=>m(A,C),onDragLeave:f,onDrop:A=>v(A,C)}),p.jsx(fr,{section:_,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},_.id):p.jsx("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,onMouseEnter:()=>u(_.id),children:p.jsx(fr,{section:_,selectedId:n})},_.id)});if(x&&k.length>0){const _=e.sections.length,C=a===_;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:I=>m(I,_),onDragLeave:f,onDrop:I=>v(I,_)},"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:x=>{c.current[t.header.id]=x},"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:x=>{c.current[t.footer.id]=x},"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})=>(j.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 ru(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Gr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function io(e){return"nodeType"in e}function Le(e){var t,r;return e?Mt(e)?e:io(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function so(e){const{Document:t}=Le(e);return e instanceof t}function hr(e){return Mt(e)?!1:e instanceof Le(e).HTMLElement}function es(e){return e instanceof Le(e).SVGElement}function Ft(e){return e?Mt(e)?e.document:io(e)?so(e)?e:hr(e)||es(e)?e.ownerDocument:document:document:document}const Ke=Gr?j.useLayoutEffect:j.useEffect;function Kr(e){const t=j.useRef(e);return Ke(()=>{t.current=e}),j.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 nu(){const e=j.useRef(null),t=j.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function pr(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Ke(()=>{r.current!==e&&(r.current=e)},t),r}function mr(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Xr(e){const t=Kr(e),r=j.useRef(null),n=j.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function qr(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let ao={};function gr(e,t){return j.useMemo(()=>{if(t)return t;const r=ao[e]==null?0:ao[e]+1;return ao[e]=r,e+"-"+r},[e,t])}function ts(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 Bt=ts(1),br=ts(-1);function ou(e){return"clientX"in e&&"clientY"in e}function Jr(e){if(!e)return!1;const{KeyboardEvent:t}=Le(e.target);return t&&e instanceof t}function iu(e){if(!e)return!1;const{TouchEvent:t}=Le(e.target);return t&&e instanceof t}function Qr(e){if(iu(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 ou(e)?{x:e.clientX,y:e.clientY}:null}const gt=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[gt.Translate.toString(e),gt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),rs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function su(e){return e.matches(rs)?e:e.querySelector(rs)}const au={display:"none"};function lu(e){let{id:t,value:r}=e;return j.createElement("div",{id:t,style:au},r)}function cu(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 j.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function du(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ns=j.createContext(null);function uu(e){const t=j.useContext(ns);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function fu(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.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 hu={draggable:`
208
+ */const eu=ke("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 tu extends j.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(Qd,{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 ru=({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:pe("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:pe("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(Wr,{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})]})})},ur=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var g,x;const{mode:a}=qi(),{registry:l}=dr(),c=a==="studio",d=c&&r===e.id,u=l[e.type],m=e.type==="header"||e.type==="footer"?"global":"local",f=e.type==="tiptap",v=e.type==="header"&&((g=e.settings)==null?void 0:g.sticky);if(!u)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 h=()=>{const k=u;return e.type==="header"&&t?p.jsx(k,{data:e.data,settings:e.settings,menu:t}):p.jsx(k,{data:e.data,settings:e.settings})},b=(x=e.data)==null?void 0:x.anchorId;return p.jsxs("div",{id:b||void 0,"data-section-id":c?e.id:void 0,"data-section-type":c?e.type:void 0,"data-section-scope":c?m:void 0,...c&&d?{"data-jp-selected":!0}:{},className:pe("relative w-full",c&&!f&&"group cursor-pointer",c&&v?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",d&&"z-[70]"),children:[p.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:p.jsx(tu,{type:e.type,children:h()})}),c&&!f&&p.jsx(ru,{type:e.type,scope:m,isSelected:!!d,sectionId:n&&m==="local"?e.id:void 0,sectionIndex:n&&m==="local"?o:void 0,totalSections:n&&m==="local"?i:void 0,onReorder:n&&m==="local"?s:void 0})]})},nu=e=>{j.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])},ou="application/json",io=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,g;nu(e.meta);const[a,l]=j.useState(null),c=j.useRef({}),d=j.useRef(s);d.current=s;const u=x=>{var k;(k=d.current)==null||k.call(d,x)};j.useEffect(()=>{if(!i)return;const x=c.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),j.useEffect(()=>{if(!d.current)return;const k=[...t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],_=new IntersectionObserver(A=>{A.forEach(I=>{var D;if(I.isIntersecting&&I.intersectionRatio>.5){const B=I.target.getAttribute("data-section-id");B&&((D=d.current)==null||D.call(d,B))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let C=!1;const T=requestAnimationFrame(()=>{C||k.forEach(A=>{const I=c.current[A];I&&_.observe(I)})});return()=>{C=!0,cancelAnimationFrame(T),_.disconnect()}},[e.sections,(b=t.header)==null?void 0:b.id,(g=t.footer)==null?void 0:g.id]);const m=(x,k)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",l(k)},f=()=>{l(null)},v=(x,k)=>{if(x.preventDefault(),l(null),!!o)try{const _=x.dataTransfer.getData(ou),{sectionId:C}=JSON.parse(_);typeof C=="string"&&o(C,k)}catch{}},h=()=>{const x=typeof o=="function",k=e.sections.map((_,C)=>{const T=a===C;return x?p.jsxs("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,style:{position:"relative"},onMouseEnter:()=>u(_.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=>v(A,C)}),p.jsx(ur,{section:_,selectedId:n,reorderable:!0,sectionIndex:C,totalSections:e.sections.length,onReorder:o})]},_.id):p.jsx("div",{ref:A=>{c.current[_.id]=A},"data-section-id":_.id,onMouseEnter:()=>u(_.id),children:p.jsx(ur,{section:_,selectedId:n})},_.id)});if(x&&k.length>0){const _=e.sections.length,C=a===_;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,_),onDragLeave:f,onDrop:T=>v(T,_)},"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:x=>{c.current[t.header.id]=x},"data-section-id":t.header.id,onMouseEnter:()=>u(t.header.id),children:p.jsx(ur,{section:t.header,menu:r.main,selectedId:n})}),p.jsx("main",{className:"flex-1",children:h()}),t.footer!=null&&p.jsx("div",{ref:x=>{c.current[t.footer.id]=x},"data-section-id":t.footer.id,onMouseEnter:()=>u(t.footer.id),children:p.jsx(ur,{section:t.footer,selectedId:n})})]})},Vr=({mode:e,tenantCss:t,adminCss:r,children:n})=>(j.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 iu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Yr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function so(e){return"nodeType"in e}function Re(e){var t,r;return e?Mt(e)?e:so(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ao(e){const{Document:t}=Re(e);return e instanceof t}function fr(e){return Mt(e)?!1:e instanceof Re(e).HTMLElement}function rs(e){return e instanceof Re(e).SVGElement}function Ft(e){return e?Mt(e)?e.document:so(e)?ao(e)?e:fr(e)||rs(e)?e.ownerDocument:document:document:document}const Ke=Yr?j.useLayoutEffect:j.useEffect;function Zr(e){const t=j.useRef(e);return Ke(()=>{t.current=e}),j.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 su(){const e=j.useRef(null),t=j.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=j.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function hr(e,t){t===void 0&&(t=[e]);const r=j.useRef(e);return Ke(()=>{r.current!==e&&(r.current=e)},t),r}function pr(e,t){const r=j.useRef();return j.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Kr(e){const t=Zr(e),r=j.useRef(null),n=j.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function Gr(e){const t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function mr(e,t){return j.useMemo(()=>{if(t)return t;const r=lo[e]==null?0:lo[e]+1;return lo[e]=r,e+"-"+r},[e,t])}function ns(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 Bt=ns(1),gr=ns(-1);function au(e){return"clientX"in e&&"clientY"in e}function Xr(e){if(!e)return!1;const{KeyboardEvent:t}=Re(e.target);return t&&e instanceof t}function lu(e){if(!e)return!1;const{TouchEvent:t}=Re(e.target);return t&&e instanceof t}function qr(e){if(lu(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 au(e)?{x:e.clientX,y:e.clientY}:null}const gt=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[gt.Translate.toString(e),gt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),os="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function cu(e){return e.matches(os)?e:e.querySelector(os)}const du={display:"none"};function uu(e){let{id:t,value:r}=e;return j.createElement("div",{id:t,style:du},r)}function fu(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 j.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function hu(){const[e,t]=j.useState("");return{announce:j.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const is=j.createContext(null);function pu(e){const t=j.useContext(is);j.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function mu(){const[e]=j.useState(()=>new Set),t=j.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[j.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 gu={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
- `},pu={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 mu(e){let{announcements:t=pu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=hu}=e;const{announce:i,announcement:s}=du(),a=gr("DndLiveRegion"),[l,c]=j.useState(!1);if(j.useEffect(()=>{c(!0)},[]),uu(j.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=j.createElement(j.Fragment,null,j.createElement(lu,{id:n,value:o.draggable}),j.createElement(cu,{id:a,announcement:s}));return r?ht.createPortal(d,r):d}var Oe;(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"})(Oe||(Oe={}));function en(){}function lo(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Xe=Object.freeze({x:0,y:0});function os(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bu(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 is(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function vu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ss(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 as(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ls(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 wu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ls(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=os(ls(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(is)},xu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ss(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ss(l),d=o.reduce((m,f,v)=>m+os(c[v],f),0),u=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(is)};function yu(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 ku=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=yu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(vu)};function _u(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function cs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xe}function Su(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 Cu=Su(1);function ds(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 Eu(e,t,r){const n=ds(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 Nu={ignoreTransform:!1};function Ut(e,t){t===void 0&&(t=Nu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Le(e).getComputedStyle(e);c&&(r=Eu(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 us(e){return Ut(e,{ignoreTransform:!0})}function Au(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function zu(e,t){return t===void 0&&(t=Le(e).getComputedStyle(e)),t.position==="fixed"}function ju(e,t){t===void 0&&(t=Le(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(so(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!hr(o)||es(o)||r.includes(o))return r;const i=Le(e).getComputedStyle(o);return o!==e&&ju(o,i)&&r.push(o),zu(o,i)?r:n(o.parentNode)}return e?n(e):r}function fs(e){const[t]=tn(e,1);return t??null}function co(e){return!Gr||!e?null:Mt(e)?e:io(e)?so(e)||e===Ft(e).scrollingElement?window:hr(e)?e:null:null}function hs(e){return Mt(e)?e.scrollX:e.scrollLeft}function ps(e){return Mt(e)?e.scrollY:e.scrollTop}function uo(e){return{x:hs(e),y:ps(e)}}var Pe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pe||(Pe={}));function ms(e){return!Gr||!e?!1:e===document.scrollingElement}function gs(e){const t={x:0,y:0},r=ms(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 Tu={x:.2,y:.2};function Ou(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Tu);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=gs(e),f={x:0,y:0},v={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(f.y=Pe.Backward,v.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(f.y=Pe.Forward,v.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(f.x=Pe.Forward,v.x=n*Math.abs((t.right-h.width-a)/h.width)):!u&&s<=t.left+h.width&&(f.x=Pe.Backward,v.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:f,speed:v}}function Pu(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 bs(e){return e.reduce((t,r)=>Bt(t,uo(r)),Xe)}function Iu(e){return e.reduce((t,r)=>t+hs(r),0)}function Du(e){return e.reduce((t,r)=>t+ps(r),0)}function vs(e,t){if(t===void 0&&(t=Ut),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);fs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ru=[["x",["left","right"],Iu],["y",["top","bottom"],Du]];class fo{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=bs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Ru)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 Lu(e){const{EventTarget:t}=Le(e);return e instanceof t?e:Ft(e)}function ho(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 Ve;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ve||(Ve={}));function ws(e){e.preventDefault()}function Mu(e){e.stopPropagation()}var we;(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"})(we||(we={}));const xs={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},Fu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case we.Right:return{...r,x:r.x+25};case we.Left:return{...r,x:r.x-25};case we.Down:return{...r,y:r.y+25};case we.Up:return{...r,y:r.y-25}}};class po{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(Ft(r)),this.windowListeners=new vr(Le(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ve.Resize,this.handleCancel),this.windowListeners.add(Ve.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ve.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&vs(n),r(Xe)}handleKeyDown(t){if(Jr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=xs,coordinateGetter:s=Fu,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}:Xe;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:v}=n.current;for(const h of v){const b=t.code,{isTop:g,isRight:x,isLeft:k,isBottom:_,maxScroll:C,minScroll:I}=gs(h),A=Pu(h),D={x:Math.min(b===we.Right?A.right-A.width/2:A.right,Math.max(b===we.Right?A.left:A.left+A.width/2,u.x)),y:Math.min(b===we.Down?A.bottom-A.height/2:A.bottom,Math.max(b===we.Down?A.top:A.top+A.height/2,u.y))},R=b===we.Right&&!x||b===we.Left&&!k,F=b===we.Down&&!_||b===we.Up&&!g;if(R&&D.x!==u.x){const Y=h.scrollLeft+m.x,N=b===we.Right&&Y<=C.x||b===we.Left&&Y>=I.x;if(N&&!m.y){h.scrollTo({left:Y,behavior:a});return}N?f.x=h.scrollLeft-Y:f.x=b===we.Right?h.scrollLeft-C.x:h.scrollLeft-I.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(F&&D.y!==u.y){const Y=h.scrollTop+m.y,N=b===we.Down&&Y<=C.y||b===we.Up&&Y>=I.y;if(N&&!m.x){h.scrollTo({top:Y,behavior:a});return}N?f.y=h.scrollTop-Y:f.y=b===we.Down?h.scrollTop-C.y:h.scrollTop-I.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Bt(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()}}po.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=xs,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 ys(e){return!!(e&&"distance"in e)}function ks(e){return!!(e&&"delay"in e)}class mo{constructor(t,r,n){var o;n===void 0&&(n=Lu(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=Ft(s),this.documentListeners=new vr(this.document),this.listeners=new vr(n),this.windowListeners=new vr(Le(s)),this.initialCoordinates=(o=Qr(i))!=null?o:Xe,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(Ve.Resize,this.handleCancel),this.windowListeners.add(Ve.DragStart,ws),this.windowListeners.add(Ve.VisibilityChange,this.handleCancel),this.windowListeners.add(Ve.ContextMenu,ws),this.documentListeners.add(Ve.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ks(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ys(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(Ve.Click,Mu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ve.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:Xe,c=br(o,l);if(!n&&a){if(ys(a)){if(a.tolerance!=null&&ho(c,a.tolerance))return this.handleCancel();if(ho(c,a.distance))return this.handleStart()}if(ks(a)&&ho(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===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Bu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class go extends mo{constructor(t){const{event:r}=t,n=Ft(r.target);super(t,Bu,n)}}go.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 Uu={move:{name:"mousemove"},end:{name:"mouseup"}};var bo;(function(e){e[e.RightClick=2]="RightClick"})(bo||(bo={}));class Wu extends mo{constructor(t){super(t,Uu,Ft(t.event.target))}}Wu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===bo.RightClick?!1:(n==null||n({event:r}),!0)}}];const vo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _s extends mo{constructor(t){super(t,vo)}static setup(){return window.addEventListener(vo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(vo.move.name,t)};function t(){}}}_s.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 $u(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=Vu({delta:u,disabled:!i}),[v,h]=nu(),b=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),x=j.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=j.useRef(null),_=j.useCallback(()=>{const I=k.current;if(!I)return;const A=b.current.x*g.current.x,D=b.current.y*g.current.y;I.scrollBy(A,D)},[]),C=j.useMemo(()=>a===rn.TreeOrder?[...c].reverse():c,[a,c]);j.useEffect(()=>{if(!i||!c.length||!x){h();return}for(const I of C){if((n==null?void 0:n(I))===!1)continue;const A=c.indexOf(I),D=d[A];if(!D)continue;const{direction:R,speed:F}=Ou(I,D,x,t,m);for(const Y of["x","y"])f[Y][R[Y]]||(F[Y]=0,R[Y]=0);if(F.x>0||F.y>0){h(),k.current=I,v(_,s),b.current=F,g.current=R;return}}b.current={x:0,y:0},g.current={x:0,y:0},h()},[t,_,n,h,i,s,JSON.stringify(x),JSON.stringify(f),v,c,C,d,JSON.stringify(m)])}const Hu={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Vu(e){let{delta:t,disabled:r}=e;const n=qr(t);return mr(o=>{if(r||!n||!o)return Hu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Pe.Backward]:o.x[Pe.Backward]||i.x===-1,[Pe.Forward]:o.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:o.y[Pe.Backward]||i.y===-1,[Pe.Forward]:o.y[Pe.Forward]||i.y===1}}},[r,t,n])}function Yu(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 Zu(e,t){return j.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 wo;(function(e){e.Optimized="optimized"})(wo||(wo={}));const Ss=new Map;function Gu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=j.useState(null),{frequency:a,measure:l,strategy:c}=o,d=j.useRef(e),u=b(),m=pr(u),f=j.useCallback(function(g){g===void 0&&(g=[]),!m.current&&s(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[m]),v=j.useRef(null),h=mr(g=>{if(u&&!r)return Ss;if(!g||g===Ss||d.current!==e||i!=null){const x=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const _=k.node.current,C=_?new fo(l(_),_):null;k.rect.current=C,C&&x.set(k.id,C)}return x}return g},[e,i,r,u,l]);return j.useEffect(()=>{d.current=e},[e]),j.useEffect(()=>{u||f()},[r,u]),j.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),j.useEffect(()=>{u||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{f(),v.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 xo(e,t){return mr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Ku(e,t){return xo(e,t)}function Xu(e){let{callback:t,disabled:r}=e;const n=Kr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function nn(e){let{callback:t,disabled:r}=e;const n=Kr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function qu(e){return new fo(Ut(e),e)}function Cs(e,t,r){t===void 0&&(t=qu);const[n,o]=j.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=Xu({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 Ke(()=>{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 Ju(e){const t=xo(e);return cs(e,t)}const Es=[];function Qu(e){const t=j.useRef(e),r=mr(n=>e?n&&n!==Es&&e&&t.current&&e.parentNode===t.current.parentNode?n:tn(e):Es,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function ef(e){const[t,r]=j.useState(null),n=j.useRef(e),o=j.useCallback(i=>{const s=co(i.target);s&&r(a=>a?(a.set(s,uo(s)),new Map(a)):null)},[]);return j.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=co(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,uo(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=co(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Bt(i,s),Xe):bs(e):Xe,[e,t])}function Ns(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==Xe;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?br(e,r.current):Xe}function tf(e){j.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 rf(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function As(e){return j.useMemo(()=>e?Au(e):null,[e])}const zs=[];function nf(e,t){t===void 0&&(t=Ut);const[r]=e,n=As(r?Le(r):null),[o,i]=j.useState(zs);function s(){i(()=>e.length?e.map(l=>ms(l)?n:new fo(t(l),l)):zs)}const a=nn({callback:s});return Ke(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function js(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hr(t)?t:e}function of(e){let{measure:t}=e;const[r,n]=j.useState(null),o=j.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=j.useCallback(c=>{const d=js(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=Xr(s);return j.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const sf=[{sensor:go,options:{}},{sensor:po,options:{}}],af={current:{}},on={draggable:{measure:us},droppable:{measure:us,strategy:xr.WhileDragging,frequency:wo.Optimized},dragOverlay:{measure:Ut}};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 lf={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},Ts={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:en,draggableNodes:new Map,over:null,measureDroppableContainers:en},kr=j.createContext(Ts),Os=j.createContext(lf);function cf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yr}}}function df(e,t){switch(t.type){case Oe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Oe.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 Oe.DragEnd:case Oe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Oe.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 Oe.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 Oe.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 uf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=j.useContext(kr),i=qr(n),s=qr(r==null?void 0:r.id);return j.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=su(d);if(u){u.focus();break}}})}},[n,t,o,s,i]),null}function Ps(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function ff(e){return j.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 hf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=j.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ke(()=>{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=cs(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=fs(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,s,a,n,r])}const sn=j.createContext({...Xe,scaleX:1,scaleY:1});var bt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(bt||(bt={}));const pf=j.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=sf,collisionDetection:u=ku,measuring:m,modifiers:f,...v}=t;const h=j.useReducer(df,void 0,cf),[b,g]=h,[x,k]=fu(),[_,C]=j.useState(bt.Uninitialized),I=_===bt.Initialized,{draggable:{active:A,nodes:D,translate:R},droppable:{containers:F}}=b,Y=A!=null?D.get(A):null,N=j.useRef({initial:null,translated:null}),M=j.useMemo(()=>{var Ne;return A!=null?{id:A,data:(Ne=Y==null?void 0:Y.data)!=null?Ne:af,rect:N}:null},[A,Y]),y=j.useRef(null),[B,te]=j.useState(null),[U,$]=j.useState(null),Z=pr(v,Object.values(v)),ne=gr("DndDescribedBy",s),z=j.useMemo(()=>F.getEnabled(),[F]),L=ff(m),{droppableRects:K,measureDroppableContainers:q,measuringScheduled:ee}=Gu(z,{dragging:I,dependencies:[R.x,R.y],config:L.droppable}),ue=Yu(D,A),re=j.useMemo(()=>U?Qr(U):null,[U]),ie=Gn(),ae=Ku(ue,L.draggable.measure);hf({activeNode:A!=null?D.get(A):null,config:ie.layoutShiftCompensation,initialRect:ae,measure:L.draggable.measure});const oe=Cs(ue,L.draggable.measure,ae),le=Cs(ue?ue.parentElement:null),fe=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=F.getNodeFor((r=fe.current.over)==null?void 0:r.id),w=of({measure:L.dragOverlay.measure}),X=(n=w.nodeRef.current)!=null?n:ue,H=I?(o=w.rect)!=null?o:oe:null,T=!!(w.nodeRef.current&&w.rect),S=Ju(T?null:oe),P=As(X?Le(X):null),W=Qu(I?ve??ue:null),G=nf(W),O=Ps(f,{transform:{x:R.x-S.x,y:R.y-S.y,scaleX:1,scaleY:1},activatorEvent:U,active:M,activeNodeRect:oe,containerNodeRect:le,draggingNodeRect:H,over:fe.current.over,overlayNodeRect:w.rect,scrollableAncestors:W,scrollableAncestorRects:G,windowRect:P}),V=re?Bt(re,R):null,J=ef(W),Q=Ns(J),se=Ns(J,[oe]),pe=Bt(O,Q),he=H?Cu(H,O):null,Ae=M&&he?u({active:M,collisionRect:he,droppableRects:K,droppableContainers:z,pointerCoordinates:V}):null,Se=as(Ae,"id"),[ze,St]=j.useState(null),Ee=T?O:Bt(O,se),sr=_u(Ee,(i=ze==null?void 0:ze.rect)!=null?i:null,oe),Pt=j.useRef(null),Ze=j.useCallback((Ne,Ie)=>{let{sensor:We,options:Ct}=Ie;if(y.current==null)return;const Ge=D.get(y.current);if(!Ge)return;const $e=Ne.nativeEvent,st=new We({active:y.current,activeNode:Ge,event:$e,options:Ct,context:fe,onAbort(Re){if(!D.get(Re))return;const{onDragAbort:at}=Z.current,ft={id:Re};at==null||at(ft),x({type:"onDragAbort",event:ft})},onPending(Re,Et,at,ft){if(!D.get(Re))return;const{onDragPending:Ir}=Z.current,Nt={id:Re,constraint:Et,initialCoordinates:at,offset:ft};Ir==null||Ir(Nt),x({type:"onDragPending",event:Nt})},onStart(Re){const Et=y.current;if(Et==null)return;const at=D.get(Et);if(!at)return;const{onDragStart:ft}=Z.current,Pr={activatorEvent:$e,active:{id:Et,data:at.data,rect:N}};ht.unstable_batchedUpdates(()=>{ft==null||ft(Pr),C(bt.Initializing),g({type:Oe.DragStart,initialCoordinates:Re,active:Et}),x({type:"onDragStart",event:Pr}),te(Pt.current),$($e)})},onMove(Re){g({type:Oe.DragMove,coordinates:Re})},onEnd:ar(Oe.DragEnd),onCancel:ar(Oe.DragCancel)});Pt.current=st;function ar(Re){return async function(){const{active:at,collisions:ft,over:Pr,scrollAdjustedTranslate:Ir}=fe.current;let Nt=null;if(at&&Ir){const{cancelDrop:Dr}=Z.current;Nt={activatorEvent:$e,active:at,collisions:ft,delta:Ir,over:Pr},Re===Oe.DragEnd&&typeof Dr=="function"&&await Promise.resolve(Dr(Nt))&&(Re=Oe.DragCancel)}y.current=null,ht.unstable_batchedUpdates(()=>{g({type:Re}),C(bt.Uninitialized),St(null),te(null),$(null),Pt.current=null;const Dr=Re===Oe.DragEnd?"onDragEnd":"onDragCancel";if(Nt){const bi=Z.current[Dr];bi==null||bi(Nt),x({type:Dr,event:Nt})}})}}},[D]),Yn=j.useCallback((Ne,Ie)=>(We,Ct)=>{const Ge=We.nativeEvent,$e=D.get(Ct);if(y.current!==null||!$e||Ge.dndKit||Ge.defaultPrevented)return;const st={active:$e};Ne(We,Ie.options,st)===!0&&(Ge.dndKit={capturedBy:Ie.sensor},y.current=Ct,Ze(We,Ie))},[D,Ze]),Zn=Zu(d,Yn);tf(d),Ke(()=>{oe&&_===bt.Initializing&&C(bt.Initialized)},[oe,_]),j.useEffect(()=>{const{onDragMove:Ne}=Z.current,{active:Ie,activatorEvent:We,collisions:Ct,over:Ge}=fe.current;if(!Ie||!We)return;const $e={active:Ie,activatorEvent:We,collisions:Ct,delta:{x:pe.x,y:pe.y},over:Ge};ht.unstable_batchedUpdates(()=>{Ne==null||Ne($e),x({type:"onDragMove",event:$e})})},[pe.x,pe.y]),j.useEffect(()=>{const{active:Ne,activatorEvent:Ie,collisions:We,droppableContainers:Ct,scrollAdjustedTranslate:Ge}=fe.current;if(!Ne||y.current==null||!Ie||!Ge)return;const{onDragOver:$e}=Z.current,st=Ct.get(Se),ar=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Re={active:Ne,activatorEvent:Ie,collisions:We,delta:{x:Ge.x,y:Ge.y},over:ar};ht.unstable_batchedUpdates(()=>{St(ar),$e==null||$e(Re),x({type:"onDragOver",event:Re})})},[Se]),Ke(()=>{fe.current={activatorEvent:U,active:M,activeNode:ue,collisionRect:he,collisions:Ae,droppableRects:K,draggableNodes:D,draggingNode:X,draggingNodeRect:H,droppableContainers:F,over:ze,scrollableAncestors:W,scrollAdjustedTranslate:pe},N.current={initial:H,translated:he}},[M,ue,Ae,he,D,X,H,K,F,ze,W,pe]),$u({...ie,delta:R,draggingRect:he,pointerCoordinates:V,scrollableAncestors:W,scrollableAncestorRects:G});const mi=j.useMemo(()=>({active:M,activeNode:ue,activeNodeRect:oe,activatorEvent:U,collisions:Ae,containerNodeRect:le,dragOverlay:w,draggableNodes:D,droppableContainers:F,droppableRects:K,over:ze,measureDroppableContainers:q,scrollableAncestors:W,scrollableAncestorRects:G,measuringConfiguration:L,measuringScheduled:ee,windowRect:P}),[M,ue,oe,U,Ae,le,w,D,F,K,ze,q,W,G,L,ee,P]),gi=j.useMemo(()=>({activatorEvent:U,activators:Zn,active:M,activeNodeRect:oe,ariaDescribedById:{draggable:ne},dispatch:g,draggableNodes:D,over:ze,measureDroppableContainers:q}),[U,Zn,M,oe,g,ne,D,ze,q]);return j.createElement(ns.Provider,{value:k},j.createElement(kr.Provider,{value:gi},j.createElement(Os.Provider,{value:mi},j.createElement(sn.Provider,{value:sr},c)),j.createElement(uf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),j.createElement(mu,{...a,hiddenTextDescribedById:ne}));function Gn(){const Ne=(B==null?void 0:B.autoScrollEnabled)===!1,Ie=typeof l=="object"?l.enabled===!1:l===!1,We=I&&!Ne&&!Ie;return typeof l=="object"?{...l,enabled:We}:{enabled:We}}}),mf=j.createContext(null),Is="button",gf="Draggable";function bf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=gr(gf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=j.useContext(kr),{role:f=Is,roleDescription:v="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,g=j.useContext(b?sn:mf),[x,k]=Xr(),[_,C]=Xr(),I=rf(s,t),A=pr(r);Ke(()=>(u.set(t,{id:t,key:i,node:x,activatorNode:_,data:A}),()=>{const R=u.get(t);R&&R.key===i&&u.delete(t)}),[u,t]);const D=j.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&f===Is?!0:void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[n,f,h,b,v,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:D,isDragging:b,listeners:n?void 0:I,node:x,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Ds(){return j.useContext(Os)}const vf="Droppable",wf={timeout:25};function xf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=gr(vf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=j.useContext(kr),d=j.useRef({disabled:r}),u=j.useRef(!1),m=j.useRef(null),f=j.useRef(null),{disabled:v,updateMeasurementsFor:h,timeout:b}={...wf,...o},g=pr(h??n),x=j.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:x,disabled:v||!s}),_=j.useCallback((D,R)=>{k&&(R&&(k.unobserve(R),u.current=!1),D&&k.observe(D))},[k]),[C,I]=Xr(_),A=pr(t);return j.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),j.useEffect(()=>(a({type:Oe.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:A}}),()=>a({type:Oe.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==d.current.disabled&&(a({type:Oe.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:I}}function yf(e){let{animation:t,children:r}=e;const[n,o]=j.useState(null),[i,s]=j.useState(null),a=qr(r);return!r&&!n&&a&&o(a),Ke(()=>{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]),j.createElement(j.Fragment,null,r,n?j.cloneElement(n,{ref:s}):null)}const kf={x:0,y:0,scaleX:1,scaleY:1};function _f(e){let{children:t}=e;return j.createElement(kr.Provider,{value:Ts},j.createElement(sn.Provider,{value:kf},t))}const Sf={position:"fixed",touchAction:"none"},Cf=e=>Jr(e)?"transform 250ms ease":void 0,Ef=j.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Cf}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},m={...Sf,width:a.width,height:a.height,top:a.top,left:a.left,transform:gt.Transform.toString(u),transformOrigin:o&&n?bu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return j.createElement(r,{className:s,style:m,ref:t},i)}),Nf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:gt.Transform.toString(t)},{transform:gt.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 Af(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Kr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=js(s);if(!c)return;const{transform:d}=Le(s).getComputedStyle(s),u=ds(d);if(!u)return;const m=typeof t=="function"?t:zf(t);return vs(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 zf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Nf,...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}}),[v]=f,h=f[f.length-1];if(JSON.stringify(v)===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(x=>{g.onfinish=()=>{b==null||b(),x()}})}}let Rs=0;function jf(e){return j.useMemo(()=>{if(e!=null)return Rs++,Rs},[e])}const Tf=j.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:v,droppableContainers:h,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:_,windowRect:C}=Ds(),I=j.useContext(sn),A=jf(u==null?void 0:u.id),D=Ps(s,{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:_,transform:I,windowRect:C}),R=xo(m),F=Af({config:n,draggableNodes:v,droppableContainers:h,measuringConfiguration:x}),Y=R?b.setRef:void 0;return j.createElement(_f,null,j.createElement(yf,{animation:F},u&&A?j.createElement(Ef,{key:A,id:u.id,ref:Y,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:R,style:{zIndex:c,...o},transform:D},r):null))}),Of=e=>{let{transform:t}=e;return{...t,x:0}};function Ls(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Pf(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 If(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 Df(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ms=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ls(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},Rf=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=Lf(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 Lf(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 Fs="Sortable",Bs=j.createContext({activeIndex:-1,containerId:Fs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ms,disabled:{draggable:!1,droppable:!1}});function Mf(e){let{children:t,id:r,items:n,strategy:o=Ms,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Ds(),u=gr(Fs,r),m=a.rect!==null,f=j.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),v=s!=null,h=s?f.indexOf(s.id):-1,b=c?f.indexOf(c.id):-1,g=j.useRef(f),x=!If(f,g.current),k=b!==-1&&h===-1||x,_=Df(i);Ke(()=>{x&&v&&d(f)},[x,f,v,d]),j.useEffect(()=>{g.current=f},[f]);const C=j.useMemo(()=>({activeIndex:h,containerId:u,disabled:_,disableTransforms:k,items:f,overIndex:b,useDragOverlay:m,sortedRects:Pf(f,l),strategy:o}),[h,u,_.draggable,_.droppable,k,f,b,l,m,o]);return j.createElement(Bs.Provider,{value:C},t)}const Ff=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ls(r,n,o).indexOf(t)},Bf=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},Uf={duration:200,easing:"ease"},Us="transform",Wf=gt.Transition.toString({property:Us,duration:0,easing:"linear"}),$f={roleDescription:"sortable"};function Hf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=j.useState(null),a=j.useRef(r);return Ke(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Ut(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]),j.useEffect(()=>{i&&s(null)},[i]),i}function Vf(e){let{animateLayoutChanges:t=Bf,attributes:r,disabled:n,data:o,getNewIndex:i=Ff,id:s,strategy:a,resizeObserverConfig:l,transition:c=Uf}=e;const{items:d,containerId:u,activeIndex:m,disabled:f,disableTransforms:v,sortedRects:h,overIndex:b,useDragOverlay:g,strategy:x}=j.useContext(Bs),k=Yf(n,f),_=d.indexOf(s),C=j.useMemo(()=>({sortable:{containerId:u,index:_,items:d},...o}),[u,o,_,d]),I=j.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:A,node:D,isOver:R,setNodeRef:F}=xf({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:Y,activatorEvent:N,activeNodeRect:M,attributes:y,setNodeRef:B,listeners:te,isDragging:U,over:$,setActivatorNodeRef:Z,transform:ne}=bf({id:s,data:C,attributes:{...$f,...r},disabled:k.draggable}),z=ru(F,B),L=!!Y,K=L&&!v&&an(m)&&an(b),q=!g&&U,ee=q&&K?ne:null,re=K?ee??(a??x)({rects:h,activeNodeRect:M,activeIndex:m,overIndex:b,index:_}):null,ie=an(m)&&an(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):_,ae=Y==null?void 0:Y.id,oe=j.useRef({activeId:ae,items:d,newIndex:ie,containerId:u}),le=d!==oe.current.items,fe=t({active:Y,containerId:u,isDragging:U,isSorting:L,id:s,index:_,items:d,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:c,wasDragging:oe.current.activeId!=null}),ve=Hf({disabled:!fe,index:_,node:D,rect:A});return j.useEffect(()=>{L&&oe.current.newIndex!==ie&&(oe.current.newIndex=ie),u!==oe.current.containerId&&(oe.current.containerId=u),d!==oe.current.items&&(oe.current.items=d)},[L,ie,u,d]),j.useEffect(()=>{if(ae===oe.current.activeId)return;if(ae!=null&&oe.current.activeId==null){oe.current.activeId=ae;return}const X=setTimeout(()=>{oe.current.activeId=ae},50);return()=>clearTimeout(X)},[ae]),{active:Y,activeIndex:m,attributes:y,data:C,rect:A,index:_,newIndex:ie,items:d,isOver:R,isSorting:L,isDragging:U,listeners:te,node:D,overIndex:b,over:$,setNodeRef:z,setActivatorNodeRef:Z,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:ve??re,transition:w()};function w(){if(ve||le&&oe.current.newIndex===_)return Wf;if(!(q&&!Jr(N)||!c)&&(L||fe))return gt.Transition.toString({...c,property:Us})}}function Yf(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 Zf=[we.Down,we.Right,we.Up,we.Left],Gf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Zf.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 we.Down:n.top<m.top&&l.push(u);break;case we.Up:n.top>m.top&&l.push(u);break;case we.Left:n.left>m.left&&l.push(u);break;case we.Right:n.left<m.left&&l.push(u);break}});const c=xu({collisionRect:n,droppableRects:o,droppableContainers:l});let d=as(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,v=m==null?void 0:m.node.current;if(v&&f&&u&&m){const b=tn(v).some((I,A)=>a[A]!==I),g=Ws(u,m),x=Kf(u,m),k=b||!g?{x:0,y:0}:{x:x?n.width-f.width:0,y:x?n.height-f.height:0},_={x:f.left,y:f.top};return k.x&&k.y?_:br(_,k)}}}};function Ws(e,t){return!cn(e)||!cn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Kf(e,t){return!cn(e)||!cn(t)||!Ws(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function yo({className:e,type:t,...r}){return p.jsx("input",{type:t,className:me("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 Xf({className:e,...t}){return p.jsx("textarea",{className:me("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 qf({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:me("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function zt({className:e,...t}){return p.jsx("label",{className:me("text-sm font-medium leading-none select-none",e),...t})}function ko(e,[t,r]){return Math.min(r,Math.max(t,e))}function be(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 Wt(e,t=[]){let r=[];function n(i,s){const a=E.createContext(s),l=r.length;r=[...r,s];const c=u=>{var g;const{scope:m,children:f,...v}=u,h=((g=m==null?void 0:m[e])==null?void 0:g[l])||a,b=E.useMemo(()=>v,Object.values(v));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,v=E.useContext(f);if(v)return v;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=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Jf(o,...t)]}function Jf(...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 E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function $s(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=$s(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():$s(e[o],null)}}}}function _e(...e){return E.useCallback(Hs(...e),e)}function $t(e){const t=eh(e),r=E.forwardRef((n,o)=>{const{children:i,...s}=n,a=E.Children.toArray(i),l=a.find(rh);if(l){const c=l.props.children,d=a.map(u=>u===l?E.Children.count(c)>1?E.Children.only(null):E.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...s,ref:o,children:E.isValidElement(c)?E.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Qf=$t("Slot");function eh(e){const t=E.forwardRef((r,n)=>{const{children:o,...i}=r;if(E.isValidElement(o)){const s=oh(o),a=nh(i,o.props);return o.type!==E.Fragment&&(a.ref=n?Hs(n,s):s),E.cloneElement(o,a)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vs=Symbol("radix.slottable");function th(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Vs,t}function rh(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vs}function nh(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 oh(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 ih(e){const t=e+"CollectionProvider",[r,n]=Wt(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:g}=h,x=j.useRef(null),k=j.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:x,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=$t(a),c=j.forwardRef((h,b)=>{const{scope:g,children:x}=h,k=i(a,g),_=_e(b,k.collectionRef);return p.jsx(l,{ref:_,children:x})});c.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=$t(d),f=j.forwardRef((h,b)=>{const{scope:g,children:x,...k}=h,_=j.useRef(null),C=_e(b,_),I=i(d,g);return j.useEffect(()=>(I.itemMap.set(_,{ref:_,...k}),()=>void I.itemMap.delete(_))),p.jsx(m,{[u]:"",ref:C,children:x})});f.displayName=d;function v(h){const b=i(e+"CollectionConsumer",h);return j.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const k=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((I,A)=>k.indexOf(I.ref.current)-k.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},v,n]}var sh=E.createContext(void 0);function Ys(e){const t=E.useContext(sh);return e||t||"ltr"}var ah=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=ah.reduce((e,t)=>{const r=$t(`Primitive.${t}`),n=E.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 lh(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}function Me(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function ch(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e);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 dh="DismissableLayer",_o="dismissableLayer.update",uh="dismissableLayer.pointerDownOutside",fh="dismissableLayer.focusOutside",Zs,Gs=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dn=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=E.useContext(Gs),[d,u]=E.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=E.useState({}),v=_e(t,A=>u(A)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(b),x=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=g,C=mh(A=>{const D=A.target,R=[...c.branches].some(F=>F.contains(D));!_||R||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},m),I=gh(A=>{const D=A.target;[...c.branches].some(F=>F.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},m);return ch(A=>{x===c.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},m),E.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ks(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zs)}},[d,m,r,c]),E.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ks())},[d,c]),E.useEffect(()=>{const A=()=>f({});return document.addEventListener(_o,A),()=>document.removeEventListener(_o,A)},[]),p.jsx(ke.div,{...l,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,I.onFocusCapture),onBlurCapture:be(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});dn.displayName=dh;var hh="DismissableLayerBranch",ph=E.forwardRef((e,t)=>{const r=E.useContext(Gs),n=E.useRef(null),o=_e(t,n);return E.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(ke.div,{...e,ref:o})});ph.displayName=hh;function mh(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e),n=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Xs(uh,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 gh(e,t=globalThis==null?void 0:globalThis.document){const r=Me(e),n=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!n.current&&Xs(fh,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 Ks(){const e=new CustomEvent(_o);document.dispatchEvent(e)}function Xs(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?lh(o,i):o.dispatchEvent(i)}var So=0;function qs(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Js()),document.body.insertAdjacentElement("beforeend",e[1]??Js()),So++,()=>{So===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),So--}},[])}function Js(){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 Co="focusScope.autoFocusOnMount",Eo="focusScope.autoFocusOnUnmount",Qs={bubbles:!1,cancelable:!0},bh="FocusScope",No=E.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=E.useState(null),c=Me(o),d=Me(i),u=E.useRef(null),m=_e(t,h=>l(h)),f=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(n){let h=function(k){if(f.paused||!a)return;const _=k.target;a.contains(_)?u.current=_:vt(u.current,{select:!0})},b=function(k){if(f.paused||!a)return;const _=k.relatedTarget;_!==null&&(a.contains(_)||vt(u.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&vt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const x=new MutationObserver(g);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),x.disconnect()}}},[n,a,f.paused]),E.useEffect(()=>{if(a){ra.add(f);const h=document.activeElement;if(!a.contains(h)){const g=new CustomEvent(Co,Qs);a.addEventListener(Co,c),a.dispatchEvent(g),g.defaultPrevented||(vh(_h(ea(a)),{select:!0}),document.activeElement===h&&vt(a))}return()=>{a.removeEventListener(Co,c),setTimeout(()=>{const g=new CustomEvent(Eo,Qs);a.addEventListener(Eo,d),a.dispatchEvent(g),g.defaultPrevented||vt(h??document.body,{select:!0}),a.removeEventListener(Eo,d),ra.remove(f)},0)}}},[a,c,d,f]);const v=E.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 x=h.currentTarget,[k,_]=wh(x);k&&_?!h.shiftKey&&g===_?(h.preventDefault(),r&&vt(k,{select:!0})):h.shiftKey&&g===k&&(h.preventDefault(),r&&vt(_,{select:!0})):g===x&&h.preventDefault()}},[r,n,f.paused]);return p.jsx(ke.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});No.displayName=bh;function vh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(vt(n,{select:t}),document.activeElement!==r)return}function wh(e){const t=ea(e),r=ta(t,e),n=ta(t.reverse(),e);return[r,n]}function ea(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 ta(e,t){for(const r of e)if(!xh(r,{upTo:t}))return r}function xh(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 yh(e){return e instanceof HTMLInputElement&&"select"in e}function vt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yh(e)&&t&&e.select()}}var ra=kh();function kh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=na(e,t),e.unshift(t)},remove(t){var r;e=na(e,t),(r=e[0])==null||r.resume()}}}function na(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function _h(e){return e.filter(t=>t.tagName!=="A")}var De=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Sh=E[" useId ".trim().toString()]||(()=>{}),Ch=0;function _r(e){const[t,r]=E.useState(Sh());return De(()=>{r(n=>n??String(Ch++))},[e]),t?`radix-${t}`:""}const Eh=["top","right","bottom","left"],wt=Math.min,Fe=Math.max,un=Math.round,fn=Math.floor,et=e=>({x:e,y:e}),Nh={left:"right",right:"left",bottom:"top",top:"bottom"},Ah={start:"end",end:"start"};function Ao(e,t,r){return Fe(e,wt(t,r))}function ct(e,t){return typeof e=="function"?e(t):e}function dt(e){return e.split("-")[0]}function Ht(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const zh=new Set(["top","bottom"]);function tt(e){return zh.has(dt(e))?"y":"x"}function To(e){return zo(tt(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=Ht(e),o=To(e),i=jo(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 Th(e){const t=hn(e);return[Oo(e),t,Oo(t)]}function Oo(e){return e.replace(/start|end/g,t=>Ah[t])}const oa=["left","right"],ia=["right","left"],Oh=["top","bottom"],Ph=["bottom","top"];function Ih(e,t,r){switch(e){case"top":case"bottom":return r?t?ia:oa:t?oa:ia;case"left":case"right":return t?Oh:Ph;default:return[]}}function Dh(e,t,r,n){const o=Ht(e);let i=Ih(dt(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Oo)))),i}function hn(e){return e.replace(/left|right|bottom|top/g,t=>Nh[t])}function Rh(e){return{top:0,right:0,bottom:0,left:0,...e}}function sa(e){return typeof e!="number"?Rh(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 aa(e,t,r){let{reference:n,floating:o}=e;const i=tt(t),s=To(t),a=jo(s),l=dt(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(Ht(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 Lh(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}=ct(t,e),v=sa(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})),x=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)),_=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:x,offsetParent:k,strategy:l}):x);return{top:(g.top-C.top+v.top)/_.y,bottom:(C.bottom-g.bottom+v.bottom)/_.y,left:(g.left-C.left+v.left)/_.x,right:(C.right-g.right+v.right)/_.x}}const Mh=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}=aa(c,n,l),m=n,f={},v=0;for(let b=0;b<a.length;b++){var h;const{name:g,fn:x}=a[b],{x:k,y:_,data:C,reset:I}=await x({x:d,y:u,initialPlacement:n,placement:m,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Lh},elements:{reference:e,floating:t}});d=k??d,u=_??u,f={...f,[g]:{...f[g],...C}},I&&v<=50&&(v++,typeof I=="object"&&(I.placement&&(m=I.placement),I.rects&&(c=I.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:d,y:u}=aa(c,m,l)),b=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:f}},Fh=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}=ct(e,t)||{};if(c==null)return{};const u=sa(d),m={x:r,y:n},f=To(o),v=jo(f),h=await s.getDimensions(c),b=f==="y",g=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",_=i.reference[v]+i.reference[f]-m[f]-i.floating[v],C=m[f]-i.reference[f],I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=I?I[k]:0;(!A||!await(s.isElement==null?void 0:s.isElement(I)))&&(A=a.floating[k]||i.floating[v]);const D=_/2-C/2,R=A/2-h[v]/2-1,F=wt(u[g],R),Y=wt(u[x],R),N=F,M=A-h[v]-Y,y=A/2-h[v]/2+D,B=Ao(N,y,M),te=!l.arrow&&Ht(o)!=null&&y!==B&&i.reference[v]/2-(y<N?F:Y)-h[v]/2<0,U=te?y<N?y-N:y-M:0;return{[f]:m[f]+U,data:{[f]:B,centerOffset:y-B-U,...te&&{alignmentOffset:U}},reset:te}}}),Bh=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:v="none",flipAlignment:h=!0,...b}=ct(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=dt(o),x=tt(a),k=dt(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[hn(a)]:Th(a)),I=v!=="none";!m&&I&&C.push(...Dh(a,h,v,_));const A=[a,...C],D=await l.detectOverflow(t,b),R=[];let F=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&R.push(D[g]),u){const y=jh(o,s,_);R.push(D[y[0]],D[y[1]])}if(F=[...F,{placement:o,overflows:R}],!R.every(y=>y<=0)){var Y,N;const y=(((Y=i.flip)==null?void 0:Y.index)||0)+1,B=A[y];if(B&&(!(u==="alignment"?x!==tt(B):!1)||F.every($=>tt($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:y,overflows:F},reset:{placement:B}};let te=(N=F.filter(U=>U.overflows[0]<=0).sort((U,$)=>U.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(f){case"bestFit":{var M;const U=(M=F.filter($=>{if(I){const Z=tt($.placement);return Z===x||Z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Z=>Z>0).reduce((Z,ne)=>Z+ne,0)]).sort(($,Z)=>$[1]-Z[1])[0])==null?void 0:M[0];U&&(te=U);break}case"initialPlacement":te=a;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function la(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ca(e){return Eh.some(t=>e[t]>=0)}const Uh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ct(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=la(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ca(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=la(s,r.floating);return{data:{escapedOffsets:a,escaped:ca(a)}}}default:return{}}}}},da=new Set(["left","top"]);async function Wh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=dt(r),a=Ht(r),l=tt(r)==="y",c=da.has(s)?-1:1,d=i&&l?-1:1,u=ct(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const $h=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 Wh(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}}}}},Hh=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,y:k}=g;return{x,y:k}}},...c}=ct(e,t),d={x:r,y:n},u=await i.detectOverflow(t,c),m=tt(dt(o)),f=zo(m);let v=d[f],h=d[m];if(s){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",k=v+u[g],_=v-u[x];v=Ao(k,v,_)}if(a){const g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",k=h+u[g],_=h-u[x];h=Ao(k,h,_)}const b=l.fn({...t,[f]:v,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[f]:s,[m]:a}}}}}},Vh=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}=ct(e,t),d={x:r,y:n},u=tt(o),m=zo(u);let f=d[m],v=d[u];const h=ct(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",_=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;f<_?f=_:f>C&&(f=C)}if(c){var g,x;const k=m==="y"?"width":"height",_=da.has(dt(o)),C=i.reference[u]-i.floating[k]+(_&&((g=s.offset)==null?void 0:g[u])||0)+(_?0:b.crossAxis),I=i.reference[u]+i.reference[k]+(_?0:((x=s.offset)==null?void 0:x[u])||0)-(_?b.crossAxis:0);v<C?v=C:v>I&&(v=I)}return{[m]:f,[u]:v}}}},Yh=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}=ct(e,t),d=await s.detectOverflow(t,c),u=dt(o),m=Ht(o),f=tt(o)==="y",{width:v,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 x=h-d.top-d.bottom,k=v-d.left-d.right,_=wt(h-d[b],x),C=wt(v-d[g],k),I=!t.middlewareData.shift;let A=_,D=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(D=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=x),I&&!m){const F=Fe(d.left,0),Y=Fe(d.right,0),N=Fe(d.top,0),M=Fe(d.bottom,0);f?D=v-2*(F!==0||Y!==0?F+Y:Fe(d.left,d.right)):A=h-2*(N!==0||M!==0?N+M:Fe(d.top,d.bottom))}await l({...t,availableWidth:D,availableHeight:A});const R=await s.getDimensions(a.floating);return v!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Vt(e){return ua(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ua(e){return mn()?e instanceof Node||e instanceof Be(e).Node:!1}function qe(e){return mn()?e instanceof Element||e instanceof Be(e).Element:!1}function nt(e){return mn()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function fa(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}const Zh=new Set(["inline","contents"]);function Sr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Zh.has(o)}const Gh=new Set(["table","td","th"]);function Kh(e){return Gh.has(Vt(e))}const Xh=[":popover-open",":modal"];function gn(e){return Xh.some(t=>{try{return e.matches(t)}catch{return!1}})}const qh=["transform","translate","scale","rotate","perspective"],Jh=["transform","translate","scale","rotate","perspective","filter"],Qh=["paint","layout","strict","content"];function Po(e){const t=Io(),r=qe(e)?Je(e):e;return qh.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)||Jh.some(n=>(r.willChange||"").includes(n))||Qh.some(n=>(r.contain||"").includes(n))}function ep(e){let t=xt(e);for(;nt(t)&&!Yt(t);){if(Po(t))return t;if(gn(t))return null;t=xt(t)}return null}function Io(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tp=new Set(["html","body","#document"]);function Yt(e){return tp.has(Vt(e))}function Je(e){return Be(e).getComputedStyle(e)}function bn(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if(Vt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fa(e)&&e.host||rt(e);return fa(t)?t.host:t}function ha(e){const t=xt(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&&Sr(t)?t:ha(t)}function Cr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ha(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Be(o);if(i){const a=Do(s);return t.concat(s,s.visualViewport||[],Sr(o)?o:[],a&&r?Cr(a):[])}return t.concat(o,Cr(o,[],r))}function Do(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pa(e){const t=Je(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=nt(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 Ro(e){return qe(e)?e:e.contextElement}function Zt(e){const t=Ro(e);if(!nt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=pa(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 rp=et(0);function ma(e){const t=Be(e);return!Io()||!t.visualViewport?rp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function np(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Be(e)?!1:t}function jt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ro(e);let s=et(1);t&&(n?qe(n)&&(s=Zt(n)):s=Zt(e));const a=np(i,r,n)?ma(i):et(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=Be(i),f=n&&qe(n)?Be(n):n;let v=m,h=Do(v);for(;h&&n&&f!==v;){const b=Zt(h),g=h.getBoundingClientRect(),x=Je(h),k=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*b.x,_=g.top+(h.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=k,c+=_,v=Be(h),h=Do(v)}}return pn({width:d,height:u,x:l,y:c})}function vn(e,t){const r=bn(e).scrollLeft;return t?t.left+r:jt(rt(e)).left+r}function ga(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 op(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=rt(n),a=t?gn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=et(1);const d=et(0),u=nt(n);if((u||!u&&!i)&&((Vt(n)!=="body"||Sr(s))&&(l=bn(n)),nt(n))){const f=jt(n);c=Zt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const m=s&&!u&&!i?ga(s,l):et(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 ip(e){return Array.from(e.getClientRects())}function sp(e){const t=rt(e),r=bn(e),n=e.ownerDocument.body,o=Fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+vn(e);const a=-r.scrollTop;return Je(n).direction==="rtl"&&(s+=Fe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ba=25;function ap(e,t){const r=Be(e),n=rt(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=Io();(!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,v=Math.abs(n.clientWidth-u.clientWidth-f);v<=ba&&(i-=v)}else c<=ba&&(i+=c);return{width:i,height:s,x:a,y:l}}const lp=new Set(["absolute","fixed"]);function cp(e,t){const r=jt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=nt(e)?Zt(e):et(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 va(e,t,r){let n;if(t==="viewport")n=ap(e,r);else if(t==="document")n=sp(rt(e));else if(qe(t))n=cp(t,r);else{const o=ma(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pn(n)}function wa(e,t){const r=xt(e);return r===t||!qe(r)||Yt(r)?!1:Je(r).position==="fixed"||wa(r,t)}function dp(e,t){const r=t.get(e);if(r)return r;let n=Cr(e,[],!1).filter(a=>qe(a)&&Vt(a)!=="body"),o=null;const i=Je(e).position==="fixed";let s=i?xt(e):e;for(;qe(s)&&!Yt(s);){const a=Je(s),l=Po(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&lp.has(o.position)||Sr(s)&&!l&&wa(e,s))?n=n.filter(d=>d!==s):o=a,s=xt(s)}return t.set(e,n),n}function up(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?gn(t)?[]:dp(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const u=va(t,d,o);return c.top=Fe(u.top,c.top),c.right=wt(u.right,c.right),c.bottom=wt(u.bottom,c.bottom),c.left=Fe(u.left,c.left),c},va(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fp(e){const{width:t,height:r}=pa(e);return{width:t,height:r}}function hp(e,t,r){const n=nt(t),o=rt(t),i=r==="fixed",s=jt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);function c(){l.x=vn(o)}if(n||!n&&!i)if((Vt(t)!=="body"||Sr(o))&&(a=bn(t)),n){const f=jt(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?ga(o,a):et(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 Lo(e){return Je(e).position==="static"}function xa(e,t){if(!nt(e)||Je(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rt(e)===r&&(r=r.ownerDocument.body),r}function ya(e,t){const r=Be(e);if(gn(e))return r;if(!nt(e)){let o=xt(e);for(;o&&!Yt(o);){if(qe(o)&&!Lo(o))return o;o=xt(o)}return r}let n=xa(e,t);for(;n&&Kh(n)&&Lo(n);)n=xa(n,t);return n&&Yt(n)&&Lo(n)&&!Po(n)?r:n||ep(e)||r}const pp=async function(e){const t=this.getOffsetParent||ya,r=this.getDimensions,n=await r(e.floating);return{reference:hp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function mp(e){return Je(e).direction==="rtl"}const gp={convertOffsetParentRelativeRectToViewportRelativeRect:op,getDocumentElement:rt,getClippingRect:up,getOffsetParent:ya,getElementRects:pp,getClientRects:ip,getDimensions:fp,getScale:Zt,isElement:qe,isRTL:mp};function ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bp(e,t){let r=null,n;const o=rt(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 v=fn(u),h=fn(o.clientWidth-(d+m)),b=fn(o.clientHeight-(u+f)),g=fn(d),k={rootMargin:-v+"px "+-h+"px "+-b+"px "+-g+"px",threshold:Fe(0,wt(1,l))||1};let _=!0;function C(I){const A=I[0].intersectionRatio;if(A!==l){if(!_)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!ka(c,e.getBoundingClientRect())&&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 vp(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=Ro(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?bp(c,r):null;let m=-1,f=null;s&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.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 v,h=l?jt(e):null;l&&b();function b(){const g=jt(e);h&&!ka(h,g)&&r(),h=g,v=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(x=>{o&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const wp=$h,xp=Hh,yp=Bh,kp=Yh,_p=Uh,_a=Fh,Sp=Vh,Cp=(e,t,r)=>{const n=new Map,o={platform:gp,...r},i={...o.platform,_c:n};return Mh(e,t,{...o,platform:i})};var Ep=typeof document<"u",Np=function(){},wn=Ep?j.useLayoutEffect:Np;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 Sa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ca(e,t){const r=Sa(e);return Math.round(t*r)/r}function Mo(e){const t=E.useRef(e);return wn(()=>{t.current=e}),t}function Ap(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]=E.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=E.useState(n);xn(m,n)||f(n);const[v,h]=E.useState(null),[b,g]=E.useState(null),x=E.useCallback($=>{$!==I.current&&(I.current=$,h($))},[]),k=E.useCallback($=>{$!==A.current&&(A.current=$,g($))},[]),_=i||v,C=s||b,I=E.useRef(null),A=E.useRef(null),D=E.useRef(d),R=l!=null,F=Mo(l),Y=Mo(o),N=Mo(c),M=E.useCallback(()=>{if(!I.current||!A.current)return;const $={placement:t,strategy:r,middleware:m};Y.current&&($.platform=Y.current),Cp(I.current,A.current,$).then(Z=>{const ne={...Z,isPositioned:N.current!==!1};y.current&&!xn(D.current,ne)&&(D.current=ne,Rr.flushSync(()=>{u(ne)}))})},[m,t,r,Y,N]);wn(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,u($=>({...$,isPositioned:!1})))},[c]);const y=E.useRef(!1);wn(()=>(y.current=!0,()=>{y.current=!1}),[]),wn(()=>{if(_&&(I.current=_),C&&(A.current=C),_&&C){if(F.current)return F.current(_,C,M);M()}},[_,C,M,F,R]);const B=E.useMemo(()=>({reference:I,floating:A,setReference:x,setFloating:k}),[x,k]),te=E.useMemo(()=>({reference:_,floating:C}),[_,C]),U=E.useMemo(()=>{const $={position:r,left:0,top:0};if(!te.floating)return $;const Z=Ca(te.floating,d.x),ne=Ca(te.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+ne+"px)",...Sa(te.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:ne}},[r,a,te.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:M,refs:B,elements:te,floatingStyles:U}),[d,M,B,te,U])}const zp=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?_a({element:n.current,padding:o}).fn(r):{}:n?_a({element:n,padding:o}).fn(r):{}}}},jp=(e,t)=>({...wp(e),options:[e,t]}),Tp=(e,t)=>({...xp(e),options:[e,t]}),Op=(e,t)=>({...Sp(e),options:[e,t]}),Pp=(e,t)=>({...yp(e),options:[e,t]}),Ip=(e,t)=>({...kp(e),options:[e,t]}),Dp=(e,t)=>({..._p(e),options:[e,t]}),Rp=(e,t)=>({...zp(e),options:[e,t]});var Lp="Arrow",Ea=E.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(ke.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"})})});Ea.displayName=Lp;var Mp=Ea;function Fp(e){const[t,r]=E.useState(void 0);return De(()=>{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 Fo="Popper",[Na,Gt]=Wt(Fo),[Bp,Aa]=Na(Fo),za=e=>{const{__scopePopper:t,children:r}=e,[n,o]=E.useState(null);return p.jsx(Bp,{scope:t,anchor:n,onAnchorChange:o,children:r})};za.displayName=Fo;var ja="PopperAnchor",Ta=E.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Aa(ja,r),s=E.useRef(null),a=_e(t,s),l=E.useRef(null);return E.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(ke.div,{...o,ref:a})});Ta.displayName=ja;var Bo="PopperContent",[Up,Wp]=Na(Bo),Oa=E.forwardRef((e,t)=>{var re,ie,ae,oe,le,fe;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:v,...h}=e,b=Aa(Bo,r),[g,x]=E.useState(null),k=_e(t,ve=>x(ve)),[_,C]=E.useState(null),I=Fp(_),A=(I==null?void 0:I.width)??0,D=(I==null?void 0:I.height)??0,R=n+(i!=="center"?"-"+i:""),F=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Y=Array.isArray(c)?c:[c],N=Y.length>0,M={padding:F,boundary:Y.filter(Hp),altBoundary:N},{refs:y,floatingStyles:B,placement:te,isPositioned:U,middlewareData:$}=Ap({strategy:"fixed",placement:R,whileElementsMounted:(...ve)=>vp(...ve,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[jp({mainAxis:o+D,alignmentAxis:s}),l&&Tp({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Op():void 0,...M}),l&&Pp({...M}),Ip({...M,apply:({elements:ve,rects:w,availableWidth:X,availableHeight:H})=>{const{width:T,height:S}=w.reference,P=ve.floating.style;P.setProperty("--radix-popper-available-width",`${X}px`),P.setProperty("--radix-popper-available-height",`${H}px`),P.setProperty("--radix-popper-anchor-width",`${T}px`),P.setProperty("--radix-popper-anchor-height",`${S}px`)}}),_&&Rp({element:_,padding:a}),Vp({arrowWidth:A,arrowHeight:D}),m&&Dp({strategy:"referenceHidden",...M})]}),[Z,ne]=Da(te),z=Me(v);De(()=>{U&&(z==null||z())},[U,z]);const L=(re=$.arrow)==null?void 0:re.x,K=(ie=$.arrow)==null?void 0:ie.y,q=((ae=$.arrow)==null?void 0:ae.centerOffset)!==0,[ee,ue]=E.useState();return De(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),p.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:U?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(oe=$.transformOrigin)==null?void 0:oe.x,(le=$.transformOrigin)==null?void 0:le.y].join(" "),...((fe=$.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Up,{scope:r,placedSide:Z,onArrowChange:C,arrowX:L,arrowY:K,shouldHideArrow:q,children:p.jsx(ke.div,{"data-side":Z,"data-align":ne,...h,ref:k,style:{...h.style,animation:U?void 0:"none"}})})})});Oa.displayName=Bo;var Pa="PopperArrow",$p={top:"bottom",right:"left",bottom:"top",left:"right"},Ia=E.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Wp(Pa,n),s=$p[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(Mp,{...o,ref:r,style:{...o.style,display:"block"}})})});Ia.displayName=Pa;function Hp(e){return e!==null}var Vp=e=>({name:"transformOrigin",options:e,fn(t){var b,g,x;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]=Da(r),u={start:"0%",center:"50%",end:"100%"}[d],m=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let v="",h="";return c==="bottom"?(v=s?u:`${m}px`,h=`${-l}px`):c==="top"?(v=s?u:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,h=s?u:`${f}px`):c==="left"&&(v=`${n.floating.width+l}px`,h=s?u:`${f}px`),{data:{x:v,y:h}}}});function Da(e){const[t,r="center"]=e.split("-");return[t,r]}var Uo=za,yn=Ta,Wo=Oa,$o=Ia,Yp="Portal",kn=E.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=E.useState(!1);De(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ht.createPortal(p.jsx(ke.div,{...n,ref:t}),s):null});kn.displayName=Yp;var Zp=E[" useInsertionEffect ".trim().toString()]||De;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Gp({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=E.useRef(e!==void 0);E.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=E.useCallback(d=>{var u;if(a){const m=Kp(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 Gp({defaultProp:e,onChange:t}){const[r,n]=E.useState(e),o=E.useRef(r),i=E.useRef(t);return Zp(()=>{i.current=t},[t]),E.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Kp(e){return typeof e=="function"}function Xp(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ra=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"}),qp="VisuallyHidden",La=E.forwardRef((e,t)=>p.jsx(ke.span,{...e,ref:t,style:{...Ra,...e.style}}));La.displayName=qp;var Jp=La,Qp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Kt=new WeakMap,Sn=new WeakMap,Cn={},Ho=0,Ma=function(e){return e&&(e.host||Ma(e.parentNode))},em=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ma(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})},tm=function(e,t,r,n){var o=em(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),v=f!==null&&f!=="false",h=(Kt.get(m)||0)+1,b=(i.get(m)||0)+1;Kt.set(m,h),i.set(m,b),s.push(m),h===1&&v&&Sn.set(m,!0),b===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return d(t),a.clear(),Ho++,function(){s.forEach(function(u){var m=Kt.get(u)-1,f=i.get(u)-1;Kt.set(u,m),i.set(u,f),m||(Sn.has(u)||u.removeAttribute(n),Sn.delete(u)),f||u.removeAttribute(r)}),Ho--,Ho||(Kt=new WeakMap,Kt=new WeakMap,Sn=new WeakMap,Cn={})}},Fa=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Qp(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),tm(n,o,r,"aria-hidden")):function(){return null}},ot=function(){return ot=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},ot.apply(this,arguments)};function Ba(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 rm(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",nm="with-scroll-bars-hidden",om="--removed-body-scroll-bar-size";function Vo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function im(e,t){var r=j.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 sm=typeof window<"u"?E.useLayoutEffect:E.useEffect,Ua=new WeakMap;function am(e,t){var r=im(null,function(n){return e.forEach(function(o){return Vo(o,n)})});return sm(function(){var n=Ua.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Vo(a,null)}),i.forEach(function(a){o.has(a)||Vo(a,s)})}Ua.set(r,e)},[e]),r}function lm(e){return e}function cm(e,t){t===void 0&&(t=lm);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 dm(e){e===void 0&&(e={});var t=cm(null);return t.options=ot({async:!0,ssr:!1},e),t}var Wa=function(e){var t=e.sideCar,r=Ba(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 E.createElement(n,ot({},r))};Wa.isSideCarExport=!0;function um(e,t){return e.useMedium(t),Wa}var $a=dm(),Yo=function(){},An=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:Yo,onWheelCapture:Yo,onTouchMoveCapture:Yo}),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,v=e.noIsolation,h=e.inert,b=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,k=e.gapMode,_=Ba(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,I=am([r,t]),A=ot(ot({},_),o);return E.createElement(E.Fragment,null,d&&E.createElement(C,{sideCar:$a,removeScrollBar:c,shards:u,noRelative:f,noIsolation:v,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?E.cloneElement(E.Children.only(a),ot(ot({},A),{ref:I})):E.createElement(x,ot({},A,{className:l,ref:I}),a))});An.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},An.classNames={fullWidth:Nn,zeroRight:En};var fm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fm();return t&&e.setAttribute("nonce",t),e}function pm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=hm())&&(pm(t,r),mm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bm=function(){var e=gm();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ha=function(){var e=bm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vm={left:0,top:0,right:0,gap:0},Zo=function(e){return parseInt(e||"",10)||0},wm=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[Zo(r),Zo(n),Zo(o)]},xm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vm;var t=wm(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])}},ym=Ha(),Xt="data-scroll-locked",km=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(nm,` {
212
+ `},bu={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 vu(e){let{announcements:t=bu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=gu}=e;const{announce:i,announcement:s}=hu(),a=mr("DndLiveRegion"),[l,c]=j.useState(!1);if(j.useEffect(()=>{c(!0)},[]),pu(j.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=j.createElement(j.Fragment,null,j.createElement(uu,{id:n,value:o.draggable}),j.createElement(fu,{id:a,announcement:s}));return r?ht.createPortal(d,r):d}var je;(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"})(je||(je={}));function Jr(){}function co(e,t){return j.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function wu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Ge=Object.freeze({x:0,y:0});function ss(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xu(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 as(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function yu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ls(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 cs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ds(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 ku=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ds(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ss(ds(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(as)},_u=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ls(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ls(l),d=o.reduce((m,f,v)=>m+ss(c[v],f),0),u=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(as)};function Su(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 Cu=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=Su(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(yu)};function Eu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function us(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ge}function Nu(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 zu=Nu(1);function fs(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 Au(e,t,r){const n=fs(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 ju={ignoreTransform:!1};function Ut(e,t){t===void 0&&(t=ju);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Re(e).getComputedStyle(e);c&&(r=Au(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 hs(e){return Ut(e,{ignoreTransform:!0})}function Tu(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ou(e,t){return t===void 0&&(t=Re(e).getComputedStyle(e)),t.position==="fixed"}function Pu(e,t){t===void 0&&(t=Re(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 Qr(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(!fr(o)||rs(o)||r.includes(o))return r;const i=Re(e).getComputedStyle(o);return o!==e&&Pu(o,i)&&r.push(o),Ou(o,i)?r:n(o.parentNode)}return e?n(e):r}function ps(e){const[t]=Qr(e,1);return t??null}function uo(e){return!Yr||!e?null:Mt(e)?e:so(e)?ao(e)||e===Ft(e).scrollingElement?window:fr(e)?e:null:null}function ms(e){return Mt(e)?e.scrollX:e.scrollLeft}function gs(e){return Mt(e)?e.scrollY:e.scrollTop}function fo(e){return{x:ms(e),y:gs(e)}}var Oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oe||(Oe={}));function bs(e){return!Yr||!e?!1:e===document.scrollingElement}function vs(e){const t={x:0,y:0},r=bs(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 Iu={x:.2,y:.2};function Du(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Iu);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=vs(e),f={x:0,y:0},v={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+h.height?(f.y=Oe.Backward,v.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(f.y=Oe.Forward,v.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!m&&a>=t.right-h.width?(f.x=Oe.Forward,v.x=n*Math.abs((t.right-h.width-a)/h.width)):!u&&s<=t.left+h.width&&(f.x=Oe.Backward,v.x=n*Math.abs((t.left+h.width-s)/h.width)),{direction:f,speed:v}}function Ru(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 ws(e){return e.reduce((t,r)=>Bt(t,fo(r)),Ge)}function Lu(e){return e.reduce((t,r)=>t+ms(r),0)}function Mu(e){return e.reduce((t,r)=>t+gs(r),0)}function xs(e,t){if(t===void 0&&(t=Ut),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ps(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Fu=[["x",["left","right"],Lu],["y",["top","bottom"],Mu]];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=Qr(r),o=ws(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Fu)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 br{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 Bu(e){const{EventTarget:t}=Re(e);return e instanceof t?e:Ft(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 $e;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($e||($e={}));function ys(e){e.preventDefault()}function Uu(e){e.stopPropagation()}var xe;(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"})(xe||(xe={}));const ks={start:[xe.Space,xe.Enter],cancel:[xe.Esc],end:[xe.Space,xe.Enter,xe.Tab]},Wu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case xe.Right:return{...r,x:r.x+25};case xe.Left:return{...r,x:r.x-25};case xe.Down:return{...r,y:r.y+25};case xe.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 br(Ft(r)),this.windowListeners=new br(Re(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($e.Resize,this.handleCancel),this.windowListeners.add($e.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($e.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&xs(n),r(Ge)}handleKeyDown(t){if(Xr(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=ks,coordinateGetter:s=Wu,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}:Ge;this.referenceCoordinates||(this.referenceCoordinates=d);const u=s(t,{active:r,context:n.current,currentCoordinates:d});if(u){const m=gr(u,d),f={x:0,y:0},{scrollableAncestors:v}=n.current;for(const h of v){const b=t.code,{isTop:g,isRight:x,isLeft:k,isBottom:_,maxScroll:C,minScroll:T}=vs(h),A=Ru(h),I={x:Math.min(b===xe.Right?A.right-A.width/2:A.right,Math.max(b===xe.Right?A.left:A.left+A.width/2,u.x)),y:Math.min(b===xe.Down?A.bottom-A.height/2:A.bottom,Math.max(b===xe.Down?A.top:A.top+A.height/2,u.y))},D=b===xe.Right&&!x||b===xe.Left&&!k,B=b===xe.Down&&!_||b===xe.Up&&!g;if(D&&I.x!==u.x){const Z=h.scrollLeft+m.x,z=b===xe.Right&&Z<=C.x||b===xe.Left&&Z>=T.x;if(z&&!m.y){h.scrollTo({left:Z,behavior:a});return}z?f.x=h.scrollLeft-Z:f.x=b===xe.Right?h.scrollLeft-C.x:h.scrollLeft-T.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(B&&I.y!==u.y){const Z=h.scrollTop+m.y,z=b===xe.Down&&Z<=C.y||b===xe.Up&&Z>=T.y;if(z&&!m.x){h.scrollTo({top:Z,behavior:a});return}z?f.y=h.scrollTop-Z:f.y=b===xe.Down?h.scrollTop-C.y:h.scrollTop-T.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Bt(gr(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=ks,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 Ss(e){return!!(e&&"delay"in e)}class go{constructor(t,r,n){var o;n===void 0&&(n=Bu(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=Ft(s),this.documentListeners=new br(this.document),this.listeners=new br(n),this.windowListeners=new br(Re(s)),this.initialCoordinates=(o=qr(i))!=null?o:Ge,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($e.Resize,this.handleCancel),this.windowListeners.add($e.DragStart,ys),this.windowListeners.add($e.VisibilityChange,this.handleCancel),this.windowListeners.add($e.ContextMenu,ys),this.documentListeners.add($e.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ss(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($e.Click,Uu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($e.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:Ge,c=gr(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(Ss(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===xe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $u={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bo extends go{constructor(t){const{event:r}=t,n=Ft(r.target);super(t,$u,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 Hu={move:{name:"mousemove"},end:{name:"mouseup"}};var vo;(function(e){e[e.RightClick=2]="RightClick"})(vo||(vo={}));class Vu extends go{constructor(t){super(t,Hu,Ft(t.event.target))}}Vu.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 Cs 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(){}}}Cs.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 vr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(vr||(vr={}));var en;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(en||(en={}));function Yu(e){let{acceleration:t,activator:r=vr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=en.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e;const f=Ku({delta:u,disabled:!i}),[v,h]=su(),b=j.useRef({x:0,y:0}),g=j.useRef({x:0,y:0}),x=j.useMemo(()=>{switch(r){case vr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case vr.DraggableRect:return o}},[r,o,l]),k=j.useRef(null),_=j.useCallback(()=>{const T=k.current;if(!T)return;const A=b.current.x*g.current.x,I=b.current.y*g.current.y;T.scrollBy(A,I)},[]),C=j.useMemo(()=>a===en.TreeOrder?[...c].reverse():c,[a,c]);j.useEffect(()=>{if(!i||!c.length||!x){h();return}for(const T of C){if((n==null?void 0:n(T))===!1)continue;const A=c.indexOf(T),I=d[A];if(!I)continue;const{direction:D,speed:B}=Du(T,I,x,t,m);for(const Z of["x","y"])f[Z][D[Z]]||(B[Z]=0,D[Z]=0);if(B.x>0||B.y>0){h(),k.current=T,v(_,s),b.current=B,g.current=D;return}}b.current={x:0,y:0},g.current={x:0,y:0},h()},[t,_,n,h,i,s,JSON.stringify(x),JSON.stringify(f),v,c,C,d,JSON.stringify(m)])}const Zu={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};function Ku(e){let{delta:t,disabled:r}=e;const n=Gr(t);return pr(o=>{if(r||!n||!o)return Zu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Oe.Backward]:o.x[Oe.Backward]||i.x===-1,[Oe.Forward]:o.x[Oe.Forward]||i.x===1},y:{[Oe.Backward]:o.y[Oe.Backward]||i.y===-1,[Oe.Forward]:o.y[Oe.Forward]||i.y===1}}},[r,t,n])}function Gu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return pr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Xu(e,t){return j.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 wr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(wr||(wr={}));var xo;(function(e){e.Optimized="optimized"})(xo||(xo={}));const Es=new Map;function qu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=j.useState(null),{frequency:a,measure:l,strategy:c}=o,d=j.useRef(e),u=b(),m=hr(u),f=j.useCallback(function(g){g===void 0&&(g=[]),!m.current&&s(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[m]),v=j.useRef(null),h=pr(g=>{if(u&&!r)return Es;if(!g||g===Es||d.current!==e||i!=null){const x=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const _=k.node.current,C=_?new ho(l(_),_):null;k.rect.current=C,C&&x.set(k.id,C)}return x}return g},[e,i,r,u,l]);return j.useEffect(()=>{d.current=e},[e]),j.useEffect(()=>{u||f()},[r,u]),j.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),j.useEffect(()=>{u||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{f(),v.current=null},a))},[a,u,f,...n]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:i!=null};function b(){switch(c){case wr.Always:return!1;case wr.BeforeDragging:return r;default:return!r}}}function yo(e,t){return pr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Ju(e,t){return yo(e,t)}function Qu(e){let{callback:t,disabled:r}=e;const n=Zr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function tn(e){let{callback:t,disabled:r}=e;const n=Zr(t),o=j.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return j.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ef(e){return new ho(Ut(e),e)}function Ns(e,t,r){t===void 0&&(t=ef);const[n,o]=j.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=Qu({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=tn({callback:i});return Ke(()=>{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 tf(e){const t=yo(e);return us(e,t)}const zs=[];function rf(e){const t=j.useRef(e),r=pr(n=>e?n&&n!==zs&&e&&t.current&&e.parentNode===t.current.parentNode?n:Qr(e):zs,[e]);return j.useEffect(()=>{t.current=e},[e]),r}function nf(e){const[t,r]=j.useState(null),n=j.useRef(e),o=j.useCallback(i=>{const s=uo(i.target);s&&r(a=>a?(a.set(s,fo(s)),new Map(a)):null)},[]);return j.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]),j.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Bt(i,s),Ge):ws(e):Ge,[e,t])}function As(e,t){t===void 0&&(t=[]);const r=j.useRef(null);return j.useEffect(()=>{r.current=null},t),j.useEffect(()=>{const n=e!==Ge;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?gr(e,r.current):Ge}function of(e){j.useEffect(()=>{if(!Yr)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 sf(e,t){return j.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function js(e){return j.useMemo(()=>e?Tu(e):null,[e])}const Ts=[];function af(e,t){t===void 0&&(t=Ut);const[r]=e,n=js(r?Re(r):null),[o,i]=j.useState(Ts);function s(){i(()=>e.length?e.map(l=>bs(l)?n:new ho(t(l),l)):Ts)}const a=tn({callback:s});return Ke(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Os(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return fr(t)?t:e}function lf(e){let{measure:t}=e;const[r,n]=j.useState(null),o=j.useCallback(c=>{for(const{target:d}of c)if(fr(d)){n(u=>{const m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=tn({callback:o}),s=j.useCallback(c=>{const d=Os(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=Kr(s);return j.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const cf=[{sensor:bo,options:{}},{sensor:mo,options:{}}],df={current:{}},rn={draggable:{measure:hs},droppable:{measure:hs,strategy:wr.WhileDragging,frequency:xo.Optimized},dragOverlay:{measure:Ut}};class xr 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 uf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jr},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rn,measureDroppableContainers:Jr,windowRect:null,measuringScheduled:!1},Ps={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jr,draggableNodes:new Map,over:null,measureDroppableContainers:Jr},yr=j.createContext(Ps),Is=j.createContext(uf);function ff(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xr}}}function hf(e,t){switch(t.type){case je.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case je.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 je.DragEnd:case je.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case je.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new xr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case je.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 xr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case je.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new xr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function pf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=j.useContext(yr),i=Gr(n),s=Gr(r==null?void 0:r.id);return j.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!Xr(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=cu(d);if(u){u.focus();break}}})}},[n,t,o,s,i]),null}function Ds(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function mf(e){return j.useMemo(()=>({draggable:{...rn.draggable,...e==null?void 0:e.draggable},droppable:{...rn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...rn.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 gf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=j.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ke(()=>{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=us(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=ps(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,s,a,n,r])}const nn=j.createContext({...Ge,scaleX:1,scaleY:1});var bt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(bt||(bt={}));const bf=j.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=cf,collisionDetection:u=Cu,measuring:m,modifiers:f,...v}=t;const h=j.useReducer(hf,void 0,ff),[b,g]=h,[x,k]=mu(),[_,C]=j.useState(bt.Uninitialized),T=_===bt.Initialized,{draggable:{active:A,nodes:I,translate:D},droppable:{containers:B}}=b,Z=A!=null?I.get(A):null,z=j.useRef({initial:null,translated:null}),F=j.useMemo(()=>{var Ne;return A!=null?{id:A,data:(Ne=Z==null?void 0:Z.data)!=null?Ne:df,rect:z}:null},[A,Z]),y=j.useRef(null),[U,ee]=j.useState(null),[W,V]=j.useState(null),Y=hr(v,Object.values(v)),oe=mr("DndDescribedBy",s),N=j.useMemo(()=>B.getEnabled(),[B]),R=mf(m),{droppableRects:G,measureDroppableContainers:q,measuringScheduled:J}=qu(N,{dragging:T,dependencies:[D.x,D.y],config:R.droppable}),ue=Gu(I,A),Q=j.useMemo(()=>W?qr(W):null,[W]),ie=Gn(),ae=Ju(ue,R.draggable.measure);gf({activeNode:A!=null?I.get(A):null,config:ie.layoutShiftCompensation,initialRect:ae,measure:R.draggable.measure});const ne=Ns(ue,R.draggable.measure,ae),de=Ns(ue?ue.parentElement:null),fe=j.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),we=B.getNodeFor((r=fe.current.over)==null?void 0:r.id),w=lf({measure:R.dragOverlay.measure}),X=(n=w.nodeRef.current)!=null?n:ue,H=T?(o=w.rect)!=null?o:ne:null,O=!!(w.nodeRef.current&&w.rect),S=tf(O?null:ne),P=js(X?Re(X):null),$=rf(T?we??ue:null),M=af($),L=Ds(f,{transform:{x:D.x-S.x,y:D.y-S.y,scaleX:1,scaleY:1},activatorEvent:W,active:F,activeNodeRect:ne,containerNodeRect:de,draggingNodeRect:H,over:fe.current.over,overlayNodeRect:w.rect,scrollableAncestors:$,scrollableAncestorRects:M,windowRect:P}),K=Q?Bt(Q,D):null,te=nf($),re=As(te),se=As(te,[ne]),he=Bt(L,re),me=H?zu(H,L):null,ve=F&&me?u({active:F,collisionRect:me,droppableRects:G,droppableContainers:N,pointerCoordinates:K}):null,it=cs(ve,"id"),[Te,St]=j.useState(null),Ee=O?L:Bt(L,se),ir=Eu(Ee,(i=Te==null?void 0:Te.rect)!=null?i:null,ne),Pt=j.useRef(null),Ye=j.useCallback((Ne,Pe)=>{let{sensor:Be,options:Ct}=Pe;if(y.current==null)return;const Ze=I.get(y.current);if(!Ze)return;const Ue=Ne.nativeEvent,st=new Be({active:y.current,activeNode:Ze,event:Ue,options:Ct,context:fe,onAbort(De){if(!I.get(De))return;const{onDragAbort:at}=Y.current,ft={id:De};at==null||at(ft),x({type:"onDragAbort",event:ft})},onPending(De,Et,at,ft){if(!I.get(De))return;const{onDragPending:Or}=Y.current,Nt={id:De,constraint:Et,initialCoordinates:at,offset:ft};Or==null||Or(Nt),x({type:"onDragPending",event:Nt})},onStart(De){const Et=y.current;if(Et==null)return;const at=I.get(Et);if(!at)return;const{onDragStart:ft}=Y.current,Tr={activatorEvent:Ue,active:{id:Et,data:at.data,rect:z}};ht.unstable_batchedUpdates(()=>{ft==null||ft(Tr),C(bt.Initializing),g({type:je.DragStart,initialCoordinates:De,active:Et}),x({type:"onDragStart",event:Tr}),ee(Pt.current),V(Ue)})},onMove(De){g({type:je.DragMove,coordinates:De})},onEnd:sr(je.DragEnd),onCancel:sr(je.DragCancel)});Pt.current=st;function sr(De){return async function(){const{active:at,collisions:ft,over:Tr,scrollAdjustedTranslate:Or}=fe.current;let Nt=null;if(at&&Or){const{cancelDrop:Pr}=Y.current;Nt={activatorEvent:Ue,active:at,collisions:ft,delta:Or,over:Tr},De===je.DragEnd&&typeof Pr=="function"&&await Promise.resolve(Pr(Nt))&&(De=je.DragCancel)}y.current=null,ht.unstable_batchedUpdates(()=>{g({type:De}),C(bt.Uninitialized),St(null),ee(null),V(null),Pt.current=null;const Pr=De===je.DragEnd?"onDragEnd":"onDragCancel";if(Nt){const xi=Y.current[Pr];xi==null||xi(Nt),x({type:Pr,event:Nt})}})}}},[I]),Zn=j.useCallback((Ne,Pe)=>(Be,Ct)=>{const Ze=Be.nativeEvent,Ue=I.get(Ct);if(y.current!==null||!Ue||Ze.dndKit||Ze.defaultPrevented)return;const st={active:Ue};Ne(Be,Pe.options,st)===!0&&(Ze.dndKit={capturedBy:Pe.sensor},y.current=Ct,Ye(Be,Pe))},[I,Ye]),Kn=Xu(d,Zn);of(d),Ke(()=>{ne&&_===bt.Initializing&&C(bt.Initialized)},[ne,_]),j.useEffect(()=>{const{onDragMove:Ne}=Y.current,{active:Pe,activatorEvent:Be,collisions:Ct,over:Ze}=fe.current;if(!Pe||!Be)return;const Ue={active:Pe,activatorEvent:Be,collisions:Ct,delta:{x:he.x,y:he.y},over:Ze};ht.unstable_batchedUpdates(()=>{Ne==null||Ne(Ue),x({type:"onDragMove",event:Ue})})},[he.x,he.y]),j.useEffect(()=>{const{active:Ne,activatorEvent:Pe,collisions:Be,droppableContainers:Ct,scrollAdjustedTranslate:Ze}=fe.current;if(!Ne||y.current==null||!Pe||!Ze)return;const{onDragOver:Ue}=Y.current,st=Ct.get(it),sr=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,De={active:Ne,activatorEvent:Pe,collisions:Be,delta:{x:Ze.x,y:Ze.y},over:sr};ht.unstable_batchedUpdates(()=>{St(sr),Ue==null||Ue(De),x({type:"onDragOver",event:De})})},[it]),Ke(()=>{fe.current={activatorEvent:W,active:F,activeNode:ue,collisionRect:me,collisions:ve,droppableRects:G,draggableNodes:I,draggingNode:X,draggingNodeRect:H,droppableContainers:B,over:Te,scrollableAncestors:$,scrollAdjustedTranslate:he},z.current={initial:H,translated:me}},[F,ue,ve,me,I,X,H,G,B,Te,$,he]),Yu({...ie,delta:D,draggingRect:me,pointerCoordinates:K,scrollableAncestors:$,scrollableAncestorRects:M});const vi=j.useMemo(()=>({active:F,activeNode:ue,activeNodeRect:ne,activatorEvent:W,collisions:ve,containerNodeRect:de,dragOverlay:w,draggableNodes:I,droppableContainers:B,droppableRects:G,over:Te,measureDroppableContainers:q,scrollableAncestors:$,scrollableAncestorRects:M,measuringConfiguration:R,measuringScheduled:J,windowRect:P}),[F,ue,ne,W,ve,de,w,I,B,G,Te,q,$,M,R,J,P]),wi=j.useMemo(()=>({activatorEvent:W,activators:Kn,active:F,activeNodeRect:ne,ariaDescribedById:{draggable:oe},dispatch:g,draggableNodes:I,over:Te,measureDroppableContainers:q}),[W,Kn,F,ne,g,oe,I,Te,q]);return j.createElement(is.Provider,{value:k},j.createElement(yr.Provider,{value:wi},j.createElement(Is.Provider,{value:vi},j.createElement(nn.Provider,{value:ir},c)),j.createElement(pf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),j.createElement(vu,{...a,hiddenTextDescribedById:oe}));function Gn(){const Ne=(U==null?void 0:U.autoScrollEnabled)===!1,Pe=typeof l=="object"?l.enabled===!1:l===!1,Be=T&&!Ne&&!Pe;return typeof l=="object"?{...l,enabled:Be}:{enabled:Be}}}),vf=j.createContext(null),Rs="button",wf="Draggable";function xf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=mr(wf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=j.useContext(yr),{role:f=Rs,roleDescription:v="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,g=j.useContext(b?nn:vf),[x,k]=Kr(),[_,C]=Kr(),T=sf(s,t),A=hr(r);Ke(()=>(u.set(t,{id:t,key:i,node:x,activatorNode:_,data:A}),()=>{const D=u.get(t);D&&D.key===i&&u.delete(t)}),[u,t]);const I=j.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":n,"aria-pressed":b&&f===Rs?!0:void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[n,f,h,b,v,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:I,isDragging:b,listeners:n?void 0:T,node:x,over:m,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Ls(){return j.useContext(Is)}const yf="Droppable",kf={timeout:25};function _f(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=mr(yf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=j.useContext(yr),d=j.useRef({disabled:r}),u=j.useRef(!1),m=j.useRef(null),f=j.useRef(null),{disabled:v,updateMeasurementsFor:h,timeout:b}={...kf,...o},g=hr(h??n),x=j.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=tn({callback:x,disabled:v||!s}),_=j.useCallback((I,D)=>{k&&(D&&(k.unobserve(D),u.current=!1),I&&k.observe(I))},[k]),[C,T]=Kr(_),A=hr(t);return j.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),j.useEffect(()=>(a({type:je.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:m,data:A}}),()=>a({type:je.UnregisterDroppable,key:i,id:n})),[n]),j.useEffect(()=>{r!==d.current.disabled&&(a({type:je.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 Sf(e){let{animation:t,children:r}=e;const[n,o]=j.useState(null),[i,s]=j.useState(null),a=Gr(r);return!r&&!n&&a&&o(a),Ke(()=>{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]),j.createElement(j.Fragment,null,r,n?j.cloneElement(n,{ref:s}):null)}const Cf={x:0,y:0,scaleX:1,scaleY:1};function Ef(e){let{children:t}=e;return j.createElement(yr.Provider,{value:Ps},j.createElement(nn.Provider,{value:Cf},t))}const Nf={position:"fixed",touchAction:"none"},zf=e=>Xr(e)?"transform 250ms ease":void 0,Af=j.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=zf}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},m={...Nf,width:a.width,height:a.height,top:a.top,left:a.left,transform:gt.Transform.toString(u),transformOrigin:o&&n?xu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return j.createElement(r,{className:s,style:m,ref:t},i)}),jf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:gt.Transform.toString(t)},{transform:gt.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 Tf(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Zr((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Os(s);if(!c)return;const{transform:d}=Re(s).getComputedStyle(s),u=fs(d);if(!u)return;const m=typeof t=="function"?t:Of(t);return xs(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 Of(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...jf,...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}}),[v]=f,h=f[f.length-1];if(JSON.stringify(v)===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(x=>{g.onfinish=()=>{b==null||b(),x()}})}}let Ms=0;function Pf(e){return j.useMemo(()=>{if(e!=null)return Ms++,Ms},[e])}const If=j.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:v,droppableContainers:h,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:_,windowRect:C}=Ls(),T=j.useContext(nn),A=Pf(u==null?void 0:u.id),I=Ds(s,{activatorEvent:d,active:u,activeNodeRect:m,containerNodeRect:f,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:_,transform:T,windowRect:C}),D=yo(m),B=Tf({config:n,draggableNodes:v,droppableContainers:h,measuringConfiguration:x}),Z=D?b.setRef:void 0;return j.createElement(Ef,null,j.createElement(Sf,{animation:B},u&&A?j.createElement(Af,{key:A,id:u.id,ref:Z,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:c,...o},transform:I},r):null))}),Df=e=>{let{transform:t}=e;return{...t,x:0}};function Fs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Rf(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function on(e){return e!==null&&e>=0}function Lf(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 Mf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Bs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Fs(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}},sn={scaleX:1,scaleY:1},Ff=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,...sn}:null}const l=Bf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...sn}:o<r&&o>=s?{x:0,y:a.height+l,...sn}:{x:0,y:0,...sn}};function Bf(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 Us="Sortable",Ws=j.createContext({activeIndex:-1,containerId:Us,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bs,disabled:{draggable:!1,droppable:!1}});function Uf(e){let{children:t,id:r,items:n,strategy:o=Bs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Ls(),u=mr(Us,r),m=a.rect!==null,f=j.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),v=s!=null,h=s?f.indexOf(s.id):-1,b=c?f.indexOf(c.id):-1,g=j.useRef(f),x=!Lf(f,g.current),k=b!==-1&&h===-1||x,_=Mf(i);Ke(()=>{x&&v&&d(f)},[x,f,v,d]),j.useEffect(()=>{g.current=f},[f]);const C=j.useMemo(()=>({activeIndex:h,containerId:u,disabled:_,disableTransforms:k,items:f,overIndex:b,useDragOverlay:m,sortedRects:Rf(f,l),strategy:o}),[h,u,_.draggable,_.droppable,k,f,b,l,m,o]);return j.createElement(Ws.Provider,{value:C},t)}const Wf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Fs(r,n,o).indexOf(t)},$f=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},Hf={duration:200,easing:"ease"},$s="transform",Vf=gt.Transition.toString({property:$s,duration:0,easing:"linear"}),Yf={roleDescription:"sortable"};function Zf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=j.useState(null),a=j.useRef(r);return Ke(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Ut(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]),j.useEffect(()=>{i&&s(null)},[i]),i}function Kf(e){let{animateLayoutChanges:t=$f,attributes:r,disabled:n,data:o,getNewIndex:i=Wf,id:s,strategy:a,resizeObserverConfig:l,transition:c=Hf}=e;const{items:d,containerId:u,activeIndex:m,disabled:f,disableTransforms:v,sortedRects:h,overIndex:b,useDragOverlay:g,strategy:x}=j.useContext(Ws),k=Gf(n,f),_=d.indexOf(s),C=j.useMemo(()=>({sortable:{containerId:u,index:_,items:d},...o}),[u,o,_,d]),T=j.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:A,node:I,isOver:D,setNodeRef:B}=_f({id:s,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:Z,activatorEvent:z,activeNodeRect:F,attributes:y,setNodeRef:U,listeners:ee,isDragging:W,over:V,setActivatorNodeRef:Y,transform:oe}=xf({id:s,data:C,attributes:{...Yf,...r},disabled:k.draggable}),N=iu(B,U),R=!!Z,G=R&&!v&&on(m)&&on(b),q=!g&&W,J=q&&G?oe:null,Q=G?J??(a??x)({rects:h,activeNodeRect:F,activeIndex:m,overIndex:b,index:_}):null,ie=on(m)&&on(b)?i({id:s,items:d,activeIndex:m,overIndex:b}):_,ae=Z==null?void 0:Z.id,ne=j.useRef({activeId:ae,items:d,newIndex:ie,containerId:u}),de=d!==ne.current.items,fe=t({active:Z,containerId:u,isDragging:W,isSorting:R,id:s,index:_,items:d,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:c,wasDragging:ne.current.activeId!=null}),we=Zf({disabled:!fe,index:_,node:I,rect:A});return j.useEffect(()=>{R&&ne.current.newIndex!==ie&&(ne.current.newIndex=ie),u!==ne.current.containerId&&(ne.current.containerId=u),d!==ne.current.items&&(ne.current.items=d)},[R,ie,u,d]),j.useEffect(()=>{if(ae===ne.current.activeId)return;if(ae!=null&&ne.current.activeId==null){ne.current.activeId=ae;return}const X=setTimeout(()=>{ne.current.activeId=ae},50);return()=>clearTimeout(X)},[ae]),{active:Z,activeIndex:m,attributes:y,data:C,rect:A,index:_,newIndex:ie,items:d,isOver:D,isSorting:R,isDragging:W,listeners:ee,node:I,overIndex:b,over:V,setNodeRef:N,setActivatorNodeRef:Y,setDroppableNodeRef:B,setDraggableNodeRef:U,transform:we??Q,transition:w()};function w(){if(we||de&&ne.current.newIndex===_)return Vf;if(!(q&&!Xr(z)||!c)&&(R||fe))return gt.Transition.toString({...c,property:$s})}}function Gf(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 an(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 Xf=[xe.Down,xe.Right,xe.Up,xe.Left],qf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Xf.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 xe.Down:n.top<m.top&&l.push(u);break;case xe.Up:n.top>m.top&&l.push(u);break;case xe.Left:n.left>m.left&&l.push(u);break;case xe.Right:n.left<m.left&&l.push(u);break}});const c=_u({collisionRect:n,droppableRects:o,droppableContainers:l});let d=cs(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,v=m==null?void 0:m.node.current;if(v&&f&&u&&m){const b=Qr(v).some((T,A)=>a[A]!==T),g=Hs(u,m),x=Jf(u,m),k=b||!g?{x:0,y:0}:{x:x?n.width-f.width:0,y:x?n.height-f.height:0},_={x:f.left,y:f.top};return k.x&&k.y?_:gr(_,k)}}}};function Hs(e,t){return!an(e)||!an(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Jf(e,t){return!an(e)||!an(t)||!Hs(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:pe("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 Qf({className:e,...t}){return p.jsx("textarea",{className:pe("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 eh({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:pe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function At({className:e,...t}){return p.jsx("label",{className:pe("text-sm font-medium leading-none select-none",e),...t})}function _o(e,[t,r]){return Math.min(r,Math.max(t,e))}function be(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 Wt(e,t=[]){let r=[];function n(i,s){const a=E.createContext(s),l=r.length;r=[...r,s];const c=u=>{var g;const{scope:m,children:f,...v}=u,h=((g=m==null?void 0:m[e])==null?void 0:g[l])||a,b=E.useMemo(()=>v,Object.values(v));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,v=E.useContext(f);if(v)return v;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=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,th(o,...t)]}function th(...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 E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Vs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ys(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Vs(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():Vs(e[o],null)}}}}function Se(...e){return E.useCallback(Ys(...e),e)}function $t(e){const t=nh(e),r=E.forwardRef((n,o)=>{const{children:i,...s}=n,a=E.Children.toArray(i),l=a.find(ih);if(l){const c=l.props.children,d=a.map(u=>u===l?E.Children.count(c)>1?E.Children.only(null):E.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...s,ref:o,children:E.isValidElement(c)?E.cloneElement(c,void 0,d):null})}return p.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var rh=$t("Slot");function nh(e){const t=E.forwardRef((r,n)=>{const{children:o,...i}=r;if(E.isValidElement(o)){const s=ah(o),a=sh(i,o.props);return o.type!==E.Fragment&&(a.ref=n?Ys(n,s):s),E.cloneElement(o,a)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zs=Symbol("radix.slottable");function oh(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Zs,t}function ih(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zs}function sh(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 ah(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 lh(e){const t=e+"CollectionProvider",[r,n]=Wt(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:g}=h,x=j.useRef(null),k=j.useRef(new Map).current;return p.jsx(o,{scope:b,itemMap:k,collectionRef:x,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=$t(a),c=j.forwardRef((h,b)=>{const{scope:g,children:x}=h,k=i(a,g),_=Se(b,k.collectionRef);return p.jsx(l,{ref:_,children:x})});c.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=$t(d),f=j.forwardRef((h,b)=>{const{scope:g,children:x,...k}=h,_=j.useRef(null),C=Se(b,_),T=i(d,g);return j.useEffect(()=>(T.itemMap.set(_,{ref:_,...k}),()=>void T.itemMap.delete(_))),p.jsx(m,{[u]:"",ref:C,children:x})});f.displayName=d;function v(h){const b=i(e+"CollectionConsumer",h);return j.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const k=Array.from(x.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},v,n]}var ch=E.createContext(void 0);function Ks(e){const t=E.useContext(ch);return e||t||"ltr"}var dh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=dh.reduce((e,t)=>{const r=$t(`Primitive.${t}`),n=E.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 uh(e,t){e&&Ir.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function fh(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e);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 hh="DismissableLayer",So="dismissableLayer.update",ph="dismissableLayer.pointerDownOutside",mh="dismissableLayer.focusOutside",Gs,Xs=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ln=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=E.useContext(Xs),[d,u]=E.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=E.useState({}),v=Se(t,A=>u(A)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(b),x=d?h.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=g,C=vh(A=>{const I=A.target,D=[...c.branches].some(B=>B.contains(I));!_||D||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},m),T=wh(A=>{const I=A.target;[...c.branches].some(B=>B.contains(I))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},m);return fh(A=>{x===c.layers.size-1&&(n==null||n(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},m),E.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Gs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),qs(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Gs)}},[d,m,r,c]),E.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),qs())},[d,c]),E.useEffect(()=>{const A=()=>f({});return document.addEventListener(So,A),()=>document.removeEventListener(So,A)},[]),p.jsx(_e.div,{...l,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,T.onFocusCapture),onBlurCapture:be(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});ln.displayName=hh;var gh="DismissableLayerBranch",bh=E.forwardRef((e,t)=>{const r=E.useContext(Xs),n=E.useRef(null),o=Se(t,n);return E.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),p.jsx(_e.div,{...e,ref:o})});bh.displayName=gh;function vh(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Js(ph,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 wh(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!n.current&&Js(mh,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 qs(){const e=new CustomEvent(So);document.dispatchEvent(e)}function Js(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?uh(o,i):o.dispatchEvent(i)}var Co=0;function Qs(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ea()),document.body.insertAdjacentElement("beforeend",e[1]??ea()),Co++,()=>{Co===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Co--}},[])}function ea(){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",ta={bubbles:!1,cancelable:!0},xh="FocusScope",zo=E.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=E.useState(null),c=Le(o),d=Le(i),u=E.useRef(null),m=Se(t,h=>l(h)),f=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(n){let h=function(k){if(f.paused||!a)return;const _=k.target;a.contains(_)?u.current=_:vt(u.current,{select:!0})},b=function(k){if(f.paused||!a)return;const _=k.relatedTarget;_!==null&&(a.contains(_)||vt(u.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&vt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const x=new MutationObserver(g);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),x.disconnect()}}},[n,a,f.paused]),E.useEffect(()=>{if(a){oa.add(f);const h=document.activeElement;if(!a.contains(h)){const g=new CustomEvent(Eo,ta);a.addEventListener(Eo,c),a.dispatchEvent(g),g.defaultPrevented||(yh(Eh(ra(a)),{select:!0}),document.activeElement===h&&vt(a))}return()=>{a.removeEventListener(Eo,c),setTimeout(()=>{const g=new CustomEvent(No,ta);a.addEventListener(No,d),a.dispatchEvent(g),g.defaultPrevented||vt(h??document.body,{select:!0}),a.removeEventListener(No,d),oa.remove(f)},0)}}},[a,c,d,f]);const v=E.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 x=h.currentTarget,[k,_]=kh(x);k&&_?!h.shiftKey&&g===_?(h.preventDefault(),r&&vt(k,{select:!0})):h.shiftKey&&g===k&&(h.preventDefault(),r&&vt(_,{select:!0})):g===x&&h.preventDefault()}},[r,n,f.paused]);return p.jsx(_e.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});zo.displayName=xh;function yh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(vt(n,{select:t}),document.activeElement!==r)return}function kh(e){const t=ra(e),r=na(t,e),n=na(t.reverse(),e);return[r,n]}function ra(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 na(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 Sh(e){return e instanceof HTMLInputElement&&"select"in e}function vt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Sh(e)&&t&&e.select()}}var oa=Ch();function Ch(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ia(e,t),e.unshift(t)},remove(t){var r;e=ia(e,t),(r=e[0])==null||r.resume()}}}function ia(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Eh(e){return e.filter(t=>t.tagName!=="A")}var Ie=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Nh=E[" useId ".trim().toString()]||(()=>{}),zh=0;function kr(e){const[t,r]=E.useState(Nh());return Ie(()=>{r(n=>n??String(zh++))},[e]),t?`radix-${t}`:""}const Ah=["top","right","bottom","left"],wt=Math.min,Me=Math.max,cn=Math.round,dn=Math.floor,Qe=e=>({x:e,y:e}),jh={left:"right",right:"left",bottom:"top",top:"bottom"},Th={start:"end",end:"start"};function Ao(e,t,r){return Me(e,wt(t,r))}function ct(e,t){return typeof e=="function"?e(t):e}function dt(e){return e.split("-")[0]}function Ht(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function To(e){return e==="y"?"height":"width"}const Oh=new Set(["top","bottom"]);function et(e){return Oh.has(dt(e))?"y":"x"}function Oo(e){return jo(et(e))}function Ph(e,t,r){r===void 0&&(r=!1);const n=Ht(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=un(s)),[s,un(s)]}function Ih(e){const t=un(e);return[Po(e),t,Po(t)]}function Po(e){return e.replace(/start|end/g,t=>Th[t])}const sa=["left","right"],aa=["right","left"],Dh=["top","bottom"],Rh=["bottom","top"];function Lh(e,t,r){switch(e){case"top":case"bottom":return r?t?aa:sa:t?sa:aa;case"left":case"right":return t?Dh:Rh;default:return[]}}function Mh(e,t,r,n){const o=Ht(e);let i=Lh(dt(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Po)))),i}function un(e){return e.replace(/left|right|bottom|top/g,t=>jh[t])}function Fh(e){return{top:0,right:0,bottom:0,left:0,...e}}function la(e){return typeof e!="number"?Fh(e):{top:e,right:e,bottom:e,left:e}}function fn(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 ca(e,t,r){let{reference:n,floating:o}=e;const i=et(t),s=Oo(t),a=To(s),l=dt(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(Ht(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 Bh(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}=ct(t,e),v=la(f),b=a[m?u==="floating"?"reference":"floating":u],g=fn(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})),x=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)),_=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=fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:k,strategy:l}):x);return{top:(g.top-C.top+v.top)/_.y,bottom:(C.bottom-g.bottom+v.bottom)/_.y,left:(g.left-C.left+v.left)/_.x,right:(C.right-g.right+v.right)/_.x}}const Uh=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}=ca(c,n,l),m=n,f={},v=0;for(let b=0;b<a.length;b++){var h;const{name:g,fn:x}=a[b],{x:k,y:_,data:C,reset:T}=await x({x:d,y:u,initialPlacement:n,placement:m,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(h=s.detectOverflow)!=null?h:Bh},elements:{reference:e,floating:t}});d=k??d,u=_??u,f={...f,[g]:{...f[g],...C}},T&&v<=50&&(v++,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}=ca(c,m,l)),b=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:f}},Wh=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}=ct(e,t)||{};if(c==null)return{};const u=la(d),m={x:r,y:n},f=Oo(o),v=To(f),h=await s.getDimensions(c),b=f==="y",g=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",_=i.reference[v]+i.reference[f]-m[f]-i.floating[v],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[v]);const I=_/2-C/2,D=A/2-h[v]/2-1,B=wt(u[g],D),Z=wt(u[x],D),z=B,F=A-h[v]-Z,y=A/2-h[v]/2+I,U=Ao(z,y,F),ee=!l.arrow&&Ht(o)!=null&&y!==U&&i.reference[v]/2-(y<z?B:Z)-h[v]/2<0,W=ee?y<z?y-z:y-F:0;return{[f]:m[f]+W,data:{[f]:U,centerOffset:y-U-W,...ee&&{alignmentOffset:W}},reset:ee}}}),$h=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:v="none",flipAlignment:h=!0,...b}=ct(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=dt(o),x=et(a),k=dt(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=m||(k||!h?[un(a)]:Ih(a)),T=v!=="none";!m&&T&&C.push(...Mh(a,h,v,_));const A=[a,...C],I=await l.detectOverflow(t,b),D=[];let B=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&D.push(I[g]),u){const y=Ph(o,s,_);D.push(I[y[0]],I[y[1]])}if(B=[...B,{placement:o,overflows:D}],!D.every(y=>y<=0)){var Z,z;const y=(((Z=i.flip)==null?void 0:Z.index)||0)+1,U=A[y];if(U&&(!(u==="alignment"?x!==et(U):!1)||B.every(V=>et(V.placement)===x?V.overflows[0]>0:!0)))return{data:{index:y,overflows:B},reset:{placement:U}};let ee=(z=B.filter(W=>W.overflows[0]<=0).sort((W,V)=>W.overflows[1]-V.overflows[1])[0])==null?void 0:z.placement;if(!ee)switch(f){case"bestFit":{var F;const W=(F=B.filter(V=>{if(T){const Y=et(V.placement);return Y===x||Y==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Y=>Y>0).reduce((Y,oe)=>Y+oe,0)]).sort((V,Y)=>V[1]-Y[1])[0])==null?void 0:F[0];W&&(ee=W);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function da(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ua(e){return Ah.some(t=>e[t]>=0)}const Hh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ct(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=da(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ua(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=da(s,r.floating);return{data:{escapedOffsets:a,escaped:ua(a)}}}default:return{}}}}},fa=new Set(["left","top"]);async function Vh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=dt(r),a=Ht(r),l=et(r)==="y",c=fa.has(s)?-1:1,d=i&&l?-1:1,u=ct(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const Yh=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 Vh(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}}}}},Zh=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,y:k}=g;return{x,y:k}}},...c}=ct(e,t),d={x:r,y:n},u=await i.detectOverflow(t,c),m=et(dt(o)),f=jo(m);let v=d[f],h=d[m];if(s){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",k=v+u[g],_=v-u[x];v=Ao(k,v,_)}if(a){const g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",k=h+u[g],_=h-u[x];h=Ao(k,h,_)}const b=l.fn({...t,[f]:v,[m]:h});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[f]:s,[m]:a}}}}}},Kh=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}=ct(e,t),d={x:r,y:n},u=et(o),m=jo(u);let f=d[m],v=d[u];const h=ct(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const k=m==="y"?"height":"width",_=i.reference[m]-i.floating[k]+b.mainAxis,C=i.reference[m]+i.reference[k]-b.mainAxis;f<_?f=_:f>C&&(f=C)}if(c){var g,x;const k=m==="y"?"width":"height",_=fa.has(dt(o)),C=i.reference[u]-i.floating[k]+(_&&((g=s.offset)==null?void 0:g[u])||0)+(_?0:b.crossAxis),T=i.reference[u]+i.reference[k]+(_?0:((x=s.offset)==null?void 0:x[u])||0)-(_?b.crossAxis:0);v<C?v=C:v>T&&(v=T)}return{[m]:f,[u]:v}}}},Gh=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}=ct(e,t),d=await s.detectOverflow(t,c),u=dt(o),m=Ht(o),f=et(o)==="y",{width:v,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 x=h-d.top-d.bottom,k=v-d.left-d.right,_=wt(h-d[b],x),C=wt(v-d[g],k),T=!t.middlewareData.shift;let A=_,I=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=x),T&&!m){const B=Me(d.left,0),Z=Me(d.right,0),z=Me(d.top,0),F=Me(d.bottom,0);f?I=v-2*(B!==0||Z!==0?B+Z:Me(d.left,d.right)):A=h-2*(z!==0||F!==0?z+F:Me(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:A});const D=await s.getDimensions(a.floating);return v!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function hn(){return typeof window<"u"}function Vt(e){return ha(e)?(e.nodeName||"").toLowerCase():"#document"}function Fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tt(e){var t;return(t=(ha(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ha(e){return hn()?e instanceof Node||e instanceof Fe(e).Node:!1}function Xe(e){return hn()?e instanceof Element||e instanceof Fe(e).Element:!1}function rt(e){return hn()?e instanceof HTMLElement||e instanceof Fe(e).HTMLElement:!1}function pa(e){return!hn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fe(e).ShadowRoot}const Xh=new Set(["inline","contents"]);function _r(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Xh.has(o)}const qh=new Set(["table","td","th"]);function Jh(e){return qh.has(Vt(e))}const Qh=[":popover-open",":modal"];function pn(e){return Qh.some(t=>{try{return e.matches(t)}catch{return!1}})}const ep=["transform","translate","scale","rotate","perspective"],tp=["transform","translate","scale","rotate","perspective","filter"],rp=["paint","layout","strict","content"];function Io(e){const t=Do(),r=Xe(e)?qe(e):e;return ep.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)||tp.some(n=>(r.willChange||"").includes(n))||rp.some(n=>(r.contain||"").includes(n))}function np(e){let t=xt(e);for(;rt(t)&&!Yt(t);){if(Io(t))return t;if(pn(t))return null;t=xt(t)}return null}function Do(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const op=new Set(["html","body","#document"]);function Yt(e){return op.has(Vt(e))}function qe(e){return Fe(e).getComputedStyle(e)}function mn(e){return Xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if(Vt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pa(e)&&e.host||tt(e);return pa(t)?t.host:t}function ma(e){const t=xt(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&_r(t)?t:ma(t)}function Sr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ma(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Fe(o);if(i){const a=Ro(s);return t.concat(s,s.visualViewport||[],_r(o)?o:[],a&&r?Sr(a):[])}return t.concat(o,Sr(o,[],r))}function Ro(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ga(e){const t=qe(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=rt(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=cn(r)!==i||cn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Lo(e){return Xe(e)?e:e.contextElement}function Zt(e){const t=Lo(e);if(!rt(t))return Qe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=ga(t);let s=(i?cn(r.width):r.width)/n,a=(i?cn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ip=Qe(0);function ba(e){const t=Fe(e);return!Do()||!t.visualViewport?ip:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sp(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Fe(e)?!1:t}function jt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Lo(e);let s=Qe(1);t&&(n?Xe(n)&&(s=Zt(n)):s=Zt(e));const a=sp(i,r,n)?ba(i):Qe(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=Fe(i),f=n&&Xe(n)?Fe(n):n;let v=m,h=Ro(v);for(;h&&n&&f!==v;){const b=Zt(h),g=h.getBoundingClientRect(),x=qe(h),k=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*b.x,_=g.top+(h.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=k,c+=_,v=Fe(h),h=Ro(v)}}return fn({width:d,height:u,x:l,y:c})}function gn(e,t){const r=mn(e).scrollLeft;return t?t.left+r:jt(tt(e)).left+r}function va(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-gn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function ap(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=tt(n),a=t?pn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),u=rt(n);if((u||!u&&!i)&&((Vt(n)!=="body"||_r(s))&&(l=mn(n)),rt(n))){const f=jt(n);c=Zt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const m=s&&!u&&!i?va(s,l):Qe(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 lp(e){return Array.from(e.getClientRects())}function cp(e){const t=tt(e),r=mn(e),n=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+gn(e);const a=-r.scrollTop;return qe(n).direction==="rtl"&&(s+=Me(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const wa=25;function dp(e,t){const r=Fe(e),n=tt(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=gn(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,v=Math.abs(n.clientWidth-u.clientWidth-f);v<=wa&&(i-=v)}else c<=wa&&(i+=c);return{width:i,height:s,x:a,y:l}}const up=new Set(["absolute","fixed"]);function fp(e,t){const r=jt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=rt(e)?Zt(e):Qe(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 xa(e,t,r){let n;if(t==="viewport")n=dp(e,r);else if(t==="document")n=cp(tt(e));else if(Xe(t))n=fp(t,r);else{const o=ba(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fn(n)}function ya(e,t){const r=xt(e);return r===t||!Xe(r)||Yt(r)?!1:qe(r).position==="fixed"||ya(r,t)}function hp(e,t){const r=t.get(e);if(r)return r;let n=Sr(e,[],!1).filter(a=>Xe(a)&&Vt(a)!=="body"),o=null;const i=qe(e).position==="fixed";let s=i?xt(e):e;for(;Xe(s)&&!Yt(s);){const a=qe(s),l=Io(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&up.has(o.position)||_r(s)&&!l&&ya(e,s))?n=n.filter(d=>d!==s):o=a,s=xt(s)}return t.set(e,n),n}function pp(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?pn(t)?[]:hp(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const u=xa(t,d,o);return c.top=Me(u.top,c.top),c.right=wt(u.right,c.right),c.bottom=wt(u.bottom,c.bottom),c.left=Me(u.left,c.left),c},xa(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mp(e){const{width:t,height:r}=ga(e);return{width:t,height:r}}function gp(e,t,r){const n=rt(t),o=tt(t),i=r==="fixed",s=jt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Qe(0);function c(){l.x=gn(o)}if(n||!n&&!i)if((Vt(t)!=="body"||_r(o))&&(a=mn(t)),n){const f=jt(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?va(o,a):Qe(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 qe(e).position==="static"}function ka(e,t){if(!rt(e)||qe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return tt(e)===r&&(r=r.ownerDocument.body),r}function _a(e,t){const r=Fe(e);if(pn(e))return r;if(!rt(e)){let o=xt(e);for(;o&&!Yt(o);){if(Xe(o)&&!Mo(o))return o;o=xt(o)}return r}let n=ka(e,t);for(;n&&Jh(n)&&Mo(n);)n=ka(n,t);return n&&Yt(n)&&Mo(n)&&!Io(n)?r:n||np(e)||r}const bp=async function(e){const t=this.getOffsetParent||_a,r=this.getDimensions,n=await r(e.floating);return{reference:gp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function vp(e){return qe(e).direction==="rtl"}const wp={convertOffsetParentRelativeRectToViewportRelativeRect:ap,getDocumentElement:tt,getClippingRect:pp,getOffsetParent:_a,getElementRects:bp,getClientRects:lp,getDimensions:mp,getScale:Zt,isElement:Xe,isRTL:vp};function Sa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xp(e,t){let r=null,n;const o=tt(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 v=dn(u),h=dn(o.clientWidth-(d+m)),b=dn(o.clientHeight-(u+f)),g=dn(d),k={rootMargin:-v+"px "+-h+"px "+-b+"px "+-g+"px",threshold:Me(0,wt(1,l))||1};let _=!0;function C(T){const A=T[0].intersectionRatio;if(A!==l){if(!_)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!Sa(c,e.getBoundingClientRect())&&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 yp(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?Sr(c):[],...Sr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const u=c&&a?xp(c,r):null;let m=-1,f=null;s&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.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 v,h=l?jt(e):null;l&&b();function b(){const g=jt(e);h&&!Sa(h,g)&&r(),h=g,v=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(x=>{o&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u==null||u(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const kp=Yh,_p=Zh,Sp=$h,Cp=Gh,Ep=Hh,Ca=Wh,Np=Kh,zp=(e,t,r)=>{const n=new Map,o={platform:wp,...r},i={...o.platform,_c:n};return Uh(e,t,{...o,platform:i})};var Ap=typeof document<"u",jp=function(){},bn=Ap?j.useLayoutEffect:jp;function vn(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(!vn(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)&&!vn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ea(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Na(e,t){const r=Ea(e);return Math.round(t*r)/r}function Fo(e){const t=E.useRef(e);return bn(()=>{t.current=e}),t}function Tp(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]=E.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=E.useState(n);vn(m,n)||f(n);const[v,h]=E.useState(null),[b,g]=E.useState(null),x=E.useCallback(V=>{V!==T.current&&(T.current=V,h(V))},[]),k=E.useCallback(V=>{V!==A.current&&(A.current=V,g(V))},[]),_=i||v,C=s||b,T=E.useRef(null),A=E.useRef(null),I=E.useRef(d),D=l!=null,B=Fo(l),Z=Fo(o),z=Fo(c),F=E.useCallback(()=>{if(!T.current||!A.current)return;const V={placement:t,strategy:r,middleware:m};Z.current&&(V.platform=Z.current),zp(T.current,A.current,V).then(Y=>{const oe={...Y,isPositioned:z.current!==!1};y.current&&!vn(I.current,oe)&&(I.current=oe,Ir.flushSync(()=>{u(oe)}))})},[m,t,r,Z,z]);bn(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,u(V=>({...V,isPositioned:!1})))},[c]);const y=E.useRef(!1);bn(()=>(y.current=!0,()=>{y.current=!1}),[]),bn(()=>{if(_&&(T.current=_),C&&(A.current=C),_&&C){if(B.current)return B.current(_,C,F);F()}},[_,C,F,B,D]);const U=E.useMemo(()=>({reference:T,floating:A,setReference:x,setFloating:k}),[x,k]),ee=E.useMemo(()=>({reference:_,floating:C}),[_,C]),W=E.useMemo(()=>{const V={position:r,left:0,top:0};if(!ee.floating)return V;const Y=Na(ee.floating,d.x),oe=Na(ee.floating,d.y);return a?{...V,transform:"translate("+Y+"px, "+oe+"px)",...Ea(ee.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Y,top:oe}},[r,a,ee.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:F,refs:U,elements:ee,floatingStyles:W}),[d,F,U,ee,W])}const Op=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?Ca({element:n.current,padding:o}).fn(r):{}:n?Ca({element:n,padding:o}).fn(r):{}}}},Pp=(e,t)=>({...kp(e),options:[e,t]}),Ip=(e,t)=>({..._p(e),options:[e,t]}),Dp=(e,t)=>({...Np(e),options:[e,t]}),Rp=(e,t)=>({...Sp(e),options:[e,t]}),Lp=(e,t)=>({...Cp(e),options:[e,t]}),Mp=(e,t)=>({...Ep(e),options:[e,t]}),Fp=(e,t)=>({...Op(e),options:[e,t]});var Bp="Arrow",za=E.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return p.jsx(_e.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"})})});za.displayName=Bp;var Up=za;function Wp(e){const[t,r]=E.useState(void 0);return Ie(()=>{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",[Aa,Kt]=Wt(Bo),[$p,ja]=Aa(Bo),Ta=e=>{const{__scopePopper:t,children:r}=e,[n,o]=E.useState(null);return p.jsx($p,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ta.displayName=Bo;var Oa="PopperAnchor",Pa=E.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=ja(Oa,r),s=E.useRef(null),a=Se(t,s),l=E.useRef(null);return E.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(_e.div,{...o,ref:a})});Pa.displayName=Oa;var Uo="PopperContent",[Hp,Vp]=Aa(Uo),Ia=E.forwardRef((e,t)=>{var Q,ie,ae,ne,de,fe;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:v,...h}=e,b=ja(Uo,r),[g,x]=E.useState(null),k=Se(t,we=>x(we)),[_,C]=E.useState(null),T=Wp(_),A=(T==null?void 0:T.width)??0,I=(T==null?void 0:T.height)??0,D=n+(i!=="center"?"-"+i:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Z=Array.isArray(c)?c:[c],z=Z.length>0,F={padding:B,boundary:Z.filter(Zp),altBoundary:z},{refs:y,floatingStyles:U,placement:ee,isPositioned:W,middlewareData:V}=Tp({strategy:"fixed",placement:D,whileElementsMounted:(...we)=>yp(...we,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Pp({mainAxis:o+I,alignmentAxis:s}),l&&Ip({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Dp():void 0,...F}),l&&Rp({...F}),Lp({...F,apply:({elements:we,rects:w,availableWidth:X,availableHeight:H})=>{const{width:O,height:S}=w.reference,P=we.floating.style;P.setProperty("--radix-popper-available-width",`${X}px`),P.setProperty("--radix-popper-available-height",`${H}px`),P.setProperty("--radix-popper-anchor-width",`${O}px`),P.setProperty("--radix-popper-anchor-height",`${S}px`)}}),_&&Fp({element:_,padding:a}),Kp({arrowWidth:A,arrowHeight:I}),m&&Mp({strategy:"referenceHidden",...F})]}),[Y,oe]=La(ee),N=Le(v);Ie(()=>{W&&(N==null||N())},[W,N]);const R=(Q=V.arrow)==null?void 0:Q.x,G=(ie=V.arrow)==null?void 0:ie.y,q=((ae=V.arrow)==null?void 0:ae.centerOffset)!==0,[J,ue]=E.useState();return Ie(()=>{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:J,"--radix-popper-transform-origin":[(ne=V.transformOrigin)==null?void 0:ne.x,(de=V.transformOrigin)==null?void 0:de.y].join(" "),...((fe=V.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Hp,{scope:r,placedSide:Y,onArrowChange:C,arrowX:R,arrowY:G,shouldHideArrow:q,children:p.jsx(_e.div,{"data-side":Y,"data-align":oe,...h,ref:k,style:{...h.style,animation:W?void 0:"none"}})})})});Ia.displayName=Uo;var Da="PopperArrow",Yp={top:"bottom",right:"left",bottom:"top",left:"right"},Ra=E.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Vp(Da,n),s=Yp[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(Up,{...o,ref:r,style:{...o.style,display:"block"}})})});Ra.displayName=Da;function Zp(e){return e!==null}var Kp=e=>({name:"transformOrigin",options:e,fn(t){var b,g,x;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]=La(r),u={start:"0%",center:"50%",end:"100%"}[d],m=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let v="",h="";return c==="bottom"?(v=s?u:`${m}px`,h=`${-l}px`):c==="top"?(v=s?u:`${m}px`,h=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,h=s?u:`${f}px`):c==="left"&&(v=`${n.floating.width+l}px`,h=s?u:`${f}px`),{data:{x:v,y:h}}}});function La(e){const[t,r="center"]=e.split("-");return[t,r]}var Wo=Ta,wn=Pa,$o=Ia,Ho=Ra,Gp="Portal",xn=E.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=E.useState(!1);Ie(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ht.createPortal(p.jsx(_e.div,{...n,ref:t}),s):null});xn.displayName=Gp;var Xp=E[" useInsertionEffect ".trim().toString()]||Ie;function yn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=qp({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=E.useRef(e!==void 0);E.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=E.useCallback(d=>{var u;if(a){const m=Jp(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 qp({defaultProp:e,onChange:t}){const[r,n]=E.useState(e),o=E.useRef(r),i=E.useRef(t);return Xp(()=>{i.current=t},[t]),E.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Jp(e){return typeof e=="function"}function Qp(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ma=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"}),em="VisuallyHidden",Fa=E.forwardRef((e,t)=>p.jsx(_e.span,{...e,ref:t,style:{...Ma,...e.style}}));Fa.displayName=em;var tm=Fa,rm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Gt=new WeakMap,kn=new WeakMap,_n={},Vo=0,Ba=function(e){return e&&(e.host||Ba(e.parentNode))},nm=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ba(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})},om=function(e,t,r,n){var o=nm(t,Array.isArray(e)?e:[e]);_n[r]||(_n[r]=new WeakMap);var i=_n[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),v=f!==null&&f!=="false",h=(Gt.get(m)||0)+1,b=(i.get(m)||0)+1;Gt.set(m,h),i.set(m,b),s.push(m),h===1&&v&&kn.set(m,!0),b===1&&m.setAttribute(r,"true"),v||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=Gt.get(u)-1,f=i.get(u)-1;Gt.set(u,m),i.set(u,f),m||(kn.has(u)||u.removeAttribute(n),kn.delete(u)),f||u.removeAttribute(r)}),Vo--,Vo||(Gt=new WeakMap,Gt=new WeakMap,kn=new WeakMap,_n={})}},Ua=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=rm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),om(n,o,r,"aria-hidden")):function(){return null}},nt=function(){return nt=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},nt.apply(this,arguments)};function Wa(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 im(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 Sn="right-scroll-bar-position",Cn="width-before-scroll-bar",sm="with-scroll-bars-hidden",am="--removed-body-scroll-bar-size";function Yo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lm(e,t){var r=j.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 cm=typeof window<"u"?E.useLayoutEffect:E.useEffect,$a=new WeakMap;function dm(e,t){var r=lm(null,function(n){return e.forEach(function(o){return Yo(o,n)})});return cm(function(){var n=$a.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)})}$a.set(r,e)},[e]),r}function um(e){return e}function fm(e,t){t===void 0&&(t=um);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 hm(e){e===void 0&&(e={});var t=fm(null);return t.options=nt({async:!0,ssr:!1},e),t}var Ha=function(e){var t=e.sideCar,r=Wa(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 E.createElement(n,nt({},r))};Ha.isSideCarExport=!0;function pm(e,t){return e.useMedium(t),Ha}var Va=hm(),Zo=function(){},En=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.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,v=e.noIsolation,h=e.inert,b=e.allowPinchZoom,g=e.as,x=g===void 0?"div":g,k=e.gapMode,_=Wa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,T=dm([r,t]),A=nt(nt({},_),o);return E.createElement(E.Fragment,null,d&&E.createElement(C,{sideCar:Va,removeScrollBar:c,shards:u,noRelative:f,noIsolation:v,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:k}),s?E.cloneElement(E.Children.only(a),nt(nt({},A),{ref:T})):E.createElement(x,nt({},A,{className:l,ref:T}),a))});En.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},En.classNames={fullWidth:Cn,zeroRight:Sn};var mm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mm();return t&&e.setAttribute("nonce",t),e}function bm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=gm())&&(bm(t,r),vm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xm=function(){var e=wm();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ya=function(){var e=xm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ym={left:0,top:0,right:0,gap:0},Ko=function(e){return parseInt(e||"",10)||0},km=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 ym;var t=km(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])}},Sm=Ya(),Xt="data-scroll-locked",Cm=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(sm,` {
214
214
  overflow: hidden `).concat(n,`;
215
215
  padding-right: `).concat(a,"px ").concat(n,`;
216
216
  }
@@ -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(Sn,` {
231
231
  right: `).concat(a,"px ").concat(n,`;
232
232
  }
233
233
 
234
- .`).concat(Nn,` {
234
+ .`).concat(Cn,` {
235
235
  margin-right: `).concat(a,"px ").concat(n,`;
236
236
  }
237
237
 
238
- .`).concat(En," .").concat(En,` {
238
+ .`).concat(Sn," .").concat(Sn,` {
239
239
  right: 0 `).concat(n,`;
240
240
  }
241
241
 
242
- .`).concat(Nn," .").concat(Nn,` {
242
+ .`).concat(Cn," .").concat(Cn,` {
243
243
  margin-right: 0 `).concat(n,`;
244
244
  }
245
245
 
246
246
  body[`).concat(Xt,`] {
247
- `).concat(om,": ").concat(a,`px;
247
+ `).concat(am,": ").concat(a,`px;
248
248
  }
249
- `)},Va=function(){var e=parseInt(document.body.getAttribute(Xt)||"0",10);return isFinite(e)?e:0},_m=function(){E.useEffect(function(){return document.body.setAttribute(Xt,(Va()+1).toString()),function(){var e=Va()-1;e<=0?document.body.removeAttribute(Xt):document.body.setAttribute(Xt,e.toString())}},[])},Sm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;_m();var i=E.useMemo(function(){return xm(o)},[o]);return E.createElement(ym,{styles:km(i,!t,o,r?"":"!important")})},Go=!1;if(typeof window<"u")try{var zn=Object.defineProperty({},"passive",{get:function(){return Go=!0,!0}});window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Go=!1}var qt=Go?{passive:!1}:!1,Cm=function(e){return e.tagName==="TEXTAREA"},Ya=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Cm(e)&&r[t]==="visible")},Em=function(e){return Ya(e,"overflowY")},Nm=function(e){return Ya(e,"overflowX")},Za=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Ga(e,n);if(o){var i=Ka(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Am=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},zm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ga=function(e,t){return e==="v"?Em(t):Nm(t)},Ka=function(e,t){return e==="v"?Am(t):zm(t)},jm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tm=function(e,t,r,n,o){var i=jm(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=Ka(e,a),v=f[0],h=f[1],b=f[2],g=h-b-i*v;(v||g)&&Ga(e,a)&&(u+=g,m+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}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]},Xa=function(e){return[e.deltaX,e.deltaY]},qa=function(e){return e&&"current"in e?e.current:e},Om=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pm=function(e){return`
249
+ `)},Za=function(){var e=parseInt(document.body.getAttribute(Xt)||"0",10);return isFinite(e)?e:0},Em=function(){E.useEffect(function(){return document.body.setAttribute(Xt,(Za()+1).toString()),function(){var e=Za()-1;e<=0?document.body.removeAttribute(Xt):document.body.setAttribute(Xt,e.toString())}},[])},Nm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Em();var i=E.useMemo(function(){return _m(o)},[o]);return E.createElement(Sm,{styles:Cm(i,!t,o,r?"":"!important")})},Go=!1;if(typeof window<"u")try{var Nn=Object.defineProperty({},"passive",{get:function(){return Go=!0,!0}});window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{Go=!1}var qt=Go?{passive:!1}:!1,zm=function(e){return e.tagName==="TEXTAREA"},Ka=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!zm(e)&&r[t]==="visible")},Am=function(e){return Ka(e,"overflowY")},jm=function(e){return Ka(e,"overflowX")},Ga=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Xa(e,n);if(o){var i=qa(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Tm=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Om=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Xa=function(e,t){return e==="v"?Am(t):jm(t)},qa=function(e,t){return e==="v"?Tm(t):Om(t)},Pm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Im=function(e,t,r,n,o){var i=Pm(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=qa(e,a),v=f[0],h=f[1],b=f[2],g=h-b-i*v;(v||g)&&Xa(e,a)&&(u+=g,m+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}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},zn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ja=function(e){return[e.deltaX,e.deltaY]},Qa=function(e){return e&&"current"in e?e.current:e},Dm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rm=function(e){return`
250
250
  .block-interactivity-`.concat(e,` {pointer-events: none;}
251
251
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
252
- `)},Im=0,Jt=[];function Dm(e){var t=E.useRef([]),r=E.useRef([0,0]),n=E.useRef(),o=E.useState(Im++)[0],i=E.useState(Ha)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=rm([e.lockRef.current],(e.shards||[]).map(qa),!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=E.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),x=r.current,k="deltaX"in h?h.deltaX:x[0]-g[0],_="deltaY"in h?h.deltaY:x[1]-g[1],C,I=h.target,A=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in h&&A==="h"&&I.type==="range")return!1;var D=window.getSelection(),R=D&&D.anchorNode,F=R?R===I||R.contains(I):!1;if(F)return!1;var Y=Za(A,I);if(!Y)return!0;if(Y?C=A:(C=A==="v"?"h":"v",Y=Za(A,I)),!Y)return!1;if(!n.current&&"changedTouches"in h&&(k||_)&&(n.current=C),!C)return!0;var N=n.current||C;return Tm(N,b,h,N==="h"?k:_)},[]),l=E.useCallback(function(h){var b=h;if(!(!Jt.length||Jt[Jt.length-1]!==i)){var g="deltaY"in b?Xa(b):jn(b),x=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Om(C.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var k=(s.current.shards||[]).map(qa).filter(Boolean).filter(function(C){return C.contains(b.target)}),_=k.length>0?a(b,k[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=E.useCallback(function(h,b,g,x){var k={name:h,delta:b,target:g,should:x,shadowParent:Rm(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),d=E.useCallback(function(h){r.current=jn(h),n.current=void 0},[]),u=E.useCallback(function(h){c(h.type,Xa(h),h.target,a(h,e.lockRef.current))},[]),m=E.useCallback(function(h){c(h.type,jn(h),h.target,a(h,e.lockRef.current))},[]);E.useEffect(function(){return Jt.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(){Jt=Jt.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,v=e.inert;return E.createElement(E.Fragment,null,v?E.createElement(i,{styles:Pm(o)}):null,f?E.createElement(Sm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lm=um($a,Dm);var Ko=E.forwardRef(function(e,t){return E.createElement(An,ot({},e,{ref:t,sideCar:Lm}))});Ko.classNames=An.classNames;var Mm=[" ","Enter","ArrowUp","ArrowDown"],Fm=[" ","Enter"],Tt="Select",[Tn,On,Bm]=ih(Tt),[Qt]=Wt(Tt,[Bm,Gt]),Pn=Gt(),[Um,yt]=Qt(Tt),[Wm,$m]=Qt(Tt),Ja=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:v}=e,h=Pn(t),[b,g]=E.useState(null),[x,k]=E.useState(null),[_,C]=E.useState(!1),I=Ys(c),[A,D]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Tt}),[R,F]=_n({prop:s,defaultProp:a,onChange:l,caller:Tt}),Y=E.useRef(null),N=b?v||!!b.closest("form"):!0,[M,y]=E.useState(new Set),B=Array.from(M).map(te=>te.props.value).join(";");return p.jsx(Uo,{...h,children:p.jsxs(Um,{required:f,scope:t,trigger:b,onTriggerChange:g,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:_r(),value:R,onValueChange:F,open:A,onOpenChange:D,dir:I,triggerPointerDownPosRef:Y,disabled:m,children:[p.jsx(Tn.Provider,{scope:t,children:p.jsx(Wm,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(te=>{y(U=>new Set(U).add(te))},[]),onNativeOptionRemove:E.useCallback(te=>{y(U=>{const $=new Set(U);return $.delete(te),$})},[]),children:r})}),N?p.jsxs(vl,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:R,onChange:te=>F(te.target.value),disabled:m,form:v,children:[R===void 0?p.jsx("option",{value:""}):null,Array.from(M)]},B):null]})})};Ja.displayName=Tt;var Qa="SelectTrigger",el=E.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=yt(Qa,r),a=s.disabled||n,l=_e(t,s.onTriggerChange),c=On(r),d=E.useRef("touch"),[u,m,f]=xl(h=>{const b=c().filter(k=>!k.disabled),g=b.find(k=>k.value===s.value),x=yl(b,h,g);x!==void 0&&s.onValueChange(x.value)}),v=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(ke.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":wl(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&v(h)}),onPointerDown:be(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"&&(v(h),h.preventDefault())}),onKeyDown:be(o.onKeyDown,h=>{const b=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Mm.includes(h.key)&&(v(),h.preventDefault())})})})});el.displayName=Qa;var tl="SelectValue",rl=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=yt(tl,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=_e(t,l.onValueNodeChange);return De(()=>{c(d)},[c,d]),p.jsx(ke.span,{...a,ref:u,style:{pointerEvents:"none"},children:wl(l.value)?p.jsx(p.Fragment,{children:s}):i})});rl.displayName=tl;var Hm="SelectIcon",nl=E.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(ke.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});nl.displayName=Hm;var Vm="SelectPortal",ol=e=>p.jsx(kn,{asChild:!0,...e});ol.displayName=Vm;var Ot="SelectContent",il=E.forwardRef((e,t)=>{const r=yt(Ot,e.__scopeSelect),[n,o]=E.useState();if(De(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Rr.createPortal(p.jsx(sl,{scope:e.__scopeSelect,children:p.jsx(Tn.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(al,{...e,ref:t})});il.displayName=Ot;var Qe=10,[sl,kt]=Qt(Ot),Ym="SelectContentImpl",Zm=$t("SelectContent.RemoveScroll"),al=E.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:v,hideWhenDetached:h,avoidCollisions:b,...g}=e,x=yt(Ot,r),[k,_]=E.useState(null),[C,I]=E.useState(null),A=_e(t,re=>_(re)),[D,R]=E.useState(null),[F,Y]=E.useState(null),N=On(r),[M,y]=E.useState(!1),B=E.useRef(!1);E.useEffect(()=>{if(k)return Fa(k)},[k]),qs();const te=E.useCallback(re=>{const[ie,...ae]=N().map(fe=>fe.ref.current),[oe]=ae.slice(-1),le=document.activeElement;for(const fe of re)if(fe===le||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ie&&C&&(C.scrollTop=0),fe===oe&&C&&(C.scrollTop=C.scrollHeight),fe==null||fe.focus(),document.activeElement!==le))return},[N,C]),U=E.useCallback(()=>te([D,k]),[te,D,k]);E.useEffect(()=>{M&&U()},[M,U]);const{onOpenChange:$,triggerPointerDownPosRef:Z}=x;E.useEffect(()=>{if(k){let re={x:0,y:0};const ie=oe=>{var le,fe;re={x:Math.abs(Math.round(oe.pageX)-(((le=Z.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((fe=Z.current)==null?void 0:fe.y)??0))}},ae=oe=>{re.x<=10&&re.y<=10?oe.preventDefault():k.contains(oe.target)||$(!1),document.removeEventListener("pointermove",ie),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ae,{capture:!0})}}},[k,$,Z]),E.useEffect(()=>{const re=()=>$(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[$]);const[ne,z]=xl(re=>{const ie=N().filter(le=>!le.disabled),ae=ie.find(le=>le.ref.current===document.activeElement),oe=yl(ie,re,ae);oe&&setTimeout(()=>oe.ref.current.focus())}),L=E.useCallback((re,ie,ae)=>{const oe=!B.current&&!ae;(x.value!==void 0&&x.value===ie||oe)&&(R(re),oe&&(B.current=!0))},[x.value]),K=E.useCallback(()=>k==null?void 0:k.focus(),[k]),q=E.useCallback((re,ie,ae)=>{const oe=!B.current&&!ae;(x.value!==void 0&&x.value===ie||oe)&&Y(re)},[x.value]),ee=n==="popper"?Xo:ll,ue=ee===Xo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(sl,{scope:r,content:k,viewport:C,onViewportChange:I,itemRefCallback:L,selectedItem:D,onItemLeave:K,itemTextRefCallback:q,focusSelectedItem:U,selectedItemText:F,position:n,isPositioned:M,searchRef:ne,children:p.jsx(Ko,{as:Zm,allowPinchZoom:!0,children:p.jsx(No,{asChild:!0,trapped:x.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:be(o,re=>{var ie;(ie=x.trigger)==null||ie.focus({preventScroll:!0}),re.preventDefault()}),children:p.jsx(dn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:p.jsx(ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:re=>re.preventDefault(),...g,...ue,onPlaced:()=>y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,re=>{const ie=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ie&&re.key.length===1&&z(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let oe=N().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(re.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const le=re.target,fe=oe.indexOf(le);oe=oe.slice(fe+1)}setTimeout(()=>te(oe)),re.preventDefault()}})})})})})})});al.displayName=Ym;var Gm="SelectItemAlignedPosition",ll=E.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=yt(Ot,r),s=kt(Ot,r),[a,l]=E.useState(null),[c,d]=E.useState(null),u=_e(t,A=>d(A)),m=On(r),f=E.useRef(!1),v=E.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:g,focusSelectedItem:x}=s,k=E.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&g){const A=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),F=g.getBoundingClientRect();if(i.dir!=="rtl"){const le=F.left-D.left,fe=R.left-le,ve=A.left-fe,w=A.width+ve,X=Math.max(w,D.width),H=window.innerWidth-Qe,T=ko(fe,[Qe,Math.max(Qe,H-X)]);a.style.minWidth=w+"px",a.style.left=T+"px"}else{const le=D.right-F.right,fe=window.innerWidth-R.right-le,ve=window.innerWidth-A.right-fe,w=A.width+ve,X=Math.max(w,D.width),H=window.innerWidth-Qe,T=ko(fe,[Qe,Math.max(Qe,H-X)]);a.style.minWidth=w+"px",a.style.right=T+"px"}const Y=m(),N=window.innerHeight-Qe*2,M=h.scrollHeight,y=window.getComputedStyle(c),B=parseInt(y.borderTopWidth,10),te=parseInt(y.paddingTop,10),U=parseInt(y.borderBottomWidth,10),$=parseInt(y.paddingBottom,10),Z=B+te+M+$+U,ne=Math.min(b.offsetHeight*5,Z),z=window.getComputedStyle(h),L=parseInt(z.paddingTop,10),K=parseInt(z.paddingBottom,10),q=A.top+A.height/2-Qe,ee=N-q,ue=b.offsetHeight/2,re=b.offsetTop+ue,ie=B+te+re,ae=Z-ie;if(ie<=q){const le=Y.length>0&&b===Y[Y.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-h.offsetTop-h.offsetHeight,ve=Math.max(ee,ue+(le?K:0)+fe+U),w=ie+ve;a.style.height=w+"px"}else{const le=Y.length>0&&b===Y[0].ref.current;a.style.top="0px";const ve=Math.max(q,B+h.offsetTop+(le?L:0)+ue)+ae;a.style.height=ve+"px",h.scrollTop=ie-q+h.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=ne+"px",a.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,g,i.dir,n]);De(()=>k(),[k]);const[_,C]=E.useState();De(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const I=E.useCallback(A=>{A&&v.current===!0&&(k(),x==null||x(),v.current=!1)},[k,x]);return p.jsx(Xm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:I,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:p.jsx(ke.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ll.displayName=Gm;var Km="SelectPopperPosition",Xo=E.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Qe,...i}=e,s=Pn(r);return p.jsx(Wo,{...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)"}})});Xo.displayName=Km;var[Xm,qo]=Qt(Ot,{}),Jo="SelectViewport",cl=E.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=kt(Jo,r),s=qo(Jo,r),a=_e(t,i.onViewportChange),l=E.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(ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(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 v=window.innerHeight-Qe*2,h=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),g=Math.max(h,b);if(g<v){const x=g+f,k=Math.min(v,x),_=x-k;u.style.height=k+"px",u.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});cl.displayName=Jo;var dl="SelectGroup",[qm,Jm]=Qt(dl),Qm=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=_r();return p.jsx(qm,{scope:r,id:o,children:p.jsx(ke.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Qm.displayName=dl;var ul="SelectLabel",eg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Jm(ul,r);return p.jsx(ke.div,{id:o.id,...n,ref:t})});eg.displayName=ul;var In="SelectItem",[tg,fl]=Qt(In),hl=E.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=yt(In,r),l=kt(In,r),c=a.value===n,[d,u]=E.useState(i??""),[m,f]=E.useState(!1),v=_e(t,x=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,x,n,o)}),h=_r(),b=E.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(tg,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:E.useCallback(x=>{u(k=>k||((x==null?void 0:x.textContent)??"").trim())},[]),children:p.jsx(Tn.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(ke.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:v,onFocus:be(s.onFocus,()=>f(!0)),onBlur:be(s.onBlur,()=>f(!1)),onClick:be(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:be(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:be(s.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:be(s.onPointerMove,x=>{var k;b.current=x.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,x=>{var k;x.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:be(s.onKeyDown,x=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&x.key===" "||(Fm.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})})})})});hl.displayName=In;var Er="SelectItemText",pl=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=yt(Er,r),a=kt(Er,r),l=fl(Er,r),c=$m(Er,r),[d,u]=E.useState(null),m=_e(t,g=>u(g),l.onItemTextChange,g=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,v=E.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 De(()=>(h(v),()=>b(v)),[h,b,v]),p.jsxs(p.Fragment,{children:[p.jsx(ke.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Rr.createPortal(i.children,s.valueNode):null]})});pl.displayName=Er;var ml="SelectItemIndicator",gl=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return fl(ml,r).isSelected?p.jsx(ke.span,{"aria-hidden":!0,...n,ref:t}):null});gl.displayName=ml;var Qo="SelectScrollUpButton",rg=E.forwardRef((e,t)=>{const r=kt(Qo,e.__scopeSelect),n=qo(Qo,e.__scopeSelect),[o,i]=E.useState(!1),s=_e(t,n.onScrollButtonChange);return De(()=>{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(bl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});rg.displayName=Qo;var ei="SelectScrollDownButton",ng=E.forwardRef((e,t)=>{const r=kt(ei,e.__scopeSelect),n=qo(ei,e.__scopeSelect),[o,i]=E.useState(!1),s=_e(t,n.onScrollButtonChange);return De(()=>{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(bl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ng.displayName=ei;var bl=E.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=kt("SelectScrollButton",r),s=E.useRef(null),a=On(r),l=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),De(()=>{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(ke.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:be(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),og="SelectSeparator",ig=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(ke.div,{"aria-hidden":!0,...n,ref:t})});ig.displayName=og;var ti="SelectArrow",sg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=yt(ti,r),s=kt(ti,r);return i.open&&s.position==="popper"?p.jsx($o,{...o,...n,ref:t}):null});sg.displayName=ti;var ag="SelectBubbleInput",vl=E.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=E.useRef(null),i=_e(n,o),s=Xp(t);return E.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(ke.select,{...r,style:{...Ra,...r.style},ref:i,defaultValue:t})});vl.displayName=ag;function wl(e){return e===""||e===void 0}function xl(e){const t=Me(e),r=E.useRef(""),n=E.useRef(0),o=E.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=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function yl(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=lg(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 lg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cg=Ja,kl=el,dg=rl,ug=nl,fg=ol,_l=il,hg=cl,Sl=hl,pg=pl,mg=gl;const gg=cg,bg=dg,Cl=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(kl,{ref:n,className:me("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(ug,{asChild:!0,children:p.jsx(Hr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Cl.displayName=kl.displayName;const El=E.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(fg,{children:p.jsx(_l,{ref:o,className:me("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(hg,{className:me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));El.displayName=_l.displayName;const Nl=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Sl,{ref:n,className:me("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(mg,{children:p.jsx(eo,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(pg,{children:t})]}));Nl.displayName=Sl.displayName;const Al=E.createContext(null);function zl(){const e=E.useContext(Al);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function jl({open:e,onOpenChange:t,children:r}){const[n,o]=E.useState(!1),i=e!==void 0,s=i?e:n,a=E.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=E.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(Al.Provider,{value:l,children:r})}function vg({asChild:e,children:t}){const{onOpenChange:r}=zl(),n=E.Children.only(t);return e&&E.isValidElement(n)?E.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 Tl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=zl();if(E.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 ht.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:me("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 Ol({className:e,...t}){return p.jsx("div",{className:me("flex flex-col gap-1.5 pb-4",e),...t})}function wg({className:e,...t}){return p.jsx("div",{className:me("flex justify-end gap-2 pt-4",e),...t})}function Pl({className:e,...t}){return p.jsx("h2",{className:me("text-sm font-semibold text-white",e),...t})}function Il({className:e,...t}){return p.jsx("p",{className:me("text-xs text-zinc-400",e),...t})}const Ue=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?Qf:"button";return p.jsx(c,{ref:i,type:"button",className:me(s,a[t],l[r],e),...o})});Ue.displayName="Button";const xg=["library","upload","url"];function yg({library:e,selectedId:t,onSelect:r}){const[n,o]=j.useState(""),[i,s]=j.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(Vd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),p.jsx(yo,{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:me("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:me("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:me("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:me("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(eo,{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 kg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=j.useState(!1),i=j.useRef(null),s=j.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 v;t({name:d.name,size:d.size,dataUrl:(v=f.target)==null?void 0:v.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=j.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=j.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=j.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:me("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(Ue,{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(Qi,{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 _g({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=j.useState(""),[o,i]=j.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(zt,{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(yo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:me("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),p.jsx(Ue,{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(eo,{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(Ji,{size:32,className:"mb-3 opacity-40"}),p.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Sg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=ur(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=j.useState("library"),[a,l]=j.useState(null),[c,d]=j.useState(null),[u,m]=j.useState(null);j.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),j.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]),j.useEffect(()=>{if(!e||i!=="upload")return;const g=k=>{k.preventDefault()},x={capture:!0};return document.addEventListener("dragover",g,x),document.addEventListener("drop",g,x),window.addEventListener("dragover",g,x),window.addEventListener("drop",g,x),()=>{document.removeEventListener("dragover",g,x),document.removeEventListener("drop",g,x),window.removeEventListener("dragover",g,x),window.removeEventListener("drop",g,x)}},[e,i]);const f=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&u!=null,v=()=>{if(i==="library"&&a){const g=o.find(x=>x.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(jl,{open:e,onOpenChange:t,children:p.jsxs(Tl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(Ol,{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(Pl,{children:"Image Picker"}),p.jsx(Il,{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(Lt,{size:18})})]}),p.jsx("div",{className:"flex border-b border-zinc-800",children:xg.map(g=>p.jsxs("button",{type:"button",onClick:()=>s(g),className:me("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(Qi,{size:14}),g==="url"&&p.jsx(Ji,{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(yg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(kg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(_g,{urlPreview:u,onUrlPreviewChange:m})]}),p.jsxs(wg,{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(Ue,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),p.jsx(Ue,{type:"button",size:"sm",disabled:!f,onClick:v,className:me(!f&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Dl=(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}`},Cg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=ur(),[i,s]=j.useState(!1),[a,l]=j.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Dl(e.url,o):"",u=f=>{t(f),s(!1)},m=f=>{f.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:me("space-y-1.5",n),children:[p.jsx(zt,{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:me("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:me("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($d,{size:13}),p.jsx("span",{children:"Cambia"})]}),p.jsx(Ue,{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:me("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(Sg,{open:i,onOpenChange:s,onSelect:u})]})},Rl=[{name:"layers",Icon:ro},{name:"github",Icon:Ud},{name:"arrow-right",Icon:Id},{name:"box",Icon:Rd},{name:"terminal",Icon:Kd},{name:"chevron-right",Icon:Ld},{name:"menu",Icon:Wd},{name:"x",Icon:Lt},{name:"sparkles",Icon:Zd},{name:"zap",Icon:qd}],er={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(yo,{type:"text",className:"h-7 text-[11px] bg-zinc-900/50 border-zinc-800 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-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsx(Xf,{className:"min-h-[80px] text-[11px] bg-zinc-900/50 border-zinc-800 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-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(gg,{value:t||"",onValueChange:r,children:[p.jsx(Cl,{className:"w-full h-7 text-[11px] bg-zinc-900/50 border-zinc-800 focus:ring-blue-600",children:p.jsx(bg,{placeholder:"Select..."})}),p.jsx(El,{className:"dark",children:n.map(o=>p.jsx(Nl,{value:o,className:"text-[11px]",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 rounded border border-zinc-800/50 bg-zinc-900/20",children:[p.jsx(qf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(zt,{htmlFor:e,className:"text-[11px] font-medium cursor-pointer select-none text-zinc-300",children: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(Cg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=j.useState(!1),i=Rl.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(zt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(jl,{open:n,onOpenChange:o,children:[p.jsx(vg,{asChild:!0,children:p.jsx(Ue,{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(Tl,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(Ol,{children:[p.jsx(Pl,{className:"text-sm",children:"Choose icon"}),p.jsx(Il,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Rl.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:me("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))})]})]})]})}},ri=e=>{if(e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault)return ri(e._def.innerType);if(e instanceof je.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=ri(e.shape[r]));return t}return e instanceof je.z.ZodArray?[]:e instanceof je.z.ZodString?"":e instanceof je.z.ZodNumber?0:e instanceof je.z.ZodBoolean?!1:e instanceof je.z.ZodEnum?e._def.values[0]:null},Dn=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?Dn(e._def.innerType):e,Ll=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=Dn(e);return r!==e?Ll(r):null},Rn=(e,t)=>e&&!t?"opacity-10":"opacity-100",tr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),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=Dn(m),v=Ll(m)||"ui:text",h=t[u];if(v==="ui:editorial-markdown")return null;if(v==="ui:image-picker"&&f instanceof je.z.ZodObject){const _=tr(c,u),C=er["ui:image-picker"]||er["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(d,_)}`,..._?{"data-jp-focused-field":u}:{},children:p.jsx(C,{label:u,value:h,onChange:I=>r({...t,[u]:I})})},u)}if(f instanceof je.z.ZodObject){const _=h||{},C=tr(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 ${Rn(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-[10px] font-black uppercase text-zinc-400 tracking-widest",children:u})]}),p.jsx(Nr,{schema:f,data:_,onChange:I=>r({...t,[u]:I}),expandedItemPath:o&&tr(l==null?void 0:l.fieldKey,u)?o.slice(1):void 0})]},u)}if(f instanceof je.z.ZodArray){const _=Array.isArray(h)?h:[],C=Dn(f.element),I=(F,Y)=>{if(Y<0||Y>=_.length)return;const N=[..._],[M]=N.splice(F,1);N.splice(Y,0,M),r({...t,[u]:N})},A=tr(c,u),R=tr(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 ${Rn(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-[10px] font-black uppercase text-zinc-500 tracking-widest",children:[u," (",_.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const F=ri(C);r({...t,[u]:[..._,F]})},className:"flex items-center gap-1 px-2 py-1 bg-blue-600/10 hover:bg-blue-600/20 text-blue-500 rounded text-[10px] font-bold transition-colors",children:[p.jsx(no,{size:12})," Add Item"]})]}),p.jsx("div",{className:"space-y-2",children:_.map((F,Y)=>{const N=F,M=N.id||`legacy-${Y}`,y=(typeof N.title=="string"?N.title:null)||(typeof N.label=="string"?N.label:null)||(typeof N.name=="string"?N.name:null)||(typeof N.content=="string"?N.content:null)||(typeof N.text=="string"?N.text:null)||`${u} #${Y+1}`,B=R,te=String(N.id??M),U=B!=null&&String(B)===te,$=U&&o&&o.length>1?o.slice(1):void 0,Z=d&&A&&B!=null&&!U;return p.jsx(Eg,{itemId:te,openItemId:B!=null?String(B):void 0,isFaded:Z,index:Y,isFirst:Y===0,isLast:Y===_.length-1,label:y,onExpandedChange:i?ne=>i(ne?{fieldKey:u,itemId:te}:null):void 0,onRemove:()=>{const ne=_.filter((z,L)=>L!==Y);r({...t,[u]:ne})},onMoveUp:()=>I(Y,Y-1),onMoveDown:()=>I(Y,Y+1),children:C instanceof je.z.ZodObject?p.jsx(Nr,{schema:C,data:N||{},expandedItemPath:$,onChange:ne=>{const z=[..._];z[Y]=ne,r({...t,[u]:z})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},u)}const b=v in er?v:"ui:text",g=er[b]||er["ui:text"],x=f instanceof je.z.ZodEnum?f._def.values:void 0,k=tr(c,u);return p.jsx("div",{className:`transition-opacity duration-200 ${Rn(d,k)}`,...k?{"data-jp-focused-field":u}:{},children:p.jsx(g,{label:u,value:h,options:x,onChange:_=>r({...t,[u]:_})})},u)})})},Eg=({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]=j.useState(u);j.useEffect(()=>{u&&!m&&f(!0),!u&&m&&f(!1)},[u,m]);const v=()=>{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:v,className:"flex items-center gap-2 text-[10px] font-bold text-zinc-300 uppercase tracking-tight truncate",children:[m?p.jsx(to,{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(Dd,{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(Pd,{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 Ng(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var ut=e=>{const{present:t,children:r}=e,n=Ag(t),o=typeof r=="function"?r({present:n.isPresent}):E.Children.only(r),i=_e(n.ref,zg(o));return typeof r=="function"||n.isPresent?E.cloneElement(o,{ref:i}):null};ut.displayName="Presence";function Ag(e){const[t,r]=E.useState(),n=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ng(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Ln(n.current);i.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,f=Ln(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]),De(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=f=>{const h=Ln(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=Ln(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:E.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Ln(e){return(e==null?void 0:e.animationName)||"none"}function zg(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[Mn]=Wt("Tooltip",[Gt]),Fn=Gt(),Ml="TooltipProvider",jg=700,ni="tooltip.open",[Tg,oi]=Mn(Ml),Fl=e=>{const{__scopeTooltip:t,delayDuration:r=jg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Tg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Fl.displayName=Ml;var Ar="Tooltip",[Og,zr]=Mn(Ar),Bl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=oi(Ar,e.__scopeTooltip),c=Fn(t),[d,u]=E.useState(null),m=_r(),f=E.useRef(0),v=s??l.disableHoverableContent,h=a??l.delayDuration,b=E.useRef(!1),[g,x]=_n({prop:n,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ni))):l.onClose(),i==null||i(A)},caller:Ar}),k=E.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),_=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,x(!0)},[x]),C=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x(!1)},[x]),I=E.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,x(!0),f.current=0},h)},[h,x]);return E.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx(Uo,{...c,children:p.jsx(Og,{scope:t,contentId:m,open:g,stateAttribute:k,trigger:d,onTriggerChange:u,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?I():_()},[l.isOpenDelayedRef,I,_]),onTriggerLeave:E.useCallback(()=>{v?C():(window.clearTimeout(f.current),f.current=0)},[C,v]),onOpen:_,onClose:C,disableHoverableContent:v,children:r})})};Bl.displayName=Ar;var ii="TooltipTrigger",Ul=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=zr(ii,r),i=oi(ii,r),s=Fn(r),a=E.useRef(null),l=_e(t,a,o.onTriggerChange),c=E.useRef(!1),d=E.useRef(!1),u=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(yn,{asChild:!0,...s,children:p.jsx(ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:be(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});Ul.displayName=ii;var si="TooltipPortal",[Pg,Ig]=Mn(si,{forceMount:void 0}),Wl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=zr(si,t);return p.jsx(Pg,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};Wl.displayName=si;var rr="TooltipContent",$l=E.forwardRef((e,t)=>{const r=Ig(rr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=zr(rr,e.__scopeTooltip);return p.jsx(ut,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Hl,{side:o,...i,ref:t}):p.jsx(Dg,{side:o,...i,ref:t})})}),Dg=E.forwardRef((e,t)=>{const r=zr(rr,e.__scopeTooltip),n=oi(rr,e.__scopeTooltip),o=E.useRef(null),i=_e(t,o),[s,a]=E.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:u}=n,m=E.useCallback(()=>{a(null),u(!1)},[u]),f=E.useCallback((v,h)=>{const b=v.currentTarget,g={x:v.clientX,y:v.clientY},x=Bg(g,b.getBoundingClientRect()),k=Ug(g,x),_=Wg(h.getBoundingClientRect()),C=Hg([...k,..._]);a(C),u(!0)},[u]);return E.useEffect(()=>()=>m(),[m]),E.useEffect(()=>{if(l&&d){const v=b=>f(b,d),h=b=>f(b,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",h)}}},[l,d,f,m]),E.useEffect(()=>{if(s){const v=h=>{const b=h.target,g={x:h.clientX,y:h.clientY},x=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!$g(g,s);x?m():k&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,m]),p.jsx(Hl,{...e,ref:i})}),[Rg,Lg]=Mn(Ar,{isInside:!1}),Mg=th("TooltipContent"),Hl=E.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=zr(rr,r),c=Fn(r),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(ni,d),()=>document.removeEventListener(ni,d)),[d]),E.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(Wo,{"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(Mg,{children:n}),p.jsx(Rg,{scope:r,isInside:!0,children:p.jsx(Jp,{id:l.contentId,role:"tooltip",children:o||n})})]})})});$l.displayName=rr;var Vl="TooltipArrow",Fg=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Fn(r);return Lg(Vl,r).isInside?null:p.jsx($o,{...o,...n,ref:t})});Fg.displayName=Vl;function Bg(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 Ug(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 Wg(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 $g(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 Hg(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),Vg(t)}function Vg(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 Yg=Fl,Zg=Bl,Gg=Ul,Kg=Wl,Yl=$l;const Xg=Yg,jr=Zg,Tr=Gg,nr=E.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(Kg,{children:p.jsx(Yl,{ref:n,sideOffset:t,className:me("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})}));nr.displayName=Yl.displayName;var Bn="Popover",[Zl]=Wt(Bn,[Gt]),Or=Gt(),[qg,_t]=Zl(Bn),Gl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Or(t),l=E.useRef(null),[c,d]=E.useState(!1),[u,m]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Bn});return p.jsx(Uo,{...a,children:p.jsx(qg,{scope:t,contentId:_r(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:E.useCallback(()=>m(f=>!f),[m]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:s,children:r})})};Gl.displayName=Bn;var Kl="PopoverAnchor",Jg=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Kl,r),i=Or(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return E.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(yn,{...i,...n,ref:t})});Jg.displayName=Kl;var Xl="PopoverTrigger",ql=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Xl,r),i=Or(r),s=_e(t,o.triggerRef),a=p.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rc(o.open),...n,ref:s,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(yn,{asChild:!0,...i,children:a})});ql.displayName=Xl;var ai="PopoverPortal",[Qg,e0]=Zl(ai,{forceMount:void 0}),Jl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=_t(ai,t);return p.jsx(Qg,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(kn,{asChild:!0,container:o,children:n})})})};Jl.displayName=ai;var or="PopoverContent",Ql=E.forwardRef((e,t)=>{const r=e0(or,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=_t(or,e.__scopePopover);return p.jsx(ut,{present:n||i.open,children:i.modal?p.jsx(r0,{...o,ref:t}):p.jsx(n0,{...o,ref:t})})});Ql.displayName=or;var t0=$t("PopoverContent.RemoveScroll"),r0=E.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=E.useRef(null),o=_e(t,n),i=E.useRef(!1);return E.useEffect(()=>{const s=n.current;if(s)return Fa(s)},[]),p.jsx(Ko,{as:t0,allowPinchZoom:!0,children:p.jsx(ec,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(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:be(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),n0=E.forwardRef((e,t)=>{const r=_t(or,e.__scopePopover),n=E.useRef(!1),o=E.useRef(!1);return p.jsx(ec,{...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()}})}),ec=E.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=_t(or,r),f=Or(r);return qs(),p.jsx(No,{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(Wo,{"data-state":rc(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)"}})})})}),tc="PopoverClose",o0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(tc,r);return p.jsx(ke.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});o0.displayName=tc;var i0="PopoverArrow",s0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Or(r);return p.jsx($o,{...o,...n,ref:t})});s0.displayName=i0;function rc(e){return e?"open":"closed"}var a0=Gl,l0=ql,c0=Jl,nc=Ql;const d0=a0,u0=l0,oc=E.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(c0,{children:p.jsx(nc,{ref:o,align:t,sideOffset:r,className:me("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})}));oc.displayName=nc.displayName;const ic=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",f0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=j.useState(!1),c=s??ic(t),d=u=>{r(u),l(!1)};return p.jsx("div",{className:me("mx-3 mt-2 mb-2",i),children:p.jsxs(d0,{open:a,onOpenChange:l,children:[p.jsx(u0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:me("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(Bd,{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(oc,{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=ic(u);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(u),className:me("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(no,{size:12,"aria-hidden":!0}),p.jsx("span",{children:"New page"})]})})]})]})})};function h0(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var li="ScrollArea",[sc]=Wt(li),[p0,Ye]=sc(li),ac=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=E.useState(null),[c,d]=E.useState(null),[u,m]=E.useState(null),[f,v]=E.useState(null),[h,b]=E.useState(null),[g,x]=E.useState(0),[k,_]=E.useState(0),[C,I]=E.useState(!1),[A,D]=E.useState(!1),R=_e(t,Y=>l(Y)),F=Ys(o);return p.jsx(p0,{scope:r,type:n,dir:F,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:m,scrollbarX:f,onScrollbarXChange:v,scrollbarXEnabled:C,onScrollbarXEnabledChange:I,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:x,onCornerHeightChange:_,children:p.jsx(ke.div,{dir:F,...s,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});ac.displayName=li;var lc="ScrollAreaViewport",cc=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ye(lc,r),a=E.useRef(null),l=_e(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(ke.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})})]})});cc.displayName=lc;var it="ScrollAreaScrollbar",dc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return E.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(m0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(g0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(uc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(ci,{...n,ref:t}):null});dc.displayName=it;var m0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),[i,s]=E.useState(!1);return E.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(ut,{present:r||i,children:p.jsx(uc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),g0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ye(it,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Hn(()=>l("SCROLL_END"),100),[a,l]=h0("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 E.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),E.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(ut,{present:r||a!=="hidden",children:p.jsx(ci,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),uc=E.forwardRef((e,t)=>{const r=Ye(it,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=E.useState(!1),a=e.orientation==="horizontal",l=Hn(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?c:d)}},10);return ir(r.viewport,l),ir(r.content,l),p.jsx(ut,{present:n||i,children:p.jsx(ci,{"data-state":i?"visible":"hidden",...o,ref:t})})}),ci=E.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ye(it,e.__scopeScrollArea),i=E.useRef(null),s=E.useRef(0),[a,l]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=gc(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 k0(m,s.current,a,f)}return r==="horizontal"?p.jsx(b0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,f=bc(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(v0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,f=bc(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}),b0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ye(it,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=_e(t,l,i.onScrollbarXChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(hc,{"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":$n(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),wc(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:Wn(s.paddingLeft),paddingEnd:Wn(s.paddingRight)}})}})}),v0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ye(it,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=_e(t,l,i.onScrollbarYChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(hc,{"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":$n(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),wc(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:Wn(s.paddingTop),paddingEnd:Wn(s.paddingBottom)}})}})}),[w0,fc]=sc(it),hc=E.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=Ye(it,r),[v,h]=E.useState(null),b=_e(t,R=>h(R)),g=E.useRef(null),x=E.useRef(""),k=f.viewport,_=n.content-n.viewport,C=Me(d),I=Me(l),A=Hn(u,10);function D(R){if(g.current){const F=R.clientX-g.current.left,Y=R.clientY-g.current.top;c({x:F,y:Y})}}return E.useEffect(()=>{const R=F=>{const Y=F.target;(v==null?void 0:v.contains(Y))&&C(F,_)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[k,v,_,C]),E.useEffect(I,[n,I]),ir(v,A),ir(f.content,A),p.jsx(w0,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Me(i),onThumbPointerUp:Me(s),onThumbPositionChange:I,onThumbPointerDown:Me(a),children:p.jsx(ke.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:be(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),g.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),D(R))}),onPointerMove:be(e.onPointerMove,D),onPointerUp:be(e.onPointerUp,R=>{const F=R.target;F.hasPointerCapture(R.pointerId)&&F.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Un="ScrollAreaThumb",pc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=fc(Un,e.__scopeScrollArea);return p.jsx(ut,{present:r||o.hasThumb,children:p.jsx(x0,{ref:t,...n})})}),x0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ye(Un,r),s=fc(Un,r),{onThumbPositionChange:a}=s,l=_e(t,u=>s.onThumbChange(u)),c=E.useRef(void 0),d=Hn(()=>{c.current&&(c.current(),c.current=void 0)},100);return E.useEffect(()=>{const u=i.viewport;if(u){const m=()=>{if(d(),!c.current){const f=_0(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(ke.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:be(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),v=u.clientX-f.left,h=u.clientY-f.top;s.onThumbPointerDown({x:v,y:h})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});pc.displayName=Un;var di="ScrollAreaCorner",mc=E.forwardRef((e,t)=>{const r=Ye(di,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(y0,{...e,ref:t}):null});mc.displayName=di;var y0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ye(di,r),[i,s]=E.useState(0),[a,l]=E.useState(0),c=!!(i&&a);return ir(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),ir(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(ke.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 Wn(e){return e?parseInt(e,10):0}function gc(e,t){const r=e/t;return isNaN(r)?0:r}function $n(e){const t=gc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function k0(e,t,r,n="ltr"){const o=$n(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 vc([l,c],u)(e)}function bc(e,t,r="ltr"){const n=$n(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=ko(e,l);return vc([0,s],[0,a])(c)}function vc(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 wc(e,t){return e>0&&e<t}var _0=(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 Hn(e,t){const r=Me(e),n=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),E.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ir(e,t){const r=Me(t);De(()=>{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 xc=ac,S0=cc,C0=dc,E0=pc,N0=mc;const yc=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(xc,{ref:n,className:me("relative overflow-hidden",e),...r,children:[p.jsx(S0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(C0,{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(E0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(N0,{})]}));yc.displayName=xc.displayName;const ui=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),kc=new Set(["ui:editorial-markdown"]),_c=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?_c(e._def.innerType):e,fi=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=_c(e);return o!==e?fi(o):""},A0={activationConstraint:{distance:8}},z0={activationConstraint:{delay:200,tolerance:5}};function hi({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:me("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:me("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(Ue,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:u=>{u.stopPropagation(),l(u)},children:p.jsx(Yd,{size:12})})}),p.jsx(nr,{children:"Settings"})]}),s&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx(Ue,{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(nr,{children:"Delete section"})]})]})]})}function j0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Vf({id:e.id,disabled:!t.canReorder}),l={transform:gt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:l,className:me(a&&"z-10"),children:p.jsx(hi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const Sc=({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,onExportHTML:v,onSaveToFile:h,saveSuccessFeedback:b=!1,onResetToFile:g,showResetToFile:x=!1,pageSlugs:k=[],currentSlug:_="home",onPageChange:C})=>{const{schemas:I}=ur(),[A,D]=j.useState(!0),[R,F]=j.useState(null),[Y,N]=j.useState(null),[M,y]=j.useState(null),[B,te]=j.useState(null),U=j.useRef(null),$=j.useRef(null),Z=gu(lo(go,A0),lo(_s,z0),lo(po,{coordinateGetter:Gf})),ne=j.useDeferredValue(e),z=e!=null&&(ne==null?void 0:ne.id)!==e.id,L=s&&s.length>0?s:M?[M]:null,K=L!=null&&L.length?{fieldKey:L[L.length-1].fieldKey,itemId:L[L.length-1].itemId}:null,q=j.useRef(s);j.useEffect(()=>{q.current!=null&&s==null&&y(null),q.current=s},[s]),j.useEffect(()=>{(e==null?void 0:e.id)!=null&&D(!1)},[e==null?void 0:e.id]);const ee=()=>{const O=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const V=U.current;V&&V.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(O)},ue=j.useRef(A);j.useEffect(()=>{if(A&&!ue.current){const O=ee();return ue.current=A,O}ue.current=A},[A]),j.useEffect(()=>{if(!K)return;const O=U.current;if(!O)return;const V=requestAnimationFrame(()=>{const J=O.querySelector("[data-jp-expanded-item]")??O.querySelector("[data-jp-focused-field]");J&&J.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(V)},[K]);const re=O=>{D(!1),d==null||d(O)},ie=()=>{D(O=>{const V=!O;return V&&ee(),V})},ae=(O,V)=>{V.stopPropagation(),r.length>0&&o?te(O):(D(!1),d==null||d(O))};j.useEffect(()=>{if(B==null)return;const O=V=>{V.key==="Escape"&&te(null)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[B]);const oe=O=>{R===O?(u==null||u(O),F(null)):(F(O),setTimeout(()=>F(null),3e3))},le=j.useMemo(()=>l.filter(O=>O.scope==="local").map(O=>O.id),[l]),fe=!!a&&le.length>0,ve=O=>{N(O.active.id)},w=O=>{N(null);const{active:V,over:J}=O;if(!J||V.id===J.id||!a)return;const Q=l.findIndex(he=>he.id===V.id),se=l.findIndex(he=>he.id===J.id);if(Q===-1||se===-1)return;const pe=Q<se?se:se-1;a(V.id,pe)},X=e?t.sections.find(O=>O.id===e.id):void 0,H=ne?t.sections.find(O=>O.id===ne.id):void 0,T=ne?I[ne.type]:void 0,S=j.useMemo(()=>{if(!T)return!1;const O=T.shape,V=Object.keys(O).filter(J=>!ui.has(J));return V.length===0?!1:V.every(J=>kc.has(fi(O[J])))},[T]);j.useEffect(()=>{(e==null?void 0:e.id)!=null&&S&&D(!0)},[e==null?void 0:e.id,S]);const P=l.length>0&&(A||!e),W=_?_.charAt(0).toUpperCase()+_.slice(1):"Select page",G=j.useMemo(()=>{const O=[];let V=null;for(const J of l){const Q=J.type.toUpperCase(),se=V!==null&&(V==="HEADER"&&Q!=="HEADER"||V!=="HEADER"&&V!=="FOOTER"&&Q==="FOOTER");O.push({layer:J,showSeparatorAbove:se}),V=Q}return O},[l]);return p.jsx(Xg,{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:[W," · ",l.length," sections"]})})]}),p.jsx(Ue,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Lt,{size:14})})]}),k.length>0&&C&&p.jsx(f0,{pageSlugs:k,currentSlug:_,onPageChange:C,sectionCount:l.length,currentPageLabel:W}),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:ie,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":P,"aria-label":P?"Collapse Page Layers":"Expand Page Layers",children:[p.jsx(ro,{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(to,{size:13,className:me("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!A&&"rotate-180")})]}),m!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsx(Ue,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(no,{size:14})})}),p.jsx(nr,{children:"Add section"})]})]}),p.jsxs(yc,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:U,className:"flex flex-col min-h-0",children:P&&p.jsxs("div",{className:"py-1",children:[p.jsxs(pf,{sensors:Z,collisionDetection:wu,modifiers:[Of],onDragStart:ve,onDragEnd:w,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:O})=>O?`Posizione ${le.indexOf(String(O.id))+1} di ${le.length}.`:void 0,onDragEnd:({over:O})=>O?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Mf,{items:le,strategy:Rf,children:p.jsx("div",{className:"px-2 space-y-0.5",children:G.map(({layer:O,showSeparatorAbove:V})=>p.jsxs(j.Fragment,{children:[V&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),O.scope==="local"&&fe?p.jsx(j0,{layer:O,opts:{isSelected:(e==null?void 0:e.id)===O.id,isActive:c===O.id,isDragging:!1,canReorder:!0,canDelete:!!u,deleteConfirm:R===O.id,onSelect:()=>re(O.id),onDelete:()=>oe(O.id),onOpenSettings:J=>ae(O.id,J)}}):p.jsx("div",{children:p.jsx(hi,{layer:O,opts:{isSelected:(e==null?void 0:e.id)===O.id,isActive:c===O.id,isDragging:!1,canDelete:O.scope==="local"&&!!u,deleteConfirm:R===O.id,onSelect:()=>re(O.id),onDelete:()=>oe(O.id),onOpenSettings:J=>ae(O.id,J)}})})]},O.id))})}),p.jsx(Tf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Y?(()=>{const O=l.find(V=>V.id===Y);return O?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(hi,{layer:O,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),R&&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(Md,{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"})]})]})}),K&&X&&(()=>{const O=X.data||{};let V;if(L&&L.length>0){let J=O;for(const pe of L){const he=J==null?void 0:J[pe.fieldKey];pe.itemId!=null&&Array.isArray(he)?J=he.find(Se=>String(Se==null?void 0:Se.id)===String(pe.itemId))??null:J=he}const Q=J||{},se=K.fieldKey;V=(typeof Q.name=="string"?Q.name:null)??(typeof Q.title=="string"?Q.title:null)??(typeof Q.label=="string"?Q.label:null)??se.charAt(0).toUpperCase()+se.slice(1).replace(/([A-Z])/g," $1").trim()}else{const J=K.fieldKey;if(K.itemId!=null){const pe=(Array.isArray(O[J])?O[J]:[]).find(he=>String(he==null?void 0:he.id)===String(K.itemId))||{};V=(typeof pe.name=="string"?pe.name:null)??(typeof pe.title=="string"?pe.title:null)??(typeof pe.label=="string"?pe.label:null)??J}else V=J.charAt(0).toUpperCase()+J.slice(1).replace(/([A-Z])/g," $1").trim()}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:V})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&D(!1),children:e?z?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"})]}):T?(()=>{const V=Object.keys(T.shape).filter(Q=>!ui.has(Q)&&!kc.has(fi(T.shape[Q]))),J=(H==null?void 0:H.data)||{};return V.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:T,data:J,onChange:Q=>n(Q),keys:V,expandedItemPath:L,onSidebarExpandedItemChange:y})})():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 ",(ne==null?void 0:ne.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 gap-3 opacity-100 flex-wrap shrink-0",children:(v!=null||h!=null||g!=null)&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:me("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:me("text-xs font-medium transition-colors duration-300 shrink-0",b?"text-emerald-400":f?"text-amber-500":"text-zinc-500"),children:b?"Salvato":f?"Unsaved Changes":"All Changes Saved"}),v!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs(Ue,{variant:"outline",size:"sm",className:"gap-1.5",onClick:v,children:[p.jsx(Xi,{size:12}),p.jsx("span",{children:"Bake HTML"})]})}),p.jsx(nr,{children:"Generate static HTML output"})]}),h!=null&&p.jsxs(jr,{children:[p.jsx(Tr,{asChild:!0,children:p.jsxs(Ue,{size:"sm",disabled:!f,className:"gap-1.5",onClick:O=>{O.preventDefault(),O.stopPropagation(),h()},children:[p.jsx(Hd,{size:12}),p.jsx("span",{children:"Save"})]})}),p.jsx(nr,{children:"Save (export JSON)"})]}),g!=null&&x&&p.jsx("button",{type:"button",onClick:g,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"})})]})}),B!=null&&r.length>0&&o!=null&&(()=>{const O=r.find(Se=>Se.id===B),V=l.find(Se=>Se.id===B);if(!O)return null;const J=(V==null?void 0:V.scope)==="global"?"global":"local",Q=O.type,se=I[Q],he=(se?Object.keys(se.shape):[]).filter(Se=>ui.has(Se)),Ae=O.data??{};return he.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:()=>te(null),children:p.jsxs("div",{ref:$,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:Se=>Se.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 — ",Q]}),p.jsx("button",{type:"button",onClick:()=>te(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(Lt,{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:Se=>Se.target===Se.currentTarget&&te(null),children:p.jsxs("div",{ref:$,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:Se=>Se.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 — ",Q]}),p.jsx("button",{type:"button",onClick:()=>te(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(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(Nr,{schema:se,data:Ae,onChange:Se=>{const ze={...O.data,...Se};o(B,J,Q,ze)},keys:he})})]})})})()]})})},Cc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=j.useRef(null),l=j.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return j.useEffect(()=>{l()},[l]),j.useEffect(()=>{const c=d=>{d.data.type===Ce.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),j.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.SYNC_SELECTION,selectedId:o},"*")},[o]),j.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:Ce.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"})})},Vn={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)})}},T0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',Ec=()=>{var f;const[e,t]=j.useState(null),[r,n]=j.useState(null),[o,i]=j.useState(null),[s,a]=j.useState(null),[l,c]=j.useState(!1);if(j.useEffect(()=>{const v=h=>{if(!(h.origin!==window.location.origin||h.source!==window.parent)){if(h.data.type===Ce.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Vn.setTheme(h.data.themeConfig)),h.data.type===Ce.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===Ce.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===Ce.REQUEST_INLINE_FLUSH){const b=typeof h.data.requestId=="string"?h.data.requestId:null;window.dispatchEvent(new CustomEvent(Ce.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:Ce.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}h.data.type===Ce.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:Ce.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))}};return window.addEventListener("message",v),window.parent.postMessage({type:Ce.STAGE_READY},"*"),()=>window.removeEventListener("message",v)},[]),j.useEffect(()=>{const v=b=>!!(b.closest(T0)||b.closest("a[href]")),h=b=>{var M,y,B,te,U,$,Z,ne;const g=b.target;if(v(g)){g.closest("a[href]")&&b.preventDefault();return}const x=b.clientX,k=b.clientY;let _=null,C=g;for(;C&&C!==document.body;){const z=(M=C.getAttribute)==null?void 0:M.call(C,"data-section-id"),L=(y=C.getAttribute)==null?void 0:y.call(C,"data-section-type"),K=(B=C.getAttribute)==null?void 0:B.call(C,"data-section-scope");if(z&&L&&K){_=C;break}C=C.parentElement}if(!_)return;b.preventDefault(),b.stopPropagation();const I=_.getAttribute("data-section-id"),A=_.getAttribute("data-section-type"),D=_.getAttribute("data-section-scope");if(!I||!A||!D)return;const R={id:I,type:A,scope:D};if(g===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}const F=document.elementFromPoint(x,k)??g;if(!F||!_.contains(F)){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}if(F===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:R},"*");return}const Y=[];for(C=F;C&&C!==_;){const z=(te=C.getAttribute)==null?void 0:te.call(C,"data-jp-item-id"),L=(U=C.getAttribute)==null?void 0:U.call(C,"data-jp-item-field");z&&L&&Y.push({fieldKey:L||"items",itemId:z}),C=C.parentElement}if(Y.reverse(),Y.length===0)for(C=F;C&&C!==_;){const z=($=C.getAttribute)==null?void 0:$.call(C,"data-jp-field");if(z){Y.push({fieldKey:z});break}C=C.parentElement}if(Y.length===0&&F){let z=null;const L=K=>{var ee,ue;const q=K.getBoundingClientRect();if(q.left<=x&&x<=q.right&&q.top<=k&&k<=q.bottom){for(let re=0;re<K.children.length;re++)L(K.children[re]);((ee=K.getAttribute)!=null&&ee.call(K,"data-jp-item-id")||(ue=K.getAttribute)!=null&&ue.call(K,"data-jp-field"))&&(z=K)}};if(L(F),z){const K=z,q=(Z=K.getAttribute)==null?void 0:Z.call(K,"data-jp-item-id"),ee=(ne=K.getAttribute)==null?void 0:ne.call(K,"data-jp-field");q&&ee?Y.push({fieldKey:ee||"items",itemId:q}):ee&&Y.push({fieldKey:ee})}}const N={type:Ce.SECTION_SELECT,section:R};Y.length>0&&(N.itemPath=Y),window.parent.postMessage(N,"*")};return document.addEventListener("click",h,!0),()=>document.removeEventListener("click",h,!0)},[]),j.useEffect(()=>{if(!s)return;const v=setTimeout(()=>a(null),600);return()=>clearTimeout(v)},[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=v=>{window.parent.postMessage({type:Ce.ACTIVE_SECTION_CHANGED,activeSectionId:v},"*")};return p.jsx($r,{mode:l?"visitor":"studio",children:p.jsx("div",{className:l?"":"jp-ice-active",children:p.jsx(oo,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:l?null:o,scrollToSectionId:s,onActiveSectionChange:m})})})};function O0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Nc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(j.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])??O0(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(ro,{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(Lt,{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:me("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"})})]})]})},Ac=()=>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"})]}),P0='/*! 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-\\[80px\\]{min-height:80px}.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-\\[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\\/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{padding:calc(var(--spacing)*2)}.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}.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\\.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;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 I0 extends j.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 pi(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function zc(e,t=""){const r=pi(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return pi(o)||"home"}const jc=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const s=He.useLocation(),a=zc(s.pathname),[l,c]=j.useState(null);j.useEffect(()=>{const f=document.getElementById("jp-baked-state");if(f!=null&&f.textContent)try{const v=JSON.parse(f.textContent);c(v),Vn.setTheme(v.theme)}catch(v){console.error("Failed to parse baked state",v)}},[]);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(oo,{pageConfig:d,siteConfig:u,menuConfig:m})})}):p.jsx(i,{})},Tc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,exportHTML:c})=>{const d=He.useLocation(),u=zc(d.pathname,"admin"),m=He.useNavigate(),f=Object.keys(e).sort((S,P)=>S==="home"?-1:P==="home"?1:S.localeCompare(P)),[v,h]=j.useState(null),[b,g]=j.useState(!1),[x,k]=j.useState(!1),[_,C]=j.useState(()=>{var S;try{const P=JSON.parse(JSON.stringify(t??{}));P.identity||(P.identity={title:"Site"}),P.pages||(P.pages=[]);const W=(S=P.header)==null?void 0:S.data;return W&&(r!=null&&r.main)&&(W.links=JSON.parse(JSON.stringify(r.main))),P}catch{return{identity:{title:"Site"},pages:[]}}}),[I,A]=j.useState(null),[D,R]=j.useState(null),[F,Y]=j.useState(null),[N,M]=j.useState(null),[y,B]=j.useState(!1),[te,U]=j.useState(400),$=j.useRef(v),Z=j.useRef(_),ne=360,z=920;j.useEffect(()=>{$.current=v},[v]),j.useEffect(()=>{Z.current=_},[_]);const L=j.useCallback(S=>{S.preventDefault();const P=S.currentTarget;P.setPointerCapture(S.pointerId);const W=S.clientX,G=te,O=J=>{const Q=W-J.clientX,se=Math.min(z,Math.max(ne,G+Q));U(se)},V=()=>{P.releasePointerCapture(S.pointerId),P.removeEventListener("pointermove",O),P.removeEventListener("pointerup",V),P.removeEventListener("pointercancel",V),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",P.addEventListener("pointermove",O),P.addEventListener("pointerup",V),P.addEventListener("pointercancel",V)},[te]),K=v?[..._.header?[{id:_.header.id,type:_.header.type,scope:"global",title:"Header"}]:[],...v.sections.map(S=>{var P,W;return{id:S.id,type:S.type,scope:"local",title:((P=S.data)==null?void 0:P.title)??((W=S.data)==null?void 0:W.titleHighlight)}}),..._.footer?[{id:_.footer.id,type:_.footer.type,scope:"global",title:"Footer"}]:[]]:[];j.useEffect(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),R(null),g(!1)},[u,e]);const q=j.useCallback(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),R(null),g(!1)},[u,e]),ee=j.useCallback((S,P,W)=>{const G=[...W.sections],O=G.findIndex(Q=>Q.id===S);if(O===-1||P<0||P>=G.length)return;const[V]=G.splice(O,1),J=P>O?P-1:P;G.splice(Math.min(J,G.length),0,V),h({...W,sections:G}),g(!0)},[]),ue=j.useCallback(S=>{var P;if(S.origin===window.location.origin){if(S.data.type===Ce.SECTION_SELECT){A(S.data.section);const W=S.data.itemPath;Array.isArray(W)&&W.length>0?R(W.map(G=>({fieldKey:G.fieldKey,...G.itemId!=null?{itemId:String(G.itemId)}:{}}))):R(null)}if(S.data.type===Ce.INLINE_FIELD_UPDATE){const W=typeof S.data.sectionId=="string"?S.data.sectionId:null,G=typeof S.data.fieldKey=="string"?S.data.fieldKey:null;W&&G&&(h(O=>{if(!O)return O;const V={...O,sections:O.sections.map(J=>J.id===W?{...J,data:{...J.data,[G]:S.data.value}}:J)};return $.current=V,V}),g(!0))}if(S.data.type===Ce.ACTIVE_SECTION_CHANGED&&Y(S.data.activeSectionId??null),S.data.type==="jsonpages:section-reorder"&&$.current){const{sectionId:W,newIndex:G}=S.data;typeof W=="string"&&typeof G=="number"&&G>=0&&ee(W,G,$.current)}if(S.data.type===Ce.SEND_CLEAN_HTML){if(!$.current)return;const W=(P=Z.current.header)==null?void 0:P.data,G={page:$.current,site:Z.current,menu:{main:(W==null?void 0:W.links)??[]},theme:n};c(G,u,S.data.html),g(!1)}}},[u,n,ee,c]);j.useEffect(()=>(window.addEventListener("message",ue),()=>window.removeEventListener("message",ue)),[ue]);const re=j.useCallback(S=>{const P=K.find(W=>W.id===S);P&&A({id:P.id,type:P.type,scope:P.scope}),R(null),M(S)},[K]),ie=j.useCallback(()=>{M(null)},[]),ae=j.useCallback(S=>{h(P=>P&&{...P,sections:P.sections.filter(W=>W.id!==S)}),g(!0),A(P=>(P==null?void 0:P.id)===S?null:P)},[]),oe=S=>{if(!(!I||!v))if(g(!0),I.scope==="global")I.type==="header"&&_.header!=null?C({..._,header:{..._.header,data:S}}):I.type==="footer"&&_.footer!=null&&C({..._,footer:{..._.footer,data:S}});else{const P=v.sections.map(W=>W.id===I.id?{...W,data:S}:W);h({...v,sections:P})}},le=j.useCallback((S,P,W,G)=>{var O,V;if(g(!0),P==="global")((O=_.header)==null?void 0:O.id)===S?C({..._,header:{..._.header,data:G}}):((V=_.footer)==null?void 0:V.id)===S&&C({..._,footer:{..._.footer,data:G}});else if(v){const J=v.sections.map(Q=>Q.id===S?{...Q,data:G}:Q);h({...v,sections:J})}},[v,_]),fe=()=>{var P;const S=document.querySelector("iframe");(P=S==null?void 0:S.contentWindow)==null||P.postMessage({type:Ce.REQUEST_CLEAN_HTML},"*")},ve=j.useCallback(async()=>{const S=document.querySelector("iframe");if(!(S!=null&&S.contentWindow))return;const P=crypto.randomUUID();await new Promise(W=>{var V;let G=!1;const O=J=>{var Q,se;J.origin===window.location.origin&&((Q=J.data)==null?void 0:Q.type)===Ce.INLINE_FLUSHED&&((se=J.data)==null?void 0:se.requestId)===P&&(G=!0,window.removeEventListener("message",O),W())};window.addEventListener("message",O),(V=S.contentWindow)==null||V.postMessage({type:Ce.REQUEST_INLINE_FLUSH,requestId:P},"*"),window.setTimeout(()=>{G||(window.removeEventListener("message",O),W())},400)})},[]),w=async()=>{var O;if(!l)return;await ve();const S=$.current,P=Z.current;if(!S)return;const W=(O=P.header)==null?void 0:O.data,G={page:S,site:P,menu:{main:(W==null?void 0:W.links)??[]},theme:n};l(G,u).then(()=>{g(!1),k(!0)}).catch(V=>{console.error("[JsonPages] saveToFile failed",V);const J=V instanceof Error?V.message:String(V);alert(`Save to file failed: ${J}`)})},X=S=>{var G;if(!v)return;const P=((G=s==null?void 0:s.getDefaultSectionData)==null?void 0:G.call(s,S))??{},W={id:crypto.randomUUID(),type:S,data:P,settings:void 0};h({...v,sections:[...v.sections,W]}),g(!0),A({id:W.id,type:S,scope:"local"})};if(!v)return p.jsx("div",{children:"Loading Studio..."});const H=(I==null?void 0:I.scope)==="global"?{sections:[_.header,_.footer].filter(S=>S!=null)}:v,T=[..._.header?[_.header]:[],...v.sections,..._.footer?[_.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(Cc,{draft:v,globalDraft:_,themeConfig:n,slug:u,selectedId:I==null?void 0:I.id,scrollToSectionId:N,onScrollRequested:ie})}),p.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:te,minWidth:ne,maxWidth:z},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:L}),p.jsx(Sc,{selectedSection:I,pageData:H,allSectionsData:T,onUpdate:oe,onUpdateSection:le,onClose:()=>{A(null),R(null)},expandedItemPath:D,onReorderSection:v?(S,P)=>ee(S,P,v):void 0,allLayers:K,activeSectionId:F,onRequestScrollToSection:re,onDeleteSection:v?ae:void 0,onAddSection:a.length>0?()=>B(!0):void 0,hasChanges:b,onExportHTML:fe,onSaveToFile:l!=null?w:void 0,saveSuccessFeedback:x,onResetToFile:q,pageSlugs:f,currentSlug:u,onPageChange:f.length>1?S=>{const P=pi(S);m(P==="home"?"/admin":`/admin/${P}`)}:void 0})]})]}),p.jsx(Nc,{open:y,onClose:()=>B(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:X})]})})})},Oc=({tenantCss:e,adminCss:t})=>p.jsx(Zr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(Ec,{})});function D0({config:e}){var b,g,x;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=Ac}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(k=>k!=="header"&&k!=="footer"),u={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??ki,exportHTML:((g=e.persistence)==null?void 0:g.exportHTML)??_i,saveToFile:(x=e.persistence)==null?void 0:x.saveToFile},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",f=typeof(a==null?void 0:a.admin)=="string"?a.admin:P0,[v,h]=j.useState(!1);return j.useEffect(()=>{try{i!=null&&i.tokens&&Vn.setTheme(i)}catch(k){console.warn("[JsonPages] setTheme failed",k)}h(!0)},[i]),v?p.jsx(I0,{children:p.jsx(Yi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets},children:p.jsx(He.BrowserRouter,{children:p.jsxs(He.Routes,{children:[p.jsx(He.Route,{path:"/",element:p.jsx(jc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(He.Route,{path:"/*",element:p.jsx(jc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(He.Route,{path:"/admin",element:p.jsx(Tc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(He.Route,{path:"/admin/*",element:p.jsx(Tc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(He.Route,{path:"/admin/preview",element:p.jsx(Oc,{tenantCss:m,adminCss:f})}),p.jsx(He.Route,{path:"/admin/preview/*",element:p.jsx(Oc,{tenantCss:m,adminCss:f})}),p.jsx(He.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 R0=({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(Gd,{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(Xi,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:me("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(Fd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});xe.AddSectionLibrary=Nc,xe.AdminSidebar=Sc,xe.ConfigProvider=Yi,xe.ControlBar=R0,xe.DefaultNotFound=Ac,xe.FormFactory=Nr,xe.InputWidgets=er,xe.JsonPagesEngine=D0,xe.PageRenderer=oo,xe.PreviewEntry=Ec,xe.STUDIO_EVENTS=Ce,xe.SectionRenderer=fr,xe.StudioProvider=$r,xe.StudioStage=Cc,xe.ThemeLoader=Zr,xe.cn=me,xe.exportBakedHTML=_i,xe.exportProjectJSON=ki,xe.resolveAssetUrl=Dl,xe.themeManager=Vn,xe.useConfig=ur,xe.useStudio=Gi,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})}));
252
+ `)},Lm=0,Jt=[];function Mm(e){var t=E.useRef([]),r=E.useRef([0,0]),n=E.useRef(),o=E.useState(Lm++)[0],i=E.useState(Ya)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=im([e.lockRef.current],(e.shards||[]).map(Qa),!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=E.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var g=zn(h),x=r.current,k="deltaX"in h?h.deltaX:x[0]-g[0],_="deltaY"in h?h.deltaY:x[1]-g[1],C,T=h.target,A=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in h&&A==="h"&&T.type==="range")return!1;var I=window.getSelection(),D=I&&I.anchorNode,B=D?D===T||D.contains(T):!1;if(B)return!1;var Z=Ga(A,T);if(!Z)return!0;if(Z?C=A:(C=A==="v"?"h":"v",Z=Ga(A,T)),!Z)return!1;if(!n.current&&"changedTouches"in h&&(k||_)&&(n.current=C),!C)return!0;var z=n.current||C;return Im(z,b,h,z==="h"?k:_)},[]),l=E.useCallback(function(h){var b=h;if(!(!Jt.length||Jt[Jt.length-1]!==i)){var g="deltaY"in b?Ja(b):zn(b),x=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Dm(C.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var k=(s.current.shards||[]).map(Qa).filter(Boolean).filter(function(C){return C.contains(b.target)}),_=k.length>0?a(b,k[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=E.useCallback(function(h,b,g,x){var k={name:h,delta:b,target:g,should:x,shadowParent:Fm(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),d=E.useCallback(function(h){r.current=zn(h),n.current=void 0},[]),u=E.useCallback(function(h){c(h.type,Ja(h),h.target,a(h,e.lockRef.current))},[]),m=E.useCallback(function(h){c(h.type,zn(h),h.target,a(h,e.lockRef.current))},[]);E.useEffect(function(){return Jt.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(){Jt=Jt.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,v=e.inert;return E.createElement(E.Fragment,null,v?E.createElement(i,{styles:Rm(o)}):null,f?E.createElement(Nm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bm=pm(Va,Mm);var Xo=E.forwardRef(function(e,t){return E.createElement(En,nt({},e,{ref:t,sideCar:Bm}))});Xo.classNames=En.classNames;var Um=[" ","Enter","ArrowUp","ArrowDown"],Wm=[" ","Enter"],Tt="Select",[An,jn,$m]=lh(Tt),[Qt]=Wt(Tt,[$m,Kt]),Tn=Kt(),[Hm,yt]=Qt(Tt),[Vm,Ym]=Qt(Tt),el=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:v}=e,h=Tn(t),[b,g]=E.useState(null),[x,k]=E.useState(null),[_,C]=E.useState(!1),T=Ks(c),[A,I]=yn({prop:n,defaultProp:o??!1,onChange:i,caller:Tt}),[D,B]=yn({prop:s,defaultProp:a,onChange:l,caller:Tt}),Z=E.useRef(null),z=b?v||!!b.closest("form"):!0,[F,y]=E.useState(new Set),U=Array.from(F).map(ee=>ee.props.value).join(";");return p.jsx(Wo,{...h,children:p.jsxs(Hm,{required:f,scope:t,trigger:b,onTriggerChange:g,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:kr(),value:D,onValueChange:B,open:A,onOpenChange:I,dir:T,triggerPointerDownPosRef:Z,disabled:m,children:[p.jsx(An.Provider,{scope:t,children:p.jsx(Vm,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(ee=>{y(W=>new Set(W).add(ee))},[]),onNativeOptionRemove:E.useCallback(ee=>{y(W=>{const V=new Set(W);return V.delete(ee),V})},[]),children:r})}),z?p.jsxs(xl,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:D,onChange:ee=>B(ee.target.value),disabled:m,form:v,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};el.displayName=Tt;var tl="SelectTrigger",rl=E.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Tn(r),s=yt(tl,r),a=s.disabled||n,l=Se(t,s.onTriggerChange),c=jn(r),d=E.useRef("touch"),[u,m,f]=kl(h=>{const b=c().filter(k=>!k.disabled),g=b.find(k=>k.value===s.value),x=_l(b,h,g);x!==void 0&&s.onValueChange(x.value)}),v=h=>{a||(s.onOpenChange(!0),f()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return p.jsx(wn,{asChild:!0,...i,children:p.jsx(_e.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":yl(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&v(h)}),onPointerDown:be(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"&&(v(h),h.preventDefault())}),onKeyDown:be(o.onKeyDown,h=>{const b=u.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(b&&h.key===" ")&&Um.includes(h.key)&&(v(),h.preventDefault())})})})});rl.displayName=tl;var nl="SelectValue",ol=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=yt(nl,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=Se(t,l.onValueNodeChange);return Ie(()=>{c(d)},[c,d]),p.jsx(_e.span,{...a,ref:u,style:{pointerEvents:"none"},children:yl(l.value)?p.jsx(p.Fragment,{children:s}):i})});ol.displayName=nl;var Zm="SelectIcon",il=E.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return p.jsx(_e.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});il.displayName=Zm;var Km="SelectPortal",sl=e=>p.jsx(xn,{asChild:!0,...e});sl.displayName=Km;var Ot="SelectContent",al=E.forwardRef((e,t)=>{const r=yt(Ot,e.__scopeSelect),[n,o]=E.useState();if(Ie(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Ir.createPortal(p.jsx(ll,{scope:e.__scopeSelect,children:p.jsx(An.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(cl,{...e,ref:t})});al.displayName=Ot;var Je=10,[ll,kt]=Qt(Ot),Gm="SelectContentImpl",Xm=$t("SelectContent.RemoveScroll"),cl=E.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:v,hideWhenDetached:h,avoidCollisions:b,...g}=e,x=yt(Ot,r),[k,_]=E.useState(null),[C,T]=E.useState(null),A=Se(t,Q=>_(Q)),[I,D]=E.useState(null),[B,Z]=E.useState(null),z=jn(r),[F,y]=E.useState(!1),U=E.useRef(!1);E.useEffect(()=>{if(k)return Ua(k)},[k]),Qs();const ee=E.useCallback(Q=>{const[ie,...ae]=z().map(fe=>fe.ref.current),[ne]=ae.slice(-1),de=document.activeElement;for(const fe of Q)if(fe===de||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ie&&C&&(C.scrollTop=0),fe===ne&&C&&(C.scrollTop=C.scrollHeight),fe==null||fe.focus(),document.activeElement!==de))return},[z,C]),W=E.useCallback(()=>ee([I,k]),[ee,I,k]);E.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:V,triggerPointerDownPosRef:Y}=x;E.useEffect(()=>{if(k){let Q={x:0,y:0};const ie=ne=>{var de,fe;Q={x:Math.abs(Math.round(ne.pageX)-(((de=Y.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((fe=Y.current)==null?void 0:fe.y)??0))}},ae=ne=>{Q.x<=10&&Q.y<=10?ne.preventDefault():k.contains(ne.target)||V(!1),document.removeEventListener("pointermove",ie),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ae,{capture:!0})}}},[k,V,Y]),E.useEffect(()=>{const Q=()=>V(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[V]);const[oe,N]=kl(Q=>{const ie=z().filter(de=>!de.disabled),ae=ie.find(de=>de.ref.current===document.activeElement),ne=_l(ie,Q,ae);ne&&setTimeout(()=>ne.ref.current.focus())}),R=E.useCallback((Q,ie,ae)=>{const ne=!U.current&&!ae;(x.value!==void 0&&x.value===ie||ne)&&(D(Q),ne&&(U.current=!0))},[x.value]),G=E.useCallback(()=>k==null?void 0:k.focus(),[k]),q=E.useCallback((Q,ie,ae)=>{const ne=!U.current&&!ae;(x.value!==void 0&&x.value===ie||ne)&&Z(Q)},[x.value]),J=n==="popper"?qo:dl,ue=J===qo?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(ll,{scope:r,content:k,viewport:C,onViewportChange:T,itemRefCallback:R,selectedItem:I,onItemLeave:G,itemTextRefCallback:q,focusSelectedItem:W,selectedItemText:B,position:n,isPositioned:F,searchRef:oe,children:p.jsx(Xo,{as:Xm,allowPinchZoom:!0,children:p.jsx(zo,{asChild:!0,trapped:x.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:be(o,Q=>{var ie;(ie=x.trigger)==null||ie.focus({preventScroll:!0}),Q.preventDefault()}),children:p.jsx(ln,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:p.jsx(J,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Q=>Q.preventDefault(),...g,...ue,onPlaced:()=>y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,Q=>{const ie=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ie&&Q.key.length===1&&N(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ne=z().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const de=Q.target,fe=ne.indexOf(de);ne=ne.slice(fe+1)}setTimeout(()=>ee(ne)),Q.preventDefault()}})})})})})})});cl.displayName=Gm;var qm="SelectItemAlignedPosition",dl=E.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=yt(Ot,r),s=kt(Ot,r),[a,l]=E.useState(null),[c,d]=E.useState(null),u=Se(t,A=>d(A)),m=jn(r),f=E.useRef(!1),v=E.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:g,focusSelectedItem:x}=s,k=E.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&h&&b&&g){const A=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),B=g.getBoundingClientRect();if(i.dir!=="rtl"){const de=B.left-I.left,fe=D.left-de,we=A.left-fe,w=A.width+we,X=Math.max(w,I.width),H=window.innerWidth-Je,O=_o(fe,[Je,Math.max(Je,H-X)]);a.style.minWidth=w+"px",a.style.left=O+"px"}else{const de=I.right-B.right,fe=window.innerWidth-D.right-de,we=window.innerWidth-A.right-fe,w=A.width+we,X=Math.max(w,I.width),H=window.innerWidth-Je,O=_o(fe,[Je,Math.max(Je,H-X)]);a.style.minWidth=w+"px",a.style.right=O+"px"}const Z=m(),z=window.innerHeight-Je*2,F=h.scrollHeight,y=window.getComputedStyle(c),U=parseInt(y.borderTopWidth,10),ee=parseInt(y.paddingTop,10),W=parseInt(y.borderBottomWidth,10),V=parseInt(y.paddingBottom,10),Y=U+ee+F+V+W,oe=Math.min(b.offsetHeight*5,Y),N=window.getComputedStyle(h),R=parseInt(N.paddingTop,10),G=parseInt(N.paddingBottom,10),q=A.top+A.height/2-Je,J=z-q,ue=b.offsetHeight/2,Q=b.offsetTop+ue,ie=U+ee+Q,ae=Y-ie;if(ie<=q){const de=Z.length>0&&b===Z[Z.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-h.offsetTop-h.offsetHeight,we=Math.max(J,ue+(de?G:0)+fe+W),w=ie+we;a.style.height=w+"px"}else{const de=Z.length>0&&b===Z[0].ref.current;a.style.top="0px";const we=Math.max(q,U+h.offsetTop+(de?R:0)+ue)+ae;a.style.height=we+"px",h.scrollTop=ie-q+h.offsetTop}a.style.margin=`${Je}px 0`,a.style.minHeight=oe+"px",a.style.maxHeight=z+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,a,c,h,b,g,i.dir,n]);Ie(()=>k(),[k]);const[_,C]=E.useState();Ie(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=E.useCallback(A=>{A&&v.current===!0&&(k(),x==null||x(),v.current=!1)},[k,x]);return p.jsx(Qm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:T,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:p.jsx(_e.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});dl.displayName=qm;var Jm="SelectPopperPosition",qo=E.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Je,...i}=e,s=Tn(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=Jm;var[Qm,Jo]=Qt(Ot,{}),Qo="SelectViewport",ul=E.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=kt(Qo,r),s=Jo(Qo,r),a=Se(t,i.onViewportChange),l=E.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(An.Slot,{scope:r,children:p.jsx(_e.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(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 v=window.innerHeight-Je*2,h=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),g=Math.max(h,b);if(g<v){const x=g+f,k=Math.min(v,x),_=x-k;u.style.height=k+"px",u.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});ul.displayName=Qo;var fl="SelectGroup",[eg,tg]=Qt(fl),rg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=kr();return p.jsx(eg,{scope:r,id:o,children:p.jsx(_e.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rg.displayName=fl;var hl="SelectLabel",ng=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=tg(hl,r);return p.jsx(_e.div,{id:o.id,...n,ref:t})});ng.displayName=hl;var On="SelectItem",[og,pl]=Qt(On),ml=E.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=yt(On,r),l=kt(On,r),c=a.value===n,[d,u]=E.useState(i??""),[m,f]=E.useState(!1),v=Se(t,x=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,x,n,o)}),h=kr(),b=E.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(og,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:E.useCallback(x=>{u(k=>k||((x==null?void 0:x.textContent)??"").trim())},[]),children:p.jsx(An.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:p.jsx(_e.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:v,onFocus:be(s.onFocus,()=>f(!0)),onBlur:be(s.onBlur,()=>f(!1)),onClick:be(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:be(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:be(s.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:be(s.onPointerMove,x=>{var k;b.current=x.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,x=>{var k;x.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:be(s.onKeyDown,x=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&x.key===" "||(Wm.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})})})})});ml.displayName=On;var Cr="SelectItemText",gl=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=yt(Cr,r),a=kt(Cr,r),l=pl(Cr,r),c=Ym(Cr,r),[d,u]=E.useState(null),m=Se(t,g=>u(g),l.onItemTextChange,g=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,v=E.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 Ie(()=>(h(v),()=>b(v)),[h,b,v]),p.jsxs(p.Fragment,{children:[p.jsx(_e.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ir.createPortal(i.children,s.valueNode):null]})});gl.displayName=Cr;var bl="SelectItemIndicator",vl=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return pl(bl,r).isSelected?p.jsx(_e.span,{"aria-hidden":!0,...n,ref:t}):null});vl.displayName=bl;var ei="SelectScrollUpButton",ig=E.forwardRef((e,t)=>{const r=kt(ei,e.__scopeSelect),n=Jo(ei,e.__scopeSelect),[o,i]=E.useState(!1),s=Se(t,n.onScrollButtonChange);return Ie(()=>{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(wl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});ig.displayName=ei;var ti="SelectScrollDownButton",sg=E.forwardRef((e,t)=>{const r=kt(ti,e.__scopeSelect),n=Jo(ti,e.__scopeSelect),[o,i]=E.useState(!1),s=Se(t,n.onScrollButtonChange);return Ie(()=>{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(wl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});sg.displayName=ti;var wl=E.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=kt("SelectScrollButton",r),s=E.useRef(null),a=jn(r),l=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),Ie(()=>{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(_e.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:be(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),ag="SelectSeparator",lg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(_e.div,{"aria-hidden":!0,...n,ref:t})});lg.displayName=ag;var ri="SelectArrow",cg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tn(r),i=yt(ri,r),s=kt(ri,r);return i.open&&s.position==="popper"?p.jsx(Ho,{...o,...n,ref:t}):null});cg.displayName=ri;var dg="SelectBubbleInput",xl=E.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=E.useRef(null),i=Se(n,o),s=Qp(t);return E.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(_e.select,{...r,style:{...Ma,...r.style},ref:i,defaultValue:t})});xl.displayName=dg;function yl(e){return e===""||e===void 0}function kl(e){const t=Le(e),r=E.useRef(""),n=E.useRef(0),o=E.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=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.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=ug(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 ug(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var fg=el,Sl=rl,hg=ol,pg=il,mg=sl,Cl=al,gg=ul,El=ml,bg=gl,vg=vl;const wg=fg,xg=hg,Nl=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Sl,{ref:n,className:pe("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(pg,{asChild:!0,children:p.jsx(Wr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Nl.displayName=Sl.displayName;const zl=E.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>p.jsx(mg,{children:p.jsx(Cl,{ref:o,className:pe("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(gg,{className:pe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));zl.displayName=Cl.displayName;const Al=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(El,{ref:n,className:pe("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(vg,{children:p.jsx(to,{className:"h-3 w-3",strokeWidth:2})})}),p.jsx(bg,{children:t})]}));Al.displayName=El.displayName;const jl=E.createContext(null);function Tl(){const e=E.useContext(jl);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Ol({open:e,onOpenChange:t,children:r}){const[n,o]=E.useState(!1),i=e!==void 0,s=i?e:n,a=E.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=E.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return p.jsx(jl.Provider,{value:l,children:r})}function yg({asChild:e,children:t}){const{onOpenChange:r}=Tl(),n=E.Children.only(t);return e&&E.isValidElement(n)?E.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 Pl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Tl();if(E.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 ht.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:pe("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 Il({className:e,...t}){return p.jsx("div",{className:pe("flex flex-col gap-1.5 pb-4",e),...t})}function kg({className:e,...t}){return p.jsx("div",{className:pe("flex justify-end gap-2 pt-4",e),...t})}function Dl({className:e,...t}){return p.jsx("h2",{className:pe("text-sm font-semibold text-white",e),...t})}function Rl({className:e,...t}){return p.jsx("p",{className:pe("text-xs text-zinc-400",e),...t})}const He=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?rh:"button";return p.jsx(c,{ref:i,type:"button",className:pe(s,a[t],l[r],e),...o})});He.displayName="Button";const _g=["library","upload","url"];function Sg({library:e,selectedId:t,onSelect:r}){const[n,o]=j.useState(""),[i,s]=j.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(Kd,{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:pe("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:pe("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:pe("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:pe("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 Cg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=j.useState(!1),i=j.useRef(null),s=j.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 v;t({name:d.name,size:d.size,dataUrl:(v=f.target)==null?void 0:v.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=j.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=j.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=j.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:pe("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(Hr,{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(ts,{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 Eg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=j.useState(""),[o,i]=j.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(At,{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:pe("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(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 Ng=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=dr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=j.useState("library"),[a,l]=j.useState(null),[c,d]=j.useState(null),[u,m]=j.useState(null);j.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),j.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]),j.useEffect(()=>{if(!e||i!=="upload")return;const g=k=>{k.preventDefault()},x={capture:!0};return document.addEventListener("dragover",g,x),document.addEventListener("drop",g,x),window.addEventListener("dragover",g,x),window.addEventListener("drop",g,x),()=>{document.removeEventListener("dragover",g,x),document.removeEventListener("drop",g,x),window.removeEventListener("dragover",g,x),window.removeEventListener("drop",g,x)}},[e,i]);const f=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&u!=null,v=()=>{if(i==="library"&&a){const g=o.find(x=>x.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(Ol,{open:e,onOpenChange:t,children:p.jsxs(Pl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:b,onDrop:b,children:[p.jsxs(Il,{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($r,{size:18})}),p.jsxs("div",{children:[p.jsx(Dl,{children:"Image Picker"}),p.jsx(Rl,{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(Lt,{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:pe("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($r,{size:14}),g==="upload"&&p.jsx(ts,{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(Sg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&p.jsx(Cg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&p.jsx(Eg,{urlPreview:u,onUrlPreviewChange:m})]}),p.jsxs(kg,{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:v,className:pe(!f&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Ll=(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}`},zg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=dr(),[i,s]=j.useState(!1),[a,l]=j.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Ll(e.url,o):"",u=f=>{t(f),s(!1)},m=f=>{f.stopPropagation(),t({url:"",alt:""})};return p.jsxs("div",{className:pe("space-y-1.5",n),children:[p.jsx(At,{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:pe("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:pe("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(Yd,{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(Hr,{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:pe("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($r,{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(Ng,{open:i,onOpenChange:s,onSelect:u})]})},Ml=[{name:"layers",Icon:no},{name:"github",Icon:Hd},{name:"arrow-right",Icon:Rd},{name:"box",Icon:Md},{name:"terminal",Icon:Jd},{name:"chevron-right",Icon:Fd},{name:"menu",Icon:Vd},{name:"x",Icon:Lt},{name:"sparkles",Icon:Xd},{name:"zap",Icon:eu}],Pn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),er={"ui:text":({label:e,value:t,onChange:r})=>p.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[p.jsx(At,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Pn(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(At,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Pn(e)}),p.jsx(Qf,{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(At,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Pn(e)}),p.jsxs(wg,{value:t||"",onValueChange:r,children:[p.jsx(Nl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:p.jsx(xg,{placeholder:"Select..."})}),p.jsx(zl,{className:"dark",children:n.map(o=>p.jsx(Al,{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(eh,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),p.jsx(At,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Pn(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(zg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=j.useState(!1),i=Ml.find(s=>s.name===(t||""));return p.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[p.jsx(At,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),p.jsxs(Ol,{open:n,onOpenChange:o,children:[p.jsx(yg,{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($r,{size:16,className:"text-zinc-500 shrink-0"}),p.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),p.jsxs(Pl,{className:"sm:max-w-[280px] p-4",children:[p.jsxs(Il,{children:[p.jsx(Dl,{className:"text-sm",children:"Choose icon"}),p.jsx(Rl,{className:"text-xs",children:"Click an icon to select it."})]}),p.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Ml.map(({name:s,Icon:a})=>p.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:pe("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 ze.z.ZodOptional||e instanceof ze.z.ZodDefault)return ni(e._def.innerType);if(e instanceof ze.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 ze.z.ZodArray?[]:e instanceof ze.z.ZodString?"":e instanceof ze.z.ZodNumber?0:e instanceof ze.z.ZodBoolean?!1:e instanceof ze.z.ZodEnum?e._def.values[0]:null},In=e=>e instanceof ze.z.ZodOptional||e instanceof ze.z.ZodDefault||e instanceof ze.z.ZodNullable?In(e._def.innerType):e,Fl=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=In(e);return r!==e?Fl(r):null},Dn=(e,t)=>e&&!t?"opacity-10":"opacity-100",tr=(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()),Er=({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=In(m),v=Fl(m)||"ui:text",h=t[u];if(v==="ui:editorial-markdown")return null;if(v==="ui:image-picker"&&f instanceof ze.z.ZodObject){const _=tr(c,u),C=er["ui:image-picker"]||er["ui:text"];return p.jsx("div",{className:`transition-opacity duration-200 ${Dn(d,_)}`,..._?{"data-jp-focused-field":u}:{},children:p.jsx(C,{label:u,value:h,onChange:T=>r({...t,[u]:T})})},u)}if(f instanceof ze.z.ZodObject){const _=h||{},C=tr(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 ${Dn(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(Er,{schema:f,data:_,onChange:T=>r({...t,[u]:T}),expandedItemPath:o&&tr(l==null?void 0:l.fieldKey,u)?o.slice(1):void 0})]},u)}if(f instanceof ze.z.ZodArray){const _=Array.isArray(h)?h:[],C=In(f.element),T=(B,Z)=>{if(Z<0||Z>=_.length)return;const z=[..._],[F]=z.splice(B,1);z.splice(Z,0,F),r({...t,[u]:z})},A=tr(c,u),D=tr(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 ${Dn(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)," (",_.length,")"]}),p.jsxs("button",{type:"button",onClick:()=>{const B=ni(C);r({...t,[u]:[..._,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:_.map((B,Z)=>{const z=B,F=z.id||`legacy-${Z}`,y=(typeof z.title=="string"?z.title:null)||(typeof z.label=="string"?z.label:null)||(typeof z.name=="string"?z.name:null)||(typeof z.content=="string"?z.content:null)||(typeof z.text=="string"?z.text:null)||`${oi(u)} #${Z+1}`,U=D,ee=String(z.id??F),W=U!=null&&String(U)===ee,V=W&&o&&o.length>1?o.slice(1):void 0,Y=d&&A&&U!=null&&!W;return p.jsx(Ag,{itemId:ee,openItemId:U!=null?String(U):void 0,isFaded:Y,index:Z,isFirst:Z===0,isLast:Z===_.length-1,label:y,onExpandedChange:i?oe=>i(oe?{fieldKey:u,itemId:ee}:null):void 0,onRemove:()=>{const oe=_.filter((N,R)=>R!==Z);r({...t,[u]:oe})},onMoveUp:()=>T(Z,Z-1),onMoveDown:()=>T(Z,Z+1),children:C instanceof ze.z.ZodObject?p.jsx(Er,{schema:C,data:z||{},expandedItemPath:V,onChange:oe=>{const N=[..._];N[Z]=oe,r({...t,[u]:N})}}):p.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},F)})})]},u)}const b=v in er?v:"ui:text",g=er[b]||er["ui:text"],x=f instanceof ze.z.ZodEnum?f._def.values:void 0,k=tr(c,u);return p.jsx("div",{className:`transition-opacity duration-200 ${Dn(d,k)}`,...k?{"data-jp-focused-field":u}:{},children:p.jsx(g,{label:u,value:h,options:x,onChange:_=>r({...t,[u]:_})})},u)})})},Ag=({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]=j.useState(u);j.useEffect(()=>{u&&!m&&f(!0),!u&&m&&f(!1)},[u,m]);const v=()=>{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:v,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(Wr,{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(Ld,{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(Dd,{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(Hr,{size:12})})]})]}),m&&p.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function jg(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var ut=e=>{const{present:t,children:r}=e,n=Tg(t),o=typeof r=="function"?r({present:n.isPresent}):E.Children.only(r),i=Se(n.ref,Og(o));return typeof r=="function"||n.isPresent?E.cloneElement(o,{ref:i}):null};ut.displayName="Presence";function Tg(e){const[t,r]=E.useState(),n=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=jg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Rn(n.current);i.current=a==="mounted"?c:"none"},[a]),Ie(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,f=Rn(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]),Ie(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=f=>{const h=Rn(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=Rn(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:E.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Rn(e){return(e==null?void 0:e.animationName)||"none"}function Og(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[Ln]=Wt("Tooltip",[Kt]),Mn=Kt(),Bl="TooltipProvider",Pg=700,ii="tooltip.open",[Ig,si]=Ln(Bl),Ul=e=>{const{__scopeTooltip:t,delayDuration:r=Pg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(Ig,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Ul.displayName=Bl;var Nr="Tooltip",[Dg,zr]=Ln(Nr),Wl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=si(Nr,e.__scopeTooltip),c=Mn(t),[d,u]=E.useState(null),m=kr(),f=E.useRef(0),v=s??l.disableHoverableContent,h=a??l.delayDuration,b=E.useRef(!1),[g,x]=yn({prop:n,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ii))):l.onClose(),i==null||i(A)},caller:Nr}),k=E.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),_=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,x(!0)},[x]),C=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x(!1)},[x]),T=E.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,x(!0),f.current=0},h)},[h,x]);return E.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),p.jsx(Wo,{...c,children:p.jsx(Dg,{scope:t,contentId:m,open:g,stateAttribute:k,trigger:d,onTriggerChange:u,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?T():_()},[l.isOpenDelayedRef,T,_]),onTriggerLeave:E.useCallback(()=>{v?C():(window.clearTimeout(f.current),f.current=0)},[C,v]),onOpen:_,onClose:C,disableHoverableContent:v,children:r})})};Wl.displayName=Nr;var ai="TooltipTrigger",$l=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=zr(ai,r),i=si(ai,r),s=Mn(r),a=E.useRef(null),l=Se(t,a,o.onTriggerChange),c=E.useRef(!1),d=E.useRef(!1),u=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(wn,{asChild:!0,...s,children:p.jsx(_e.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:be(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});$l.displayName=ai;var li="TooltipPortal",[Rg,Lg]=Ln(li,{forceMount:void 0}),Hl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=zr(li,t);return p.jsx(Rg,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(xn,{asChild:!0,container:o,children:n})})})};Hl.displayName=li;var rr="TooltipContent",Vl=E.forwardRef((e,t)=>{const r=Lg(rr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=zr(rr,e.__scopeTooltip);return p.jsx(ut,{present:n||s.open,children:s.disableHoverableContent?p.jsx(Yl,{side:o,...i,ref:t}):p.jsx(Mg,{side:o,...i,ref:t})})}),Mg=E.forwardRef((e,t)=>{const r=zr(rr,e.__scopeTooltip),n=si(rr,e.__scopeTooltip),o=E.useRef(null),i=Se(t,o),[s,a]=E.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:u}=n,m=E.useCallback(()=>{a(null),u(!1)},[u]),f=E.useCallback((v,h)=>{const b=v.currentTarget,g={x:v.clientX,y:v.clientY},x=$g(g,b.getBoundingClientRect()),k=Hg(g,x),_=Vg(h.getBoundingClientRect()),C=Zg([...k,..._]);a(C),u(!0)},[u]);return E.useEffect(()=>()=>m(),[m]),E.useEffect(()=>{if(l&&d){const v=b=>f(b,d),h=b=>f(b,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",h)}}},[l,d,f,m]),E.useEffect(()=>{if(s){const v=h=>{const b=h.target,g={x:h.clientX,y:h.clientY},x=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),k=!Yg(g,s);x?m():k&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,m]),p.jsx(Yl,{...e,ref:i})}),[Fg,Bg]=Ln(Nr,{isInside:!1}),Ug=oh("TooltipContent"),Yl=E.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=zr(rr,r),c=Mn(r),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(ii,d),()=>document.removeEventListener(ii,d)),[d]),E.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(ln,{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(Ug,{children:n}),p.jsx(Fg,{scope:r,isInside:!0,children:p.jsx(tm,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Vl.displayName=rr;var Zl="TooltipArrow",Wg=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mn(r);return Bg(Zl,r).isInside?null:p.jsx(Ho,{...o,...n,ref:t})});Wg.displayName=Zl;function $g(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 Hg(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 Vg(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 Yg(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 Zg(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),Kg(t)}function Kg(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 Gg=Ul,Xg=Wl,qg=$l,Jg=Hl,Kl=Vl;const Qg=Gg,Fn=Xg,Bn=qg,Ar=E.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(Jg,{children:p.jsx(Kl,{ref:n,sideOffset:t,className:pe("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})}));Ar.displayName=Kl.displayName;var Un="Popover",[Gl]=Wt(Un,[Kt]),jr=Kt(),[e0,_t]=Gl(Un),Xl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=jr(t),l=E.useRef(null),[c,d]=E.useState(!1),[u,m]=yn({prop:n,defaultProp:o??!1,onChange:i,caller:Un});return p.jsx(Wo,{...a,children:p.jsx(e0,{scope:t,contentId:kr(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:E.useCallback(()=>m(f=>!f),[m]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:s,children:r})})};Xl.displayName=Un;var ql="PopoverAnchor",t0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(ql,r),i=jr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return E.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(wn,{...i,...n,ref:t})});t0.displayName=ql;var Jl="PopoverTrigger",Ql=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(Jl,r),i=jr(r),s=Se(t,o.triggerRef),a=p.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":oc(o.open),...n,ref:s,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(wn,{asChild:!0,...i,children:a})});Ql.displayName=Jl;var ci="PopoverPortal",[r0,n0]=Gl(ci,{forceMount:void 0}),ec=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=_t(ci,t);return p.jsx(r0,{scope:t,forceMount:r,children:p.jsx(ut,{present:r||i.open,children:p.jsx(xn,{asChild:!0,container:o,children:n})})})};ec.displayName=ci;var nr="PopoverContent",tc=E.forwardRef((e,t)=>{const r=n0(nr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=_t(nr,e.__scopePopover);return p.jsx(ut,{present:n||i.open,children:i.modal?p.jsx(i0,{...o,ref:t}):p.jsx(s0,{...o,ref:t})})});tc.displayName=nr;var o0=$t("PopoverContent.RemoveScroll"),i0=E.forwardRef((e,t)=>{const r=_t(nr,e.__scopePopover),n=E.useRef(null),o=Se(t,n),i=E.useRef(!1);return E.useEffect(()=>{const s=n.current;if(s)return Ua(s)},[]),p.jsx(Xo,{as:o0,allowPinchZoom:!0,children:p.jsx(rc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(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:be(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),s0=E.forwardRef((e,t)=>{const r=_t(nr,e.__scopePopover),n=E.useRef(!1),o=E.useRef(!1);return p.jsx(rc,{...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()}})}),rc=E.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=_t(nr,r),f=jr(r);return Qs(),p.jsx(zo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(ln,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:p.jsx($o,{"data-state":oc(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)"}})})})}),nc="PopoverClose",a0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_t(nc,r);return p.jsx(_e.button,{type:"button",...n,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});a0.displayName=nc;var l0="PopoverArrow",c0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jr(r);return p.jsx(Ho,{...o,...n,ref:t})});c0.displayName=l0;function oc(e){return e?"open":"closed"}var d0=Xl,u0=Ql,f0=ec,ic=tc;const h0=d0,p0=u0,sc=E.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>p.jsx(f0,{children:p.jsx(ic,{ref:o,align:t,sideOffset:r,className:pe("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})}));sc.displayName=ic.displayName;const ac=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",m0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=j.useState(!1),c=s??ac(t),d=u=>{r(u),l(!1)};return p.jsx("div",{className:pe("mx-3 mt-2 mb-2",i),children:p.jsxs(h0,{open:a,onOpenChange:l,children:[p.jsx(p0,{asChild:!0,children:p.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:pe("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($d,{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(Wr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),p.jsxs(sc,{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=ac(u);return p.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(u),className:pe("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 g0(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var di="ScrollArea",[lc]=Wt(di),[b0,Ve]=lc(di),cc=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=E.useState(null),[c,d]=E.useState(null),[u,m]=E.useState(null),[f,v]=E.useState(null),[h,b]=E.useState(null),[g,x]=E.useState(0),[k,_]=E.useState(0),[C,T]=E.useState(!1),[A,I]=E.useState(!1),D=Se(t,Z=>l(Z)),B=Ks(o);return p.jsx(b0,{scope:r,type:n,dir:B,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:m,scrollbarX:f,onScrollbarXChange:v,scrollbarXEnabled:C,onScrollbarXEnabledChange:T,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:I,onCornerWidthChange:x,onCornerHeightChange:_,children:p.jsx(_e.div,{dir:B,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});cc.displayName=di;var dc="ScrollAreaViewport",uc=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...i}=e,s=Ve(dc,r),a=E.useRef(null),l=Se(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(_e.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})})]})});uc.displayName=dc;var ot="ScrollAreaScrollbar",fc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return E.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(v0,{...n,ref:t,forceMount:r}):o.type==="scroll"?p.jsx(w0,{...n,ref:t,forceMount:r}):o.type==="auto"?p.jsx(hc,{...n,ref:t,forceMount:r}):o.type==="always"?p.jsx(ui,{...n,ref:t}):null});fc.displayName=ot;var v0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),[i,s]=E.useState(!1);return E.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(ut,{present:r||i,children:p.jsx(hc,{"data-state":i?"visible":"hidden",...n,ref:t})})}),w0=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Vn(()=>l("SCROLL_END"),100),[a,l]=g0("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 E.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),E.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(ut,{present:r||a!=="hidden",children:p.jsx(ui,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),hc=E.forwardRef((e,t)=>{const r=Ve(ot,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,s]=E.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 or(r.viewport,l),or(r.content,l),p.jsx(ut,{present:n||i,children:p.jsx(ui,{"data-state":i?"visible":"hidden",...o,ref:t})})}),ui=E.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ve(ot,e.__scopeScrollArea),i=E.useRef(null),s=E.useRef(0),[a,l]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=vc(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 C0(m,s.current,a,f)}return r==="horizontal"?p.jsx(x0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,f=wc(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(y0,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,f=wc(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}),x0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ve(ot,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=Se(t,l,i.onScrollbarXChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(mc,{"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),yc(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)}})}})}),y0=E.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=Ve(ot,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=Se(t,l,i.onScrollbarYChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(mc,{"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),yc(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)}})}})}),[k0,pc]=lc(ot),mc=E.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=Ve(ot,r),[v,h]=E.useState(null),b=Se(t,D=>h(D)),g=E.useRef(null),x=E.useRef(""),k=f.viewport,_=n.content-n.viewport,C=Le(d),T=Le(l),A=Vn(u,10);function I(D){if(g.current){const B=D.clientX-g.current.left,Z=D.clientY-g.current.top;c({x:B,y:Z})}}return E.useEffect(()=>{const D=B=>{const Z=B.target;(v==null?void 0:v.contains(Z))&&C(B,_)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[k,v,_,C]),E.useEffect(T,[n,T]),or(v,A),or(f.content,A),p.jsx(k0,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Le(i),onThumbPointerUp:Le(s),onThumbPositionChange:T,onThumbPointerDown:Le(a),children:p.jsx(_e.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:be(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),g.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),I(D))}),onPointerMove:be(e.onPointerMove,I),onPointerUp:be(e.onPointerUp,D=>{const B=D.target;B.hasPointerCapture(D.pointerId)&&B.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Wn="ScrollAreaThumb",gc=E.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pc(Wn,e.__scopeScrollArea);return p.jsx(ut,{present:r||o.hasThumb,children:p.jsx(_0,{ref:t,...n})})}),_0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=Ve(Wn,r),s=pc(Wn,r),{onThumbPositionChange:a}=s,l=Se(t,u=>s.onThumbChange(u)),c=E.useRef(void 0),d=Vn(()=>{c.current&&(c.current(),c.current=void 0)},100);return E.useEffect(()=>{const u=i.viewport;if(u){const m=()=>{if(d(),!c.current){const f=E0(u,a);c.current=f,a()}};return a(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[i.viewport,d,a]),p.jsx(_e.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:be(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),v=u.clientX-f.left,h=u.clientY-f.top;s.onThumbPointerDown({x:v,y:h})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});gc.displayName=Wn;var fi="ScrollAreaCorner",bc=E.forwardRef((e,t)=>{const r=Ve(fi,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?p.jsx(S0,{...e,ref:t}):null});bc.displayName=fi;var S0=E.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ve(fi,r),[i,s]=E.useState(0),[a,l]=E.useState(0),c=!!(i&&a);return or(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),or(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.jsx(_e.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 vc(e,t){const r=e/t;return isNaN(r)?0:r}function Hn(e){const t=vc(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function C0(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 xc([l,c],u)(e)}function wc(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=_o(e,l);return xc([0,s],[0,a])(c)}function xc(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 yc(e,t){return e>0&&e<t}var E0=(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=Le(e),n=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),E.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function or(e,t){const r=Le(t);Ie(()=>{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 kc=cc,N0=uc,z0=fc,A0=gc,j0=bc;const _c=E.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(kc,{ref:n,className:pe("relative overflow-hidden",e),...r,children:[p.jsx(N0,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(z0,{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(A0,{className:"relative flex-1 rounded-full bg-zinc-700 hover:bg-zinc-600"})}),p.jsx(j0,{})]}));_c.displayName=kc.displayName;const hi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),Sc=new Set(["ui:editorial-markdown"]),Cc=e=>e instanceof ze.z.ZodOptional||e instanceof ze.z.ZodDefault||e instanceof ze.z.ZodNullable?Cc(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=Cc(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()),T0={activationConstraint:{distance:8}},O0={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:pe("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:pe("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(Fn,{children:[p.jsx(Bn,{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(Gd,{size:12})})}),p.jsx(Ar,{children:"Settings"})]}),s&&p.jsxs(Fn,{children:[p.jsx(Bn,{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(Hr,{size:12})})}),p.jsx(Ar,{children:"Delete section"})]})]})]})}function P0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Kf({id:e.id,disabled:!t.canReorder}),l={transform:gt.Transform.toString(i),transition:s};return p.jsx("div",{ref:o,style:l,className:pe(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 Ec=({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:v,saveSuccessFeedback:h=!1,onResetToFile:b,showResetToFile:g=!1,pageSlugs:x=[],currentSlug:k="home",onPageChange:_})=>{const{schemas:C}=dr(),[T,A]=j.useState(!0),[I,D]=j.useState(null),[B,Z]=j.useState(null),[z,F]=j.useState(null),[y,U]=j.useState(null),ee=j.useRef(null),W=j.useRef(null),V=wu(co(bo,T0),co(Cs,O0),co(mo,{coordinateGetter:qf})),Y=j.useDeferredValue(e),oe=e!=null&&(Y==null?void 0:Y.id)!==e.id,N=s&&s.length>0?s:z?[z]:null,R=N!=null&&N.length?{fieldKey:N[N.length-1].fieldKey,itemId:N[N.length-1].itemId}:null,G=j.useRef(s);j.useEffect(()=>{G.current!=null&&s==null&&F(null),G.current=s},[s]),j.useEffect(()=>{(e==null?void 0:e.id)!=null&&A(!1)},[e==null?void 0:e.id]);const q=()=>{const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const L=ee.current;L&&L.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(M)},J=j.useRef(T);j.useEffect(()=>{if(T&&!J.current){const M=q();return J.current=T,M}J.current=T},[T]),j.useEffect(()=>{if(!R)return;const M=ee.current;if(!M)return;const L=requestAnimationFrame(()=>{const K=M.querySelector("[data-jp-expanded-item]")??M.querySelector("[data-jp-focused-field]");K&&K.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(L)},[R]);const ue=M=>{A(!1),d==null||d(M)},Q=()=>{A(M=>{const L=!M;return L&&q(),L})},ie=(M,L)=>{L.stopPropagation(),r.length>0&&o?U(M):(A(!1),d==null||d(M))};j.useEffect(()=>{if(y==null)return;const M=L=>{L.key==="Escape"&&U(null)};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[y]);const ae=M=>{I===M?(u==null||u(M),D(null)):(D(M),setTimeout(()=>D(null),3e3))},ne=j.useMemo(()=>l.filter(M=>M.scope==="local").map(M=>M.id),[l]),de=!!a&&ne.length>0,fe=M=>{Z(M.active.id)},we=M=>{Z(null);const{active:L,over:K}=M;if(!K||L.id===K.id||!a)return;const te=l.findIndex(he=>he.id===L.id),re=l.findIndex(he=>he.id===K.id);if(te===-1||re===-1)return;const se=te<re?re:re-1;a(L.id,se)},w=e?t.sections.find(M=>M.id===e.id):void 0,X=Y?t.sections.find(M=>M.id===Y.id):void 0,H=Y?C[Y.type]:void 0,O=j.useMemo(()=>{if(!H)return!1;const M=H.shape,L=Object.keys(M).filter(K=>!hi.has(K));return L.length===0?!1:L.every(K=>Sc.has(pi(M[K])))},[H]);j.useEffect(()=>{(e==null?void 0:e.id)!=null&&O&&A(!0)},[e==null?void 0:e.id,O]);const S=l.length>0&&(T||!e),P=k?k.charAt(0).toUpperCase()+k.slice(1):"Select page",$=j.useMemo(()=>{const M=[];let L=null;for(const K of l){const te=K.type.toUpperCase(),re=L!==null&&(L==="HEADER"&&te!=="HEADER"||L!=="HEADER"&&L!=="FOOTER"&&te==="FOOTER");M.push({layer:K,showSeparatorAbove:re}),L=te}return M},[l]);return p.jsx(Qg,{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:[P," · ",l.length," sections"]})})]}),p.jsx(He,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:p.jsx(Lt,{size:14})})]}),x.length>0&&_&&p.jsx(m0,{pageSlugs:x,currentSlug:k,onPageChange:_,sectionCount:l.length,currentPageLabel:P}),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:Q,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":S,"aria-label":S?"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:pe("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!T&&"rotate-180")})]}),m!=null&&p.jsxs(Fn,{children:[p.jsx(Bn,{asChild:!0,children:p.jsx(He,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:p.jsx(oo,{size:14})})}),p.jsx(Ar,{children:"Add section"})]})]}),p.jsxs(_c,{className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{ref:ee,className:"flex flex-col min-h-0",children:S&&p.jsxs("div",{className:"py-1",children:[p.jsxs(bf,{sensors:V,collisionDetection:ku,modifiers:[Df],onDragStart:fe,onDragEnd:we,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:M})=>M?`Posizione ${ne.indexOf(String(M.id))+1} di ${ne.length}.`:void 0,onDragEnd:({over:M})=>M?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[p.jsx(Uf,{items:ne,strategy:Ff,children:p.jsx("div",{className:"px-2 space-y-0.5",children:$.map(({layer:M,showSeparatorAbove:L})=>p.jsxs(j.Fragment,{children:[L&&p.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),M.scope==="local"&&de?p.jsx(P0,{layer:M,opts:{isSelected:(e==null?void 0:e.id)===M.id,isActive:c===M.id,isDragging:!1,canReorder:!0,canDelete:!!u,deleteConfirm:I===M.id,onSelect:()=>ue(M.id),onDelete:()=>ae(M.id),onOpenSettings:K=>ie(M.id,K)}}):p.jsx("div",{children:p.jsx(gi,{layer:M,opts:{isSelected:(e==null?void 0:e.id)===M.id,isActive:c===M.id,isDragging:!1,canDelete:M.scope==="local"&&!!u,deleteConfirm:I===M.id,onSelect:()=>ue(M.id),onDelete:()=>ae(M.id),onOpenSettings:K=>ie(M.id,K)}})})]},M.id))})}),p.jsx(If,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:B?(()=>{const M=l.find(L=>L.id===B);return M?p.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:p.jsx(gi,{layer:M,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),I&&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(Bd,{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"})]})]})}),R&&w&&(()=>{const M=w.data||{};let L;if(N&&N.length>0){let K=M;for(const se of N){const he=K==null?void 0:K[se.fieldKey];se.itemId!=null&&Array.isArray(he)?K=he.find(ve=>String(ve==null?void 0:ve.id)===String(se.itemId))??null:K=he}const te=K||{},re=R.fieldKey;L=(typeof te.name=="string"?te.name:null)??(typeof te.title=="string"?te.title:null)??(typeof te.label=="string"?te.label:null)??mi(re)}else{const K=R.fieldKey;if(R.itemId!=null){const se=(Array.isArray(M[K])?M[K]:[]).find(he=>String(he==null?void 0:he.id)===String(R.itemId))||{};L=(typeof se.name=="string"?se.name:null)??(typeof se.title=="string"?se.title:null)??(typeof se.label=="string"?se.label:null)??mi(K)}else L=mi(K)}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:L})]})})(),p.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&A(!1),children:e?oe?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"})]}):H?(()=>{const L=Object.keys(H.shape).filter(te=>!hi.has(te)&&!Sc.has(pi(H.shape[te]))),K=(X==null?void 0:X.data)||{};return L.length===0?p.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):p.jsx(Er,{schema:H,data:K,onChange:te=>n(te),keys:L,expandedItemPath:N,onSidebarExpandedItemChange:F})})():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 ",(Y==null?void 0:Y.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:(v!=null||b!=null)&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("div",{className:pe("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:pe("text-sm font-medium transition-colors duration-300 truncate",h?"text-emerald-400":f?"text-amber-500":"text-zinc-500"),children:h?"Salvato":f?"Unsaved Changes":"All Changes Saved"})]}),v!=null&&p.jsxs(Fn,{children:[p.jsx(Bn,{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:M=>{M.preventDefault(),M.stopPropagation(),v()},children:[p.jsx(Zd,{size:14}),p.jsx("span",{children:"Save"})]})}),p.jsx(Ar,{children:"Save (export JSON)"})]}),b!=null&&g&&p.jsx("button",{type:"button",onClick:b,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"})})]})}),y!=null&&r.length>0&&o!=null&&(()=>{const M=r.find(ve=>ve.id===y),L=l.find(ve=>ve.id===y);if(!M)return null;const K=(L==null?void 0:L.scope)==="global"?"global":"local",te=M.type,re=C[te],he=(re?Object.keys(re.shape):[]).filter(ve=>hi.has(ve)),me=M.data??{};return he.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:()=>U(null),children:p.jsxs("div",{ref:W,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:ve=>ve.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 — ",te]}),p.jsx("button",{type:"button",onClick:()=>U(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(Lt,{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:ve=>ve.target===ve.currentTarget&&U(null),children:p.jsxs("div",{ref:W,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:ve=>ve.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 — ",te]}),p.jsx("button",{type:"button",onClick:()=>U(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(Lt,{size:18})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:p.jsx(Er,{schema:re,data:me,onChange:ve=>{const it={...M.data,...ve};o(y,K,te,it)},keys:he})})]})})})()]})})},Nc=({draft:e,globalDraft:t,themeConfig:r,slug:n,selectedId:o,scrollToSectionId:i,onScrollRequested:s})=>{const a=j.useRef(null),l=j.useCallback(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.UPDATE_DRAFTS,draft:e,globalDraft:t,themeConfig:r},"*")},[e,t,r]);return j.useEffect(()=>{l()},[l]),j.useEffect(()=>{const c=d=>{d.data.type===Ce.STAGE_READY&&l()};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l]),j.useEffect(()=>{var c;(c=a.current)!=null&&c.contentWindow&&a.current.contentWindow.postMessage({type:Ce.SYNC_SELECTION,selectedId:o},"*")},[o]),j.useEffect(()=>{var c;!i||!((c=a.current)!=null&&c.contentWindow)||(a.current.contentWindow.postMessage({type:Ce.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)})}},I0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',zc=()=>{var f;const[e,t]=j.useState(null),[r,n]=j.useState(null),[o,i]=j.useState(null),[s,a]=j.useState(null),[l,c]=j.useState(!1);if(j.useEffect(()=>{const v=h=>{if(!(h.origin!==window.location.origin||h.source!==window.parent)){if(h.data.type===Ce.UPDATE_DRAFTS&&(t(h.data.draft),n(h.data.globalDraft),h.data.themeConfig&&Yn.setTheme(h.data.themeConfig)),h.data.type===Ce.SYNC_SELECTION&&i(h.data.selectedId),h.data.type===Ce.REQUEST_SCROLL_TO_SECTION&&a(h.data.sectionId??null),h.data.type===Ce.REQUEST_INLINE_FLUSH){const b=typeof h.data.requestId=="string"?h.data.requestId:null;window.dispatchEvent(new CustomEvent(Ce.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:Ce.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}h.data.type===Ce.REQUEST_CLEAN_HTML&&(c(!0),setTimeout(()=>{const b=document.documentElement.outerHTML;window.parent.postMessage({type:Ce.SEND_CLEAN_HTML,html:b},"*"),c(!1)},50))}};return window.addEventListener("message",v),window.parent.postMessage({type:Ce.STAGE_READY},"*"),()=>window.removeEventListener("message",v)},[]),j.useEffect(()=>{const v=b=>!!(b.closest(I0)||b.closest("a[href]")),h=b=>{var F,y,U,ee,W,V,Y,oe;const g=b.target;if(v(g)){g.closest("a[href]")&&b.preventDefault();return}const x=b.clientX,k=b.clientY;let _=null,C=g;for(;C&&C!==document.body;){const N=(F=C.getAttribute)==null?void 0:F.call(C,"data-section-id"),R=(y=C.getAttribute)==null?void 0:y.call(C,"data-section-type"),G=(U=C.getAttribute)==null?void 0:U.call(C,"data-section-scope");if(N&&R&&G){_=C;break}C=C.parentElement}if(!_)return;b.preventDefault(),b.stopPropagation();const T=_.getAttribute("data-section-id"),A=_.getAttribute("data-section-type"),I=_.getAttribute("data-section-scope");if(!T||!A||!I)return;const D={id:T,type:A,scope:I};if(g===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:D},"*");return}const B=document.elementFromPoint(x,k)??g;if(!B||!_.contains(B)){window.parent.postMessage({type:Ce.SECTION_SELECT,section:D},"*");return}if(B===_){window.parent.postMessage({type:Ce.SECTION_SELECT,section:D},"*");return}const Z=[];for(C=B;C&&C!==_;){const N=(ee=C.getAttribute)==null?void 0:ee.call(C,"data-jp-item-id"),R=(W=C.getAttribute)==null?void 0:W.call(C,"data-jp-item-field");N&&R&&Z.push({fieldKey:R||"items",itemId:N}),C=C.parentElement}if(Z.reverse(),Z.length===0)for(C=B;C&&C!==_;){const N=(V=C.getAttribute)==null?void 0:V.call(C,"data-jp-field");if(N){Z.push({fieldKey:N});break}C=C.parentElement}if(Z.length===0&&B){let N=null;const R=G=>{var J,ue;const q=G.getBoundingClientRect();if(q.left<=x&&x<=q.right&&q.top<=k&&k<=q.bottom){for(let Q=0;Q<G.children.length;Q++)R(G.children[Q]);((J=G.getAttribute)!=null&&J.call(G,"data-jp-item-id")||(ue=G.getAttribute)!=null&&ue.call(G,"data-jp-field"))&&(N=G)}};if(R(B),N){const G=N,q=(Y=G.getAttribute)==null?void 0:Y.call(G,"data-jp-item-id"),J=(oe=G.getAttribute)==null?void 0:oe.call(G,"data-jp-field");q&&J?Z.push({fieldKey:J||"items",itemId:q}):J&&Z.push({fieldKey:J})}}const z={type:Ce.SECTION_SELECT,section:D};Z.length>0&&(z.itemPath=Z),window.parent.postMessage(z,"*")};return document.addEventListener("click",h,!0),()=>document.removeEventListener("click",h,!0)},[]),j.useEffect(()=>{if(!s)return;const v=setTimeout(()=>a(null),600);return()=>clearTimeout(v)},[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=v=>{window.parent.postMessage({type:Ce.ACTIVE_SECTION_CHANGED,activeSectionId:v},"*")};return p.jsx(Ur,{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 D0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Ac=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(j.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])??D0(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(Lt,{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:pe("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"})})]})]})},jc=()=>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"})]}),R0='/*! 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 L0 extends j.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 Tc(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 Oc=({pageRegistry:e,siteConfig:t,menuConfig:r,tenantCss:n,adminCss:o,NotFoundComponent:i})=>{const s=We.useLocation(),a=Tc(s.pathname),[l,c]=j.useState(null);j.useEffect(()=>{const f=document.getElementById("jp-baked-state");if(f!=null&&f.textContent)try{const v=JSON.parse(f.textContent);c(v),Yn.setTheme(v.theme)}catch(v){console.error("Failed to parse baked state",v)}},[]);const d=l?l.page:e[a],u=l?l.site:t,m=l?l.menu:r;return d?p.jsx(Vr,{mode:"tenant",tenantCss:n,adminCss:o,children:p.jsx(Ur,{mode:"visitor",children:p.jsx(io,{pageConfig:d,siteConfig:u,menuConfig:m})})}):p.jsx(i,{})},Pc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,tenantCss:o,adminCss:i,addSectionConfig:s,addableSectionTypes:a,saveToFile:l,exportHTML:c})=>{const d=We.useLocation(),u=Tc(d.pathname,"admin"),m=We.useNavigate(),f=Object.keys(e).sort((S,P)=>S==="home"?-1:P==="home"?1:S.localeCompare(P)),[v,h]=j.useState(null),[b,g]=j.useState(!1),[x,k]=j.useState(!1),[_,C]=j.useState(()=>{var S;try{const P=JSON.parse(JSON.stringify(t??{}));P.identity||(P.identity={title:"Site"}),P.pages||(P.pages=[]);const $=(S=P.header)==null?void 0:S.data;return $&&(r!=null&&r.main)&&($.links=JSON.parse(JSON.stringify(r.main))),P}catch{return{identity:{title:"Site"},pages:[]}}}),[T,A]=j.useState(null),[I,D]=j.useState(null),[B,Z]=j.useState(null),[z,F]=j.useState(null),[y,U]=j.useState(!1),[ee,W]=j.useState(400),V=j.useRef(v),Y=j.useRef(_),oe=360,N=920;j.useEffect(()=>{V.current=v},[v]),j.useEffect(()=>{Y.current=_},[_]);const R=j.useCallback(S=>{S.preventDefault();const P=S.currentTarget;P.setPointerCapture(S.pointerId);const $=S.clientX,M=ee,L=te=>{const re=$-te.clientX,se=Math.min(N,Math.max(oe,M+re));W(se)},K=()=>{P.releasePointerCapture(S.pointerId),P.removeEventListener("pointermove",L),P.removeEventListener("pointerup",K),P.removeEventListener("pointercancel",K),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",P.addEventListener("pointermove",L),P.addEventListener("pointerup",K),P.addEventListener("pointercancel",K)},[ee]),G=v?[..._.header?[{id:_.header.id,type:_.header.type,scope:"global",title:"Header"}]:[],...v.sections.map(S=>{var P,$;return{id:S.id,type:S.type,scope:"local",title:((P=S.data)==null?void 0:P.title)??(($=S.data)==null?void 0:$.titleHighlight)}}),..._.footer?[{id:_.footer.id,type:_.footer.type,scope:"global",title:"Footer"}]:[]]:[];j.useEffect(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),D(null),g(!1)},[u,e]);const q=j.useCallback(()=>{const S=e[u];S&&h(JSON.parse(JSON.stringify(S))),A(null),D(null),g(!1)},[u,e]),J=j.useCallback((S,P,$)=>{const M=[...$.sections],L=M.findIndex(re=>re.id===S);if(L===-1||P<0||P>=M.length)return;const[K]=M.splice(L,1),te=P>L?P-1:P;M.splice(Math.min(te,M.length),0,K),h({...$,sections:M}),g(!0)},[]),ue=j.useCallback(S=>{var P;if(S.origin===window.location.origin){if(S.data.type===Ce.SECTION_SELECT){A(S.data.section);const $=S.data.itemPath;Array.isArray($)&&$.length>0?D($.map(M=>({fieldKey:M.fieldKey,...M.itemId!=null?{itemId:String(M.itemId)}:{}}))):D(null)}if(S.data.type===Ce.INLINE_FIELD_UPDATE){const $=typeof S.data.sectionId=="string"?S.data.sectionId:null,M=typeof S.data.fieldKey=="string"?S.data.fieldKey:null;$&&M&&(h(L=>{if(!L)return L;const K={...L,sections:L.sections.map(te=>te.id===$?{...te,data:{...te.data,[M]:S.data.value}}:te)};return V.current=K,K}),g(!0))}if(S.data.type===Ce.ACTIVE_SECTION_CHANGED&&Z(S.data.activeSectionId??null),S.data.type==="jsonpages:section-reorder"&&V.current){const{sectionId:$,newIndex:M}=S.data;typeof $=="string"&&typeof M=="number"&&M>=0&&J($,M,V.current)}if(S.data.type===Ce.SEND_CLEAN_HTML){if(!V.current)return;const $=(P=Y.current.header)==null?void 0:P.data,M={page:V.current,site:Y.current,menu:{main:($==null?void 0:$.links)??[]},theme:n};c(M,u,S.data.html),g(!1)}}},[u,n,J,c]);j.useEffect(()=>(window.addEventListener("message",ue),()=>window.removeEventListener("message",ue)),[ue]);const Q=j.useCallback(S=>{const P=G.find($=>$.id===S);P&&A({id:P.id,type:P.type,scope:P.scope}),D(null),F(S)},[G]),ie=j.useCallback(()=>{F(null)},[]),ae=j.useCallback(S=>{h(P=>P&&{...P,sections:P.sections.filter($=>$.id!==S)}),g(!0),A(P=>(P==null?void 0:P.id)===S?null:P)},[]),ne=S=>{if(!(!T||!v))if(g(!0),T.scope==="global")T.type==="header"&&_.header!=null?C({..._,header:{..._.header,data:S}}):T.type==="footer"&&_.footer!=null&&C({..._,footer:{..._.footer,data:S}});else{const P=v.sections.map($=>$.id===T.id?{...$,data:S}:$);h({...v,sections:P})}},de=j.useCallback((S,P,$,M)=>{var L,K;if(g(!0),P==="global")((L=_.header)==null?void 0:L.id)===S?C({..._,header:{..._.header,data:M}}):((K=_.footer)==null?void 0:K.id)===S&&C({..._,footer:{..._.footer,data:M}});else if(v){const te=v.sections.map(re=>re.id===S?{...re,data:M}:re);h({...v,sections:te})}},[v,_]),fe=()=>{var P;const S=document.querySelector("iframe");(P=S==null?void 0:S.contentWindow)==null||P.postMessage({type:Ce.REQUEST_CLEAN_HTML},"*")},we=j.useCallback(async()=>{const S=document.querySelector("iframe");if(!(S!=null&&S.contentWindow))return;const P=crypto.randomUUID();await new Promise($=>{var K;let M=!1;const L=te=>{var re,se;te.origin===window.location.origin&&((re=te.data)==null?void 0:re.type)===Ce.INLINE_FLUSHED&&((se=te.data)==null?void 0:se.requestId)===P&&(M=!0,window.removeEventListener("message",L),$())};window.addEventListener("message",L),(K=S.contentWindow)==null||K.postMessage({type:Ce.REQUEST_INLINE_FLUSH,requestId:P},"*"),window.setTimeout(()=>{M||(window.removeEventListener("message",L),$())},400)})},[]),w=async()=>{var L;if(!l)return;await we();const S=V.current,P=Y.current;if(!S)return;const $=(L=P.header)==null?void 0:L.data,M={page:S,site:P,menu:{main:($==null?void 0:$.links)??[]},theme:n};l(M,u).then(()=>{g(!1),k(!0)}).catch(K=>{console.error("[JsonPages] saveToFile failed",K);const te=K instanceof Error?K.message:String(K);alert(`Save to file failed: ${te}`)})},X=S=>{var M;if(!v)return;const P=((M=s==null?void 0:s.getDefaultSectionData)==null?void 0:M.call(s,S))??{},$={id:crypto.randomUUID(),type:S,data:P,settings:void 0};h({...v,sections:[...v.sections,$]}),g(!0),A({id:$.id,type:S,scope:"local"})};if(!v)return p.jsx("div",{children:"Loading Studio..."});const H=(T==null?void 0:T.scope)==="global"?{sections:[_.header,_.footer].filter(S=>S!=null)}:v,O=[..._.header?[_.header]:[],...v.sections,..._.footer?[_.footer]:[]];return p.jsx(Vr,{mode:"admin",tenantCss:o,adminCss:i,children:p.jsx(Ur,{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(Nc,{draft:v,globalDraft:_,themeConfig:n,slug:u,selectedId:T==null?void 0:T.id,scrollToSectionId:z,onScrollRequested:ie})}),p.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:ee,minWidth:oe,maxWidth:N},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:R}),p.jsx(Ec,{selectedSection:T,pageData:H,allSectionsData:O,onUpdate:ne,onUpdateSection:de,onClose:()=>{A(null),D(null)},expandedItemPath:I,onReorderSection:v?(S,P)=>J(S,P,v):void 0,allLayers:G,activeSectionId:B,onRequestScrollToSection:Q,onDeleteSection:v?ae:void 0,onAddSection:a.length>0?()=>U(!0):void 0,hasChanges:b,onExportHTML:fe,onSaveToFile:l!=null?w:void 0,saveSuccessFeedback:x,onResetToFile:q,pageSlugs:f,currentSlug:u,onPageChange:f.length>1?S=>{const P=bi(S);m(P==="home"?"/admin":`/admin/${P}`)}:void 0})]})]}),p.jsx(Ac,{open:y,onClose:()=>U(!1),sectionTypes:a,sectionTypeLabels:s==null?void 0:s.sectionTypeLabels,onSelect:X})]})})})},Ic=({tenantCss:e,adminCss:t})=>p.jsx(Vr,{mode:"tenant",tenantCss:e,adminCss:t,children:p.jsx(zc,{})});function M0({config:e}){var b,g,x;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,themeCss:a,addSection:l,NotFoundComponent:c=jc}=e,d=(l==null?void 0:l.addableSectionTypes)??Object.keys(r).filter(k=>k!=="header"&&k!=="footer"),u={exportJSON:((b=e.persistence)==null?void 0:b.exportJSON)??Ci,exportHTML:((g=e.persistence)==null?void 0:g.exportHTML)??Ei,saveToFile:(x=e.persistence)==null?void 0:x.saveToFile},m=typeof(a==null?void 0:a.tenant)=="string"?a.tenant:"",f=typeof(a==null?void 0:a.admin)=="string"?a.admin:R0,[v,h]=j.useState(!1);return j.useEffect(()=>{try{i!=null&&i.tokens&&Yn.setTheme(i)}catch(k){console.warn("[JsonPages] setTheme failed",k)}h(!0)},[i]),v?p.jsx(L0,{children:p.jsx(Gi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets},children:p.jsx(We.BrowserRouter,{children:p.jsxs(We.Routes,{children:[p.jsx(We.Route,{path:"/",element:p.jsx(Oc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(We.Route,{path:"/*",element:p.jsx(Oc,{pageRegistry:n,siteConfig:o,menuConfig:s,tenantCss:m,adminCss:f,NotFoundComponent:c})}),p.jsx(We.Route,{path:"/admin",element:p.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(We.Route,{path:"/admin/*",element:p.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:i,tenantCss:m,adminCss:f,addSectionConfig:l,addableSectionTypes:d,saveToFile:u.saveToFile,exportHTML:u.exportHTML})}),p.jsx(We.Route,{path:"/admin/preview",element:p.jsx(Ic,{tenantCss:m,adminCss:f})}),p.jsx(We.Route,{path:"/admin/preview/*",element:p.jsx(Ic,{tenantCss:m,adminCss:f})}),p.jsx(We.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 F0=({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(qd,{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(Ud,{size:14}),p.jsx("span",{children:"Bake HTML"})]}),p.jsxs("button",{onClick:t,disabled:!e,className:pe("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(Wd,{size:14}),p.jsx("span",{children:"Export JSON"})]})]})]});ye.AddSectionLibrary=Ac,ye.AdminSidebar=Ec,ye.ConfigProvider=Gi,ye.ControlBar=F0,ye.DefaultNotFound=jc,ye.FormFactory=Er,ye.InputWidgets=er,ye.JsonPagesEngine=M0,ye.PageRenderer=io,ye.PreviewEntry=zc,ye.STUDIO_EVENTS=Ce,ye.SectionRenderer=ur,ye.StudioProvider=Ur,ye.StudioStage=Nc,ye.ThemeLoader=Vr,ye.cn=pe,ye.exportBakedHTML=Ei,ye.exportProjectJSON=Ci,ye.resolveAssetUrl=Ll,ye.themeManager=Yn,ye.useConfig=dr,ye.useStudio=qi,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})}));