@makebot.it/js 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +170 -0
  2. package/dist/web.js +112 -65
  3. package/package.json +4 -3
package/dist/web.js CHANGED
@@ -1,24 +1,24 @@
1
1
  // v0.9.11
2
- var R0=Object.create;var Ki=Object.defineProperty;var O0=Object.getOwnPropertyDescriptor;var $0=Object.getOwnPropertyNames;var N0=Object.getPrototypeOf,M0=Object.prototype.hasOwnProperty;var D0=(e,t)=>()=>(e&&(t=e(e=0)),t);var bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),L0=(e,t)=>{for(var r in t)Ki(e,r,{get:t[r],enumerable:!0})},td=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $0(t))!M0.call(e,o)&&o!==r&&Ki(e,o,{get:()=>t[o],enumerable:!(n=O0(t,o))||n.enumerable});return e};var rd=(e,t,r)=>(r=e!=null?R0(N0(e)):{},td(t||!e||!e.__esModule?Ki(r,"default",{value:e,enumerable:!0}):r,e)),Xi=e=>td(Ki({},"__esModule",{value:!0}),e);var Qy=bt(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});function Es(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Es=function(t){return typeof t}:Es=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Es(e)}var Zy="https://js.stripe.com/v3",r_=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Ky="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",n_=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Zy,'"]')),r=0;r<t.length;r++){var n=t[r];if(r_.test(n.src))return n}return null},o_=function(t){var r=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Zy).concat(r);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},i_=function(t,r){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:r})},Ss=null,a_=function(t){return Ss!==null||(Ss=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&t&&console.warn(Ky),window.Stripe){r(window.Stripe);return}try{var o=n_();o&&t?console.warn(Ky):o||(o=o_(t)),o.addEventListener("load",function(){window.Stripe?r(window.Stripe):n(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){n(new Error("Failed to load Stripe.js"))})}catch(i){n(i);return}})),Ss},s_=function(t,r,n){if(t===null)return null;var o=t.apply(void 0,r);return i_(o,n),o},Xy=function(t){var r=`invalid load parameters; expected object of shape
2
+ var g1=Object.create;var Ja=Object.defineProperty;var h1=Object.getOwnPropertyDescriptor;var b1=Object.getOwnPropertyNames;var y1=Object.getPrototypeOf,v1=Object.prototype.hasOwnProperty;var x1=(e,t)=>()=>(e&&(t=e(e=0)),t);var It=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),w1=(e,t)=>{for(var n in t)Ja(e,n,{get:t[n],enumerable:!0})},bm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b1(t))!v1.call(e,o)&&o!==n&&Ja(e,o,{get:()=>t[o],enumerable:!(r=h1(t,o))||r.enumerable});return e};var ym=(e,t,n)=>(n=e!=null?g1(y1(e)):{},bm(t||!e||!e.__esModule?Ja(n,"default",{value:e,enumerable:!0}):n,e)),Qa=e=>bm(Ja({},"__esModule",{value:!0}),e);var Ux=It(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});function Dl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dl=function(t){return typeof t}:Dl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(e)}var Bx="https://js.stripe.com/v3",iR=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Dx="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",aR=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Bx,'"]')),n=0;n<t.length;n++){var r=t[n];if(iR.test(r.src))return r}return null},sR=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Bx).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(r),r},lR=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:n})},Ml=null,cR=function(t){return Ml!==null||(Ml=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(Dx),window.Stripe){n(window.Stripe);return}try{var o=aR();o&&t?console.warn(Dx):o||(o=sR(t)),o.addEventListener("load",function(){window.Stripe?n(window.Stripe):r(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){r(new Error("Failed to load Stripe.js"))})}catch(i){r(i);return}})),Ml},uR=function(t,n,r){if(t===null)return null;var o=t.apply(void 0,n);return lR(o,r),o},Lx=function(t){var n=`invalid load parameters; expected object of shape
3
3
 
4
4
  {advancedFraudSignals: boolean}
5
5
 
6
6
  but received
7
7
 
8
8
  `.concat(JSON.stringify(t),`
9
- `);if(t===null||Es(t)!=="object")throw new Error(r);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(r)},Ps,Vc=!1,Jy=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];Vc=!0;var o=Date.now();return a_(Ps).then(function(i){return s_(i,r,o)})};Jy.setLoadParameters=function(e){if(Vc&&Ps){var t=Xy(e),r=Object.keys(t),n=r.reduce(function(o,i){var a;return o&&e[i]===((a=Ps)===null||a===void 0?void 0:a[i])},!0);if(n)return}if(Vc)throw new Error("You cannot change load parameters after calling loadStripe");Ps=Xy(e)};zc.loadStripe=Jy});var tx=bt((dV,ex)=>{"use strict";ex.exports=Qy()});var Oi={};L0(Oi,{__addDisposableResource:()=>Bx,__assign:()=>As,__asyncDelegator:()=>Ax,__asyncGenerator:()=>Ix,__asyncValues:()=>Rx,__await:()=>Po,__awaiter:()=>Cx,__classPrivateFieldGet:()=>Mx,__classPrivateFieldIn:()=>Lx,__classPrivateFieldSet:()=>Dx,__createBinding:()=>Os,__decorate:()=>hx,__disposeResources:()=>Fx,__esDecorate:()=>yx,__exportStar:()=>Sx,__extends:()=>px,__generator:()=>Tx,__importDefault:()=>Nx,__importStar:()=>$x,__makeTemplateObject:()=>Ox,__metadata:()=>kx,__param:()=>bx,__propKey:()=>vx,__read:()=>Kc,__rest:()=>gx,__rewriteRelativeImportExtension:()=>Ux,__runInitializers:()=>xx,__setFunctionName:()=>wx,__spread:()=>Ex,__spreadArray:()=>_x,__spreadArrays:()=>Px,__values:()=>Rs,default:()=>Y_});function px(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");qc(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function gx(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 hx(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function bx(e,t){return function(r,n){t(r,n,e)}}function yx(e,t,r,n,o,i){function a(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var s=n.kind,l=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),d,p=!1,f=r.length-1;f>=0;f--){var x={};for(var h in n)x[h]=h==="access"?{}:n[h];for(var h in n.access)x.access[h]=n.access[h];x.addInitializer=function(T){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(T||null))};var w=(0,r[f])(s==="accessor"?{get:u.get,set:u.set}:u[l],x);if(s==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(d=a(w.get))&&(u.get=d),(d=a(w.set))&&(u.set=d),(d=a(w.init))&&o.unshift(d)}else(d=a(w))&&(s==="field"?o.unshift(d):u[l]=d)}c&&Object.defineProperty(c,n.name,u),p=!0}function xx(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function vx(e){return typeof e=="symbol"?e:"".concat(e)}function wx(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function kx(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Cx(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function Tx(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Sx(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Os(t,e,r)}function Rs(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Kc(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Ex(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Kc(arguments[t]));return e}function Px(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function _x(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))}function Po(e){return this instanceof Po?(this.v=e,this):new Po(e)}function Ix(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(f){return function(x){return Promise.resolve(x).then(f,d)}}function s(f,x){n[f]&&(o[f]=function(h){return new Promise(function(w,T){i.push([f,h,w,T])>1||l(f,h)})},x&&(o[f]=x(o[f])))}function l(f,x){try{c(n[f](x))}catch(h){p(i[0][3],h)}}function c(f){f.value instanceof Po?Promise.resolve(f.value.v).then(u,d):p(i[0][2],f)}function u(f){l("next",f)}function d(f){l("throw",f)}function p(f,x){f(x),i.shift(),i.length&&l(i[0][0],i[0][1])}}function Ax(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(a){return(r=!r)?{value:Po(e[o](a)),done:!1}:i?i(a):a}:i}}function Rx(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Rs=="function"?Rs(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},a)}}function Ox(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function $x(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Yc(e),n=0;n<r.length;n++)r[n]!=="default"&&Os(t,e,r[n]);return W_(t,e),t}function Nx(e){return e&&e.__esModule?e:{default:e}}function Mx(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Dx(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function Lx(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Bx(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function Fx(e){function t(i){e.error=e.hasError?new q_(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return t(a),o()})}else n|=1}catch(a){t(a)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function Ux(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,a){return n?t?".jsx":".js":o&&(!i||!a)?r:o+i+"."+a.toLowerCase()+"js"}):e}var qc,As,Os,W_,Yc,q_,Y_,$i=D0(()=>{"use strict";qc=function(e,t){return qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},qc(e,t)};As=function(){return As=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},As.apply(this,arguments)};Os=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]});W_=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Yc=function(e){return Yc=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Yc(e)};q_=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};Y_={__extends:px,__assign:As,__rest:gx,__decorate:hx,__param:bx,__esDecorate:yx,__runInitializers:xx,__propKey:vx,__setFunctionName:wx,__metadata:kx,__awaiter:Cx,__generator:Tx,__createBinding:Os,__exportStar:Sx,__values:Rs,__read:Kc,__spread:Ex,__spreadArrays:Px,__spreadArray:_x,__await:Po,__asyncGenerator:Ix,__asyncDelegator:Ax,__asyncValues:Rx,__makeTemplateObject:Ox,__importStar:$x,__importDefault:Nx,__classPrivateFieldGet:Mx,__classPrivateFieldSet:Dx,__classPrivateFieldIn:Lx,__addDisposableResource:Bx,__disposeResources:Fx,__rewriteRelativeImportExtension:Ux}});var _o=bt($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.WebmBase=void 0;var Xc=class{constructor(t="Unknown",r=0){this.name=t,this.start=r}getType(){return"Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource()}updateByData(){}setData(t){this.data=t,this.updateByData()}getValue(){return this.data}setValue(t){this.setData(t)}};$s.WebmBase=Xc});var Ms=bt(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.SectionType=void 0;var Vx;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"})(Vx||(Ns.SectionType=Vx={}))});var Zc=bt(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.sections=void 0;var E=Ms();Ds.sections={172351395:{name:"EBML",type:E.SectionType.Container},646:{name:"EBMLVersion",type:E.SectionType.Uint},759:{name:"EBMLReadVersion",type:E.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:E.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:E.SectionType.Uint},642:{name:"DocType",type:E.SectionType.String},647:{name:"DocTypeVersion",type:E.SectionType.Uint},645:{name:"DocTypeReadVersion",type:E.SectionType.Uint},108:{name:"Void",type:E.SectionType.Binary},63:{name:"CRC-32",type:E.SectionType.Binary},190023271:{name:"SignatureSlot",type:E.SectionType.Container},16010:{name:"SignatureAlgo",type:E.SectionType.Uint},16026:{name:"SignatureHash",type:E.SectionType.Uint},16037:{name:"SignaturePublicKey",type:E.SectionType.Binary},16053:{name:"Signature",type:E.SectionType.Binary},15963:{name:"SignatureElements",type:E.SectionType.Container},15995:{name:"SignatureElementList",type:E.SectionType.Container},9522:{name:"SignedElement",type:E.SectionType.Binary},139690087:{name:"Segment",type:E.SectionType.Container},21863284:{name:"SeekHead",type:E.SectionType.Container},3515:{name:"Seek",type:E.SectionType.Container},5035:{name:"SeekID",type:E.SectionType.Binary},5036:{name:"SeekPosition",type:E.SectionType.Uint},88713574:{name:"Info",type:E.SectionType.Container},13220:{name:"SegmentUID",type:E.SectionType.Binary},13188:{name:"SegmentFilename",type:E.SectionType.String},1882403:{name:"PrevUID",type:E.SectionType.Binary},1868715:{name:"PrevFilename",type:E.SectionType.String},2013475:{name:"NextUID",type:E.SectionType.Binary},1999803:{name:"NextFilename",type:E.SectionType.String},1092:{name:"SegmentFamily",type:E.SectionType.Binary},10532:{name:"ChapterTranslate",type:E.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:E.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:E.SectionType.Uint},10661:{name:"ChapterTranslateID",type:E.SectionType.Binary},710577:{name:"TimecodeScale",type:E.SectionType.Uint},1161:{name:"Duration",type:E.SectionType.Float},1121:{name:"DateUTC",type:E.SectionType.Date},15273:{name:"Title",type:E.SectionType.String},3456:{name:"MuxingApp",type:E.SectionType.String},5953:{name:"WritingApp",type:E.SectionType.String},103:{name:"Timecode",type:E.SectionType.Uint},6228:{name:"SilentTracks",type:E.SectionType.Container},6359:{name:"SilentTrackNumber",type:E.SectionType.Uint},39:{name:"Position",type:E.SectionType.Uint},43:{name:"PrevSize",type:E.SectionType.Uint},35:{name:"SimpleBlock",type:E.SectionType.Binary},32:{name:"BlockGroup",type:E.SectionType.Container},33:{name:"Block",type:E.SectionType.Binary},34:{name:"BlockVirtual",type:E.SectionType.Binary},13729:{name:"BlockAdditions",type:E.SectionType.Container},38:{name:"BlockMore",type:E.SectionType.Container},110:{name:"BlockAddID",type:E.SectionType.Uint},37:{name:"BlockAdditional",type:E.SectionType.Binary},27:{name:"BlockDuration",type:E.SectionType.Uint},122:{name:"ReferencePriority",type:E.SectionType.Uint},123:{name:"ReferenceBlock",type:E.SectionType.Int},125:{name:"ReferenceVirtual",type:E.SectionType.Int},36:{name:"CodecState",type:E.SectionType.Binary},13730:{name:"DiscardPadding",type:E.SectionType.Int},14:{name:"Slices",type:E.SectionType.Container},104:{name:"TimeSlice",type:E.SectionType.Container},76:{name:"LaceNumber",type:E.SectionType.Uint},77:{name:"FrameNumber",type:E.SectionType.Uint},75:{name:"BlockAdditionID",type:E.SectionType.Uint},78:{name:"Delay",type:E.SectionType.Uint},79:{name:"SliceDuration",type:E.SectionType.Uint},72:{name:"ReferenceFrame",type:E.SectionType.Container},73:{name:"ReferenceOffset",type:E.SectionType.Uint},74:{name:"ReferenceTimeCode",type:E.SectionType.Uint},47:{name:"EncryptedBlock",type:E.SectionType.Binary},106212971:{name:"Tracks",type:E.SectionType.Container},46:{name:"TrackEntry",type:E.SectionType.Container},87:{name:"TrackNumber",type:E.SectionType.Uint},13253:{name:"TrackUID",type:E.SectionType.Uint},3:{name:"TrackType",type:E.SectionType.Uint},57:{name:"FlagEnabled",type:E.SectionType.Uint},8:{name:"FlagDefault",type:E.SectionType.Uint},5546:{name:"FlagForced",type:E.SectionType.Uint},28:{name:"FlagLacing",type:E.SectionType.Uint},11751:{name:"MinCache",type:E.SectionType.Uint},11768:{name:"MaxCache",type:E.SectionType.Uint},254851:{name:"DefaultDuration",type:E.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:E.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:E.SectionType.Float},4991:{name:"TrackOffset",type:E.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:E.SectionType.Uint},4974:{name:"Name",type:E.SectionType.String},177564:{name:"Language",type:E.SectionType.String},6:{name:"CodecID",type:E.SectionType.String},9122:{name:"CodecPrivate",type:E.SectionType.Binary},362120:{name:"CodecName",type:E.SectionType.String},13382:{name:"AttachmentLink",type:E.SectionType.Uint},1742487:{name:"CodecSettings",type:E.SectionType.String},1785920:{name:"CodecInfoURL",type:E.SectionType.String},438848:{name:"CodecDownloadURL",type:E.SectionType.String},42:{name:"CodecDecodeAll",type:E.SectionType.Uint},12203:{name:"TrackOverlay",type:E.SectionType.Uint},5802:{name:"CodecDelay",type:E.SectionType.Uint},5819:{name:"SeekPreRoll",type:E.SectionType.Uint},9764:{name:"TrackTranslate",type:E.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:E.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:E.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:E.SectionType.Binary},96:{name:"Video",type:E.SectionType.Container},26:{name:"FlagInterlaced",type:E.SectionType.Uint},5048:{name:"StereoMode",type:E.SectionType.Uint},5056:{name:"AlphaMode",type:E.SectionType.Uint},5049:{name:"OldStereoMode",type:E.SectionType.Uint},48:{name:"PixelWidth",type:E.SectionType.Uint},58:{name:"PixelHeight",type:E.SectionType.Uint},5290:{name:"PixelCropBottom",type:E.SectionType.Uint},5307:{name:"PixelCropTop",type:E.SectionType.Uint},5324:{name:"PixelCropLeft",type:E.SectionType.Uint},5341:{name:"PixelCropRight",type:E.SectionType.Uint},5296:{name:"DisplayWidth",type:E.SectionType.Uint},5306:{name:"DisplayHeight",type:E.SectionType.Uint},5298:{name:"DisplayUnit",type:E.SectionType.Uint},5299:{name:"AspectRatioType",type:E.SectionType.Uint},963876:{name:"ColourSpace",type:E.SectionType.Binary},1029411:{name:"GammaValue",type:E.SectionType.Float},230371:{name:"FrameRate",type:E.SectionType.Float},97:{name:"Audio",type:E.SectionType.Container},53:{name:"SamplingFrequency",type:E.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:E.SectionType.Float},31:{name:"Channels",type:E.SectionType.Uint},15739:{name:"ChannelPositions",type:E.SectionType.Binary},8804:{name:"BitDepth",type:E.SectionType.Uint},98:{name:"TrackOperation",type:E.SectionType.Container},99:{name:"TrackCombinePlanes",type:E.SectionType.Container},100:{name:"TrackPlane",type:E.SectionType.Container},101:{name:"TrackPlaneUID",type:E.SectionType.Uint},102:{name:"TrackPlaneType",type:E.SectionType.Uint},105:{name:"TrackJoinBlocks",type:E.SectionType.Container},109:{name:"TrackJoinUID",type:E.SectionType.Uint},64:{name:"TrickTrackUID",type:E.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:E.SectionType.Binary},70:{name:"TrickTrackFlag",type:E.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:E.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:E.SectionType.Binary},11648:{name:"ContentEncodings",type:E.SectionType.Container},8768:{name:"ContentEncoding",type:E.SectionType.Container},4145:{name:"ContentEncodingOrder",type:E.SectionType.Uint},4146:{name:"ContentEncodingScope",type:E.SectionType.Uint},4147:{name:"ContentEncodingType",type:E.SectionType.Uint},4148:{name:"ContentCompression",type:E.SectionType.Container},596:{name:"ContentCompAlgo",type:E.SectionType.Uint},597:{name:"ContentCompSettings",type:E.SectionType.Binary},4149:{name:"ContentEncryption",type:E.SectionType.Container},2017:{name:"ContentEncAlgo",type:E.SectionType.Uint},2018:{name:"ContentEncKeyID",type:E.SectionType.Binary},2019:{name:"ContentSignature",type:E.SectionType.Binary},2020:{name:"ContentSigKeyID",type:E.SectionType.Binary},2021:{name:"ContentSigAlgo",type:E.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:E.SectionType.Uint},206814059:{name:"Cues",type:E.SectionType.Container},59:{name:"CuePoint",type:E.SectionType.Container},51:{name:"CueTime",type:E.SectionType.Uint},55:{name:"CueTrackPositions",type:E.SectionType.Container},119:{name:"CueTrack",type:E.SectionType.Uint},113:{name:"CueClusterPosition",type:E.SectionType.Uint},112:{name:"CueRelativePosition",type:E.SectionType.Uint},50:{name:"CueDuration",type:E.SectionType.Uint},4984:{name:"CueBlockNumber",type:E.SectionType.Uint},106:{name:"CueCodecState",type:E.SectionType.Uint},91:{name:"CueReference",type:E.SectionType.Container},22:{name:"CueRefTime",type:E.SectionType.Uint},23:{name:"CueRefCluster",type:E.SectionType.Uint},4959:{name:"CueRefNumber",type:E.SectionType.Uint},107:{name:"CueRefCodecState",type:E.SectionType.Uint},155296873:{name:"Attachments",type:E.SectionType.Container},8615:{name:"AttachedFile",type:E.SectionType.Container},1662:{name:"FileDescription",type:E.SectionType.String},1646:{name:"FileName",type:E.SectionType.String},1632:{name:"FileMimeType",type:E.SectionType.String},1628:{name:"FileData",type:E.SectionType.Binary},1710:{name:"FileUID",type:E.SectionType.Uint},1653:{name:"FileReferral",type:E.SectionType.Binary},1633:{name:"FileUsedStartTime",type:E.SectionType.Uint},1634:{name:"FileUsedEndTime",type:E.SectionType.Uint},4433776:{name:"Chapters",type:E.SectionType.Container},1465:{name:"EditionEntry",type:E.SectionType.Container},1468:{name:"EditionUID",type:E.SectionType.Uint},1469:{name:"EditionFlagHidden",type:E.SectionType.Uint},1499:{name:"EditionFlagDefault",type:E.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:E.SectionType.Uint},54:{name:"ChapterAtom",type:E.SectionType.Container},13252:{name:"ChapterUID",type:E.SectionType.Uint},5716:{name:"ChapterStringUID",type:E.SectionType.String},17:{name:"ChapterTimeStart",type:E.SectionType.Uint},18:{name:"ChapterTimeEnd",type:E.SectionType.Uint},24:{name:"ChapterFlagHidden",type:E.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:E.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:E.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:E.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:E.SectionType.Uint},15:{name:"ChapterTrack",type:E.SectionType.Container},9:{name:"ChapterTrackNumber",type:E.SectionType.Uint},0:{name:"ChapterDisplay",type:E.SectionType.Container},5:{name:"ChapString",type:E.SectionType.String},892:{name:"ChapLanguage",type:E.SectionType.String},894:{name:"ChapCountry",type:E.SectionType.String},10564:{name:"ChapProcess",type:E.SectionType.Container},10581:{name:"ChapProcessCodecID",type:E.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:E.SectionType.Binary},10513:{name:"ChapProcessCommand",type:E.SectionType.Container},10530:{name:"ChapProcessTime",type:E.SectionType.Uint},10547:{name:"ChapProcessData",type:E.SectionType.Binary},39109479:{name:"Tags",type:E.SectionType.Container},13171:{name:"Tag",type:E.SectionType.Container},9152:{name:"Targets",type:E.SectionType.Container},10442:{name:"TargetTypeValue",type:E.SectionType.Uint},9162:{name:"TargetType",type:E.SectionType.String},9157:{name:"TagTrackUID",type:E.SectionType.Uint},9161:{name:"TagEditionUID",type:E.SectionType.Uint},9156:{name:"TagChapterUID",type:E.SectionType.Uint},9158:{name:"TagAttachmentUID",type:E.SectionType.Uint},10184:{name:"SimpleTag",type:E.SectionType.Container},1443:{name:"TagName",type:E.SectionType.String},1146:{name:"TagLanguage",type:E.SectionType.String},1156:{name:"TagDefault",type:E.SectionType.Uint},1159:{name:"TagString",type:E.SectionType.String},1157:{name:"TagBinary",type:E.SectionType.Binary},5552:{name:"Colour",type:E.SectionType.Container},5553:{name:"MatrixCoefficients",type:E.SectionType.Uint},5554:{name:"BitsPerChannel",type:E.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:E.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:E.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:E.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:E.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:E.SectionType.Uint},5560:{name:"ChromaSitingVert",type:E.SectionType.Uint},5561:{name:"Range",type:E.SectionType.Uint},5562:{name:"TransferCharacteristics",type:E.SectionType.Uint},5563:{name:"Primaries",type:E.SectionType.Uint},5564:{name:"MaxCLL",type:E.SectionType.Uint},5565:{name:"MaxFALL",type:E.SectionType.Uint}}});var Qc=bt(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.WebmUint=void 0;var K_=_o();function zx(e){return e.length%2===1?"0"+e:e}var Jc=class extends K_.WebmBase{constructor(t,r=0){super(t,r)}getType(){return"Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let r=this.source[t].toString(16);this.data+=zx(r)}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let r=0;r<t;r++){let n=this.data.substring(r*2,r*2+2);this.source[r]=parseInt(n,16)}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(zx(t.toString(16)))}};Ls.WebmUint=Jc});var tu=bt(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.WebmFloat=void 0;var X_=_o(),eu=class extends X_.WebmBase{constructor(t,r=0){super(t,r)}getType(){return"Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),r=this.getFloatArrayType(),n=new r(t.buffer);this.data=n[0]}updateByData(){let t=this.getFloatArrayType(),r=new t([this.data]),n=new Uint8Array(r.buffer);this.source=n.reverse()}};Bs.WebmFloat=eu});var nu=bt(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.WebmString=void 0;var Z_=_o(),ru=class extends Z_.WebmBase{constructor(t,r=0){super(t,r)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let t="";return this.source.forEach(r=>{t+=String.fromCharCode(r)}),t}};Fs.WebmString=ru});var iu=bt(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.WebmContainer=void 0;var Gx=_o(),J_=Zc(),Us=Ms(),Q_=Qc(),eI=tu(),tI=nu(),ou=class e extends Gx.WebmBase{constructor(t,r=!1,n=0){super(t,n),this.isInfinite=r,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),r=8-t.toString(2).length,n=t-(1<<7-r);for(let o=0;o<r;o++)n<<=8,n|=this.readByte();return n}updateBySource(){var t;this.data=[];let r;for(this.offset=0;this.offset<this.source.length;this.offset=r){let n=this.offset,o=this.readUint(),{name:i,type:a}=(t=J_.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();r=this.source.length,s>=0&&(r=Math.min(this.offset+s,r));let l=this.source.slice(this.offset,r),c;switch(a){case Us.SectionType.Container:c=new e(i,s<0,n);break;case Us.SectionType.Uint:c=new Q_.WebmUint(i,n);break;case Us.SectionType.Float:c=new eI.WebmFloat(i,n);break;case Us.SectionType.String:c=new tI.WebmString(i,n);break;default:c=new Gx.WebmBase(i,n);break}c.setSource(l),this.data.push({id:o,idHex:o.toString(16),data:c})}}writeUint(t,r=!1){let n;for(n=1;(t<0||t>=1<<7*n)&&n<8;n++);if(!r){for(let o=0;o<n;o++)this.source[this.offset+o]=t>>8*(n-1-o)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n}this.offset+=n}writeSections(t=!1){this.offset=0;for(let r=0;r<this.data.length;r++){let n=this.data[r],o=n.data.source,i=o.length;this.writeUint(n.id,t),this.writeUint(n.data instanceof e&&n.data.isInfinite?-1:i,t),t||this.source.set(o,this.offset),this.offset+=i}return this.offset}updateByData(){let t=this.writeSections(!0);this.source=new Uint8Array(t),this.writeSections()}getSectionById(t){for(let r=0;r<this.data.length;r++){let n=this.data[r];if(n.id===t)return n.data}return null}};Vs.WebmContainer=ou});var Hx=bt(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.WebmFile=void 0;var rI=($i(),Xi(Oi)),nI=iu(),au=class e extends nI.WebmContainer{constructor(t){super("File"),this.setSource(t)}getType(){return"File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((r,n)=>{try{let o=new FileReader;o.onloadend=()=>{try{r(new Uint8Array(o.result))}catch(i){n(i)}},o.readAsArrayBuffer(t)}catch(o){n(o)}})}static fromBlob(t){return rI.__awaiter(this,void 0,void 0,function*(){let r=yield e.blobToArray(t);return new e(r)})}};zs.WebmFile=au});var Wx=bt(jx=>{"use strict";Object.defineProperty(jx,"__esModule",{value:!0})});var su=bt(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});var Ar=($i(),Xi(Oi));Ar.__exportStar(_o(),rr);Ar.__exportStar(iu(),rr);Ar.__exportStar(Hx(),rr);Ar.__exportStar(tu(),rr);Ar.__exportStar(nu(),rr);Ar.__exportStar(Qc(),rr);Ar.__exportStar(Ms(),rr);Ar.__exportStar(Wx(),rr);Ar.__exportStar(Zc(),rr)});var lu=bt(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.fixParsedWebmDuration=void 0;var oI=su(),iI=(e,t,r={})=>{let n=r.logger;n===void 0?n=l=>console.debug(l):n||(n=()=>{});let o=e.getSectionById(139690087);if(!o)return n("[fix-webm-duration] Segment section is missing"),!1;let i=o.getSectionById(88713574);if(!i)return n("[fix-webm-duration] Info section is missing"),!1;let a=i.getSectionById(710577);if(!a)return n("[fix-webm-duration] TimecodeScale section is missing"),!1;let s=i.getSectionById(1161);if(s)if(s.getValue()<=0)n(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return n(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),!1;else n("[fix-webm-duration] Duration section is missing"),s=new oI.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),!0};Gs.fixParsedWebmDuration=iI});var qx=bt(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.fixWebmDuration=void 0;var aI=($i(),Xi(Oi)),sI=su(),lI=lu(),cI=(e,t,r)=>aI.__awaiter(void 0,void 0,void 0,function*(){try{let n=yield sI.WebmFile.fromBlob(e);if((0,lI.fixParsedWebmDuration)(n,t,r))return n.toBlob(e.type)}catch{}return e});Hs.fixWebmDuration=cI});var Kx=bt(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var Yx=($i(),Xi(Oi));Yx.__exportStar(qx(),js);Yx.__exportStar(lu(),js)});function B0(e){return Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=Object.assign({},o),id(o.value)&&!G0(o.value)&&!Array.isArray(o.value)&&(r[n].value=Object.assign({},o.value)),Array.isArray(o.value)&&(r[n].value=o.value.slice(0)),r},{})}function F0(e){return e?Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=id(o)&&"value"in o?o:{value:o},r[n].attribute||(r[n].attribute=z0(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function U0(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function V0(e,t){let r=B0(t);return Object.keys(t).forEach(o=>{let i=r[o],a=e.getAttribute(i.attribute),s=e[o];a!=null&&(i.value=i.parse?od(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&nd(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){let c=i.value;i.value=l,i.reflect&&nd(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),r}function od(e){if(e)try{return JSON.parse(e)}catch{return e}}function nd(e,t,r,n){if(r==null||r===!1)return e.removeAttribute(t);let o=n?JSON.stringify(r):r;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function z0(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function id(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function G0(e){return Object.prototype.toString.call(e)==="[object Function]"}function H0(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var dl;function j0(e,t){let r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let o of r)this[o]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=V0(this,t);let o=U0(this.props),i=this.Component,a=dl;try{dl=this,this.__initialized=!0,H0(i)?new i(o,{element:this}):i(o,{element:this})}finally{dl=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?od(a):a}}lookupProp(o){if(t)return r.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}var Q3=Symbol("element-context");function ad(e,t={},r={}){let{BaseElement:n=HTMLElement,extension:o,customElements:i=window.customElements}=r;return a=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=a,s):(s=j0(n,F0(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var Te={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return sd(this.context.count)},getNextContextId(){return sd(this.context.count++)}};function sd(e){let t=String(e),r=t.length-1;return Te.context.id+(r?String.fromCharCode(96+r):"")+t}function fl(e){Te.context=e}function W0(){return{...Te.context,id:Te.getNextContextId(),count:0}}var q0=!1,Y0=(e,t)=>e===t,jn=Symbol("solid-proxy"),md=typeof Proxy=="function",Uo=Symbol("solid-track"),tO=Symbol("solid-dev-component"),Ji={equals:Y0},ld=null,fd=yd,Dt=1,Bo=2,pd={owned:null,cleanups:null,context:null,owner:null};var ye=null,X=null,Vo=null,Hn=null,$e=null,Xe=null,ut=null,ta=0;function Mt(e,t){let r=$e,n=ye,o=e.length===0,i=t===void 0?n:t,a=o?pd:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>He(()=>Mr(a)));ye=a,$e=null;try{return ar(s,!0)}finally{$e=r,ye=n}}function O(e,t){t=t?Object.assign({},Ji,t):Ji;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(X&&X.running&&X.sources.has(r)?o=o(r.tValue):o=o(r.value)),bd(r,o));return[hd.bind(r),n]}function $(e,t,r){let n=yl(e,t,!1,Dt);Vo&&X&&X.running?Xe.push(n):zo(n)}function ve(e,t,r){fd=J0;let n=yl(e,t,!1,Dt),o=pl&&rn(pl);o&&(n.suspense=o),(!r||!r.render)&&(n.user=!0),ut?ut.push(n):zo(n)}function ee(e,t,r){r=r?Object.assign({},Ji,r):Ji;let n=yl(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Vo&&X&&X.running?(n.tState=Dt,Xe.push(n)):zo(n),hd.bind(n)}function He(e){if(!Hn&&$e===null)return e();let t=$e;$e=null;try{return Hn?Hn.untrack(e):e()}finally{$e=t}}function ae(e){ve(()=>He(e))}function re(e){return ye===null||(ye.cleanups===null?ye.cleanups=[e]:ye.cleanups.push(e)),e}function Wn(){return ye}function gd(e,t){let r=ye,n=$e;ye=e,$e=null;try{return ar(t,!0)}catch(o){na(o)}finally{ye=r,$e=n}}function K0(e){if(X&&X.running)return e(),X.done;let t=$e,r=ye;return Promise.resolve().then(()=>{$e=t,ye=r;let n;return(Vo||pl)&&(n=X||(X={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),n.done||(n.done=new Promise(o=>n.resolve=o)),n.running=!0),ar(e,!1),$e=ye=null,n?n.done:void 0})}var[rO,cd]=O(!1);function qn(e,t){let r=Symbol("context");return{id:r,Provider:ew(r),defaultValue:e}}function rn(e){let t;return ye&&ye.context&&(t=ye.context[e.id])!==void 0?t:e.defaultValue}function ra(e){let t=ee(e),r=ee(()=>gl(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var pl;function hd(){let e=X&&X.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Dt)zo(this);else{let t=Xe;Xe=null,ar(()=>Qi(this),!1),Xe=t}if($e){let t=this.observers?this.observers.length:0;$e.sources?($e.sources.push(this),$e.sourceSlots.push(t)):($e.sources=[this],$e.sourceSlots=[t]),this.observers?(this.observers.push($e),this.observerSlots.push($e.sources.length-1)):(this.observers=[$e],this.observerSlots=[$e.sources.length-1])}return e&&X.sources.has(this)?this.tValue:this.value}function bd(e,t,r){let n=X&&X.running&&X.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(n,t)){if(X){let o=X.running;(o||!r&&X.sources.has(e))&&(X.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&ar(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=X&&X.running;a&&X.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?Xe.push(i):ut.push(i),i.observers&&xd(i)),a?i.tState=Dt:i.state=Dt)}if(Xe.length>1e6)throw Xe=[],new Error},!1)}return t}function zo(e){if(!e.fn)return;Mr(e);let t=ta;ud(e,X&&X.running&&X.sources.has(e)?e.tValue:e.value,t),X&&!X.running&&X.sources.has(e)&&queueMicrotask(()=>{ar(()=>{X&&(X.running=!0),$e=ye=e,ud(e,e.tValue,t),$e=ye=null},!1)})}function ud(e,t,r){let n,o=ye,i=$e;$e=ye=e;try{n=e.fn(t)}catch(a){return e.pure&&(X&&X.running?(e.tState=Dt,e.tOwned&&e.tOwned.forEach(Mr),e.tOwned=void 0):(e.state=Dt,e.owned&&e.owned.forEach(Mr),e.owned=null)),e.updatedAt=r+1,na(a)}finally{$e=i,ye=o}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?bd(e,n,!0):X&&X.running&&e.pure?(X.sources.add(e),e.tValue=n):e.value=n,e.updatedAt=r)}function yl(e,t,r,n=Dt,o){let i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ye,context:ye?ye.context:null,pure:r};if(X&&X.running&&(i.state=0,i.tState=n),ye===null||ye!==pd&&(X&&X.running&&ye.pure?ye.tOwned?ye.tOwned.push(i):ye.tOwned=[i]:ye.owned?ye.owned.push(i):ye.owned=[i]),Hn&&i.fn){let[a,s]=O(void 0,{equals:!1}),l=Hn.factory(i.fn,s);re(()=>l.dispose());let c=()=>K0(s).then(()=>u.dispose()),u=Hn.factory(i.fn,c);i.fn=d=>(a(),X&&X.running?u.track(d):l.track(d))}return i}function Fo(e){let t=X&&X.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===Bo)return Qi(e);if(e.suspense&&He(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ta);){if(t&&X.disposed.has(e))return;(t?e.tState:e.state)&&r.push(e)}for(let n=r.length-1;n>=0;n--){if(e=r[n],t){let o=e,i=r[n+1];for(;(o=o.owner)&&o!==i;)if(X.disposed.has(o))return}if((t?e.tState:e.state)===Dt)zo(e);else if((t?e.tState:e.state)===Bo){let o=Xe;Xe=null,ar(()=>Qi(e,r[0]),!1),Xe=o}}}function ar(e,t){if(Xe)return e();let r=!1;t||(Xe=[]),ut?r=!0:ut=[],ta++;try{let n=e();return X0(r),n}catch(n){r||(ut=null),Xe=null,na(n)}}function X0(e){if(Xe&&(Vo&&X&&X.running?Z0(Xe):yd(Xe),Xe=null),e)return;let t;if(X){if(!X.promises.size&&!X.queue.size){let n=X.sources,o=X.disposed;ut.push.apply(ut,X.effects),t=X.resolve;for(let i of ut)"tState"in i&&(i.state=i.tState),delete i.tState;X=null,ar(()=>{for(let i of o)Mr(i);for(let i of n){if(i.value=i.tValue,i.owned)for(let a=0,s=i.owned.length;a<s;a++)Mr(i.owned[a]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}cd(!1)},!1)}else if(X.running){X.running=!1,X.effects.push.apply(X.effects,ut),ut=null,cd(!0);return}}let r=ut;ut=null,r.length&&ar(()=>fd(r),!1),t&&t()}function yd(e){for(let t=0;t<e.length;t++)Fo(e[t])}function Z0(e){for(let t=0;t<e.length;t++){let r=e[t],n=X.queue;n.has(r)||(n.add(r),Vo(()=>{n.delete(r),ar(()=>{X.running=!0,Fo(r)},!1),X&&(X.running=!1)}))}}function J0(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:Fo(n)}if(Te.context){if(Te.count){Te.effects||(Te.effects=[]),Te.effects.push(...e.slice(0,r));return}fl()}for(Te.effects&&(Te.done||!Te.count)&&(e=[...Te.effects,...e],r+=Te.effects.length,delete Te.effects),t=0;t<r;t++)Fo(e[t])}function Qi(e,t){let r=X&&X.running;r?e.tState=0:e.state=0;for(let n=0;n<e.sources.length;n+=1){let o=e.sources[n];if(o.sources){let i=r?o.tState:o.state;i===Dt?o!==t&&(!o.updatedAt||o.updatedAt<ta)&&Fo(o):i===Bo&&Qi(o,t)}}}function xd(e){let t=X&&X.running;for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(t?!n.tState:!n.state)&&(t?n.tState=Bo:n.state=Bo,n.pure?Xe.push(n):ut.push(n),n.observers&&xd(n))}}function Mr(e){let t;if(e.sources)for(;e.sources.length;){let r=e.sources.pop(),n=e.sourceSlots.pop(),o=r.observers;if(o&&o.length){let i=o.pop(),a=r.observerSlots.pop();n<o.length&&(i.sourceSlots[a]=n,o[n]=i,r.observerSlots[n]=a)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Mr(e.tOwned[t]);delete e.tOwned}if(X&&X.running&&e.pure)vd(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Mr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}X&&X.running?e.tState=0:e.state=0}function vd(e,t){if(t||(e.tState=0,X.disposed.add(e)),e.owned)for(let r=0;r<e.owned.length;r++)vd(e.owned[r])}function Q0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function dd(e,t,r){try{for(let n of t)n(e)}catch(n){na(n,r&&r.owner||null)}}function na(e,t=ye){let r=ld&&t&&t.context&&t.context[ld],n=Q0(e);if(!r)throw n;ut?ut.push({fn(){dd(n,r,t)},state:Dt}):dd(n,r,t)}function gl(e){if(typeof e=="function"&&!e.length)return gl(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=gl(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function ew(e,t){return function(n){let o;return $(()=>o=He(()=>(ye.context={...ye.context,[e]:n.value},ra(()=>n.children))),void 0),o}}var hl=Symbol("fallback");function ea(e){for(let t=0;t<e.length;t++)e[t]()}function wd(e,t,r={}){let n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return re(()=>ea(i)),()=>{let l=e()||[],c=l.length,u,d;return l[Uo],He(()=>{let f,x,h,w,T,b,y,g,k;if(c===0)a!==0&&(ea(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[hl],o[0]=Mt(S=>(i[0]=S,r.fallback())),a=1);else if(a===0){for(o=new Array(c),d=0;d<c;d++)n[d]=l[d],o[d]=Mt(p);a=c}else{for(h=new Array(c),w=new Array(c),s&&(T=new Array(c)),b=0,y=Math.min(a,c);b<y&&n[b]===l[b];b++);for(y=a-1,g=c-1;y>=b&&g>=b&&n[y]===l[g];y--,g--)h[g]=o[y],w[g]=i[y],s&&(T[g]=s[y]);for(f=new Map,x=new Array(g+1),d=g;d>=b;d--)k=l[d],u=f.get(k),x[d]=u===void 0?-1:u,f.set(k,d);for(u=b;u<=y;u++)k=n[u],d=f.get(k),d!==void 0&&d!==-1?(h[d]=o[u],w[d]=i[u],s&&(T[d]=s[u]),d=x[d],f.set(k,d)):i[u]();for(d=b;d<c;d++)d in h?(o[d]=h[d],i[d]=w[d],s&&(s[d]=T[d],s[d](d))):o[d]=Mt(p);o=o.slice(0,a=c),n=l.slice(0)}return o});function p(f){if(i[d]=f,s){let[x,h]=O(d);return s[d]=h,t(l[d],x)}return t(l[d])}}}function tw(e,t,r={}){let n=[],o=[],i=[],a=[],s=0,l;return re(()=>ea(i)),()=>{let c=e()||[],u=c.length;return c[Uo],He(()=>{if(u===0)return s!==0&&(ea(i),i=[],n=[],o=[],s=0,a=[]),r.fallback&&(n=[hl],o[0]=Mt(p=>(i[0]=p,r.fallback())),s=1),o;for(n[0]===hl&&(i[0](),i=[],n=[],o=[],s=0),l=0;l<u;l++)l<n.length&&n[l]!==c[l]?a[l](()=>c[l]):l>=n.length&&(o[l]=Mt(d));for(;l<n.length;l++)i[l]();return s=a.length=i.length=u,n=c.slice(0),o=o.slice(0,s)});function d(p){i[l]=p;let[f,x]=O(c[l]);return a[l]=x,t(f,l)}}}var rw=!1;function m(e,t){if(rw&&Te.context){let r=Te.context;fl(W0());let n=He(()=>e(t||{}));return fl(r),n}return He(()=>e(t||{}))}function Zi(){return!0}var bl={get(e,t,r){return t===jn?r:e.get(t)},has(e,t){return t===jn?!0:e.has(t)},set:Zi,deleteProperty:Zi,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Zi,deleteProperty:Zi}},ownKeys(e){return e.keys()}};function ml(e){return(e=typeof e=="function"?e():e)?e:{}}function nw(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function ce(...e){let t=!1;for(let a=0;a<e.length;a++){let s=e[a];t=t||!!s&&jn in s,e[a]=typeof s=="function"?(t=!0,ee(s)):s}if(md&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let l=ml(e[s])[a];if(l!==void 0)return l}},has(a){for(let s=e.length-1;s>=0;s--)if(a in ml(e[s]))return!0;return!1},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(ml(e[s])));return[...new Set(a)]}},bl);let r={},n=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){let u=l[c];if(u==="__proto__"||u==="constructor")continue;let d=Object.getOwnPropertyDescriptor(s,u);if(!n[u])n[u]=d.get?{enumerable:!0,configurable:!0,get:nw.bind(r[u]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{let p=r[u];p&&(d.get?p.push(d.get.bind(s)):d.value!==void 0&&p.push(()=>d.value))}}}let o={},i=Object.keys(n);for(let a=i.length-1;a>=0;a--){let s=i[a],l=n[s];l&&l.get?Object.defineProperty(o,s,l):o[s]=l?l.value:void 0}return o}function De(e,...t){if(md&&jn in e){let o=new Set(t.length>1?t.flat():t[0]),i=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},bl));return i.push(new Proxy({get(a){return o.has(a)?void 0:e[a]},has(a){return o.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!o.has(a))}},bl)),i}let r={},n=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=!1,l=0;for(let c of t)c.includes(o)&&(s=!0,a?n[l][o]=i.value:Object.defineProperty(n[l],o,i)),++l;s||(a?r[o]=i.value:Object.defineProperty(r,o,i))}return[...n,r]}var ow=0;function We(){return Te.context?Te.getNextContextId():`cl-${ow++}`}var kd=e=>`Stale read from <${e}>.`;function we(e){let t="fallback"in e&&{fallback:()=>e.fallback};return ee(wd(()=>e.each,e.children,t||void 0))}function Go(e){let t="fallback"in e&&{fallback:()=>e.fallback};return ee(tw(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,r=ee(()=>e.when,void 0,void 0),n=t?r:ee(r,void 0,{equals:(o,i)=>!o==!i});return ee(()=>{let o=n();if(o){let i=e.children;return typeof i=="function"&&i.length>0?He(()=>i(t?o:()=>{if(!He(n))throw kd("Show");return r()})):i}return e.fallback},void 0,void 0)}function Ie(e){let t=ra(()=>e.children),r=ee(()=>{let n=t(),o=Array.isArray(n)?n:[n],i=()=>{};for(let a=0;a<o.length;a++){let s=a,l=o[a],c=i,u=ee(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:ee(u,void 0,{equals:(p,f)=>!p==!f});i=()=>c()||(d()?[s,u,l]:void 0)}return i});return ee(()=>{let n=r()();if(!n)return e.fallback;let[o,i,a]=n,s=a.children;return typeof s=="function"&&s.length>0?He(()=>s(a.keyed?i():()=>{if(He(r)()?.[0]!==o)throw kd("Match");return i()})):s},void 0,void 0)}function Z(e){return e}var iw=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],aw=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...iw]),sw=new Set(["innerHTML","textContent","innerText","children"]),lw=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),cw=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function uw(e,t){let r=cw[e];return typeof r=="object"?r[t]?r.$:void 0:r}var dw=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),mw=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),fw={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};var L=e=>ee(()=>e());function pw(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;){if(t[a]===r[s]){a++,s++;continue}for(;t[o-1]===r[i-1];)o--,i--;if(o===a){let u=i<n?s?r[s-1].nextSibling:r[i-s]:l;for(;s<i;)e.insertBefore(r[s++],u)}else if(i===s)for(;a<o;)(!c||!c.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[i-1]&&r[s]===t[o-1]){let u=t[--o].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--i],u),t[o]=r[i]}else{if(!c){c=new Map;let d=s;for(;d<i;)c.set(r[d],d++)}let u=c.get(t[a]);if(u!=null)if(s<u&&u<i){let d=a,p=1,f;for(;++d<o&&d<i&&!((f=c.get(t[d]))==null||f!==u+p);)p++;if(p>u-s){let x=t[a];for(;s<u;)e.insertBefore(r[s++],x)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Cd="_$DX_DELEGATE";function C(e,t,r,n){let o,i=()=>{let s=n?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,r?s.content.firstChild.firstChild:n?s.firstChild:s.content.firstChild},a=t?()=>He(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return a.cloneNode=a,a}function Se(e,t=window.document){let r=t[Cd]||(t[Cd]=new Set);for(let n=0,o=e.length;n<o;n++){let i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,ww))}}function G(e,t,r){nn(e)||(r==null?e.removeAttribute(t):e.setAttribute(t,r))}function gw(e,t,r,n){nn(e)||(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n))}function hw(e,t,r){nn(e)||(r?e.setAttribute(t,""):e.removeAttribute(t))}function V(e,t){nn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Be(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){let o=r[0];e.addEventListener(t,r[0]=i=>o.call(e,r[1],i))}else e.addEventListener(t,r,typeof r!="function"&&r)}function bw(e,t,r={}){let n=Object.keys(t||{}),o=Object.keys(r),i,a;for(i=0,a=o.length;i<a;i++){let s=o[i];!s||s==="undefined"||t[s]||(Td(e,s,!1),delete r[s])}for(i=0,a=n.length;i<a;i++){let s=n[i],l=!!t[s];!s||s==="undefined"||r[s]===l||!l||(Td(e,s,!0),r[s]=l)}return r}function Ho(e,t,r){if(!t)return r?G(e,"style"):t;let n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let o,i;for(i in r)t[i]==null&&n.removeProperty(i),delete r[i];for(i in t)o=t[i],o!==r[i]&&(n.setProperty(i,o),r[i]=o);return r}function ne(e,t,r){r!=null?e.style.setProperty(t,r):e.style.removeProperty(t)}function be(e,t={},r,n){let o={};return n||$(()=>o.children=Kn(e,t.children,o.children)),$(()=>typeof t.ref=="function"&&ge(t.ref,e)),$(()=>yw(e,t,r,!0,o,!0)),o}function ge(e,t,r){return He(()=>e(t,r))}function v(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return Kn(e,t,n,r);$(o=>Kn(e,t(),o,r),n)}function yw(e,t,r,n,o={},i=!1){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=Sd(e,a,null,o[a],r,i,t)}for(let a in t){if(a==="children"){n||Kn(e,t.children);continue}let s=t[a];o[a]=Sd(e,a,s,o[a],r,i,t)}}function xw(e){let t,r;return!nn()||!(t=Te.registry.get(r=kw()))?e():(Te.completed&&Te.completed.add(t),Te.registry.delete(r),t)}function nn(e){return!!Te.context&&!Te.done&&(!e||e.isConnected)}function vw(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Td(e,t,r){let n=t.trim().split(/\s+/);for(let o=0,i=n.length;o<i;o++)e.classList.toggle(n[o],r)}function Sd(e,t,r,n,o,i,a){let s,l,c,u,d;if(t==="style")return Ho(e,r,n);if(t==="classList")return bw(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let p=t.slice(3);n&&e.removeEventListener(p,n,typeof n!="function"&&n),r&&e.addEventListener(p,r,typeof r!="function"&&r)}else if(t.slice(0,10)==="oncapture:"){let p=t.slice(10);n&&e.removeEventListener(p,n,!0),r&&e.addEventListener(p,r,!0)}else if(t.slice(0,2)==="on"){let p=t.slice(2).toLowerCase(),f=dw.has(p);if(!f&&n){let x=Array.isArray(n)?n[0]:n;e.removeEventListener(p,x)}(f||r)&&(Be(e,p,r,f),f&&Se([p]))}else if(t.slice(0,5)==="attr:")G(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")hw(e,t.slice(5),r);else if((d=t.slice(0,5)==="prop:")||(c=sw.has(t))||!o&&((u=uw(t,e.tagName))||(l=aw.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(d)t=t.slice(5),l=!0;else if(nn(e))return r;t==="class"||t==="className"?V(e,r):s&&!l&&!c?e[vw(t)]=r:e[u||t]=r}else{let p=o&&t.indexOf(":")>-1&&fw[t.split(":")[0]];p?gw(e,p,t,r):G(e,lw[t]||t,r)}return r}function ww(e){if(Te.registry&&Te.events&&Te.events.find(([l,c])=>c===e))return;let t=e.target,r=`$$${e.type}`,n=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),a=()=>{let l=t[r];if(l&&!t.disabled){let c=t[`${r}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Te.registry&&!Te.done&&(Te.done=_$HY.done=!0),e.composedPath){let l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!a());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(n)}function Kn(e,t,r,n,o){let i=nn(e);if(i){!r&&(r=[...e.childNodes]);let l=[];for(let c=0;c<r.length;c++){let u=r[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}r=l}for(;typeof r=="function";)r=r();if(t===r)return r;let a=typeof t,s=n!==void 0;if(e=s&&r[0]&&r[0].parentNode||e,a==="string"||a==="number"){if(i||a==="number"&&(t=t.toString(),t===r))return r;if(s){let l=r[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),r=Yn(e,r,n,l)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||a==="boolean"){if(i)return r;r=Yn(e,r,n)}else{if(a==="function")return $(()=>{let l=t();for(;typeof l=="function";)l=l();r=Kn(e,l,r,n)}),()=>r;if(Array.isArray(t)){let l=[],c=r&&Array.isArray(r);if(xl(l,t,r,o))return $(()=>r=Kn(e,l,r,n,!0)),()=>r;if(i){if(!l.length)return r;if(n===void 0)return r=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return r;let d=[u];for(;(u=u.nextSibling)!==n;)d.push(u);return r=d}if(l.length===0){if(r=Yn(e,r,n),s)return r}else c?r.length===0?Ed(e,l,n):pw(e,r,l):(r&&Yn(e),Ed(e,l));r=l}else if(t.nodeType){if(i&&t.parentNode)return r=s?[t]:t;if(Array.isArray(r)){if(s)return r=Yn(e,r,n,t);Yn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function xl(e,t,r,n){let o=!1;for(let i=0,a=t.length;i<a;i++){let s=t[i],l=r&&r[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=xl(e,s,l)||o;else if(c==="function")if(n){for(;typeof s=="function";)s=s();o=xl(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{let u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function Ed(e,t,r=null){for(let n=0,o=t.length;n<o;n++)e.insertBefore(t[n],r)}function Yn(e,t,r,n){if(r===void 0)return e.textContent="";let o=n||document.createTextNode("");if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let s=t[a];if(o!==s){let l=s.parentNode===e;!i&&!a?l?e.replaceChild(o,s):e.insertBefore(o,r):l&&s.remove()}else i=!0}}else e.insertBefore(o,r);return[o]}function kw(){return Te.getNextContextId()}var cO=Symbol();var Pd=!1;var Cw="http://www.w3.org/2000/svg";function _d(e,t=!1,r=void 0){return t?document.createElementNS(Cw,e):document.createElement(e,{is:r})}function oa(e){let{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,o=Wn(),i,a=!!Te.context;return ve(()=>{a&&(Wn().user=a=!1),i||(i=gd(o,()=>ee(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[l,c]=O(!1),u=()=>c(!0);Mt(d=>v(s,()=>l()?d():i(),null)),re(u)}else{let l=_d(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:!0}),v(c,i),s.appendChild(l),e.ref&&e.ref(l),re(()=>s.removeChild(l))}},void 0,{render:!a}),r}function Tw(e,t){let r=ee(e);return ee(()=>{let n=r();switch(typeof n){case"function":return He(()=>n(t));case"string":let o=mw.has(n),i=Te.context?xw():_d(n,o,He(()=>t.is));return be(i,t,o),i}})}function Id(e){let[,t]=De(e,["component"]);return Tw(()=>e.component,t)}function Sw(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[o,i]=O(e[t[n]]);Object.defineProperty(r,t[n],{get:o,set(a){i(()=>a)}})}return r}function Ew(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Pw(e){return(t,r)=>{let{element:n}=r;return Mt(o=>{let i=Sw(t);n.addPropertyChangedCallback((s,l)=>i[s]=l),n.addReleaseCallback(()=>{n.renderRoot.textContent="",o()});let a=e(i,r);return v(n.renderRoot,a)},Ew(n))}}function ia(e,t,r){return arguments.length===2&&(r=t,t={}),ad(e,t)(Pw(r))}var aa={makebot:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,wsHost:void 0,resultId:void 0,sessionId:void 0},Ad={...aa,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Rd={...aa,isOpen:void 0,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0,inlineStyle:void 0},jo={xs:440,sm:640,md:768,lg:1024,xl:1280};var vl=qn(()=>{}),sa=()=>rn(vl);var Od=e=>{sessionStorage.setItem("makebotPaymentInProgress",JSON.stringify(e))},Xn=()=>sessionStorage.getItem("makebotPaymentInProgress"),la=()=>{sessionStorage.removeItem("makebotPaymentInProgress")};var Wt=(e,t)=>{if(typeof window<"u")return window.__ENV?window.__ENV[e]??t:void 0;if(typeof process>"u")return;let r=process.env[e];return r===""?t:r??t};var _w="https://makebot.it",dt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{let t=Wt("NEXT_PUBLIC_CHAT_API_URL"),r=Wt("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(i=>i===window.location.href)))return t;let n=Wt("NEXT_PUBLIC_VIEWER_URL")?.split(",");return n?.find(i=>window.location.href.startsWith(i))??n?.[0]??_w};var $d=async e=>{let t;try{let r=typeof e=="string"?e:e.url;t=await fetch(r,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&de(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&de(e.body)?JSON.stringify(e.body):void 0});let n=await t.json();if(!t.ok)throw"error"in n?n.error:n;return{data:n,response:t}}catch(r){return console.error(r),{error:r,response:t}}},de=e=>e!=null,Ze=e=>e==null,Ue=e=>e==null||e==="",pe=e=>e!=null&&e!=="";var Nd=e=>{e.split("</noscript>").forEach(r=>{let[n,o]=r.split("<noscript>"),i=document.createRange().createContextualFragment(n??"");if(document.head.append(i),Ze(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a)})};var qt=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var sr=class extends Error{response;request;options;constructor(t,r,n){let o=t.status||t.status===0?t.status:"",i=t.statusText??"",a=`${o} ${i}`.trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var Zn=class extends Error{name="NonError";value;constructor(t){let r="Non-error value was thrown";try{typeof t=="string"?r=t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"&&(r=t.message)}catch{}super(r),this.value=t}};var Jn=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){let r=t?.cause?t.cause instanceof Error?t.cause:new Zn(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",r?{cause:r}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}};var wl=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return e&&!t})(),Md=typeof globalThis.AbortController=="function",ca=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Dd=typeof globalThis.ReadableStream=="function",Ld=typeof globalThis.FormData=="function",ua=["get","post","put","patch","head","delete"],Iw=()=>{};Iw();var Bd={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},da=2147483647,Fd=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,ma=Symbol("stop"),Wo=class{options;constructor(t){this.options=t}},Ud=e=>new Wo(e),Vd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},zd={next:!0},Gd={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var Aw=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=Fd,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Hd=(e,t,r)=>{let n,o=0;return e.pipeThrough(new TransformStream({transform(i,a){if(a.enqueue(i),n){o+=n.byteLength;let s=t===0?0:o/t;s>=1&&(s=1-Number.EPSILON),r?.({percent:s,totalBytes:Math.max(t,o),transferredBytes:o},n)}n=i},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},n))}}))},jd=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Hd(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},Wd=(e,t,r)=>{if(!e.body)return e;let n=Aw(r??e.body);return new Request(e,{duplex:"half",body:Hd(e.body,n,t)})};var Dr=e=>e!==null&&typeof e=="object";var qo=(...e)=>{for(let t of e)if((!Dr(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Tl({},...e)},kl=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[i,a]of o.entries())n&&a==="undefined"||a===void 0?r.delete(i):r.set(i,a);return r};function fa(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Tl(e[r]??[],t[r]??[])}var Cl=(e={},t={})=>({beforeRequest:fa(e,t,"beforeRequest"),beforeRetry:fa(e,t,"beforeRetry"),afterResponse:fa(e,t,"afterResponse"),beforeError:fa(e,t,"beforeError")}),Rw=(e,t)=>{let r=new URLSearchParams;for(let n of[e,t])if(n!==void 0)if(n instanceof URLSearchParams)for(let[o,i]of n.entries())r.append(o,i);else if(Array.isArray(n))for(let o of n){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(o[0]),String(o[1]))}else if(Dr(n))for(let[o,i]of Object.entries(n))i!==void 0&&r.append(o,String(i));else{let o=new URLSearchParams(n);for(let[i,a]of o.entries())r.append(i,a)}return r},Tl=(...e)=>{let t={},r={},n={},o,i=[];for(let a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(Dr(a)){for(let[s,l]of Object.entries(a)){if(s==="signal"&&l instanceof globalThis.AbortSignal){i.push(l);continue}if(s==="context"){if(l!=null&&(!Dr(l)||Array.isArray(l)))throw new TypeError("The `context` option must be an object");t={...t,context:l==null?{}:{...t.context,...l}};continue}if(s==="searchParams"){l==null?o=void 0:o=o===void 0?l:Rw(o,l);continue}Dr(l)&&s in t&&(l=Tl(t[s],l)),t={...t,[s]:l}}Dr(a.hooks)&&(n=Cl(n,a.hooks),t.hooks=n),Dr(a.headers)&&(r=kl(r,a.headers),t.headers=r)}return o!==void 0&&(t.searchParams=o),i.length>0&&(i.length===1?t.signal=i[0]:ca?t.signal=AbortSignal.any(i):t.signal=i.at(-1)),t};var Yd=e=>ua.includes(e)?e.toUpperCase():e,Ow=["get","put","head","delete","options","trace"],$w=[408,413,429,500,502,503,504],Nw=[413,429,503],qd={limit:2,methods:Ow,statusCodes:$w,afterStatusCodes:Nw,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Kd=(e={})=>{if(typeof e=="number")return{...qd,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(r=>r.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");let t=Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));return{...qd,...t}};var on=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};async function Sl(e,t,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{r&&r.abort(),i(new on(e))},n.timeout);n.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a)})})}async function El(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(i),n(t.reason)}let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}var Xd=(e,t)=>{let r={};for(let n in t)Object.hasOwn(t,n)&&!(n in Gd)&&!(n in Vd)&&(!(n in e)||n in zd)&&(r[n]=t[n]);return r},Zd=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function Jd(e){return e instanceof sr||e?.name===sr.name}function Qd(e){return e instanceof on||e?.name===on.name}var Yo=class e{static create(t,r){let n=new e(t,r),o=async()=>{if(typeof n.#e.timeout=="number"&&n.#e.timeout>da)throw new RangeError(`The \`timeout\` option cannot be greater than ${da}`);await Promise.resolve();let a=await n.#b();for(let s of n.#e.hooks.afterResponse){let l=n.#f(a.clone()),c;try{c=await s(n.request,n.#c(),l,{retryCount:n.#n})}catch(d){throw n.#i(l),n.#i(a),d}if(c instanceof Wo)throw n.#i(l),n.#i(a),new Jn(c.options);let u=c instanceof globalThis.Response?c:a;l!==u&&n.#i(l),a!==u&&n.#i(a),a=u}if(n.#f(a),!a.ok&&(typeof n.#e.throwHttpErrors=="function"?n.#e.throwHttpErrors(a.status):n.#e.throwHttpErrors)){let s=new sr(a,n.request,n.#c());for(let l of n.#e.hooks.beforeError)s=await l(s,{retryCount:n.#n});throw s}if(n.#e.onDownloadProgress){if(typeof n.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Dd)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let s=a.clone();return n.#i(a),jd(s,n.#e.onDownloadProgress)}return a},i=n.#p(o).finally(()=>{let a=n.#a;n.#d(a?.body??void 0),n.#d(n.request.body??void 0)});for(let[a,s]of Object.entries(Bd))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||s);let l=await i;if(a==="json"){if(l.status===204)return"";let c=await l.text();return c===""?"":r.parseJson?r.parseJson(c):JSON.parse(c)}return l[a]()});return i}static#s(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;#r;#n=0;#t;#e;#a;#o;#l;constructor(t,r={}){if(this.#t=t,this.#e={...r,headers:kl(this.#t.headers,r.headers),hooks:Cl({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Yd(r.method??this.#t.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Kd(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Md&&ca&&(this.#o=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#r.signal]):this.#r.signal),wl&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(Ld&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),Zd(this.#e.searchParams)){let i="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(e.#s(this.#e.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);this.request=new globalThis.Request(a,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!wl)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#u(){let t=this.#e.retry.delay(this.#n),r=t;this.#e.retry.jitter===!0?r=Math.random()*t:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(t),(!Number.isFinite(r)||r<0)&&(r=t));let n=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(n,r)}async#h(t){if(this.#n++,this.#n>this.#e.retry.limit)throw t;let r=t instanceof Error?t:new Zn(t);if(r instanceof Jn)return r.customDelay??this.#u();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(this.#e.retry.shouldRetry!==void 0){let n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#n});if(n===!1)throw t;if(n===!0)return this.#u()}if(Qd(t)&&!this.#e.retry.retryOnTimeout)throw t;if(Jd(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;let n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let o=Number(n)*1e3;Number.isNaN(o)?o=Date.parse(n)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let i=this.#e.retry.maxRetryAfter??o;return o<i?o:i}if(t.response.status===413)throw t}return this.#u()}#f(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#d(t){t&&t.cancel().catch(()=>{})}#i(t){this.#d(t.body??void 0)}async#p(t){try{return await t()}catch(r){let n=Math.min(await this.#h(r),da);if(this.#n<1)throw r;if(await El(n,this.#o?{signal:this.#o}:{}),r instanceof Jn&&r.customRequest){let o=this.#e.signal?new globalThis.Request(r.customRequest,{signal:this.#e.signal}):new globalThis.Request(r.customRequest);this.#m(o)}for(let o of this.#e.hooks.beforeRetry){let i=await o({request:this.request,options:this.#c(),error:r,retryCount:this.#n});if(i instanceof globalThis.Request){this.#m(i);break}if(i instanceof globalThis.Response)return i;if(i===ma)return}return this.#p(t)}}async#b(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let r of this.#e.hooks.beforeRequest){let n=await r(this.request,this.#c(),{retryCount:this.#n});if(n instanceof Response)return n;if(n instanceof globalThis.Request){this.#m(n);break}}let t=Xd(this.request,this.#e);return this.#a=this.request,this.request=this.#a.clone(),this.#e.timeout===!1?this.#e.fetch(this.#a,t):Sl(this.#a,t,this.#r,this.#e)}#c(){if(!this.#l){let{hooks:t,...r}=this.#e;this.#l=Object.freeze(r)}return this.#l}#m(t){this.#l=void 0,this.request=this.#g(t)}#g(t,r){return!this.#e.onUploadProgress||!t.body?t:Wd(t,this.#e.onUploadProgress,r??this.#e.body??void 0)}};var Pl=e=>{let t=(r,n)=>Yo.create(r,qo(e,n));for(let r of ua)t[r]=(n,o)=>Yo.create(n,qo(e,o,{method:r}));return t.create=r=>Pl(qo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Pl(qo(e,r))),t.stop=ma,t.retry=Ud,t},Mw=Pl(),Lr=Mw;async function em({makebot:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(Ze(e))throw new Error("Makebot ID is required to get initial messages");let l=Xn()??void 0,c=l?JSON.parse(l):void 0;if(c)return Dw({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:c});let u=typeof e=="string"?e:e.id;if(t)return Lw({apiHost:r,makebotId:u,startFrom:a,makebot:e,prefilledVariables:n,sessionId:s});try{let d=parent!==window&&pe(document.referrer)?new URL(document.referrer).origin:void 0;return{data:await(await Lr.post(`${_l(r)}/api/v1/makebots/${u}/startChat`,{headers:{"x-makebot-iframe-referrer-origin":d},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:o,isOnlyRegistering:!1},timeout:!1})).json()}}catch(d){return{error:d}}}var Dw=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{la();try{return{data:{...await Lr.post(`${_l(e)}/api/v1/sessions/${r.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return{error:n}}},Lw=async({apiHost:e,makebotId:t,startFrom:r,makebot:n,prefilledVariables:o,sessionId:i})=>{try{return{data:await Lr.post(`${_l(e)}/api/v1/makebots/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:r,makebot:n,prefilledVariables:o,sessionId:i},timeout:!1}).json()}}catch(a){return{error:a}}},_l=e=>pe(e)?e:dt();var pa=class extends Error{constructor(t){super("Este bot s\xF3 pode ser executado em "+t)}};var Ko=(e,t)=>({...e,general:e.general?{...e.general,background:e.general.background?{...e.general.background,content:t?.backgroundUrl??e.general.background?.content}:void 0}:void 0,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}});var Ne={blue:{light:{1:"#fcfdfe",2:"#f6f9ff",3:"#ebf2ff",4:"#ddeaff",5:"#ccdfff",6:"#b7d2ff",7:"#a0bfff",8:"#7fa5fd",9:"#3566fc",10:"#2f5be1",11:"#2c57dd",12:"#172c65"},dark:{1:"#070d1a",2:"#0f1627",3:"#12234e",4:"#162c6a",5:"#1d377e",6:"#25428f",7:"#2e4ea4",8:"#365bc1",9:"#3566fc",10:"#2a57ec",11:"#8db4ff",12:"#d1e2ff"}},orange:{light:{1:"#fefcfb",2:"#fff4f0",3:"#ffe8de",4:"#ffd6c7",5:"#ffc8b5",6:"#ffb8a0",7:"#ffa286",8:"#f98868",9:"#ff5924",10:"#f24905",11:"#dc3b00",12:"#5b2a1c"},dark:{1:"#120b09",2:"#1f1411",3:"#371810",4:"#4e1606",5:"#5e1e0b",6:"#6e2c18",7:"#873c26",8:"#ad4d31",9:"#ff5924",10:"#f14b0f",11:"#ff9776",12:"#ffd7ca"}},green:{light:{1:"#fbfefc",2:"#f2fcf5",3:"#e9f9ee",4:"#ddf3e4",5:"#ccebd7",6:"#b4dfc4",7:"#92ceac",8:"#5bb98c",9:"#30a46c",10:"#299764",11:"#18794e",12:"#153226"},dark:{1:"#0d1912",2:"#0c1f17",3:"#0f291e",4:"#113123",5:"#133929",6:"#164430",7:"#1b543a",8:"#236e4a",9:"#30a46c",10:"#3cb179",11:"#4cc38a",12:"#e5fbeb"}},purple:{light:{1:"#fcfcff",2:"#f9f8ff",3:"#f2f0ff",4:"#e7e4ff",5:"#ddd8ff",6:"#d0c9ff",7:"#bdb3ff",8:"#a595ff",9:"#8055fd",10:"#7447ec",11:"#6841d3",12:"#321e6c"},dark:{1:"#0d0a1b",2:"#17132a",3:"#261b4f",4:"#321d6c",5:"#3b257c",6:"#46318b",7:"#543ea2",8:"#684cc7",9:"#8055fd",10:"#7446ee",11:"#b4a6ff",12:"#e0dcff"}},red:{light:{1:"#fffcfc",2:"#fff7f6",3:"#ffebe9",4:"#ffdad6",5:"#ffcbc6",6:"#ffbab5",7:"#fca5a0",8:"#f48984",9:"#f83b45",10:"#ea2638",11:"#d8062a",12:"#6a0d14"},dark:{1:"#130a0a",2:"#201211",3:"#3e0e0f",4:"#55050c",5:"#670b13",6:"#791b1f",7:"#932b2d",8:"#be3a3c",9:"#f83b45",10:"#e92939",11:"#ff8f89",12:"#ffd0cb"}},gray:{light:{1:"#ffffff",2:"#f1f1f1",3:"#f0f0f0",4:"#e8e8e8",5:"#e0e0e0",6:"#dfdfdf",7:"#cecece",8:"#bbbbbb",9:"#8d8d8d",10:"#838383",11:"#464646",12:"#202020"},dark:{1:"#0D0D0D",2:"#1D1D1D",3:"#222222",4:"#2a2a2a",5:"#313131",6:"#3a3a3a",7:"#484848",8:"#606060",9:"#6e6e6e",10:"#7b7b7b",11:"#b4b4b4",12:"#eeeeee"}}};var tm="Google",Qn="Open Sans",eo="Color",rm={6:"#FFFFFF","6.1":Ne.gray.light[2]};var nm={6:"#e0edff","6.1":Ne.green.light[9]},om={6:Ne.gray.light[3],"6.1":Ne.gray.light[9]},im=4,ga="absolute",am="Top",an="medium",yt=1,Il=0,sm="800px",lm="100%",sn="transparent";var cm={6:"#F7F8FF","6.1":Ne.gray.light[1]},um=Ne.gray.light[12],dm={6:0,"6.1":1},mm=Ne.gray.light[6],fm={6:"#FF8E21","6.1":Ne.green.light[9]},pm=Ne.gray.light[1],gm={6:0,"6.1":1},hm=Ne.green.light[6],ha={6:"#0042DA","6.1":Ne.green.light[9]},bm=Ne.gray.light[1],ym={6:0,"6.1":1},xm=Ne.green.light[8];var vm="#FFFFFF",wm=Ne.gray.light[12],km="#9095A0",Cm={6:0,"6.1":1},Tm={6:void 0,"6.1":Ne.gray.light[7]},Sm={6:"md","6.1":void 0},yr=!0,Xo=!1,Em="wrap",te={general:{bgImage:"--makebot-container-bg-image",bgColor:"--makebot-container-bg-color",fontFamily:"--makebot-container-font-family",progressBar:{position:"--makebot-progress-bar-position",color:"--makebot-progress-bar-color",colorRgb:"--makebot-progress-bar-bg-rgb",height:"--makebot-progress-bar-height",top:"--makebot-progress-bar-top",bottom:"--makebot-progress-bar-bottom"}},chat:{container:{maxWidth:"--makebot-chat-container-max-width",maxHeight:"--makebot-chat-container-max-height",bgColor:"--makebot-chat-container-bg-rgb",color:"--makebot-chat-container-color",borderRadius:"--makebot-chat-container-border-radius",borderWidth:"--makebot-chat-container-border-width",borderColor:"--makebot-chat-container-border-rgb",borderOpacity:"--makebot-chat-container-border-opacity",opacity:"--makebot-chat-container-opacity",blur:"--makebot-chat-container-blur",boxShadow:"--makebot-chat-container-box-shadow"},hostBubbles:{bgColor:"--makebot-host-bubble-bg-rgb",color:"--makebot-host-bubble-color",borderRadius:"--makebot-host-bubble-border-radius",borderWidth:"--makebot-host-bubble-border-width",borderColor:"--makebot-host-bubble-border-rgb",borderOpacity:"--makebot-host-bubble-border-opacity",opacity:"--makebot-host-bubble-opacity",blur:"--makebot-host-bubble-blur",boxShadow:"--makebot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--makebot-guest-bubble-bg-rgb",color:"--makebot-guest-bubble-color",borderRadius:"--makebot-guest-bubble-border-radius",borderWidth:"--makebot-guest-bubble-border-width",borderColor:"--makebot-guest-bubble-border-rgb",borderOpacity:"--makebot-guest-bubble-border-opacity",opacity:"--makebot-guest-bubble-opacity",blur:"--makebot-guest-bubble-blur",boxShadow:"--makebot-guest-bubble-box-shadow"},inputs:{bgColor:"--makebot-input-bg-rgb",color:"--makebot-input-color",placeholderColor:"--makebot-input-placeholder-color",borderRadius:"--makebot-input-border-radius",borderWidth:"--makebot-input-border-width",borderColor:"--makebot-input-border-rgb",borderOpacity:"--makebot-input-border-opacity",opacity:"--makebot-input-opacity",blur:"--makebot-input-blur",boxShadow:"--makebot-input-box-shadow"},buttons:{bgRgb:"--makebot-button-bg-rgb",color:"--makebot-button-color",borderRadius:"--makebot-button-border-radius",borderWidth:"--makebot-button-border-width",borderColor:"--makebot-button-border-rgb",borderOpacity:"--makebot-button-border-opacity",opacity:"--makebot-button-opacity",blur:"--makebot-button-blur",boxShadow:"--makebot-button-box-shadow",flexDirection:"--makebot-buttons-input-flex-direction"},checkbox:{bgRgb:"--makebot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},Pm="#F7F8FF",_m="#303235",Im="#F7F8FF",Am="#303235";var Bw="https://fonts.bunny.net/css2",ba="makebot-font",Al=e=>{let t=document.getElementById(ba);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??Qn;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${Bw}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=ba,document.head.appendChild(n);return}if(e.type==="Custom"){if(pe(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=ba,document.head.appendChild(r)}if(pe(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let r=document.createElement("link");r.href=e.url,r.rel="stylesheet",r.id=ba,document.head.appendChild(r)}}};var at={general:{isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},typingEmulation:{enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},metadata:{description:"Crie formul\xE1rios de conversa\xE7\xE3o atraentes e incorpore-os diretamente aos seus aplicativos, sem uma linha de c\xF3digo. Triplique sua taxa de resposta e colete respostas com mais valor em compara\xE7\xE3o com um formul\xE1rio tradicional.",favIconUrl:e=>e+"/favicon.svg",imageUrl:e=>e+"/site-preview.png"}},Lt={invalidMessage:"Mensagem inv\xE1lida. Tente novamente.",botClosed:"Este bot est\xE1 fechado agora",networkErrorTitle:"Erro de rede",networkErrorMessage:"Verifique sua conex\xE3o com a internet e tente novamente.",popupBlockedTitle:"Pop-up bloqueado",popupBlockedDescription:"O bot quer abrir uma nova aba, mas foi bloqueado pelo seu navegador. \xC9 necess\xE1ria uma aprova\xE7\xE3o manual.",popupBlockedButtonLabel:"Continuar em nova aba",fileUploadError:"Ocorreu um erro ao carregar os arquivos",fileUploadSizeError:"[[file]] \xE9 maior que [[limit]]MB",whatsAppPictureChoiceSelectLabel:"Selecione",sessionFinalized:"Sess\xE3o finalizada pelo administrador."};var Fw=Symbol("store-raw"),Uw=Symbol("store-node"),to=Symbol("store-has"),Vw=Symbol("store-self");function Zo(e){let t;return e!=null&&typeof e=="object"&&(e[jn]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rl(e,t=new Set){let r,n,o,i;if(r=e!=null&&e[Fw])return r;if(!Zo(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)o=e[a],(n=Rl(o,t))!==o&&(e[a]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=a.length;l<c;l++)i=a[l],!s[i].get&&(o=e[i],(n=Rl(o,t))!==o&&(e[i]=n))}return e}function zw(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Rm(e,t,r){if(e[t])return e[t];let[n,o]=O(r,{equals:!1,internal:!0});return n.$=o,e[t]=n}function Br(e,t,r,n=!1){if(!n&&e[t]===r)return;let o=e[t],i=e.length;r===void 0?(delete e[t],e[to]&&e[to][t]&&o!==void 0&&e[to][t].$()):(e[t]=r,e[to]&&e[to][t]&&o===void 0&&e[to][t].$());let a=zw(e,Uw),s;if((s=Rm(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(s=a[l])&&s.$();(s=Rm(a,"length",i))&&s.$(e.length)}(s=a[Vw])&&s.$()}var Ol=Symbol("store-root");function ro(e,t,r,n,o){let i=t[r];if(e===i)return;let a=Array.isArray(e);if(r!==Ol&&(!Zo(e)||!Zo(i)||a!==Array.isArray(i)||o&&e[o]!==i[o])){Br(t,r,e);return}if(a){if(e.length&&i.length&&(!n||o&&e[0]&&e[0][o]!=null)){let c,u,d,p,f,x,h,w;for(d=0,p=Math.min(i.length,e.length);d<p&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]&&i[d][o]===e[d][o]);d++)ro(e[d],i,d,n,o);let T=new Array(e.length),b=new Map;for(p=i.length-1,f=e.length-1;p>=d&&f>=d&&(i[p]===e[f]||o&&i[p]&&e[f]&&i[p][o]&&i[p][o]===e[f][o]);p--,f--)T[f]=i[p];if(d>f||d>p){for(u=d;u<=f;u++)Br(i,u,e[u]);for(;u<e.length;u++)Br(i,u,T[u]),ro(e[u],i,u,n,o);i.length>e.length&&Br(i,"length",e.length);return}for(h=new Array(f+1),u=f;u>=d;u--)x=e[u],w=o&&x?x[o]:x,c=b.get(w),h[u]=c===void 0?-1:c,b.set(w,u);for(c=d;c<=p;c++)x=i[c],w=o&&x?x[o]:x,u=b.get(w),u!==void 0&&u!==-1&&(T[u]=i[c],u=h[u],b.set(w,u));for(u=d;u<e.length;u++)u in T?(Br(i,u,T[u]),ro(e[u],i,u,n,o)):Br(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)ro(e[c],i,c,n,o);i.length>e.length&&Br(i,"length",e.length);return}let s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)ro(e[s[c]],i,s[c],n,o);let l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Br(i,l[c],void 0)}function Om(e,t={}){let{merge:r,key:n="id"}=t,o=Rl(e);return i=>{if(!Zo(i)||!Zo(o))return o;let a=ro(o,{[Ol]:i},Ol,r,n);return a===void 0?i:a}}var $l="resultId",$m=e=>{if(e)try{return sessionStorage.getItem(`${$l}-${e}`)??localStorage.getItem(`${$l}-${e}`)??void 0}catch{}},Nm=(e="session")=>(t,r)=>{try{no(e).setItem(`${$l}-${t}`,r)}catch{}},Mm=e=>{if(e)try{let t=sessionStorage.getItem(`makebot-${e}-initialChatReply`)??localStorage.getItem(`makebot-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Nl=(e,{makebotId:t,storage:r})=>{try{let n=JSON.stringify(e);no(r).setItem(`makebot-${t}-initialChatReply`,n)}catch{}},ya=()=>{try{sessionStorage.setItem("makebot-botOpened","true")}catch{}},xa=()=>{try{sessionStorage.removeItem("makebot-botOpened")}catch{}},va=()=>{try{return sessionStorage.getItem("makebot-botOpened")==="true"}catch{return!1}},no=e=>(e??at.general.rememberUser.storage)==="session"?sessionStorage:localStorage,wa=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&sessionStorage.removeItem(t)})};function Jo(e,t){if(!t.storage)return[...e];let r=no(t.storage||at.general.rememberUser.storage),n=a=>{let s=JSON.parse(JSON.stringify(a));return typeof s!="object"||("blobUrl"in s&&(s.blobUrl=void 0),"attachments"in s&&Array.isArray(s.attachments)&&s.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0)})),JSON.stringify(s)},o=JSON.parse.bind(JSON),i=r.getItem(t.key);if(i){let a=typeof e[0]=="function"?l=>e[1](()=>l):l=>e[1](Om(l)),s=o(i);t.transformInitDataFromStorage&&(s=t.transformInitDataFromStorage(s),r.setItem(t.key,n(s))),a(s),t.onRecovered?.()}return[e[0],typeof e[0]=="function"?a=>{let s=e[1](a);return a?r.setItem(t.key,n(s)):r.removeItem(t.key),s}:(...a)=>{e[1](...a);let s=n(He(()=>e[0]));r.setItem(t.key,s)}]}var Je=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(n,o,i,a)=>o+o+i+i+a+a);let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?[Number.parseInt(r[1]??"",16),Number.parseInt(r[2]??"",16),Number.parseInt(r[3]??"",16)]:[0,0,0]},Fr=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(Je(e));var oo=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??sn;if((e?.opacity??yt)<=.3||r==="transparent"||Ue(r)){let o=t?.type??eo,i=o==="Image"?"#000000":o==="Color"&&pe(t?.content)?t.content:"#ffffff";return Fr(i)}return Fr(r)};var Lm=({theme:e,container:t,isPreview:r,makebotVersion:n})=>{if(!e)return;let o=t?.style;o&&(Gw({generalTheme:e.general,documentStyle:o,isPreview:r,makebotVersion:n}),jw({chatTheme:e.chat,generalBackground:e.general?.background,documentStyle:o,makebotVersion:n}))},Gw=({generalTheme:e,documentStyle:t,isPreview:r,makebotVersion:n})=>{Ml({background:e?.background,documentStyle:t,makebotVersion:n}),t.setProperty(te.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??Qn),Hw({progressBar:e?.progressBar,documentStyle:t,isPreview:r,makebotVersion:n})},Hw=({progressBar:e,documentStyle:t,isPreview:r,makebotVersion:n})=>{let o=e?.position??ga;t.setProperty(te.general.progressBar.position,o==="fixed"?r?"absolute":"fixed":o),t.setProperty(te.general.progressBar.color,e?.color??nm[n]),t.setProperty(te.general.progressBar.colorRgb,Je(e?.backgroundColor??om[n]).join(", ")),t.setProperty(te.general.progressBar.height,`${e?.thickness??im}px`);let i=e?.placement??am;t.setProperty(te.general.progressBar.top,i==="Top"?"0":"auto"),t.setProperty(te.general.progressBar.bottom,i==="Bottom"?"0":"auto")},jw=({chatTheme:e,generalBackground:t,documentStyle:r,makebotVersion:n})=>{Ww({container:e?.container,generalBackground:t,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),qw({hostBubbles:e?.hostBubbles,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),Yw({guestBubbles:e?.guestBubbles,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),Kw({buttons:e?.buttons,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),Zw({inputs:e?.inputs,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),Jw(e?.container,t,r),Xw({buttonsInput:e?.buttonsInput,documentStyle:r,makebotVersion:n})},Ww=({container:e,generalBackground:t,documentStyle:r,legacyRoundness:n})=>{let o=e?.backgroundColor??sn,i=o==="transparent"||Ue(o);r.setProperty(te.chat.container.bgColor,i?"0, 0, 0":Je(o).join(", ")),r.setProperty(te.chat.container.color,Je(e?.color??(oo({chatContainer:e,generalBackground:t})?Ne.gray.light[12]:Ne.gray.dark[12])).join(", ")),r.setProperty(te.chat.container.maxWidth,e?.maxWidth??sm),r.setProperty(te.chat.container.maxHeight,e?.maxHeight??lm);let a=i?"1":(e?.opacity??yt).toString();r.setProperty(te.chat.container.opacity,i?"0":(e?.opacity??yt).toString()),r.setProperty(te.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??Il}px`),ei(e?.shadow,r,te.chat.container.boxShadow),Qo(e?.border??{roundeness:n??an},r,te.chat.container.borderRadius),r.setProperty(te.chat.container.borderWidth,de(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(te.chat.container.borderOpacity,de(e?.border?.opacity)?e.border.opacity.toString():yt.toString()),r.setProperty(te.chat.container.borderColor,Je(e?.border?.color??"").join(", "))},qw=({hostBubbles:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(te.chat.hostBubbles.bgColor,Je(e?.backgroundColor??cm[n]).join(", ")),t.setProperty(te.chat.hostBubbles.color,e?.color??um),Qo(e?.border??{roundeness:r??an},t,te.chat.hostBubbles.borderRadius);let o=e?.border?.thickness??dm[n];de(o)&&t.setProperty(te.chat.hostBubbles.borderWidth,o+"px"),t.setProperty(te.chat.hostBubbles.borderColor,Je(e?.border?.color??mm).join(", ")),t.setProperty(te.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":de(e?.opacity)?e.opacity.toString():yt.toString()),t.setProperty(te.chat.hostBubbles.borderOpacity,de(e?.border?.opacity)?e.border.opacity.toString():yt.toString()),t.setProperty(te.chat.hostBubbles.blur,de(e?.blur)?`${e.blur??0}px`:"none"),ei(e?.shadow,t,te.chat.hostBubbles.boxShadow)},Yw=({guestBubbles:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(te.chat.guestBubbles.bgColor,Je(e?.backgroundColor??fm[n]).join(", ")),t.setProperty(te.chat.guestBubbles.color,e?.color??pm),Qo(e?.border??{roundeness:r??an},t,te.chat.guestBubbles.borderRadius);let o=e?.border?.thickness??gm[n];de(o)&&t.setProperty(te.chat.guestBubbles.borderWidth,o+"px"),t.setProperty(te.chat.guestBubbles.borderColor,Je(e?.border?.color??hm).join(", ")),t.setProperty(te.chat.guestBubbles.borderOpacity,de(e?.border?.opacity)?e.border.opacity.toString():yt.toString()),t.setProperty(te.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":de(e?.opacity)?e.opacity.toString():yt.toString()),t.setProperty(te.chat.guestBubbles.blur,de(e?.blur)?`${e.blur??0}px`:"none"),ei(e?.shadow,t,te.chat.guestBubbles.boxShadow)},Kw=({buttons:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{let o=e?.backgroundColor??ha[n];t.setProperty(te.chat.buttons.bgRgb,Je(o).join(", ")),t.setProperty(te.chat.buttons.bgRgb,Je(o).join(", ")),t.setProperty(te.chat.buttons.color,e?.color??bm),Qo(e?.border??{roundeness:r??an},t,te.chat.buttons.borderRadius),t.setProperty(te.chat.buttons.borderWidth,de(e?.border?.thickness)?`${e?.border?.thickness}px`:`${ym[n]}px`),t.setProperty(te.chat.buttons.borderColor,Je(e?.border?.color??e?.backgroundColor??xm).join(", ")),t.setProperty(te.chat.buttons.borderOpacity,de(e?.border?.opacity)?e.border.opacity.toString():yt.toString()),t.setProperty(te.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":de(e?.opacity)?e.opacity.toString():yt.toString()),t.setProperty(te.chat.buttons.blur,de(e?.blur)?`${e.blur??0}px`:Il.toString()),ei(e?.shadow,t,te.chat.buttons.boxShadow)},Xw=({buttonsInput:e,documentStyle:t})=>{t.setProperty(te.chat.buttons.flexDirection,(e?.layout??Em)==="vertical"?"column":"unset")},Zw=({inputs:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(te.chat.inputs.bgColor,Je(e?.backgroundColor??vm).join(", ")),t.setProperty(te.chat.inputs.color,e?.color??wm),t.setProperty(te.chat.inputs.placeholderColor,e?.placeholderColor??km),Qo(e?.border??{roundeness:r??an},t,te.chat.inputs.borderRadius),t.setProperty(te.chat.inputs.borderWidth,`${e?.border?.thickness??Cm[n]}px`);let o=e?.border?.color??Tm[n];de(o)&&t.setProperty(te.chat.inputs.borderColor,Je(o).join(", ")),t.setProperty(te.chat.inputs.borderOpacity,de(e?.border?.opacity)?e.border.opacity.toString():yt.toString()),t.setProperty(te.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":de(e?.opacity)?e.opacity.toString():yt.toString()),t.setProperty(te.chat.inputs.blur,de(e?.blur)?`${e.blur??0}px`:"none"),ei(e?.shadow??Sm[n],t,te.chat.inputs.boxShadow)},Jw=(e,t,r)=>{let n=e?.backgroundColor??sn;if(n==="transparent"||Ue(n)||(e?.opacity??yt)<=.2){let i=t?.type??eo;r.setProperty(te.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":Je((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?r.setProperty(te.chat.checkbox.alphaRatio,"3"):r.setProperty(te.chat.checkbox.alphaRatio,t?.content&&Fr(t?.content)?"1":"2")}else r.setProperty(te.chat.checkbox.bgRgb,Je(n).concat(e?.opacity??1).join(", ")),r.setProperty(te.chat.checkbox.alphaRatio,Fr(n)?"1":"2")},Ml=({background:e,documentStyle:t,makebotVersion:r})=>{t.setProperty(te.general.bgImage,null),t.setProperty(te.general.bgColor,null),t.setProperty((e?.type??eo)==="Image"?te.general.bgImage:te.general.bgColor,Qw({type:e?.type??eo,content:e?.content??rm[r]}))},Qw=({type:e,content:t})=>{switch(e){case"None":return"transparent";case void 0:case"Color":return t;case"Image":return`url(${t})`}},Qo=(e,t,r)=>{switch(e?.roundeness??an){case"none":{t.setProperty(r,"0");break}case"medium":{t.setProperty(r,"6px");break}case"large":{t.setProperty(r,"20px");break}case"custom":{t.setProperty(r,`${e.customRoundeness??6}px`);break}}},ei=(e,t,r)=>{if(e===void 0){t.setProperty(r,"0 0 #0000");return}switch(e){case"none":t.setProperty(r,"0 0 #0000");break;case"sm":t.setProperty(r,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(r,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(r,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(r,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(r,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var e1=e=>typeof e=="function";function t1(e,t){e1(e)&&e(t)}function Ur(...e){return t=>{for(let r of e)t1(r,t)}}var Ae=()=>(e,t)=>De(e,t);function r1(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Oe(e={}){let{strict:t=!0,hookName:r="useContext",providerName:n="Provider",errorMessage:o,defaultValue:i}=e,a=qn(i);function s(){let l=rn(a);if(!l&&t){let c=new Error(o??r1(r,n));throw c.name="ContextError",Error.captureStackTrace?.(c,s),c}return l}return[a.Provider,s,a]}var[Dl,Bm]=Oe({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),ti=e=>Ae()(e,["lazyMount","unmountOnExit"]);var Ll=Symbol("fallback");function Fm(e){for(let t of e)t.dispose()}function n1(e,t,r,n={}){if(Pd){let a=e(),s=[];if(a&&a.length)for(let l=0,c=a.length;l<c;l++)s.push(r(()=>a[l],()=>l));else n.fallback&&(s=[n.fallback()]);return()=>s}let o=new Map;return re(()=>Fm(o.values())),()=>{let a=e()||[];return a[Uo],He(()=>{if(!a.length)return Fm(o.values()),o.clear(),n.fallback?[Mt(d=>(o.set(Ll,{dispose:d}),n.fallback()))]:[];let s=new Array(a.length),l=o.get(Ll);if(!o.size||l){l?.dispose(),o.delete(Ll);for(let u=0;u<a.length;u++){let d=a[u],p=t(d,u);i(s,d,u,p)}return s}let c=new Set(o.keys());for(let u=0;u<a.length;u++){let d=a[u],p=t(d,u);c.delete(p);let f=o.get(p);f?(s[u]=f.mapped,f.setIndex?.(u),f.setItem(()=>d)):i(s,d,u,p)}for(let u of c)o.get(u)?.dispose(),o.delete(u);return s})};function i(a,s,l,c){Mt(u=>{let[d,p]=O(s),f={setItem:p,dispose:u};if(r.length>1){let[x,h]=O(l);f.setIndex=h,f.mapped=r(d,x)}else f.mapped=r(d);o.set(c,f),a[l]=f.mapped})}}function Bl(e){let{by:t}=e;return ee(n1(()=>e.each,typeof t=="function"?t:r=>r[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function zm(e){return e?Array.isArray(e)?e:[e]:[]}var Gm=e=>e[0],Hm=e=>e[e.length-1];var jm=(e,...t)=>e.concat(t),Wm=(e,...t)=>e.filter(r=>!t.includes(r));var qm=e=>Array.from(new Set(e));function ka(e,t,r={}){let{step:n=1,loop:o=!0}=r,i=t+n,a=e.length,s=a-1;return t===-1?n>0?0:s:i<0?o?s:0:i>=a?o?0:t>a?a:t:i}function Ym(e,t,r={}){return e[ka(e,t,r)]}function Fl(e,t,r={}){let{step:n=1,loop:o=!0}=r;return ka(e,t,{step:-n,loop:o})}function Km(e,t,r={}){return e[Fl(e,t,r)]}var Um=e=>e?.constructor.name==="Array",o1=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!lr(e[r],t[r]))return!1;return!0},lr=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Um(e)&&Um(t))return o1(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return!1;for(let o=0;o<n;o++){let i=r[o];if(!lr(e[i],t[i]))return!1}return!0};var i1=e=>Array.isArray(e);var a1=e=>e!=null&&typeof e=="object",Ca=e=>a1(e)&&!i1(e),ri=e=>typeof e=="number"&&!Number.isNaN(e),_t=e=>typeof e=="string",Bt=e=>typeof e=="function",Xm=e=>e==null;var s1=Function.prototype.toString,n$=s1.call(Object);var ln=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0;var Zm=()=>{},Yt=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t)})},Ul=(()=>{let e=0;return()=>(e++,e.toString(36))})();function Jm(e,t=0){let r=0,n=null;return(...o)=>{let i=Date.now(),a=i-r;a>=t?(n&&(clearTimeout(n),n=null),e(...o),r=i):n||(n=setTimeout(()=>{e(...o),r=Date.now(),n=null},t-a))}}var{floor:l1,abs:o$,round:c1,min:u1,max:d1,pow:i$,sign:a$}=Math,m1=e=>Number.isNaN(e),Vr=e=>m1(e)?0:e;var Qm=(e,t)=>(e%t+t)%t;var ef=(e,t)=>Vr(e)>=t,tf=(e,t)=>Vr(e)<=t,rf=(e,t,r)=>Vr(e)>=t&&Vr(e)<=r;var zr=(e,t,r)=>u1(d1(Vr(e),t),r);var nf=(e,t,r)=>(Vr(e)-t)/(r-t);var io=(e,t)=>typeof t=="number"?l1(e*t+.5)/t:c1(e);var Vm=e=>{if(!Number.isFinite(e))return 0;let t=1,r=0;for(;Math.round(e*t)/t!==e;)t*=10,r+=1;return r},of=(e,t,r)=>{let n=t==="+"?e+r:e-r;if(e%1!==0||r%1!==0){let o=10**Math.max(Vm(e),Vm(r));e=Math.round(e*o),r=Math.round(r*o),n=t==="+"?e+r:e-r,n/=o}return n},af=(e,t)=>of(Vr(e),"+",t),sf=(e,t)=>of(Vr(e),"-",t);function cn(e){if(!f1(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=cn(o))}return r}var f1=e=>e&&typeof e=="object"&&e.constructor===Object;function p1(e,t){let r={},n={},o=new Set(t);for(let i in e)o.has(i)?n[i]=e[i]:r[i]=e[i];return[n,r]}var mt=e=>function(r){return p1(r,e)};function Ta(e,t){let r=performance.now(),n;function o(i){n=requestAnimationFrame(o),i-r>=t&&e()}return n=requestAnimationFrame(o),()=>cancelAnimationFrame(n)}function ao(...e){let t=e.length===1?e[0]:e[1],r=e.length===2?e[0]:!0}function lf(e,t){if(e==null)throw new Error(t())}function Sa(e,t,r){let n=[];for(let o of t)e[o]==null&&n.push(o);if(n.length>0)throw new Error(`[zag-js${r?` > ${r}`:""}] missing required props: ${n.join(", ")}`)}var g1=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]);var uf=()=>{},Pa=e=>typeof e=="object"&&e!==null,_a=2147483647,fe=e=>e?"":void 0,vr=e=>e?"true":void 0,h1=1,b1=9,y1=11,je=e=>Pa(e)&&e.nodeType===h1&&typeof e.nodeName=="string",Ia=e=>Pa(e)&&e.nodeType===b1,x1=e=>Pa(e)&&e===e.window;var df=e=>je(e)?e.localName||"":"#document";function v1(e){return["html","body","#document"].includes(df(e))}var w1=e=>Pa(e)&&e.nodeType!==void 0,lo=e=>w1(e)&&e.nodeType===y1&&"host"in e,k1=e=>je(e)&&e.localName==="input",mf=e=>!!e?.matches("a[href]"),C1=e=>je(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,T1=/(textarea|select)/;function Aa(e){if(e==null||!je(e))return!1;try{return k1(e)&&e.selectionStart!=null||T1.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function It(e,t){if(!e||!t||!je(e)||!je(t))return!1;let r=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(r&&lo(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ft(e){return Ia(e)?e:x1(e)?e.document:e?.ownerDocument??document}function S1(e){return ft(e).documentElement}function st(e){return lo(e)?st(e.host):Ia(e)?e.defaultView??window:je(e)?e.ownerDocument?.defaultView??window:window}function Ra(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}function E1(e){if(df(e)==="html")return e;let t=e.assignedSlot||e.parentNode||lo(e)&&e.host||S1(e);return lo(t)?t.host:t}var Vl=new WeakMap;function Kt(e){return Vl.has(e)||Vl.set(e,st(e).getComputedStyle(e)),Vl.get(e)}var Oa=()=>typeof document<"u";function P1(){return navigator.userAgentData?.platform??navigator.platform}function _1(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}var Gl=e=>Oa()&&e.test(P1()),I1=e=>Oa()&&e.test(_1()),A1=e=>Oa()&&e.test(navigator.vendor),Hl=()=>Oa()&&!!navigator.maxTouchPoints,R1=()=>Gl(/^iPhone/i),O1=()=>Gl(/^iPad/i)||jl()&&navigator.maxTouchPoints>1,ni=()=>R1()||O1(),ff=()=>jl()||ni(),jl=()=>Gl(/^Mac/i),Wl=()=>ff()&&A1(/apple/i),$1=()=>I1(/Firefox/i);function N1(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Qe(e){return N1(e)?.[0]??e.target}var $a=e=>It(e.currentTarget,Qe(e));function ql(e){let t=e.currentTarget;if(!t)return!1;let r=ff();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.localName;return n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit"}function Yl(e){let t=e.currentTarget;if(!t)return!1;let r=t.localName;return e.altKey?r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit":!1}function pf(e){return L1(e).isComposing||e.keyCode===229}function gf(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Kl=e=>e.button===0,Na=e=>e.button===2||jl()&&e.ctrlKey&&e.button===0,oi=e=>e.ctrlKey||e.altKey||e.metaKey,M1=e=>"touches"in e&&e.touches.length>0,D1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},cf={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function ii(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,o=e.key;return o=D1[o]??o,r==="rtl"&&n==="horizontal"&&o in cf&&(o=cf[o]),o}function L1(e){return e.nativeEvent??e}var B1=new Set(["PageUp","PageDown"]),F1=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function hf(e){return e.ctrlKey||e.metaKey?.1:B1.has(e.key)||e.shiftKey&&F1.has(e.key)?10:1}function Gr(e,t="client"){let r=M1(e)?e.touches[0]||e.changedTouches[0]:e;return{x:r[`${t}X`],y:r[`${t}Y`]}}var Ee=(e,t,r,n)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,r,n),()=>{o?.removeEventListener(t,r,n)}};function U1(e,t){let{type:r="HTMLInputElement",property:n="value"}=t,o=st(e)[r].prototype;return Object.getOwnPropertyDescriptor(o,n)??{}}function V1(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function bf(e,t,r="value"){if(!e)return;let n=V1(e);n&&U1(e,{type:n,property:r}).set?.call(e,t),e.setAttribute(r,t)}function z1(e){return G1(e)?e.form:e.closest("form")}function G1(e){return e.matches("textarea, input, select, button")}function H1(e,t){if(!e)return;let r=z1(e),n=o=>{o.defaultPrevented||t()};return r?.addEventListener("reset",n,{passive:!0}),()=>r?.removeEventListener("reset",n)}function j1(e,t){let r=e?.closest("fieldset");if(!r)return;t(r.disabled);let n=st(r),o=new n.MutationObserver(()=>t(r.disabled));return o.observe(r,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function yf(e,t){if(!e)return;let{onFieldsetDisabledChange:r,onFormReset:n}=t,o=[H1(e,n),j1(e,r)];return()=>o.forEach(i=>i?.())}var xf=e=>je(e)&&e.tagName==="IFRAME",W1=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),q1=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Xl="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Zl=(e,t=!1)=>{if(!e)return[];let r=Array.from(e.querySelectorAll(Xl));(t==!0||t=="if-empty"&&r.length===0)&&je(e)&&Ft(e)&&r.unshift(e);let o=r.filter(Ft);return o.forEach((i,a)=>{if(xf(i)&&i.contentDocument){let s=i.contentDocument.body;o.splice(a,1,...Zl(s))}}),o};function Ft(e){return!e||e.closest("[inert]")?!1:e.matches(Xl)&&C1(e)}function un(e,t){if(!e)return[];let r=Array.from(e.querySelectorAll(Xl)),n=r.filter(xr);return t&&xr(e)&&n.unshift(e),n.forEach((o,i)=>{if(xf(o)&&o.contentDocument){let a=o.contentDocument.body,s=un(a);n.splice(i,1,...s)}}),!n.length&&t?r:n}function xr(e){return e!=null&&e.tabIndex>0?!0:Ft(e)&&!q1(e)}function Y1(e,t){let r=un(e,t),n=r[0]||null,o=r[r.length-1]||null;return[n,o]}function co(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Aa(e))&&!W1(e)?0:e.tabIndex}function vf(e){let{root:t,getInitialEl:r,filter:n,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof r=="function"?r():r),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let a=un(t);i=n?a.filter(n)[0]:a[0]}return i||t||void 0}function wf(e){let t=e.currentTarget;if(!t)return!1;let[r,n]=Y1(t),o=t.ownerDocument||document;return!(o.activeElement===r&&e.shiftKey||o.activeElement===n&&!e.shiftKey||!r&&!n)}function Jl(e){let t=new Set;function r(n){let o=globalThis.requestAnimationFrame(n);t.add(()=>globalThis.cancelAnimationFrame(o))}return r(()=>r(e)),function(){t.forEach(o=>o())}}function ke(e){let t,r=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(r),t?.()}}function K1(e,t,r){let n=ke(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{n(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),n}function X1(e,t){if(!e)return;let{attributes:r,callback:n}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(a=>{for(let s of a)s.type==="attributes"&&s.attributeName&&r.includes(s.attributeName)&&n(s)});return i.observe(e,{attributes:!0,attributeFilter:r}),()=>i.disconnect()}function Ma(e,t){let{defer:r}=t,n=r?ke:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(X1(i,t))})),()=>{o.forEach(i=>i?.())}}function kf(e){let t=()=>e.click();$1()?K1(e,"keyup",t):queueMicrotask(t)}function Da(e){let t=E1(e);return v1(t)?ft(t).body:je(t)&&Cf(t)?t:Da(t)}var Z1=/auto|scroll|overlay|hidden|clip/;function Cf(e){let t=st(e),{overflow:r,overflowX:n,overflowY:o,display:i}=t.getComputedStyle(e);return Z1.test(r+o+n)&&!["inline","contents"].includes(i)}function J1(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Tf(e,t){let{rootEl:r,...n}=t||{};!e||!r||!Cf(r)||!J1(r)||e.scrollIntoView(n)}function Sf(e,t){let r=e.body,n="pointerLockElement"in e||"mozPointerLockElement"in e,o=()=>!!e.pointerLockElement;function i(){t?.(o())}function a(l){o()&&t?.(!1),console.error("PointerLock error occurred:",l),e.exitPointerLock()}if(!n)return;try{r.requestPointerLock()}catch{}let s=[Ee(e,"pointerlockchange",i,!1),Ee(e,"pointerlockerror",a,!1)];return()=>{s.forEach(l=>l()),e.exitPointerLock()}}var so="default",zl="",Ea=new WeakMap;function Q1(e={}){let{target:t,doc:r}=e,n=r??document,o=n.documentElement;return ni()?(so==="default"&&(zl=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),so="disabled"):t&&(Ea.set(t,t.style.userSelect),t.style.userSelect="none"),()=>ek({target:t,doc:n})}function ek(e={}){let{target:t,doc:r}=e,o=(r??document).documentElement;if(ni()){if(so!=="disabled")return;so="restoring",setTimeout(()=>{Jl(()=>{so==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=zl||""),zl="",so="default")})},300)}else if(t&&Ea.has(t)){let i=Ea.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ea.delete(t)}}function tk(e={}){let{defer:t,target:r,...n}=e,o=t?ke:a=>a(),i=[];return i.push(o(()=>{let a=typeof r=="function"?r():r;i.push(Q1({...n,target:a}))})),()=>{i.forEach(a=>a?.())}}function Ef(e,t){let{onPointerMove:r,onPointerUp:n}=t,i=[Ee(e,"pointermove",a=>{let s=Gr(a),l=Math.sqrt(s.x**2+s.y**2),c=a.pointerType==="touch"?10:5;if(!(l<c)){if(a.pointerType==="mouse"&&a.button===0){n();return}r({point:s,event:a})}},!1),Ee(e,"pointerup",n,!1),Ee(e,"pointercancel",n,!1),Ee(e,"contextmenu",n,!1),tk({doc:e})];return()=>{i.forEach(a=>a())}}function La(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Ql=e=>e.id;function rk(e,t,r=Ql){return e.find(n=>r(n)===t)}function nk(e,t,r=Ql){let n=rk(e,t,r);return n?e.indexOf(n):-1}var ok=e=>e.split("").map(t=>{let r=t.charCodeAt(0);return r>0&&r<128?t:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),ik=e=>ok(e.dataset?.valuetext??e.textContent??""),ak=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function sk(e,t,r,n=Ql){let o=r?nk(e,r,n):-1,i=r?g1(e,o):e;return t.length===1&&(i=i.filter(s=>n(s)!==r)),i.find(s=>ak(ik(s),t))}function dn(e,t){if(!e)return uf;let r=Object.keys(t).reduce((n,o)=>(n[o]=e.style.getPropertyValue(o),n),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,r),e.style.length===0&&e.removeAttribute("style")}}function Pf(e,t,r){if(!e)return uf;let n=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{e.style.setProperty(t,n),e.style.length===0&&e.removeAttribute("style")}}function lk(e,t){let{state:r,activeId:n,key:o,timeout:i=350,itemToId:a}=t,s=r.keysSoFar+o,c=s.length>1&&Array.from(s).every(x=>x===s[0])?s[0]:s,u=e.slice(),d=sk(u,c,n,a);function p(){clearTimeout(r.timer),r.timer=-1}function f(x){r.keysSoFar=x,p(),x!==""&&(r.timer=+setTimeout(()=>{f(""),p()},i))}return f(s),d}var ec=Object.assign(lk,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:ck});function ck(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var uk=1e3/60;function dk(e,t){let r=e();if(je(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let o=e();je(o)&&o.isConnected&&(t(o),clearInterval(n))},uk);return()=>clearInterval(n)}}function _f(e,t){let r=[];return e?.forEach(n=>{let o=dk(n,t);r.push(o)}),()=>{r.forEach(n=>n())}}var mk=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),fk=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,If=e=>{let t={},r;for(;r=fk.exec(e);)t[r[1]]=r[2];return t},pk=(e,t)=>{if(_t(e)){if(_t(t))return`${e};${t}`;e=If(e)}else _t(t)&&(t=If(t));return Object.assign({},e??{},t??{})};function Af(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=Yt(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=mk(t[n],r[n]);continue}if(n==="style"){t[n]=pk(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n]}for(let n in r)t[n]===void 0&&(t[n]=r[n])}return t}var mn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(mn||{}),Ba="__init__";function Rf(e){let t=()=>e.getRootNode?.()??document,r=()=>ft(t()),n=()=>r().defaultView??window,o=()=>Ra(t());return{...e,getRootNode:t,getDoc:r,getWin:n,getActiveElement:o,isActiveElement:s=>s===o(),getById:s=>t().getElementById(s)}}function Of(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var rt=()=>e=>Array.from(new Set(e));function Fa(e){let t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n,o]=O(t),i=ee(()=>e().value!=null),a={current:n()},s={current:void 0};ve(()=>{let u=i()?e().value:n();s.current=u,a.current=u});let l=u=>{let d=s.current,p=Bt(u)?u(a.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:p,prev:d}),i()||o(p),r(p,d)||e().onChange?.(p,d)};function c(){let u=i()?e().value:n;return Bt(u)?u():u}return{initial:t,ref:a,get:c,set:l,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}Fa.cleanup=e=>{re(()=>e())};Fa.ref=e=>{let t=e;return{get:()=>t,set:r=>{t=r}}};function gk(e){let[t,r]=O(e);return{get(n){return t()[n]},set(n,o){r(i=>({...i,[n]:o}))}}}function tc(e){return Bt(e)?e():e}var hk=(e,t)=>{let r=[],n=!0;ve(()=>{if(n){r=e.map(i=>tc(i)),n=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!lr(r[i],tc(e[i]))){o=!0;break}o&&(r=e.map(i=>tc(i)),t())})};function xt(e,t={}){let r=ee(()=>{let{id:A,ids:N,getRootNode:D}=rc(t);return Rf({id:A,ids:N,getRootNode:D})}),n=(...A)=>{e.debug&&console.log(...A)},o=ee(()=>e.props?.({props:cn(rc(t)),scope:r()})??rc(t)),i=bk(o),a=e.context?.({prop:i,bindable:Fa,get scope(){return r()},flush:$f,getContext(){return s},getComputed(){return g},getRefs(){return x}}),s={get(A){return a?.[A].get()},set(A,N){a?.[A].set(N)},initial(A){return a?.[A].initial},hash(A){let N=a?.[A].get();return a?.[A].hash(N)}},l={current:new Map},c={current:null},u={current:null},d={current:{type:""}},p=()=>ce(d.current,{current(){return d.current},previous(){return u.current}}),f=()=>ce(k,{matches(...A){let N=k.get();return A.includes(N)},hasTag(A){let N=k.get();return!!e.states[N]?.tags?.includes(A)}}),x=gk(e.refs?.({prop:i,context:s})??{}),h=()=>({state:f(),context:s,event:p(),prop:i,send:P,action:w,guard:T,track:hk,refs:x,computed:g,flush:$f,get scope(){return r()},choose:y}),w=A=>{let N=Bt(A)?A(h()):A;if(!N)return;let D=N.map(F=>{let R=e.implementations?.actions?.[F];return R||ao(`[zag-js] No implementation found for action "${JSON.stringify(F)}"`),R});for(let F of D)F?.(h())},T=A=>Bt(A)?A(h()):e.implementations?.guards?.[A](h()),b=A=>{let N=Bt(A)?A(h()):A;if(!N)return;let D=N.map(R=>{let M=e.implementations?.effects?.[R];return M||ao(`[zag-js] No implementation found for effect "${JSON.stringify(R)}"`),M}),F=[];for(let R of D){let M=R?.(h());M&&F.push(M)}return()=>F.forEach(R=>R?.())},y=A=>zm(A).find(N=>{let D=!N.guard;return _t(N.guard)?D=!!T(N.guard):Bt(N.guard)&&(D=N.guard(h())),D}),g=A=>{lf(e.computed,()=>"[zag-js] No computed object found on machine");let N=e.computed[A];return N({context:s,event:d.current,prop:i,refs:x,scope:r(),computed:g})},k=Fa(()=>({defaultValue:e.initialState({prop:i}),onChange(A,N){N&&(l.current.get(N)?.(),l.current.delete(N)),N&&w(e.states[N]?.exit),w(c.current?.actions);let D=b(e.states[A]?.effects);if(D&&l.current.set(A,D),N===Ba){w(e.entry);let F=b(e.effects);F&&l.current.set(Ba,F)}w(e.states[A]?.entry)}})),S=mn.NotStarted;ae(()=>{let A=S===mn.Started;S=mn.Started,n(A?"rehydrating...":"initializing..."),k.invoke(k.initial,Ba)}),re(()=>{n("unmounting..."),S=mn.Stopped,l.current.forEach(N=>N?.()),l.current=new Map,c.current=null,w(e.exit)});let P=A=>{if(S!==mn.Started)return;u.current=d.current,d.current=A,n("send",A);let N=k.get(),D=e.states[N].on?.[A.type]??e.on?.[A.type],F=y(D);if(!F)return;n("transition",F),c.current=F;let R=F.target??N,M=R!==N;M?k.set(R):F.reenter&&!M?k.invoke(N,N):w(F.actions)};return e.watch?.(h()),{state:f(),send:P,context:s,prop:i,get scope(){return r()},refs:x,computed:g,event:p(),getStatus:()=>S}}function $f(e){e()}function rc(e){return Bt(e)?e():e}function bk(e){return function(r){return e()[r]}}function H(...e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"&&(n=n()),n){let o=Object.getOwnPropertyDescriptors(n);for(let i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let a={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let l=e[s];typeof l=="function"&&(l=l()),a=Af(a,{[i]:(l||{})[i]})}return a[i]}for(let s=e.length-1;s>=0;s--){let l,c=e[s];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Nf={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},yk=e=>e.startsWith("--")?e:Tk(e);function xk(e){return e in Nf?Nf[e]:e}var vt=Of(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===!1)){if(r==="style"&&Ca(n)){t.style=vk(n);continue}if(r==="children"){_t(n)&&(t.textContent=n);continue}t[xk(r)]=n}}return t});function vk(e){let t={};for(let r in e){let n=e[r];!_t(n)&&!ri(n)||(t[yk(r)]=n)}return t}var wk=/[A-Z]/g,kk=/^ms-/;function Ck(e){return"-"+e.toLowerCase()}var nc={};function Tk(e){if(nc.hasOwnProperty(e))return nc[e];var t=e.replace(wk,Ck);return nc[e]=kk.test(t)?"-"+t:t}var oc=e=>r=>{let[n,o]=De(r,["asChild"]);if(n.asChild){let i=a=>{let[,s]=De(o,["ref"]);return H(s,a)};return n.asChild(i)}return m(Id,ce({component:e},o))};function Sk(){let e=new Map;return new Proxy(oc,{apply(t,r,n){return oc(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,oc(n)),e.get(n)}})}var Y=Sk();var Ek=e=>typeof e=="function",pt=(e,...t)=>Ek(e)?e(...t):e;function Mf(e,t){let{state:r,send:n,context:o}=e,i=r.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(a){a&&n({type:"NODE.SET",node:a})},unmount(){n({type:"UNMOUNT"})}}}var Df={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,action:t,prop:r}){e([()=>r("present")],()=>{t(["setInitial","syncPresence"])})},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},setNode:({refs:e,event:t})=>{e.set("node",t.node)},setStyles:({refs:e,event:t})=>{e.set("styles",Kt(t.node))},syncPresence:({context:e,refs:t,send:r,prop:n})=>{let o=n("present");if(o)return r({type:"MOUNT",src:"presence.changed"});let i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return r({type:"UNMOUNT",src:"visibilitychange"});ke(()=>{let a=Ua(t.get("styles"));e.set("unmountAnimationName",a),a==="none"||a===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{ke(()=>{e.set("prevAnimationName",Ua(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:r})=>{let n=t.get("node");if(!n)return;let o=s=>{(s.composedPath?.()?.[0]??s.target)===n&&e.set("prevAnimationName",Ua(t.get("styles")))},i=s=>{let l=Ua(t.get("styles"));Qe(s)===n&&l===e.get("unmountAnimationName")&&r({type:"UNMOUNT",src:"animationend"})};n.addEventListener("animationstart",o),n.addEventListener("animationcancel",i),n.addEventListener("animationend",i);let a=dn(n,{animationFillMode:"forwards"});return()=>{n.removeEventListener("animationstart",o),n.removeEventListener("animationcancel",i),n.removeEventListener("animationend",i),Jl(()=>a())}}}}};function Ua(e){return e?.animationName||"none"}var E$=rt()(["onExitComplete","present","immediate"]);var uo=e=>Ae()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),fn=e=>{let[t,r]=ti(pt(e)),[n,o]=O(!1),i=xt(Df,e),a=ee(()=>Mf(i,vt));return ve(()=>{a().present&&o(!0)}),ee(()=>({unmounted:!a().present&&!n()&&t.lazyMount||t.unmountOnExit&&!a().present&&n(),present:a().present,ref:a().setNode,presenceProps:{hidden:!a().present,"data-state":a().skip&&r.skipAnimationOnMount?void 0:r.present?"open":"closed"}}))};var[mo,Hr]=Oe({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var[M$,Ut]=Oe({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var[_k,nt]=Oe({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),Ik=C("<span hidden>"),pn=e=>{let[t,r]=O(),n=()=>pt(e.value)??t()?.getRootNode()??document,o=ee(()=>({getRootNode:n,getDocument:()=>ft(n()),getWindow:()=>st(n())}));return m(_k,{value:o,get children(){return[L(()=>e.children),m(U,{get when(){return!e.value},get children(){var i=Ik();return ge(r,i),i}})]}})};var Ak=Object.defineProperty,gt=(e,t)=>{for(var r in t)Ak(e,r,{get:t[r],enumerable:!0})};var et=(e,t=[])=>({parts:(...r)=>{if(Rk(t))return et(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>et(e,[...t,...r]),rename:r=>et(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${fo(e)}"][data-part="${fo(n)}"]`,`& [data-scope="${fo(e)}"][data-part="${fo(n)}"]`].join(", "),attrs:{"data-scope":fo(e),"data-part":fo(n)}}}),{})}),fo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Rk=e=>e.length===0;var Ff=["top","right","bottom","left"];var cr=Math.min,wt=Math.max,si=Math.round,li=Math.floor,Xt=e=>({x:e,y:e}),Ok={left:"right",right:"left",bottom:"top",top:"bottom"},$k={start:"end",end:"start"};function za(e,t,r){return wt(e,cr(t,r))}function ur(e,t){return typeof e=="function"?e(t):e}function dr(e){return e.split("-")[0]}function gn(e){return e.split("-")[1]}function Ga(e){return e==="x"?"y":"x"}function Ha(e){return e==="y"?"height":"width"}var Nk=new Set(["top","bottom"]);function Zt(e){return Nk.has(dr(e))?"y":"x"}function ja(e){return Ga(Zt(e))}function Uf(e,t,r){r===void 0&&(r=!1);let n=gn(e),o=ja(e),i=Ha(o),a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ai(a)),[a,ai(a)]}function Vf(e){let t=ai(e);return[Va(e),t,Va(t)]}function Va(e){return e.replace(/start|end/g,t=>$k[t])}var Lf=["left","right"],Bf=["right","left"],Mk=["top","bottom"],Dk=["bottom","top"];function Lk(e,t,r){switch(e){case"top":case"bottom":return r?t?Bf:Lf:t?Lf:Bf;case"left":case"right":return t?Mk:Dk;default:return[]}}function zf(e,t,r,n){let o=gn(e),i=Lk(dr(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Va)))),i}function ai(e){return e.replace(/left|right|bottom|top/g,t=>Ok[t])}function Bk(e){return{top:0,right:0,bottom:0,left:0,...e}}function ic(e){return typeof e!="number"?Bk(e):{top:e,right:e,bottom:e,left:e}}function hn(e){let{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 Gf(e,t,r){let{reference:n,floating:o}=e,i=Zt(t),a=ja(t),s=Ha(a),l=dr(t),c=i==="y",u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2,f;switch(l){case"top":f={x:u,y:n.y-o.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-o.width,y:d};break;default:f={x:n.x,y:n.y}}switch(gn(t)){case"start":f[a]-=p*(r&&c?-1:1);break;case"end":f[a]+=p*(r&&c?-1:1);break}return f}async function Wf(e,t){var r;t===void 0&&(t={});let{x:n,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=ur(t,e),x=ic(f),w=s[p?d==="floating"?"reference":"floating":d],T=hn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(w)))==null||r?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),g=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},k=hn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:l}):b);return{top:(T.top-k.top+x.top)/g.y,bottom:(k.bottom-T.bottom+x.bottom)/g.y,left:(T.left-k.left+x.left)/g.x,right:(k.right-T.right+x.right)/g.x}}var qf=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Gf(c,n,l),p=n,f={},x=0;for(let w=0;w<s.length;w++){var h;let{name:T,fn:b}=s[w],{x:y,y:g,data:k,reset:S}=await b({x:u,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...a,detectOverflow:(h=a.detectOverflow)!=null?h:Wf},elements:{reference:e,floating:t}});u=y??u,d=g??d,f={...f,[T]:{...f[T],...k}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Gf(c,p,l)),w=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}},Yf=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=ur(e,t)||{};if(c==null)return{};let d=ic(u),p={x:r,y:n},f=ja(o),x=Ha(f),h=await a.getDimensions(c),w=f==="y",T=w?"top":"left",b=w?"bottom":"right",y=w?"clientHeight":"clientWidth",g=i.reference[x]+i.reference[f]-p[f]-i.floating[x],k=p[f]-i.reference[f],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),P=S?S[y]:0;(!P||!await(a.isElement==null?void 0:a.isElement(S)))&&(P=s.floating[y]||i.floating[x]);let A=g/2-k/2,N=P/2-h[x]/2-1,D=cr(d[T],N),F=cr(d[b],N),R=D,M=P-h[x]-F,z=P/2-h[x]/2+A,K=za(R,z,M),I=!l.arrow&&gn(o)!=null&&z!==K&&i.reference[x]/2-(z<R?D:F)-h[x]/2<0,B=I?z<R?z-R:z-M:0;return{[f]:p[f]+B,data:{[f]:K,centerOffset:z-K-B,...I&&{alignmentOffset:B}},reset:I}}});var Kf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...w}=ur(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};let T=dr(o),b=Zt(s),y=dr(s)===s,g=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=p||(y||!h?[ai(s)]:Vf(s)),S=x!=="none";!p&&S&&k.push(...zf(s,h,x,g));let P=[s,...k],A=await l.detectOverflow(t,w),N=[],D=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&N.push(A[T]),d){let z=Uf(o,a,g);N.push(A[z[0]],A[z[1]])}if(D=[...D,{placement:o,overflows:N}],!N.every(z=>z<=0)){var F,R;let z=(((F=i.flip)==null?void 0:F.index)||0)+1,K=P[z];if(K&&(!(d==="alignment"?b!==Zt(K):!1)||D.every(j=>Zt(j.placement)===b?j.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:K}};let I=(R=D.filter(B=>B.overflows[0]<=0).sort((B,j)=>B.overflows[1]-j.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(f){case"bestFit":{var M;let B=(M=D.filter(j=>{if(S){let he=Zt(j.placement);return he===b||he==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(he=>he>0).reduce((he,le)=>he+le,0)]).sort((j,he)=>j[1]-he[1])[0])==null?void 0:M[0];B&&(I=B);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function Hf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jf(e){return Ff.some(t=>e[t]>=0)}var Xf=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ur(e,t);switch(o){case"referenceHidden":{let a=await n.detectOverflow(t,{...i,elementContext:"reference"}),s=Hf(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:jf(s)}}}case"escaped":{let a=await n.detectOverflow(t,{...i,altBoundary:!0}),s=Hf(a,r.floating);return{data:{escapedOffsets:s,escaped:jf(s)}}}default:return{}}}}};var Zf=new Set(["left","top"]);async function Fk(e,t){let{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=dr(r),s=gn(r),l=Zt(r)==="y",c=Zf.has(a)?-1:1,u=i&&l?-1:1,d=ur(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof x=="number"&&(f=s==="end"?x*-1:x),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}var Jf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:i,placement:a,middlewareData:s}=t,l=await Fk(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Qf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:T=>{let{x:b,y}=T;return{x:b,y}}},...c}=ur(e,t),u={x:r,y:n},d=await i.detectOverflow(t,c),p=Zt(dr(o)),f=Ga(p),x=u[f],h=u[p];if(a){let T=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=x+d[T],g=x-d[b];x=za(y,x,g)}if(s){let T=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+d[T],g=h-d[b];h=za(y,h,g)}let w=l.fn({...t,[f]:x,[p]:h});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[f]:a,[p]:s}}}}}},ep=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ur(e,t),u={x:r,y:n},d=Zt(o),p=Ga(d),f=u[p],x=u[d],h=ur(s,t),w=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){let y=p==="y"?"height":"width",g=i.reference[p]-i.floating[y]+w.mainAxis,k=i.reference[p]+i.reference[y]-w.mainAxis;f<g?f=g:f>k&&(f=k)}if(c){var T,b;let y=p==="y"?"width":"height",g=Zf.has(dr(o)),k=i.reference[d]-i.floating[y]+(g&&((T=a.offset)==null?void 0:T[d])||0)+(g?0:w.crossAxis),S=i.reference[d]+i.reference[y]+(g?0:((b=a.offset)==null?void 0:b[d])||0)-(g?w.crossAxis:0);x<k?x=k:x>S&&(x=S)}return{[p]:f,[d]:x}}}},tp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=ur(e,t),u=await a.detectOverflow(t,c),d=dr(o),p=gn(o),f=Zt(o)==="y",{width:x,height:h}=i.floating,w,T;d==="top"||d==="bottom"?(w=d,T=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(T=d,w=p==="end"?"top":"bottom");let b=h-u.top-u.bottom,y=x-u.left-u.right,g=cr(h-u[w],b),k=cr(x-u[T],y),S=!t.middlewareData.shift,P=g,A=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=y),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=b),S&&!p){let D=wt(u.left,0),F=wt(u.right,0),R=wt(u.top,0),M=wt(u.bottom,0);f?A=x-2*(D!==0||F!==0?D+F:wt(u.left,u.right)):P=h-2*(R!==0||M!==0?R+M:wt(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:P});let N=await a.getDimensions(s.floating);return x!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Wa(){return typeof window<"u"}function bn(e){return np(e)?(e.nodeName||"").toLowerCase():"#document"}function At(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jt(e){var t;return(t=(np(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function np(e){return Wa()?e instanceof Node||e instanceof At(e).Node:!1}function Vt(e){return Wa()?e instanceof Element||e instanceof At(e).Element:!1}function Qt(e){return Wa()?e instanceof HTMLElement||e instanceof At(e).HTMLElement:!1}function rp(e){return!Wa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof At(e).ShadowRoot}var Uk=new Set(["inline","contents"]);function go(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Uk.has(o)}var Vk=new Set(["table","td","th"]);function op(e){return Vk.has(bn(e))}var zk=[":popover-open",":modal"];function ci(e){return zk.some(t=>{try{return e.matches(t)}catch{return!1}})}var Gk=["transform","translate","scale","rotate","perspective"],Hk=["transform","translate","scale","rotate","perspective","filter"],jk=["paint","layout","strict","content"];function qa(e){let t=Ya(),r=Vt(e)?zt(e):e;return Gk.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)||Hk.some(n=>(r.willChange||"").includes(n))||jk.some(n=>(r.contain||"").includes(n))}function ip(e){let t=wr(e);for(;Qt(t)&&!yn(t);){if(qa(t))return t;if(ci(t))return null;t=wr(t)}return null}function Ya(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var Wk=new Set(["html","body","#document"]);function yn(e){return Wk.has(bn(e))}function zt(e){return At(e).getComputedStyle(e)}function ui(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wr(e){if(bn(e)==="html")return e;let t=e.assignedSlot||e.parentNode||rp(e)&&e.host||Jt(e);return rp(t)?t.host:t}function ap(e){let t=wr(e);return yn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qt(t)&&go(t)?t:ap(t)}function po(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let o=ap(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=At(o);if(i){let s=Ka(a);return t.concat(a,a.visualViewport||[],go(o)?o:[],s&&r?po(s):[])}return t.concat(o,po(o,[],r))}function Ka(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cp(e){let t=zt(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Qt(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=si(r)!==i||si(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function sc(e){return Vt(e)?e:e.contextElement}function ho(e){let t=sc(e);if(!Qt(t))return Xt(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=cp(t),a=(i?si(r.width):r.width)/n,s=(i?si(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var qk=Xt(0);function up(e){let t=At(e);return!Ya()||!t.visualViewport?qk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yk(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==At(e)?!1:t}function xn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let o=e.getBoundingClientRect(),i=sc(e),a=Xt(1);t&&(n?Vt(n)&&(a=ho(n)):a=ho(e));let s=Yk(i,r,n)?up(i):Xt(0),l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){let p=At(i),f=n&&Vt(n)?At(n):n,x=p,h=Ka(x);for(;h&&n&&f!==x;){let w=ho(h),T=h.getBoundingClientRect(),b=zt(h),y=T.left+(h.clientLeft+parseFloat(b.paddingLeft))*w.x,g=T.top+(h.clientTop+parseFloat(b.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,d*=w.y,l+=y,c+=g,x=At(h),h=Ka(x)}}return hn({width:u,height:d,x:l,y:c})}function lc(e,t){let r=ui(e).scrollLeft;return t?t.left+r:xn(Jt(e)).left+r}function dp(e,t,r){r===void 0&&(r=!1);let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:lc(e,n)),i=n.top+t.scrollTop;return{x:o,y:i}}function Kk(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i=o==="fixed",a=Jt(n),s=t?ci(t.floating):!1;if(n===a||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Xt(1),u=Xt(0),d=Qt(n);if((d||!d&&!i)&&((bn(n)!=="body"||go(a))&&(l=ui(n)),Qt(n))){let f=xn(n);c=ho(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}let p=a&&!d&&!i?dp(a,l,!0):Xt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Xk(e){return Array.from(e.getClientRects())}function Zk(e){let t=Jt(e),r=ui(e),n=e.ownerDocument.body,o=wt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=wt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+lc(e),s=-r.scrollTop;return zt(n).direction==="rtl"&&(a+=wt(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Jk(e,t){let r=At(e),n=Jt(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let c=Ya();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function Qk(e,t){let r=xn(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Qt(e)?ho(e):Xt(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:a,height:s,x:l,y:c}}function sp(e,t,r){let n;if(t==="viewport")n=Jk(e,r);else if(t==="document")n=Zk(Jt(e));else if(Vt(t))n=Qk(t,r);else{let o=up(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return hn(n)}function mp(e,t){let r=wr(e);return r===t||!Vt(r)||yn(r)?!1:zt(r).position==="fixed"||mp(r,t)}function eC(e,t){let r=t.get(e);if(r)return r;let n=po(e,[],!1).filter(s=>Vt(s)&&bn(s)!=="body"),o=null,i=zt(e).position==="fixed",a=i?wr(e):e;for(;Vt(a)&&!yn(a);){let s=zt(a),l=qa(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||go(a)&&!l&&mp(e,a))?n=n.filter(u=>u!==a):o=s,a=wr(a)}return t.set(e,n),n}function tC(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[...r==="clippingAncestors"?ci(t)?[]:eC(t,this._c):[].concat(r),n],s=a[0],l=a.reduce((c,u)=>{let d=sp(t,u,o);return c.top=wt(d.top,c.top),c.right=cr(d.right,c.right),c.bottom=cr(d.bottom,c.bottom),c.left=wt(d.left,c.left),c},sp(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rC(e){let{width:t,height:r}=cp(e);return{width:t,height:r}}function nC(e,t,r){let n=Qt(t),o=Jt(t),i=r==="fixed",a=xn(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=Xt(0);function c(){l.x=lc(o)}if(n||!n&&!i)if((bn(t)!=="body"||go(o))&&(s=ui(t)),n){let f=xn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!n&&o&&c();let u=o&&!n&&!i?dp(o,s):Xt(0),d=a.left+s.scrollLeft-l.x-u.x,p=a.top+s.scrollTop-l.y-u.y;return{x:d,y:p,width:a.width,height:a.height}}function ac(e){return zt(e).position==="static"}function lp(e,t){if(!Qt(e)||zt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Jt(e)===r&&(r=r.ownerDocument.body),r}function fp(e,t){let r=At(e);if(ci(e))return r;if(!Qt(e)){let o=wr(e);for(;o&&!yn(o);){if(Vt(o)&&!ac(o))return o;o=wr(o)}return r}let n=lp(e,t);for(;n&&op(n)&&ac(n);)n=lp(n,t);return n&&yn(n)&&ac(n)&&!qa(n)?r:n||ip(e)||r}var oC=async function(e){let t=this.getOffsetParent||fp,r=this.getDimensions,n=await r(e.floating);return{reference:nC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function iC(e){return zt(e).direction==="rtl"}var aC={convertOffsetParentRelativeRectToViewportRelativeRect:Kk,getDocumentElement:Jt,getClippingRect:tC,getOffsetParent:fp,getElementRects:oC,getClientRects:Xk,getDimensions:rC,getScale:ho,isElement:Vt,isRTL:iC};function pp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sC(e,t){let r=null,n,o=Jt(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();let c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(s||t(),!p||!f)return;let x=li(d),h=li(o.clientWidth-(u+p)),w=li(o.clientHeight-(d+f)),T=li(u),y={rootMargin:-x+"px "+-h+"px "+-w+"px "+-T+"px",threshold:wt(0,cr(1,l))||1},g=!0;function k(S){let P=S[0].intersectionRatio;if(P!==l){if(!g)return a();P?a(!1,P):n=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!pp(c,e.getBoundingClientRect())&&a(),g=!1}try{r=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,y)}r.observe(e)}return a(!0),i}function gp(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=sc(e),u=o||i?[...c?po(c):[],...po(t)]:[];u.forEach(T=>{o&&T.addEventListener("scroll",r,{passive:!0}),i&&T.addEventListener("resize",r)});let d=c&&s?sC(c,r):null,p=-1,f=null;a&&(f=new ResizeObserver(T=>{let[b]=T;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let x,h=l?xn(e):null;l&&w();function w(){let T=xn(e);h&&!pp(h,T)&&r(),h=T,x=requestAnimationFrame(w)}return r(),()=>{var T;u.forEach(b=>{o&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),d?.(),(T=f)==null||T.disconnect(),f=null,l&&cancelAnimationFrame(x)}}var hp=Jf;var bp=Qf,yp=Kf,xp=tp,vp=Xf,wp=Yf;var kp=ep,Cp=(e,t,r)=>{let n=new Map,o={platform:aC,...r},i={...o.platform,_c:n};return qf(e,t,{...o,platform:i})};function Tp(e=0,t=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(e,t,r,n);let o={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...o,toJSON:()=>o}}function lC(e){if(!e)return Tp();let{x:t,y:r,width:n,height:o}=e;return Tp(t,r,n,o)}function cC(e,t){return{contextElement:je(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?lC(n):r.getBoundingClientRect()}}}var di=e=>({variable:e,reference:`var(${e})`}),kr={arrowSize:di("--arrow-size"),arrowSizeHalf:di("--arrow-size-half"),arrowBg:di("--arrow-background"),transformOrigin:di("--transform-origin"),arrowOffset:di("--arrow-offset")},uC=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),dC={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,o=uC(n)[e],{floating:i}=t;return i.style.setProperty(kr.transformOrigin.variable,o),{data:{transformOrigin:o}}}},mC={name:"rects",fn({rects:e}){return{data:e}}},fC=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:r}){if(!r.arrow)return{};let{x:n,y:o}=r.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:n!=null?`${n}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${kr.arrowOffset.reference})`}),{}}}};function pC(e){let[t,r]=e.split("-");return{side:t,align:r,hasAlign:r!=null}}function Ep(e){return e.split("-")[0]}var gC={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Sp(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function Pp(e){return ln(e.boundary)}function hC(e,t){if(e)return wp({element:e,padding:t.arrowPadding})}function bC(e,t){if(!Xm(t.offset??t.gutter))return hp(({placement:r})=>{let n=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+n:o??n,{hasAlign:a}=pC(r),s=a?void 0:t.shift,l=t.offset?.crossAxis??s;return cn({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function yC(e){if(e.flip)return yp({boundary:Pp(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function xC(e){if(!(!e.slide&&!e.overlap))return bp({boundary:Pp(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:kp()})}function vC(e){return xp({padding:e.overflowPadding,apply({elements:t,rects:r,availableHeight:n,availableWidth:o}){let i=t.floating,a=Math.round(r.reference.width);o=Math.floor(o),n=Math.floor(n),i.style.setProperty("--reference-width",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${n}px`)}})}function wC(e){if(e.hideWhenDetached)return vp({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function kC(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function CC(e,t,r={}){let n=cC(e,r.getAnchorRect);if(!t||!n)return;let o=Object.assign({},gC,r),i=t.querySelector("[data-part=arrow]"),a=[bC(i,o),yC(o),xC(o),hC(i,o),fC(i),dC,vC(o),wC(o),mC],{placement:s,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!n||!t)return;let h=await Cp(n,t,{placement:s,middleware:a,strategy:l});c?.(h),u?.({placed:!0});let w=st(t),T=Sp(w,h.x),b=Sp(w,h.y);t.style.setProperty("--x",`${T}px`),t.style.setProperty("--y",`${b}px`),o.hideWhenDetached&&(h.middlewareData.hide?.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));let y=t.firstElementChild;if(y){let g=Kt(y);t.style.setProperty("--z-index",g.zIndex)}},p=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},f=kC(o.listeners),x=o.listeners?gp(n,t,p,f):Zm;return p(),()=>{x?.(),u?.({placed:!1})}}function cc(e,t,r={}){let{defer:n,...o}=r,i=n?ke:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;a.push(CC(s,l,o))})),()=>{a.forEach(s=>s?.())}}var TC={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function _p(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:kr.arrowSize.reference,height:kr.arrowSize.reference,[kr.arrowSizeHalf.variable]:`calc(${kr.arrowSize.reference} / 2)`,[kr.arrowOffset.variable]:`calc(${kr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?TC[t.split("-")[0]]:void 0,background:kr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function SC(e){let t={each(r){for(let n=0;n<e.frames?.length;n+=1){let o=e.frames[n];o&&r(o)}},addEventListener(r,n,o){return t.each(i=>{try{i.document.addEventListener(r,n,o)}catch{}}),()=>{try{t.removeEventListener(r,n,o)}catch{}}},removeEventListener(r,n,o){t.each(i=>{try{i.document.removeEventListener(r,n,o)}catch{}})}};return t}function EC(e){let t=e.frameElement!=null?e.parent:null;return{addEventListener:(r,n,o)=>{try{t?.addEventListener(r,n,o)}catch{}return()=>{try{t?.removeEventListener(r,n,o)}catch{}}},removeEventListener:(r,n,o)=>{try{t?.removeEventListener(r,n,o)}catch{}}}}var Ip="pointerdown.outside",Ap="focus.outside";function PC(e){for(let t of e)if(je(t)&&Ft(t))return!0;return!1}var $p=e=>"clientY"in e;function _C(e,t){if(!$p(t)||!e)return!1;let r=e.getBoundingClientRect();return r.width===0||r.height===0?!1:r.top<=t.clientY&&t.clientY<=r.top+r.height&&r.left<=t.clientX&&t.clientX<=r.left+r.width}function IC(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Rp(e,t){if(!t||!$p(e))return!1;let r=t.scrollHeight>t.clientHeight,n=r&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,a={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(r?16:0),height:t.clientHeight+(o?16:0)},s={x:e.clientX,y:e.clientY};return IC(a,s)?n||i:!1}function AC(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=ft(e),l=st(e),c=SC(l),u=EC(l);function d(b,y){if(!je(y)||!y.isConnected||It(e,y)||_C(e,b))return!1;let g=s.querySelector(`[aria-controls="${e.id}"]`);if(g){let S=Da(g);if(Rp(b,S))return!1}let k=Da(e);return Rp(b,k)?!1:!r?.(y)}let p=new Set,f=lo(e?.getRootNode());function x(b){function y(g){let k=a&&!Hl()?ke:A=>A(),S=g??b,P=S?.composedPath?.()??[S?.target];k(()=>{let A=f?P[0]:Qe(b);if(!(!e||!d(b,A))){if(o||i){let N=Yt(o,i);e.addEventListener(Ip,N,{once:!0})}Op(e,Ip,{bubbles:!1,cancelable:!0,detail:{originalEvent:S,contextmenu:Na(S),focusable:PC(P),target:A}})}})}b.pointerType==="touch"?(p.forEach(g=>g()),p.add(Ee(s,"click",y,{once:!0})),p.add(u.addEventListener("click",y,{once:!0})),p.add(c.addEventListener("click",y,{once:!0}))):y()}let h=new Set,w=setTimeout(()=>{h.add(Ee(s,"pointerdown",x,!0)),h.add(u.addEventListener("pointerdown",x,!0)),h.add(c.addEventListener("pointerdown",x,!0))},0);function T(b){(a?ke:g=>g())(()=>{let g=Qe(b);if(!(!e||!d(b,g))){if(n||i){let k=Yt(n,i);e.addEventListener(Ap,k,{once:!0})}Op(e,Ap,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:Ft(g),target:g}})}})}return Hl()||(h.add(Ee(s,"focusin",T,!0)),h.add(u.addEventListener("focusin",T,!0)),h.add(c.addEventListener("focusin",T,!0))),()=>{clearTimeout(w),p.forEach(b=>b()),h.forEach(b=>b())}}function Np(e,t){let{defer:r}=t,n=r?ke:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(AC(i,t))})),()=>{o.forEach(i=>i?.())}}function Op(e,t,r){let n=e.ownerDocument.defaultView||window,o=new n.CustomEvent(t,r);return e.dispatchEvent(o)}function RC(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n))};return Ee(ft(e),"keydown",r,{capture:!0})}var Ot={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<r},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(r=>It(r.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>It(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>n.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},Mp;function Dp(){Ot.layers.forEach(({node:e})=>{e.style.pointerEvents=Ot.isBelowPointerBlockingLayer(e)?"none":"auto"})}function OC(e){e.style.pointerEvents=""}function $C(e,t){let r=ft(e),n=[];if(Ot.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(Mp=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","")})),t){let o=_f(t,i=>{n.push(dn(i,{pointerEvents:"auto"}))});n.push(o)}return()=>{Ot.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=Mp,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style")}),n.forEach(o=>o()))}}function NC(e,t){let{warnOnMissingNode:r=!0}=t;if(r&&!e){ao("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;let{onDismiss:n,pointerBlocking:o,exclude:i,debug:a}=t,s={dismiss:n,node:e,pointerBlocking:o};Ot.add(s),Dp();function l(f){let x=Qe(f.detail.originalEvent);Ot.isBelowPointerBlockingLayer(e)||Ot.isInBranch(x)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(a&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.()))}function c(f){let x=Qe(f.detail.originalEvent);Ot.isInBranch(x)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(a&&console.log("onFocusOutside:",f.detail.originalEvent),n?.()))}function u(f){Ot.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n()))}function d(f){if(!e)return!1;let x=typeof i=="function"?i():i,h=Array.isArray(x)?x:[x],w=t.persistentElements?.map(T=>T()).filter(je);return w&&h.push(...w),h.some(T=>It(T,f))||Ot.isInNestedLayer(e,f)}let p=[o?$C(e,t.persistentElements):void 0,RC(e,u),Np(e,{exclude:d,onFocusOutside:c,onPointerDownOutside:l,defer:t.defer})];return()=>{Ot.remove(e),Dp(),OC(e),p.forEach(f=>f?.())}}function Xa(e,t){let{defer:r}=t,n=r?ke:i=>i(),o=[];return o.push(n(()=>{let i=Bt(e)?e():e;o.push(NC(i,t))})),()=>{o.forEach(i=>i?.())}}function Lp(e,t={}){let{defer:r}=t,n=r?ke:i=>i(),o=[];return o.push(n(()=>{let i=Bt(e)?e():e;if(!i){ao("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Ot.addBranch(i),o.push(()=>{Ot.removeBranch(i)})})),()=>{o.forEach(i=>i?.())}}var MC=Object.defineProperty,DC=(e,t,r)=>t in e?MC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ve=(e,t,r)=>DC(e,typeof t!="symbol"?t+"":t,r),Bp={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause()}let r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t)},deactivateTrap(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},LC=[],BC=class{constructor(e,t){Ve(this,"trapStack"),Ve(this,"config"),Ve(this,"doc"),Ve(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ve(this,"listenerCleanups",[]),Ve(this,"handleFocus",n=>{let o=Qe(n),i=this.findContainerIndex(o,n)>=0;if(i||Ia(o))i&&(this.state.mostRecentlyFocusedNode=o);else{n.stopImmediatePropagation();let a,s=!0;if(this.state.mostRecentlyFocusedNode)if(co(this.state.mostRecentlyFocusedNode)>0){let l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[l];if(c.length>0){let u=c.findIndex(d=>d===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<c.length&&(a=c[u+1],s=!1):u-1>=0&&(a=c[u-1],s=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(c=>co(c)>0))||(s=!1);else s=!1;s&&(a=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),a?this.tryFocus(a):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ve(this,"handlePointerDown",n=>{let o=Qe(n);if(!(this.findContainerIndex(o,n)>=0)){if(fi(this.config.clickOutsideDeactivates,n)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}fi(this.config.allowOutsideClick,n)||n.preventDefault()}}),Ve(this,"handleClick",n=>{let o=Qe(n);this.findContainerIndex(o,n)>=0||fi(this.config.clickOutsideDeactivates,n)||fi(this.config.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())}),Ve(this,"handleTabKey",n=>{if(this.config.isKeyForward(n)||this.config.isKeyBackward(n)){this.state.recentNavEvent=n;let o=this.config.isKeyBackward(n),i=this.findNextNavNode({event:n,isBackward:o});if(!i)return;mi(n)&&n.preventDefault(),this.tryFocus(i)}}),Ve(this,"handleEscapeKey",n=>{FC(n)&&fi(this.config.escapeDeactivates,n)!==!1&&(n.preventDefault(),this.deactivate())}),Ve(this,"_mutationObserver"),Ve(this,"setupMutationObserver",()=>{let n=this.doc.defaultView||window;this._mutationObserver=new n.MutationObserver(o=>{o.some(a=>Array.from(a.removedNodes).some(l=>l===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),Ve(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(n=>{this._mutationObserver?.observe(n,{subtree:!0,childList:!0})})}),Ve(this,"getInitialFocusNode",()=>{let n=this.getNodeForOption("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!Ft(n))if(this.findContainerIndex(this.doc.activeElement)>=0)n=this.doc.activeElement;else{let o=this.state.tabbableGroups[0];n=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else n===null&&(n=this.getNodeForOption("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n.isConnected||(n=this.getNodeForOption("fallbackFocus")),n}),Ve(this,"tryFocus",n=>{if(n!==!1&&n!==Ra(this.doc)){if(!n||!n.focus){this.tryFocus(this.getInitialFocusNode());return}n.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=n,UC(n)&&n.select()}}),Ve(this,"deactivate",n=>{if(!this.state.active)return this;let o={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...n};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),Bp.deactivateTrap(this.trapStack,this);let i=this.getOption(o,"onDeactivate"),a=this.getOption(o,"onPostDeactivate"),s=this.getOption(o,"checkCanReturnFocus"),l=this.getOption(o,"returnFocus","returnFocusOnDeactivate");i?.();let c=()=>{Fp(()=>{if(l){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}a?.()})};if(l&&s){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return s(u).then(c,c),this}return c(),this}),Ve(this,"pause",n=>{if(this.state.paused||!this.state.active)return this;let o=this.getOption(n,"onPause"),i=this.getOption(n,"onPostPause");return this.state.paused=!0,o?.(),this.removeListeners(),this.updateObservedNodes(),i?.(),this}),Ve(this,"unpause",n=>{if(!this.state.paused||!this.state.active)return this;let o=this.getOption(n,"onUnpause"),i=this.getOption(n,"onPostUnpause");return this.state.paused=!1,o?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i?.(),this}),Ve(this,"updateContainerElements",n=>(this.state.containers=Array.isArray(n)?n.filter(Boolean):[n].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ve(this,"getReturnFocusNode",n=>{let o=this.getNodeForOption("setReturnFocus",{params:[n]});return o||(o===!1?!1:n)}),Ve(this,"getOption",(n,o,i)=>n&&n[o]!==void 0?n[o]:this.config[i||o]),Ve(this,"getNodeForOption",(n,{hasFallback:o=!1,params:i=[]}={})=>{let a=this.config[n];if(typeof a=="function"&&(a=a(...i)),a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error(`\`${n}\` was specified but was not a node, or did not return a node`)}let s=a;if(typeof a=="string"){try{s=this.doc.querySelector(a)}catch(l){throw new Error(`\`${n}\` appears to be an invalid selector; error="${l.message}"`)}if(!s&&!o)throw new Error(`\`${n}\` as selector refers to no known node`)}return s}),Ve(this,"findNextNavNode",n=>{let{event:o,isBackward:i=!1}=n,a=n.target||Qe(o);this.updateTabbableNodes();let s=null;if(this.state.tabbableGroups.length>0){let l=this.findContainerIndex(a,o),c=l>=0?this.state.containerGroups[l]:void 0;if(l<0)i?s=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:s=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:d})=>a===d);if(u<0&&(c?.container===a||Ft(a)&&!xr(a)&&!c?.nextTabbableNode(a,!1))&&(u=l),u>=0){let d=u===0?this.state.tabbableGroups.length-1:u-1,p=this.state.tabbableGroups[d];s=co(a)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else mi(o)||(s=c?.nextTabbableNode(a,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:d})=>a===d);if(u<0&&(c?.container===a||Ft(a)&&!xr(a)&&!c?.nextTabbableNode(a))&&(u=l),u>=0){let d=u===this.state.tabbableGroups.length-1?0:u+1,p=this.state.tabbableGroups[d];s=co(a)>=0?p.firstTabbableNode:p.firstDomTabbableNode}else mi(o)||(s=c?.nextTabbableNode(a))}}else s=this.getNodeForOption("fallbackFocus");return s}),this.trapStack=t.trapStack||LC;let r={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(n){return mi(n)&&!n.shiftKey},isKeyBackward(n){return mi(n)&&n.shiftKey},...t};this.doc=r.document||ft(Array.isArray(e)?e[0]:e),this.config=r,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let r=typeof t?.composedPath=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:n,tabbableNodes:o})=>n.contains(e)||r?.includes(n)||o.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=un(e),r=Zl(e),n=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,i=r.find(c=>xr(c)),a=r.slice().reverse().find(c=>xr(c)),s=!!t.find(c=>co(c)>0);function l(c,u=!0){let d=t.indexOf(c);return d<0?u?r.slice(r.indexOf(c)+1).find(p=>xr(p)):r.slice(0,r.indexOf(c)).reverse().find(p=>xr(p)):t[d+(u?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:r,posTabIndexesFound:s,firstTabbableNode:n,lastTabbableNode:o,firstDomTabbableNode:i,lastDomTabbableNode:a,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return Bp.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Fp(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Ee(this.doc,"focusin",this.handleFocus,!0),Ee(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Ee(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Ee(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Ee(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Ee(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;let t=this.getOption(e,"onActivate"),r=this.getOption(e,"onPostActivate"),n=this.getOption(e,"checkCanFocusTrap");n||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t?.();let o=()=>{n&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.()};return n?(n(this.state.containers.concat()).then(o,o),this):(o(),this)}},mi=e=>e.key==="Tab",fi=(e,...t)=>typeof e=="function"?e(...t):e,FC=e=>!e.isComposing&&e.key==="Escape",Fp=e=>setTimeout(e,0),UC=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function Up(e,t={}){let r,n=ke(()=>{let o=typeof e=="function"?e():e;if(o){r=new BC(o,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o,...t,document:ft(o)});try{r.activate()}catch{}}});return function(){r?.deactivate(),n()}}var[Vp,bo]=Oe({hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),VC=e=>e.children(bo()),zC=e=>{let t=bo(),r=H(()=>t().getErrorTextProps(),e);return m(U,{get when(){return t().invalid},get children(){return m(Y.span,r)}})},GC=e=>{let t=bo(),r=H(()=>t().getHelperTextProps(),e);return m(Y.span,r)},HC=e=>{let t=bo(),r=H(()=>t().getLegendProps(),e);return m(Y.legend,r)},jC=et("fieldset").parts("root","errorText","helperText","legend"),Za=jC.build(),WC=e=>{nt();let t=ce({disabled:!1,invalid:!1},pt(e)),r,n=t.id??We(),o=`fieldset::${n}::error-text`,i=`fieldset::${n}::helper-text`,[a,s]=O(!1),[l,c]=O(!1);ve(()=>{});let u=[];a()&&t.invalid&&u.push(o),l()&&u.push(i);let d=()=>({...Za.root.attrs,disabled:t.disabled,"data-disabled":fe(t.disabled),"data-invalid":fe(t.invalid),"aria-describedby":u.join(" ")||void 0}),p=()=>({...Za.legend.attrs,"data-disabled":fe(t.disabled),"data-invalid":fe(t.invalid)}),f=()=>({id:i,...Za.helperText.attrs}),x=()=>({id:o,...Za.errorText.attrs,"aria-live":"polite"});return ee(()=>({refs:{rootRef:r},disabled:t.disabled,invalid:t.invalid,getRootProps:d,getLegendProps:p,getHelperTextProps:f,getErrorTextProps:x}))},zp=e=>{let[t,r]=Ae()(e,["id","disabled","invalid"]),n=WC(t),o=H(()=>n().getRootProps(),r);return m(Vp,{value:n,get children(){return m(Y.fieldset,o)}})};zp.displayName="FieldsetRoot";var qC=e=>{let[{value:t},r]=Ae()(e,["value"]),n=H(()=>t().getRootProps(),r);return m(Vp,{value:t,get children(){return m(Y.fieldset,n)}})},YC={};gt(YC,{Context:()=>VC,ErrorText:()=>zC,HelperText:()=>GC,Legend:()=>HC,Root:()=>zp,RootProvider:()=>qC});var Gp=e=>{if(!e)return;let t=Kt(e),r=st(e),n=ft(e),o=()=>{requestAnimationFrame(()=>{e.style.height="auto";let c;t.boxSizing==="content-box"?c=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):c=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&c>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),c=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${c}px`})};e.addEventListener("input",o),e.form?.addEventListener("reset",o);let i=Object.getPrototypeOf(e),a=Object.getOwnPropertyDescriptor(i,"value");Object.defineProperty(e,"value",{...a,set(){a?.set?.apply(this,arguments),o()}});let s=new r.ResizeObserver(()=>{requestAnimationFrame(()=>o())});s.observe(e);let l=new r.MutationObserver(()=>o());return l.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),n.fonts?.addEventListener("loadingdone",o),()=>{e.removeEventListener("input",o),e.form?.removeEventListener("reset",o),n.fonts?.removeEventListener("loadingdone",o),s.disconnect(),l.disconnect()}};var[Hp,er]=Oe({hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),KC=e=>e.children(er()),XC=e=>{let t=er(),r=H(()=>t().getErrorTextProps(),e);return m(U,{get when(){return t?.().invalid},get children(){return m(Y.span,r)}})},ZC=e=>{let t=er(),r=H(()=>t().getHelperTextProps(),e);return m(Y.span,r)},JC=e=>{let t=er(),r=H(()=>t?.().getInputProps(),e);return m(Y.input,r)},QC=e=>{let t=er(),r=H(()=>t?.().getLabelProps(),e);return m(Y.label,r)},eT=e=>{let t=er(),r=H(()=>t().getRequiredIndicatorProps(),e);return m(U,{get when(){return t().required},get fallback(){return e.fallback},get children(){return m(Y.span,ce(r,{get children(){return e.children??"*"}}))}})},tT=et("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator"),jr=tT.build(),rT=e=>{let t=bo(),r=nt(),n=ce({disabled:!!t?.().disabled,required:!1,invalid:!1,readOnly:!1},e),[o,i]=O(!1),[a,s]=O(!1),l=n.id??We(),[c,u]=O(void 0),d=n.ids?.control??`field::${l}`,p=n.ids?.errorText??`field::${l}::error-text`,f=n.ids?.helperText??`field::${l}::helper-text`,x=n.ids?.label??`field::${l}::label`;ae(()=>{let N=c();if(!N)return;let D=()=>{let M=r().getRootNode();i(!!M.getElementById(p)),s(!!M.getElementById(f))};D();let F=r().getWindow(),R=new F.MutationObserver(D);R.observe(N,{childList:!0,subtree:!0}),re(()=>R.disconnect())});let h=()=>({...jr.root.attrs,id:d,role:"group","data-disabled":fe(n.disabled),"data-invalid":fe(n.invalid),"data-readonly":fe(n.readOnly)}),w=()=>({...jr.label.attrs,id:x,"data-disabled":fe(n.disabled),"data-invalid":fe(n.invalid),"data-readonly":fe(n.readOnly),htmlFor:l}),T=ee(()=>{let N=[];return o()&&n.invalid&&N.push(p),a()&&N.push(f),N}),b=()=>({"aria-describedby":T().join(" ")||void 0,"aria-invalid":vr(n.invalid),"data-invalid":fe(n.invalid),"data-required":fe(n.required),"data-readonly":fe(n.readOnly),id:l,required:n.required,disabled:n.disabled,readOnly:n.readOnly||void 0}),y=()=>({...b(),...jr.input.attrs}),g=()=>({...b(),...jr.textarea.attrs}),k=()=>({...b(),...jr.select.attrs}),S=()=>({id:f,...jr.helperText.attrs,"data-disabled":fe(n.disabled)}),P=()=>({id:p,...jr.errorText.attrs,"aria-live":"polite"}),A=()=>({"aria-hidden":!0,...jr.requiredIndicator.attrs});return ee(()=>({ariaDescribedby:T().join(" "),ids:{control:l,label:x,errorText:p,helperText:f},refs:{rootRef:u},disabled:n.disabled,invalid:n.invalid,readOnly:n.readOnly,required:n.required,getLabelProps:w,getRootProps:h,getInputProps:y,getTextareaProps:g,getSelectProps:k,getHelperTextProps:S,getErrorTextProps:P,getRequiredIndicatorProps:A}))},nT=e=>{let[t,r]=Ae()(e,["id","ids","disabled","invalid","readOnly","required"]),n=rT(t),o=H(()=>n().getRootProps(),r);return m(Hp,{value:n,get children(){return m(Y.div,ce(o,{ref(i){var a=Ur(n().refs.rootRef,e.ref);typeof a=="function"&&a(i)}}))}})},oT=e=>{let[{value:t},r]=Ae()(e,["value"]),n=H(()=>t().getRootProps(),r);return m(Hp,{value:t,get children(){return m(Y.div,n)}})},iT=e=>{let t=er(),r=H(()=>t?.().getSelectProps(),e);return m(Y.select,r)},aT=e=>{let t=er(),r,[n,o]=De(e,["autoresize"]),i=H(()=>t?.().getTextareaProps(),()=>({style:{resize:n.autoresize?"none":void 0}}),o);return ae(()=>{if(!n.autoresize)return;let a=Gp(r);re(()=>a?.())}),m(Y.textarea,ce(i,{ref(a){var s=Ur(l=>r=l,e.ref);typeof s=="function"&&s(a)}}))},sT={};gt(sT,{Context:()=>KC,ErrorText:()=>XC,HelperText:()=>ZC,Input:()=>JC,Label:()=>QC,RequiredIndicator:()=>eT,Root:()=>nT,RootProvider:()=>oT,Select:()=>iT,Textarea:()=>aT});function jp(){return{and:(...e)=>function(r){return e.every(n=>r.guard(n))},or:(...e)=>function(r){return e.some(n=>r.guard(n))},not:e=>function(r){return!r.guard(e)}}}var Jp=et("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),yo=Jp.build(),lT=e=>`toast-group:${e}`,Wp=(e,t)=>e.getById(`toast-group:${t}`),Qp=e=>`toast:${e.id}`,qp=e=>e.getById(Qp(e)),Yp=e=>`toast:${e.id}:title`,Kp=e=>`toast:${e.id}:description`,cT=e=>`toast${e.id}:close`,Xp={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function uc(e,t){return e??Xp[t]??Xp.DEFAULT}var uT=e=>typeof e=="string"?{left:e,right:e,bottom:e,top:e}:e;function dT(e,t){let{prop:r,computed:n,context:o}=e,{offsets:i,gap:a}=r("store").attrs,s=o.get("heights"),l=uT(i),c=r("dir")==="rtl",u=t.replace("-start",c?"-right":"-left").replace("-end",c?"-left":"-right"),d=u.includes("right"),p=u.includes("left"),f={position:"fixed",pointerEvents:n("count")>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${a}px`,"--first-height":`${s[0]?.height||0}px`,zIndex:_a},x="center";if(d&&(x="flex-end"),p&&(x="flex-start"),f.alignItems=x,u.includes("top")){let h=l.top;f.top=`max(env(safe-area-inset-top, 0px), ${h})`}if(u.includes("bottom")){let h=l.bottom;f.bottom=`max(env(safe-area-inset-bottom, 0px), ${h})`}if(!u.includes("left")){let h=l.right;f.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${h})`}if(!u.includes("right")){let h=l.left;f.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${h})`}return f}function mT(e,t){let{prop:r,context:n,computed:o}=e,i=r("parent"),a=i.computed("placement"),{gap:s}=i.prop("store").attrs,[l]=a.split("-"),c=n.get("mounted"),u=n.get("remainingTime"),d=o("height"),p=o("frontmost"),f=!p,x=!r("stacked"),h=r("stacked"),T=r("type")==="loading"?Number.MAX_SAFE_INTEGER:u,b=o("heightIndex")*s+o("heightBefore"),y={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${r("removeDelay")}ms`,"--duration":`${T}ms`,"--initial-height":`${d}px`,"--offset":`${b}px`,"--index":r("index"),"--z-index":o("zIndex"),"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},g=k=>Object.assign(y,k);return l==="top"?g({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):l==="bottom"&&g({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),c&&(g({"--y":"0","--opacity":"1"}),h&&g({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||g({"--opacity":"0",pointerEvents:"none"}),f&&x&&(g({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||g({"--y":"calc(var(--sign) * 40%)"})),f&&h&&!t&&g({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),p&&!t&&g({"--y":"calc(var(--lift) * -100%)"}),y}function fT(e,t){let{computed:r}=e,n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},o=i=>Object.assign(n,i);return r("frontmost")&&!t&&o({height:"calc(var(--initial-height) + 80%)"}),n}function pT(){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function gT(e,t){let{context:r,prop:n,send:o,refs:i,computed:a}=e;return{getCount(){return r.get("toasts").length},getToasts(){return r.get("toasts")},getGroupProps(s={}){let{label:l="Notifications"}=s,{hotkey:c}=n("store").attrs,u=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=a("placement"),[p,f="center"]=d.split("-");return t.element({...yo.group.attrs,dir:n("dir"),tabIndex:-1,"aria-label":`${d} ${l} ${u}`,id:lT(d),"data-placement":d,"data-side":p,"data-align":f,"aria-live":"polite",role:"region",style:dT(e,d),onMouseMove(){o({type:"REGION.POINTER_ENTER",placement:d})},onMouseLeave(){o({type:"REGION.POINTER_LEAVE",placement:d})},onFocus(x){o({type:"REGION.FOCUS",target:x.relatedTarget})},onBlur(x){i.get("isFocusWithin")&&!It(x.currentTarget,x.relatedTarget)&&queueMicrotask(()=>o({type:"REGION.BLUR"}))}})},subscribe(s){return n("store").subscribe(()=>s(r.get("toasts")))}}}var hT={props({props:e}){return{dir:"ltr",id:Ul(),...e,store:e.store}},initialState({prop:e}){return e("store").attrs.overlap?"overlap":"stack"},refs(){return{lastFocusedEl:null,isFocusWithin:!1,dismissableCleanup:void 0}},context({bindable:e}){return{toasts:e(()=>({defaultValue:[],sync:!0,hash:t=>t.map(r=>r.id).join(",")})),heights:e(()=>({defaultValue:[],sync:!0}))}},computed:{count:({context:e})=>e.get("toasts").length,overlap:({prop:e})=>e("store").attrs.overlap,placement:({prop:e})=>e("store").attrs.placement},effects:["subscribeToStore","trackDocumentVisibility","trackHotKeyPress"],watch({track:e,context:t,action:r}){e([()=>t.hash("toasts")],()=>{queueMicrotask(()=>{r(["collapsedIfEmpty","setDismissableBranch"])})})},exit:["clearDismissableBranch","clearLastFocusedEl"],on:{"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["collapseToasts","resumeToasts","restoreLastFocusedEl"]},{target:"stack",actions:["resumeToasts","restoreLastFocusedEl"]}],"TOAST.REMOVE":{actions:["removeToast","removeHeight"]},"TOAST.PAUSE":{actions:["pauseToasts"]}},states:{stack:{on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","collapseToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap",actions:["collapseToasts"]},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{on:{"REGION.STACK":{target:"stack",actions:["expandToasts"]},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts","expandToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts","expandToasts"]}}}},implementations:{guards:{isOverlapping:({computed:e})=>e("overlap")},effects:{subscribeToStore({context:e,prop:t}){return t("store").subscribe(r=>{if(r.dismiss){e.set("toasts",n=>n.filter(o=>o.id!==r.id));return}e.set("toasts",n=>{let o=n.findIndex(i=>i.id===r.id);return o!==-1?[...n.slice(0,o),{...n[o],...r},...n.slice(o+1)]:[r,...n]})})},trackHotKeyPress({prop:e,send:t}){return Ee(document,"keydown",n=>{let{hotkey:o}=e("store").attrs;o.every(a=>n[a]||n.code===a)&&t({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility({prop:e,send:t,scope:r}){let{pauseOnPageIdle:n}=e("store").attrs;if(!n)return;let o=r.getDoc();return Ee(o,"visibilitychange",()=>{let i=o.visibilityState==="hidden";t({type:i?"PAUSE_ALL":"RESUME_ALL"})})}},actions:{setDismissableBranch({refs:e,context:t,computed:r,scope:n}){let o=t.get("toasts"),i=r("placement"),a=o.length>0;if(!a){e.get("dismissableCleanup")?.();return}if(a&&e.get("dismissableCleanup"))return;let l=Lp(()=>Wp(n,i),{defer:!0});e.set("dismissableCleanup",l)},clearDismissableBranch({refs:e}){e.get("dismissableCleanup")?.()},focusRegionEl({scope:e,computed:t}){queueMicrotask(()=>{Wp(e,t("placement"))?.focus()})},pauseToasts({prop:e}){e("store").pause()},resumeToasts({prop:e}){e("store").resume()},expandToasts({prop:e}){e("store").expand()},collapseToasts({prop:e}){e("store").collapse()},removeToast({prop:e,event:t}){e("store").remove(t.id)},removeHeight({event:e,context:t}){e?.id!=null&&queueMicrotask(()=>{t.set("heights",r=>r.filter(n=>n.id!==e.id))})},collapsedIfEmpty({send:e,computed:t}){!t("overlap")||t("count")>1||e({type:"REGION.OVERLAP"})},setLastFocusedEl({refs:e,event:t}){e.get("isFocusWithin")||!t.target||(e.set("isFocusWithin",!0),e.set("lastFocusedEl",t.target))},restoreLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))},clearLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))}}}};function eg(e,t){let{state:r,send:n,prop:o,scope:i,context:a,computed:s}=e,l=r.hasTag("visible"),c=r.hasTag("paused"),u=a.get("mounted"),d=s("frontmost"),p=o("parent").computed("placement"),f=o("type"),x=o("stacked"),h=o("title"),w=o("description"),T=o("action"),[b,y="center"]=p.split("-");return{type:f,title:h,description:w,placement:p,visible:l,paused:c,closable:!!o("closable"),pause(){n({type:"PAUSE"})},resume(){n({type:"RESUME"})},dismiss(){n({type:"DISMISS",src:"programmatic"})},getRootProps(){return t.element({...yo.root.attrs,dir:o("dir"),id:Qp(i),"data-state":l?"open":"closed","data-type":f,"data-placement":p,"data-align":y,"data-side":b,"data-mounted":fe(u),"data-paused":fe(c),"data-first":fe(d),"data-sibling":fe(!d),"data-stack":fe(x),"data-overlap":fe(!x),role:"status","aria-atomic":"true","aria-describedby":w?Kp(i):void 0,"aria-labelledby":h?Yp(i):void 0,tabIndex:0,style:mT(e,l),onKeyDown(g){g.defaultPrevented||g.key=="Escape"&&(n({type:"DISMISS",src:"keyboard"}),g.preventDefault())}})},getGhostBeforeProps(){return t.element({"data-ghost":"before",style:fT(e,l)})},getGhostAfterProps(){return t.element({"data-ghost":"after",style:pT()})},getTitleProps(){return t.element({...yo.title.attrs,id:Yp(i)})},getDescriptionProps(){return t.element({...yo.description.attrs,id:Kp(i)})},getActionTriggerProps(){return t.button({...yo.actionTrigger.attrs,type:"button",onClick(g){g.defaultPrevented||(T?.onClick?.(),n({type:"DISMISS",src:"user"}))}})},getCloseTriggerProps(){return t.button({id:cT(i),...yo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(g){g.defaultPrevented||n({type:"DISMISS",src:"user"})}})}}}var{not:bT}=jp(),tg={props({props:e}){return Sa(e,["id","type","parent","removeDelay"],"toast"),{closable:!0,...e,duration:uc(e.duration,e.type)}},initialState({prop:e}){return e("type")==="loading"||e("duration")===1/0?"visible:persist":"visible"},context({prop:e,bindable:t}){return{remainingTime:t(()=>({defaultValue:uc(e("duration"),e("type"))})),createdAt:t(()=>({defaultValue:Date.now()})),mounted:t(()=>({defaultValue:!1})),initialHeight:t(()=>({defaultValue:0}))}},refs(){return{closeTimerStartTime:Date.now(),lastCloseStartTimerStartTime:0}},computed:{zIndex:({prop:e})=>{let t=e("parent").context.get("toasts"),r=t.findIndex(n=>n.id===e("id"));return t.length-r},height:({prop:e})=>e("parent").context.get("heights").find(n=>n.id===e("id"))?.height??0,heightIndex:({prop:e})=>e("parent").context.get("heights").findIndex(r=>r.id===e("id")),frontmost:({prop:e})=>e("index")===0,heightBefore:({prop:e})=>{let t=e("parent").context.get("heights"),r=t.findIndex(n=>n.id===e("id"));return t.reduce((n,o,i)=>i>=r?n:n+o.height,0)},shouldPersist:({prop:e})=>e("type")==="loading"||e("duration")===1/0},watch({track:e,prop:t,send:r}){e([()=>t("message")],()=>{let n=t("message");n&&r({type:n,src:"programmatic"})}),e([()=>t("type"),()=>t("duration")],()=>{r({type:"UPDATE"})})},on:{UPDATE:[{guard:"shouldPersist",target:"visible:persist",actions:["resetCloseTimer"]},{target:"visible:updating",actions:["resetCloseTimer"]}],MEASURE:{actions:["measureHeight"]}},entry:["setMounted","measureHeight","invokeOnVisible"],effects:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],effects:["waitForNextTick"],on:{SHOW:{target:"visible"}}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:bT("isLoadingType"),target:"visible",actions:["setCloseTimer"]},DISMISS:{target:"dismissing"}}},visible:{tags:["visible"],effects:["waitForDuration"],on:{DISMISS:{target:"dismissing"},PAUSE:{target:"visible:persist",actions:["syncRemainingTime"]}}},dismissing:{entry:["invokeOnDismiss"],effects:["waitForRemoveDelay"],on:{REMOVE:{target:"unmounted",actions:["notifyParentToRemove"]}}},unmounted:{entry:["invokeOnUnmount"]}},implementations:{effects:{waitForRemoveDelay({prop:e,send:t}){return Ta(()=>{t({type:"REMOVE",src:"timer"})},e("removeDelay"))},waitForDuration({send:e,context:t,computed:r}){if(!r("shouldPersist"))return Ta(()=>{e({type:"DISMISS",src:"timer"})},t.get("remainingTime"))},waitForNextTick({send:e}){return Ta(()=>{e({type:"SHOW",src:"timer"})},0)},trackHeight({scope:e,prop:t}){let r;return ke(()=>{let n=qp(e);if(!n)return;let o=()=>{let s=n.style.height;n.style.height="auto";let l=n.getBoundingClientRect().height;n.style.height=s;let c={id:t("id"),height:l};Zp(t("parent"),c)},i=e.getWin(),a=new i.MutationObserver(o);a.observe(n,{childList:!0,subtree:!0,characterData:!0}),r=()=>a.disconnect()}),()=>r?.()}},guards:{isLoadingType:({prop:e})=>e("type")==="loading",shouldPersist:({computed:e})=>e("shouldPersist")},actions:{setMounted({context:e}){ke(()=>{e.set("mounted",!0)})},measureHeight({scope:e,prop:t,context:r}){queueMicrotask(()=>{let n=qp(e);if(!n)return;let o=n.style.height;n.style.height="auto";let i=n.getBoundingClientRect().height;n.style.height=o,r.set("initialHeight",i);let a={id:t("id"),height:i};Zp(t("parent"),a)})},setCloseTimer({refs:e}){e.set("closeTimerStartTime",Date.now())},resetCloseTimer({context:e,refs:t,prop:r}){t.set("closeTimerStartTime",Date.now()),e.set("remainingTime",uc(r("duration"),r("type")))},syncRemainingTime({context:e,refs:t}){e.set("remainingTime",r=>{let n=t.get("closeTimerStartTime"),o=Date.now()-n;return t.set("lastCloseStartTimerStartTime",Date.now()),r-o})},notifyParentToRemove({prop:e}){e("parent").send({type:"TOAST.REMOVE",id:e("id")})},invokeOnDismiss({prop:e,event:t}){e("onStatusChange")?.({status:"dismissing",src:t.src})},invokeOnUnmount({prop:e}){e("onStatusChange")?.({status:"unmounted"})},invokeOnVisible({prop:e}){e("onStatusChange")?.({status:"visible"})}}}};function Zp(e,t){let{id:r,height:n}=t;e.context.set("heights",o=>o.find(a=>a.id===r)?o.map(a=>a.id===r?{...a,height:n}:a):[{id:r,height:n},...o])}var yT=(e,t)=>({...t,...cn(e)});function rg(e){let t=yT(e,{placement:"bottom",overlap:!1,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:!0}),r=[],n=[],o=new Set,i=[],a=R=>(r.push(R),()=>{let M=r.indexOf(R);r.splice(M,1)}),s=R=>(r.forEach(M=>M(R)),R),l=R=>{if(n.length>=t.max){i.push(R);return}s(R),n.unshift(R)},c=()=>{for(;i.length>0&&n.length<t.max;){let R=i.shift();R&&(s(R),n.unshift(R))}},u=R=>{let M=R.id??`toast:${Ul()}`,z=n.find(K=>K.id===M);return o.has(M)&&o.delete(M),z?n=n.map(K=>K.id===M?s({...K,...R,id:M}):K):l({id:M,duration:t.duration,removeDelay:t.removeDelay,type:"info",...R,stacked:!t.overlap,gap:t.gap}),M},d=R=>(o.add(R),R?(r.forEach(M=>M({id:R,dismiss:!0})),n=n.filter(M=>M.id!==R),c()):(n.forEach(M=>{r.forEach(z=>z({id:M.id,dismiss:!0}))}),n=[],i=[]),R);return{attrs:t,subscribe:a,create:u,update:(R,M)=>u({id:R,...M}),remove:d,dismiss:R=>{R!=null?n=n.map(M=>M.id===R?s({...M,message:"DISMISS"}):M):n=n.map(M=>s({...M,message:"DISMISS"}))},error:R=>u({...R,type:"error"}),success:R=>u({...R,type:"success"}),info:R=>u({...R,type:"info"}),warning:R=>u({...R,type:"warning"}),loading:R=>u({...R,type:"loading"}),getVisibleToasts:()=>n.filter(R=>!o.has(R.id)),getCount:()=>n.length,promise:(R,M,z={})=>{if(!M)return;let K;M.loading!==void 0&&(K=u({...z,...M.loading,promise:R,type:"loading"}));let I=K!==void 0,B,j=ln(R).then(async le=>{if(B=["resolve",le],xT(le)&&!le.ok){I=!1;let Q=ln(M.error,`HTTP Error! status: ${le.status}`);u({...z,...Q,id:K,type:"error"})}else if(M.success!==void 0){I=!1;let Q=ln(M.success,le);u({...z,...Q,id:K,type:"success"})}}).catch(async le=>{if(B=["reject",le],M.error!==void 0){I=!1;let Q=ln(M.error,le);u({...z,...Q,id:K,type:"error"})}}).finally(()=>{I&&(d(K),K=void 0),M.finally?.()});return{id:K,unwrap:()=>new Promise((le,Q)=>j.then(()=>B[0]==="reject"?Q(B[1]):le(B[1])).catch(Q))}},pause:R=>{R!=null?n=n.map(M=>M.id===R?s({...M,message:"PAUSE"}):M):n=n.map(M=>s({...M,message:"PAUSE"}))},resume:R=>{R!=null?n=n.map(M=>M.id===R?s({...M,message:"RESUME"}):M):n=n.map(M=>s({...M,message:"RESUME"}))},isVisible:R=>!o.has(R)&&!!n.find(M=>M.id===R),isDismissed:R=>o.has(R),expand:()=>{n=n.map(R=>s({...R,stacked:!0}))},collapse:()=>{n=n.map(R=>s({...R,stacked:!1}))}}}var xT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dc={connect:gT,machine:hT};var mc=e=>rg(e),[wT,vn]=Oe({hookName:"useToastContext",providerName:"<ToastProvider />"}),ng=e=>{let t=vn(),r=H(()=>t().getActionTriggerProps(),e);return m(Y.button,r)},og=e=>{let t=vn(),r=H(()=>t().getCloseTriggerProps(),e);return m(Y.button,r)},ig=e=>e.children(vn()),ag=e=>{let t=vn(),r=H(()=>t().getDescriptionProps(),e);return m(Y.div,r)},kT=C("<div><div></div><div>"),sg=e=>{let t=vn(),r=H(()=>t().getRootProps(),e);return(()=>{var n=kT(),o=n.firstChild,i=o.nextSibling;return be(n,r,!1,!0),be(o,ce(()=>t().getGhostBeforeProps()),!1,!1),v(n,()=>e.children,i),be(i,ce(()=>t().getGhostAfterProps()),!1,!1),n})()},lg=e=>{let t=vn(),r=H(()=>t().getTitleProps(),e);return m(Y.div,r)},fc=e=>{let[t,r]=De(e,["toaster","children"]),n=Ut(),o=nt(),i=xt(dc.machine,()=>({store:t.toaster,id:We(),dir:n()?.dir,getRootNode:o()?.getRootNode})),a=ee(()=>dc.connect(i,vt)),s=ee(()=>a().getToasts()),l=H(()=>a().getGroupProps(),r);return m(Y.div,ce(l,{get children(){return m(Bl,{get each(){return s()},by:"id",children:(c,u)=>m(CT,{value:c,index:u,parent:i,children:d=>t.children(d)})})}}))},CT=e=>{let t=nt(),r=ee(()=>({...e.value(),parent:e.parent,index:e.index(),getRootNode:t().getRootNode})),n=xt(tg,r),o=ee(()=>eg(n,vt));return m(wT,{value:o,get children(){return e.children(e.value)}})},wn={};gt(wn,{ActionTrigger:()=>ng,CloseTrigger:()=>og,Context:()=>ig,Description:()=>ag,Root:()=>sg,Title:()=>lg});var TT=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),ST=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,cg=e=>{let t={},r;for(;r=ST.exec(e);)t[r[1]]=r[2];return t},ET=(e,t)=>{if(_t(e)){if(_t(t))return`${e};${t}`;e=cg(e)}else _t(t)&&(t=cg(t));return Object.assign({},e??{},t??{})};function ug(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=Yt(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=TT(t[n],r[n]);continue}if(n==="style"){t[n]=ET(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n]}for(let n in r)t[n]===void 0&&(t[n]=r[n])}return t}function dg(){return{and:(...e)=>function(r){return e.every(n=>r.guard(n))},or:(...e)=>function(r){return e.some(n=>r.guard(n))},not:e=>function(r){return!r.guard(e)}}}var pi=(e,t)=>({x:e,y:t});function PT(e){let{x:t,y:r,width:n,height:o}=e,i=t+n/2,a=r+o/2;return{x:t,y:r,width:n,height:o,minX:t,minY:r,maxX:t+n,maxY:r+o,midX:i,midY:a,center:pi(i,a)}}function _T(e){let t=pi(e.minX,e.minY),r=pi(e.maxX,e.minY),n=pi(e.maxX,e.maxY),o=pi(e.minX,e.maxY);return{top:t,right:r,bottom:n,left:o}}var{min:cN,max:uN}=Math;function mg(e,t){let r=PT(e),{top:n,right:o,left:i,bottom:a}=_T(r),[s]=t.split("-");return{top:[i,n,o,a],right:[n,o,a,i],bottom:[n,i,a,o],left:[o,n,i,a]}[s]}function fg(e,t){let{x:r,y:n}=t,o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let s=e[i].x,l=e[i].y,c=e[a].x,u=e[a].y;l>n!=u>n&&r<(c-s)*(n-l)/(u-l)+s&&(o=!o)}return o}var{sign:dN,abs:mN,min:fN}=Math;var yg=et("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),kt=yg.build(),es=e=>e.ids?.trigger??`menu:${e.id}:trigger`,xg=e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,gi=e=>e.ids?.content??`menu:${e.id}:content`,IT=e=>e.ids?.arrow??`menu:${e.id}:arrow`,vg=e=>e.ids?.positioner??`menu:${e.id}:popper`,AT=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,hi=(e,t)=>`${e.id}/${t}`,kn=e=>e?.dataset.value??null,pg=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,Wr=e=>e.getById(gi(e)),gg=e=>e.getById(vg(e)),Ja=e=>e.getById(es(e)),wg=(e,t)=>t?e.getById(hi(e,t)):null,hg=e=>e.getById(xg(e)),bi=e=>{let r=`[role^="menuitem"][data-ownedby=${CSS.escape(gi(e))}]:not([data-disabled])`;return La(Wr(e),r)},RT=e=>Gm(bi(e)),OT=e=>Hm(bi(e)),gc=(e,t)=>t?e.id===t||e.dataset.value===t:!1,$T=(e,t)=>{let r=bi(e),n=r.findIndex(o=>gc(o,t.value));return Ym(r,n,{loop:t.loop??t.loopFocus})},NT=(e,t)=>{let r=bi(e),n=r.findIndex(o=>gc(o,t.value));return Km(r,n,{loop:t.loop??t.loopFocus})},MT=(e,t)=>{let r=bi(e),n=r.find(o=>gc(o,t.value));return ec(r,{state:t.typeaheadState,key:t.key,activeId:n?.id??null})},Qa=e=>je(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),DT=e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),pc="menu:select";function LT(e,t){if(!e)return;let r=st(e),n=new r.CustomEvent(pc,{detail:{value:t}});e.dispatchEvent(n)}function kg(e,t){let{context:r,send:n,state:o,computed:i,prop:a,scope:s}=e,l=o.hasTag("open"),c=i("isSubmenu"),u=i("isTypingAhead"),d=a("composite"),p=r.get("currentPlacement"),f=r.get("anchorPoint"),x=r.get("highlightedValue"),h=_p({...a("positioning"),placement:f?"bottom":p});function w(g){return{id:hi(s,g.value),disabled:!!g.disabled,highlighted:x===g.value}}function T(g){let k=g.valueText??g.value;return{...g,id:g.value,valueText:k}}function b(g){return{...w(T(g)),checked:!!g.checked}}function y(g){let{closeOnSelect:k,valueText:S,value:P}=g,A=w(g),N=hi(s,P);return t.element({...kt.item.attrs,id:N,role:"menuitem","aria-disabled":vr(A.disabled),"data-disabled":fe(A.disabled),"data-ownedby":gi(s),"data-highlighted":fe(A.highlighted),"data-value":P,"data-valuetext":S,onDragStart(D){D.currentTarget.matches("a[href]")&&D.preventDefault()},onPointerMove(D){if(A.disabled||D.pointerType!=="mouse")return;let F=D.currentTarget;A.highlighted||n({type:"ITEM_POINTERMOVE",id:N,target:F,closeOnSelect:k})},onPointerLeave(D){if(A.disabled||D.pointerType!=="mouse"||!e.event.previous()?.type.includes("POINTER"))return;let R=D.currentTarget;n({type:"ITEM_POINTERLEAVE",id:N,target:R,closeOnSelect:k})},onPointerDown(D){if(A.disabled)return;let F=D.currentTarget;n({type:"ITEM_POINTERDOWN",target:F,id:N,closeOnSelect:k})},onClick(D){if(Yl(D)||ql(D)||A.disabled)return;let F=D.currentTarget;n({type:"ITEM_CLICK",target:F,id:N,closeOnSelect:k})}})}return{highlightedValue:x,open:l,setOpen(g){o.hasTag("open")!==g&&n({type:g?"OPEN":"CLOSE"})},setHighlightedValue(g){n({type:"HIGHLIGHTED.SET",value:g})},setParent(g){n({type:"PARENT.SET",value:g,id:g.prop("id")})},setChild(g){n({type:"CHILD.SET",value:g,id:g.prop("id")})},reposition(g={}){n({type:"POSITIONING.SET",options:g})},addItemListener(g){let k=s.getById(g.id);if(!k)return;let S=()=>g.onSelect?.();return k.addEventListener(pc,S),()=>k.removeEventListener(pc,S)},getContextTriggerProps(){return t.element({...kt.contextTrigger.attrs,dir:a("dir"),id:xg(s),onPointerDown(g){if(g.pointerType==="mouse")return;let k=Gr(g);n({type:"CONTEXT_MENU_START",point:k})},onPointerCancel(g){g.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(g){g.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(g){g.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(g){let k=Gr(g);n({type:"CONTEXT_MENU",point:k}),g.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(g){let k=g.getTriggerProps();return ug(y({value:k.id}),k)},getTriggerProps(){return t.button({...c?kt.triggerItem.attrs:kt.trigger.attrs,"data-placement":r.get("currentPlacement"),type:"button",dir:a("dir"),id:es(s),"data-uid":a("id"),"aria-haspopup":d?"menu":"dialog","aria-controls":gi(s),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(g){if(g.pointerType!=="mouse"||Qa(g.currentTarget)||!c)return;let S=Gr(g);n({type:"TRIGGER_POINTERMOVE",target:g.currentTarget,point:S})},onPointerLeave(g){if(Qa(g.currentTarget)||g.pointerType!=="mouse"||!c)return;let k=Gr(g);n({type:"TRIGGER_POINTERLEAVE",target:g.currentTarget,point:k})},onPointerDown(g){Qa(g.currentTarget)||Na(g)||g.preventDefault()},onClick(g){g.defaultPrevented||Qa(g.currentTarget)||n({type:"TRIGGER_CLICK",target:g.currentTarget})},onBlur(){n({type:"TRIGGER_BLUR"})},onFocus(){n({type:"TRIGGER_FOCUS"})},onKeyDown(g){if(g.defaultPrevented)return;let k={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},Enter(){n({type:"ARROW_DOWN",src:"enter"})},Space(){n({type:"ARROW_DOWN",src:"space"})}},S=ii(g,{orientation:"vertical",dir:a("dir")}),P=k[S];P&&(g.preventDefault(),P(g))}})},getIndicatorProps(){return t.element({...kt.indicator.attrs,dir:a("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...kt.positioner.attrs,dir:a("dir"),id:vg(s),style:h.floating})},getArrowProps(){return t.element({id:IT(s),...kt.arrow.attrs,dir:a("dir"),style:h.arrow})},getArrowTipProps(){return t.element({...kt.arrowTip.attrs,dir:a("dir"),style:h.arrowTip})},getContentProps(){return t.element({...kt.content.attrs,id:gi(s),"aria-label":a("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:d?"menu":"dialog",tabIndex:0,dir:a("dir"),"aria-activedescendant":i("highlightedId")||void 0,"aria-labelledby":es(s),"data-placement":p,onPointerEnter(g){g.pointerType==="mouse"&&n({type:"MENU_POINTERENTER"})},onKeyDown(g){if(g.defaultPrevented||!$a(g))return;let k=Qe(g);if(!(k?.closest("[role=menu]")===g.currentTarget||k===g.currentTarget))return;if(g.key==="Tab"&&!wf(g)){g.preventDefault();return}let P=wg(s,x),A={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},ArrowLeft(){n({type:"ARROW_LEFT"})},ArrowRight(){n({type:"ARROW_RIGHT"})},Enter(){n({type:"ENTER"}),x!=null&&mf(P)&&a("navigate")?.({value:x,node:P,href:P.href})},Space(F){u?n({type:"TYPEAHEAD",key:F.key}):A.Enter?.(F)},Home(){n({type:"HOME"})},End(){n({type:"END"})}},N=ii(g,{dir:a("dir")}),D=A[N];if(D){D(g),g.stopPropagation(),g.preventDefault();return}a("typeahead")&&gf(g)&&(oi(g)||Aa(k)||(n({type:"TYPEAHEAD",key:g.key}),g.preventDefault()))}})},getSeparatorProps(){return t.element({...kt.separator.attrs,role:"separator",dir:a("dir"),"aria-orientation":"horizontal"})},getItemState:w,getItemProps:y,getOptionItemState:b,getOptionItemProps(g){let{type:k,disabled:S,onCheckedChange:P,closeOnSelect:A}=g,N=T(g),D=b(g);return{...y(N),...t.element({"data-type":k,...kt.item.attrs,dir:a("dir"),"data-value":N.value,role:`menuitem${k}`,"aria-checked":!!D.checked,"data-state":D.checked?"checked":"unchecked",onClick(F){if(S||Yl(F)||ql(F))return;let R=F.currentTarget;n({type:"ITEM_CLICK",target:R,option:N,closeOnSelect:A}),P?.(!D.checked)}})}},getItemIndicatorProps(g){let k=b(g);return t.element({...kt.itemIndicator.attrs,dir:a("dir"),"data-disabled":fe(k.disabled),"data-highlighted":fe(k.highlighted),"data-state":k.checked?"checked":"unchecked",hidden:!k.checked})},getItemTextProps(g){let k=b(g);return t.element({...kt.itemText.attrs,dir:a("dir"),"data-disabled":fe(k.disabled),"data-highlighted":fe(k.highlighted),"data-state":k.checked?"checked":"unchecked"})},getItemGroupLabelProps(g){return t.element({...kt.itemGroupLabel.attrs,id:pg(s,g.htmlFor),dir:a("dir")})},getItemGroupProps(g){return t.element({id:AT(s,g.id),...kt.itemGroup.attrs,dir:a("dir"),"aria-labelledby":pg(s,g.id),role:"group"})}}}var{not:Gt,and:xo,or:BT}=dg(),Cg={props({props:e}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(t){kf(t.node)},...e,positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},context({bindable:e,prop:t}){return{suspendPointer:e(()=>({defaultValue:!1})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(r){t("onHighlightChange")?.({highlightedValue:r})}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(r){return`x: ${r?.x}, y: ${r?.y}`}}))}},refs(){return{parent:null,children:{},typeaheadState:{...ec.defaultOptions},positioningOverride:{}}},computed:{isSubmenu:({refs:e})=>e.get("parent")!=null,isRtl:({prop:e})=>e("dir")==="rtl",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar!=="",highlightedId:({context:e,scope:t,refs:r})=>UT(r.get("children"),e.get("highlightedValue"),t)},watch({track:e,action:t,context:r,computed:n,prop:o}){e([()=>n("isSubmenu")],()=>{t(["setSubmenuPlacement"])}),e([()=>r.hash("anchorPoint")],()=>{t(["reposition"])}),e([()=>o("open")],()=>{t(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:Gt("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:BT("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:xo(Gt("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:Gt("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:xo("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:Gt("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:xo(Gt("isPointerSuspended"),Gt("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:xo(Gt("isTriggerItemHighlighted"),Gt("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:xo(Gt("isTriggerItemHighlighted"),Gt("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:xo(Gt("isTriggerItemHighlighted"),Gt("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e("closeOnSelect")),isTriggerItem:({event:e})=>DT(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:r})=>!!(e.target??t.getById(r("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({computed:e})=>e("isSubmenu"),isPointerSuspended:({context:e})=>e.get("suspendPointer"),isHighlightedItemEditable:({scope:e,computed:t})=>Aa(e.getById(t("highlightedId"))),isOpenControlled:({prop:e})=>e("open")!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:e})=>e.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:e})=>e.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.OPEN"})},100);return()=>clearTimeout(t)},waitForCloseDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(t)},waitForLongPress({send:e}){let t=setTimeout(()=>{e({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(t)},trackPositioning({context:e,prop:t,scope:r,refs:n}){if(hg(r))return;let o={...t("positioning"),...n.get("positioningOverride")};e.set("currentPlacement",o.placement);let i=()=>gg(r);return cc(Ja(r),i,{...o,defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})},trackInteractOutside({refs:e,scope:t,prop:r,computed:n,send:o}){let i=()=>Wr(t),a=!0;return Xa(i,{defer:!0,exclude:[Ja(t)],onInteractOutside:r("onInteractOutside"),onFocusOutside:r("onFocusOutside"),onEscapeKeyDown(s){r("onEscapeKeyDown")?.(s),n("isSubmenu")&&s.preventDefault(),bg({parent:e.get("parent")})},onPointerDownOutside(s){let l=Qe(s.detail.originalEvent);if(It(hg(t),l)&&s.detail.contextmenu){s.preventDefault();return}a=!s.detail.focusable,r("onPointerDownOutside")?.(s)},onDismiss(){o({type:"CLOSE",src:"interact-outside",restoreFocus:a})}})},trackPointerMove({context:e,scope:t,send:r,refs:n,flush:o}){let i=n.get("parent");o(()=>{i.context.set("suspendPointer",!0)});let a=t.getDoc();return Ee(a,"pointermove",s=>{FT(e.get("intentPolygon"),{x:s.clientX,y:s.clientY})||(r({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),i.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:e,scope:t,computed:r}){let n=()=>{if(e.type.startsWith("ITEM_POINTER"))return;let i=t.getById(r("highlightedId")),a=Wr(t);Tf(i,{rootEl:a,block:"nearest"})};return ke(()=>n()),Ma(()=>Wr(t),{defer:!0,attributes:["aria-activedescendant"],callback:n})}},actions:{setAnchorPoint({context:e,event:t}){e.set("anchorPoint",t.point)},setSubmenuPlacement({computed:e,refs:t}){if(!e("isSubmenu"))return;let r=e("isRtl")?"left-start":"right-start";t.set("positioningOverride",{placement:r,gutter:0})},reposition({context:e,scope:t,prop:r,event:n,refs:o}){let i=()=>gg(t),a=e.get("anchorPoint"),s=a?()=>({width:0,height:0,...a}):void 0,l={...r("positioning"),...o.get("positioningOverride")};cc(Ja(t),i,{...l,defer:!0,getAnchorRect:s,...n.options??{},listeners:!1,onComplete(c){e.set("currentPlacement",c.placement)}})},setOptionState({event:e}){if(!e.option)return;let{checked:t,onCheckedChange:r,type:n}=e.option;n==="radio"?r?.(!0):n==="checkbox"&&r?.(!t)},clickHighlightedItem({scope:e,computed:t}){let r=e.getById(t("highlightedId"));!r||r.dataset.disabled||queueMicrotask(()=>r.click())},setIntentPolygon({context:e,scope:t,event:r}){let n=Wr(t),o=e.get("currentPlacement");if(!n||!o)return;let i=n.getBoundingClientRect(),a=mg(i,o);if(!a)return;let l=Ep(o)==="right"?-5:5;e.set("intentPolygon",[{...r.point,x:r.point.x+l},...a])},clearIntentPolygon({context:e}){e.set("intentPolygon",null)},resumePointer({refs:e,flush:t}){let r=e.get("parent");r&&t(()=>{r.context.set("suspendPointer",!1)})},setHighlightedItem({context:e,event:t}){let r=t.value||kn(t.target);e.set("highlightedValue",r)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},focusMenu({scope:e}){ke(()=>{let t=Wr(e);vf({root:t,enabled:!It(t,e.getActiveElement()),filter(n){return!n.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:e,scope:t}){(Wr(t)?queueMicrotask:ke)(()=>{let n=RT(t);n&&e.set("highlightedValue",kn(n))})},highlightLastItem({context:e,scope:t}){(Wr(t)?queueMicrotask:ke)(()=>{let n=OT(t);n&&e.set("highlightedValue",kn(n))})},highlightNextItem({context:e,scope:t,event:r,prop:n}){let o=$T(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",kn(o))},highlightPrevItem({context:e,scope:t,event:r,prop:n}){let o=NT(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",kn(o))},invokeOnSelect({context:e,prop:t,scope:r}){let n=e.get("highlightedValue");if(n==null)return;let o=wg(r,n);LT(o,n),t("onSelect")?.({value:n})},focusTrigger({scope:e,context:t,event:r,computed:n}){n("isSubmenu")||t.get("anchorPoint")||r.restoreFocus===!1||queueMicrotask(()=>Ja(e)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:e,context:t,event:r,refs:n}){let o=MT(e,{key:r.key,value:t.get("highlightedValue"),typeaheadState:n.get("typeaheadState")});o&&t.set("highlightedValue",kn(o))},setParentMenu({refs:e,event:t}){e.set("parent",t.value)},setChildMenu({refs:e,event:t}){let r=e.get("children");r[t.id]=t.value,e.set("children",r)},closeRootMenu({refs:e}){bg({parent:e.get("parent")})},openSubmenu({refs:e,scope:t,computed:r}){let o=t.getById(r("highlightedId"))?.getAttribute("data-uid"),i=e.get("children");(o?i[o]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:e}){e.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:e,event:t}){e.set("lastHighlightedValue",kn(t.target))},restoreHighlightedItem({context:e}){e.get("lastHighlightedValue")&&(e.set("highlightedValue",e.get("lastHighlightedValue")),e.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:e}){e.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},toggleVisibility({prop:e,event:t,send:r}){r({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}};function bg(e){let t=e.parent;for(;t&&t.computed("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"})}function FT(e,t){return e?fg(e,t):!1}function UT(e,t,r){let n=Object.keys(e).length>0;if(!t)return null;if(!n)return hi(r,t);for(let o in e){let i=e[o],a=es(i.scope);if(a===t)return a}return hi(r,t)}var VT=rt()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),TN=mt(VT),zT=rt()(["closeOnSelect","disabled","value","valueText"]),SN=mt(zT),GT=rt()(["htmlFor"]),EN=mt(GT),HT=rt()(["id"]),PN=mt(HT),jT=rt()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]),_N=mt(jT);var[Tg,qe]=Oe({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),Sg=e=>{let t=qe(),r=H(()=>t().getArrowProps(),e);return m(Y.div,r)},Eg=e=>{let t=qe(),r=H(()=>t().getArrowTipProps(),e);return m(Y.div,r)},[hc,Pg]=Oe({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[_g,Ig]=Oe({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),Ag=e=>{let[t,r]=Ae()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=H(t,{type:"checkbox"}),o=qe(),i=H(()=>o().getOptionItemProps(n),r),a=ee(()=>o().getItemState(n));return m(_g,{value:n,get children(){return m(hc,{value:a,get children(){return m(Y.div,i)}})}})},Rg=e=>{let t=qe(),r=Hr(),n=H(()=>t().getContentProps(),()=>r().presenceProps,e);return m(U,{get when(){return!r().unmounted},get children(){return m(Y.div,ce(n,{ref(o){var i=Ur(r().ref,e.ref);typeof i=="function"&&i(o)}}))}})},Og=e=>e.children(qe()),$g=e=>{let t=qe(),r=H(()=>t().getContextTriggerProps(),e);return m(Y.button,r)},Ng=e=>{let t=qe(),r=H(()=>t().getIndicatorProps(),e);return m(Y.div,r)},Mg=e=>{let[t,r]=Ae()(e,["closeOnSelect","disabled","value","valueText","onSelect"]),n=qe(),o=H(()=>n().getItemProps(t),r),i=ee(()=>n().getItemState(t));return ve(()=>{let a=n().addItemListener({id:i().id,onSelect:t.onSelect});re(()=>a?.())}),m(hc,{value:i,get children(){return m(Y.div,o)}})},Dg=e=>e.children(Pg()),[Lg,Bg]=Oe({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),Fg=e=>{let[t,r]=Ae()(e,["id"]),n=H({id:We()},t),o=qe(),i=H(()=>o().getItemGroupProps(n),r);return m(Lg,{value:n,get children(){return m(Y.div,i)}})},Ug=e=>{let t=qe(),r=Bg(),n=H(t().getItemGroupLabelProps({htmlFor:r.id}),e);return m(Y.div,n)},Vg=e=>{let t=qe(),r=Ig(),n=H(()=>t().getItemIndicatorProps(r),e);return m(Y.div,n)},zg=e=>{let t=qe(),r=Ig(),n=H(()=>t().getItemTextProps(r),e);return m(Y.div,n)},Gg=e=>{let t=qe(),r=Hr(),n=H(()=>t().getPositionerProps(),e);return m(U,{get when(){return!r().unmounted},get children(){return m(Y.div,n)}})},Hg=e=>{let[t,r]=Ae()(e,["closeOnSelect","disabled","value","valueText"]),n=qe(),o=Bg(),i=H(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=H(()=>n().getOptionItemProps(i),r),s=ee(()=>n().getOptionItemState(i));return m(_g,{value:i,get children(){return m(hc,{value:s,get children(){return m(Y.div,a)}})}})},jg=e=>{let[t,r]=Ae()(e,["id","onValueChange","value"]),n=qe(),o=H({id:We()},t),i=H(()=>n().getItemGroupProps(o),r);return m(Lg,{value:o,get children(){return m(Y.div,i)}})},Wg=e=>{let t=We(),r=Ut(),n=nt(),o=ee(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...pt(e)})),i=xt(Cg,o);return{api:ee(()=>kg(i,vt)),service:i}},[qg,Yg]=Oe({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[Kg,qT]=Oe({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),Xg=e=>{let[t,r]=uo(e),[n,o]=Ae()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=qe(),a=Yg(),s=Wg(n),l=fn(H(t,()=>({present:s.api().open})));return ae(()=>{a&&(i?.().setChild(s.service),s.api().setParent(a))}),m(Kg,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(qg,{get value(){return s.service},get children(){return m(Tg,{get value(){return s.api},get children(){return m(mo,{value:l,get children(){return o.children}})}})}})}})},Zg=e=>{let t=qe(),r=Yg(),[n,o]=uo(e),i=fn(H(n,()=>({present:o.value.api().open})));return ve(()=>{r&&(t?.().setChild(o.value.service),o.value.api().setParent(r))}),m(Kg,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(qg,{get value(){return o.value.service},get children(){return m(Tg,{get value(){return o.value.api},get children(){return m(mo,{value:i,get children(){return o.children}})}})}})}})},Jg=e=>{let t=qe(),r=H(()=>t().getSeparatorProps(),e);return m(Y.hr,r)},Qg=e=>{let t=qe(),r=Hr(),n=H(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(Y.button,n)},eh=e=>{let t=qT(),r=H(()=>t?.(),e);return m(Y.div,r)},Cr={};gt(Cr,{Arrow:()=>Sg,ArrowTip:()=>Eg,CheckboxItem:()=>Ag,Content:()=>Rg,Context:()=>Og,ContextTrigger:()=>$g,Indicator:()=>Ng,Item:()=>Mg,ItemContext:()=>Dg,ItemGroup:()=>Fg,ItemGroupLabel:()=>Ug,ItemIndicator:()=>Vg,ItemText:()=>zg,Positioner:()=>Gg,RadioItem:()=>Hg,RadioItemGroup:()=>jg,Root:()=>Xg,RootProvider:()=>Zg,Separator:()=>Jg,Trigger:()=>Qg,TriggerItem:()=>eh});var vo=new WeakMap,ts=new WeakMap,rs={},bc=0,th=e=>e&&(e.host||th(e.parentNode)),YT=(e,t)=>t.map(r=>{if(e.contains(r))return r;let n=th(r);return n&&e.contains(n)?n:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",e,". Doing nothing"),null)}).filter(r=>!!r),KT=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),XT=(e,t)=>{let{parentNode:r,markerName:n,controlAttribute:o}=t,i=YT(r,Array.isArray(e)?e:[e]);rs[n]||(rs[n]=new WeakMap);let a=rs[n],s=[],l=new Set,c=new Set(i),u=p=>{!p||l.has(p)||(l.add(p),u(p.parentNode))};i.forEach(u);let d=p=>{!p||c.has(p)||Array.prototype.forEach.call(p.children,f=>{if(l.has(f))d(f);else try{if(KT(f))return;let h=f.getAttribute(o)==="true",w=(vo.get(f)||0)+1,T=(a.get(f)||0)+1;vo.set(f,w),a.set(f,T),s.push(f),w===1&&h&&ts.set(f,!0),T===1&&f.setAttribute(n,""),h||f.setAttribute(o,"true")}catch(x){console.error("[zag-js > ariaHidden] cannot operate on ",f,x)}})};return d(r),l.clear(),bc++,()=>{s.forEach(p=>{let f=vo.get(p)-1,x=a.get(p)-1;vo.set(p,f),a.set(p,x),f||(ts.has(p)||p.removeAttribute(o),ts.delete(p)),x||p.removeAttribute(n)}),bc--,bc||(vo=new WeakMap,vo=new WeakMap,ts=new WeakMap,rs={})}},ZT=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,JT=(e,t=ZT(e),r="data-aria-hidden")=>{if(t)return XT(e,{parentNode:t,markerName:r,controlAttribute:"aria-hidden"})},QT=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function rh(e,t={}){let{defer:r=!0}=t,n=r?QT:i=>i(),o=[];return o.push(n(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&o.push(JT(a))})),()=>{o.forEach(i=>i?.())}}var yc="data-scroll-lock";function eS(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function nh(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:o}=t;if(o.hasAttribute(yc))return;o.setAttribute(yc,"");let a=r.innerWidth-n.clientWidth,s=()=>Pf(n,"--scrollbar-width",`${a}px`),l=eS(n),c=()=>dn(o,{overflow:"hidden",[l]:`${a}px`}),u=()=>{let{scrollX:p,scrollY:f,visualViewport:x}=r,h=x?.offsetLeft??0,w=x?.offsetTop??0,T=dn(o,{position:"fixed",overflow:"hidden",top:`${-(f-Math.floor(w))}px`,left:`${-(p-Math.floor(h))}px`,right:"0",[l]:`${a}px`});return()=>{T?.(),r.scrollTo({left:p,top:f,behavior:"instant"})}},d=[s(),ni()?u():c()];return()=>{d.forEach(p=>p?.()),o.removeAttribute(yc)}}function oh(e,t,r){let n=[],o;return i=>{let a=e(i);return(a.length!==n.length||a.some((l,c)=>!lr(n[c],l)))&&(n=a,o=t(...a),r?.onChange?.(o)),o}}var ah=et("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Tr=ah.build(),tS=e=>e.ids?.root??`progress-${e.id}`,rS=e=>e.ids?.track??`progress-${e.id}-track`,nS=e=>e.ids?.label??`progress-${e.id}-label`,oS=e=>e.ids?.circle??`progress-${e.id}-circle`;function sh(e,t){let{context:r,computed:n,prop:o,send:i,scope:a}=e,s=n("percent"),l=n("isIndeterminate")?"":n("formatter").format(n("percent")/100),c=o("max"),u=o("min"),d=o("orientation"),p=o("translations"),f=n("isIndeterminate"),x=r.get("value"),h=p?.value({value:x,max:c,percent:s,min:u})??"",w=iS(x,c),T={role:"progressbar","aria-label":h,"data-max":c,"aria-valuemin":u,"aria-valuemax":c,"aria-valuenow":x??void 0,"data-orientation":d,"data-state":w},b=sS(e);return{value:x,valueAsString:h,min:u,max:c,percent:s,percentAsString:l,indeterminate:f,setValue(y){i({type:"VALUE.SET",value:y})},setToMax(){i({type:"VALUE.SET",value:c})},setToMin(){i({type:"VALUE.SET",value:u})},getRootProps(){return t.element({dir:o("dir"),...Tr.root.attrs,id:tS(a),"data-max":c,"data-value":x??void 0,"data-state":w,"data-orientation":d,style:{"--percent":f?void 0:s}})},getLabelProps(){return t.element({dir:o("dir"),id:nS(a),...Tr.label.attrs,"data-orientation":d})},getValueTextProps(){return t.element({dir:o("dir"),"aria-live":"polite",...Tr.valueText.attrs})},getTrackProps(){return t.element({dir:o("dir"),id:rS(a),...Tr.track.attrs,...T})},getRangeProps(){return t.element({dir:o("dir"),...Tr.range.attrs,"data-orientation":d,"data-state":w,style:{[n("isHorizontal")?"width":"height"]:f?void 0:`${s}%`}})},getCircleProps(){return t.element({dir:o("dir"),id:oS(a),...Tr.circle.attrs,...T,...b.root})},getCircleTrackProps(){return t.element({dir:o("dir"),"data-orientation":d,...Tr.circleTrack.attrs,...b.track})},getCircleRangeProps(){return t.element({dir:o("dir"),...Tr.circleRange.attrs,...b.range,"data-state":w})},getViewProps(y){return t.element({dir:o("dir"),...Tr.view.attrs,"data-state":y.state,hidden:y.state!==w})}}}function iS(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}var ih={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}},aS={style:{width:"var(--size)",height:"var(--size)"}};function sS(e){let{context:t,computed:r}=e;return{root:aS,track:ih,range:{opacity:t.get("value")===0?0:void 0,style:{...ih.style,"--percent":r("percent"),"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:r("isIndeterminate")?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}var lh={props({props:e}){let t=e.min??0,r=e.max??100;return{...e,max:r,min:t,defaultValue:e.defaultValue??uS(t,r),orientation:"horizontal",formatOptions:{style:"percent",...e.formatOptions},translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...e.translations}}},initialState(){return"idle"},entry:["validateContext"],context({bindable:e,prop:t}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){t("onValueChange")?.({value:r})}}))}},computed:{isIndeterminate:({context:e})=>e.get("value")===null,percent({context:e,prop:t}){let r=e.get("value");return ri(r)?nf(r,t("min"),t("max"))*100:-1},formatter:oh(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>new Intl.NumberFormat(e,t)),isHorizontal:({prop:e})=>e("orientation")==="horizontal"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}},implementations:{actions:{setValue:({context:e,event:t,prop:r})=>{let n=t.value===null?null:Math.max(0,Math.min(t.value,r("max")));e.set("value",n)},validateContext:({context:e,prop:t})=>{let r=t("max"),n=t("min"),o=e.get("value");if(o!=null){if(!xc(r))throw new Error(`[progress] The max value passed \`${r}\` is not a valid number`);if(!lS(o,r))throw new Error(`[progress] The value passed \`${o}\` exceeds the max value \`${r}\``);if(!cS(o,n))throw new Error(`[progress] The value passed \`${o}\` exceeds the min value \`${n}\``)}}}}},xc=e=>ri(e)&&!isNaN(e),lS=(e,t)=>xc(e)&&e<=t,cS=(e,t)=>xc(e)&&e>=t,uS=(e,t)=>e+(t-e)/2,dS=rt()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange","defaultValue","formatOptions","locale"]),JN=mt(dS);var[ch,mr]=Oe({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),uh=e=>{let t=mr(),r=H(()=>t().getCircleProps(),e);return m(Y.svg,r)},dh=e=>{let t=mr(),r=H(()=>t().getCircleRangeProps(),e);return m(Y.circle,r)},mh=e=>{let t=mr(),r=H(()=>t().getCircleTrackProps(),e);return m(Y.circle,r)},fh=e=>e.children(mr()),ph=e=>{let t=mr(),r=H(()=>t().getLabelProps(),e);return m(Y.label,r)},gh=e=>{let t=mr(),r=H(()=>t().getRangeProps(),e);return m(Y.div,r)},hh=e=>{let t=We(),r=Ut(),n=nt(),o=ee(()=>({id:t,dir:r().dir,locale:r().locale,getRootNode:n().getRootNode,...pt(e)})),i=xt(lh,o);return ee(()=>sh(i,vt))},bh=e=>{let[t,r]=Ae()(e,["defaultValue","formatOptions","id","ids","locale","max","min","onValueChange","orientation","translations","value"]),n=hh(t),o=H(()=>n().getRootProps(),r);return m(ch,{value:n,get children(){return m(Y.div,o)}})},yh=e=>{let[{value:t},r]=Ae()(e,["value"]),n=H(()=>t().getRootProps(),r);return m(ch,{value:t,get children(){return m(Y.div,n)}})},xh=e=>{let t=mr(),r=H(()=>t().getTrackProps(),e);return m(Y.div,r)},vh=e=>{let t=mr(),r=H(()=>t().getValueTextProps(),e);return m(Y.span,ce(r,{get children(){return e.children||t().percentAsString}}))},wh=e=>{let[t,r]=Ae()(e,["state"]),n=mr(),o=H(()=>n().getViewProps(t),r);return m(Y.span,o)},Cn={};gt(Cn,{Circle:()=>uh,CircleRange:()=>dh,CircleTrack:()=>mh,Context:()=>fh,Label:()=>ph,Range:()=>gh,Root:()=>bh,RootProvider:()=>yh,Track:()=>xh,ValueText:()=>vh,View:()=>wh});function vc(e,t,r){let n=[],o;return i=>{let a=e(i);return(a.length!==n.length||a.some((l,c)=>!lr(n[c],l)))&&(n=a,o=t(...a),r?.onChange?.(o)),o}}function fS(){return{and:(...e)=>function(r){return e.every(n=>r.guard(n))},or:(...e)=>function(r){return e.some(n=>r.guard(n))},not:e=>function(r){return!r.guard(e)}}}function kh(){return{guards:fS(),createMachine:e=>e,choose:e=>function({choose:r}){return r(e)?.actions}}}var wc=new Map,kc=!1;try{kc=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}var ns=!1;try{ns=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}var Ch={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}},os=class{format(t){let r="";if(!kc&&this.options.signDisplay!=null?r=gS(this.numberFormatter,this.options.signDisplay,t):r=this.numberFormatter.format(t),this.options.style==="unit"&&!ns){var n;let{unit:o,unitDisplay:i="short",locale:a}=this.resolvedOptions();if(!o)return r;let s=(n=Ch[o])===null||n===void 0?void 0:n[i];r+=s[a]||s.default}return r}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,r){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,r);if(r<t)throw new RangeError("End date must be >= start date");return`${this.format(t)} \u2013 ${this.format(r)}`}formatRangeToParts(t,r){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,r);if(r<t)throw new RangeError("End date must be >= start date");let n=this.numberFormatter.formatToParts(t),o=this.numberFormatter.formatToParts(r);return[...n.map(i=>({...i,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!kc&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!ns&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,r={}){this.numberFormatter=pS(t,r),this.options=r}};function pS(e,t={}){let{numberingSystem:r}=t;if(r&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${r}`),t.style==="unit"&&!ns){var n;let{unit:a,unitDisplay:s="short"}=t;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((n=Ch[a])===null||n===void 0)&&n[s]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${s}`);t={...t,style:"decimal"}}let o=e+(t?Object.entries(t).sort((a,s)=>a[0]<s[0]?-1:1).join():"");if(wc.has(o))return wc.get(o);let i=new Intl.NumberFormat(e,t);return wc.set(o,i),i}function gS(e,t,r){if(t==="auto")return e.format(r);if(t==="never")return e.format(Math.abs(r));{let n=!1;if(t==="always"?n=r>0||Object.is(r,0):t==="exceptZero"&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let o=e.format(-r),i=e.format(r),a=o.replace(i,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),o.replace(i,"!!!").replace(a,"+").replace("!!!",i)}else return e.format(r)}}var hS=new RegExp("^.*\\(.*\\).*$"),bS=["latn","arab","hanidec","deva","beng"],wo=class{parse(t){return Cc(this.locale,this.options,t).parse(t)}isValidPartialNumber(t,r,n){return Cc(this.locale,this.options,t).isValidPartialNumber(t,r,n)}getNumberingSystem(t){return Cc(this.locale,this.options,t).options.numberingSystem}constructor(t,r={}){this.locale=t,this.options=r}},Th=new Map;function Cc(e,t,r){let n=Sh(e,t);if(!e.includes("-nu-")&&!n.isValidPartialNumber(r)){for(let o of bS)if(o!==n.options.numberingSystem){let i=Sh(e+(e.includes("-u-")?"-nu-":"-u-nu-")+o,t);if(i.isValidPartialNumber(r))return i}}return n}function Sh(e,t){let r=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():""),n=Th.get(r);return n||(n=new Tc(e,t),Th.set(r,n)),n}var Tc=class{parse(t){let r=this.sanitize(t);if(this.symbols.group&&(r=yi(r,this.symbols.group,"")),this.symbols.decimal&&(r=r.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(r=r.replace(this.symbols.minusSign,"-")),r=r.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let a=r.indexOf("-");r=r.replace("-","");let s=r.indexOf(".");s===-1&&(s=r.length),r=r.replace(".",""),s-2===0?r=`0.${r}`:s-2===-1?r=`0.0${r}`:s-2===-2?r="0.00":r=`${r.slice(0,s-2)}.${r.slice(s-2)}`,a>-1&&(r=`-${r}`)}let n=r?+r:NaN;if(isNaN(n))return NaN;if(this.options.style==="percent"){var o,i;let a={...this.options,style:"decimal",minimumFractionDigits:Math.min(((o=this.options.minimumFractionDigits)!==null&&o!==void 0?o:0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)+2,20)};return new wo(this.locale,a).parse(new os(this.locale,a).format(n))}return this.options.currencySign==="accounting"&&hS.test(t)&&(n=-1*n),n}sanitize(t){return t=t.replace(this.symbols.literals,""),this.symbols.minusSign&&(t=t.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(t=t.replace(",",this.symbols.decimal),t=t.replace("\u060C",this.symbols.decimal)),this.symbols.group&&(t=yi(t,".",this.symbols.group))),this.options.locale==="fr-FR"&&this.symbols.group&&(t=yi(t," ",this.symbols.group),t=yi(t,/\u00A0/g,this.symbols.group)),t}isValidPartialNumber(t,r=-1/0,n=1/0){return t=this.sanitize(t),this.symbols.minusSign&&t.startsWith(this.symbols.minusSign)&&r<0?t=t.slice(this.symbols.minusSign.length):this.symbols.plusSign&&t.startsWith(this.symbols.plusSign)&&n>0&&(t=t.slice(this.symbols.plusSign.length)),this.symbols.group&&t.startsWith(this.symbols.group)||this.symbols.decimal&&t.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(t=yi(t,this.symbols.group,"")),t=t.replace(this.symbols.numeral,""),this.symbols.decimal&&(t=t.replace(this.symbols.decimal,"")),t.length===0)}constructor(t,r={}){this.locale=t,r.roundingIncrement!==1&&r.roundingIncrement!=null&&(r.maximumFractionDigits==null&&r.minimumFractionDigits==null?(r.maximumFractionDigits=0,r.minimumFractionDigits=0):r.maximumFractionDigits==null?r.maximumFractionDigits=r.minimumFractionDigits:r.minimumFractionDigits==null&&(r.minimumFractionDigits=r.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(t,r),this.options=this.formatter.resolvedOptions(),this.symbols=xS(t,this.formatter,this.options,r);var n,o;this.options.style==="percent"&&(((n=this.options.minimumFractionDigits)!==null&&n!==void 0?n:0)>18||((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}},Eh=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),yS=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function xS(e,t,r,n){var o,i,a,s;let l=new Intl.NumberFormat(e,{...r,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=yS.map(D=>l.formatToParts(D));var p;let f=(p=(o=c.find(D=>D.type==="minusSign"))===null||o===void 0?void 0:o.value)!==null&&p!==void 0?p:"-",x=(i=u.find(D=>D.type==="plusSign"))===null||i===void 0?void 0:i.value;!x&&(n?.signDisplay==="exceptZero"||n?.signDisplay==="always")&&(x="+");let w=(a=new Intl.NumberFormat(e,{...r,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(D=>D.type==="decimal"))===null||a===void 0?void 0:a.value,T=(s=c.find(D=>D.type==="group"))===null||s===void 0?void 0:s.value,b=c.filter(D=>!Eh.has(D.type)).map(D=>Ph(D.value)),y=d.flatMap(D=>D.filter(F=>!Eh.has(F.type)).map(F=>Ph(F.value))),g=[...new Set([...b,...y])].sort((D,F)=>F.length-D.length),k=g.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${g.join("|")}|[\\p{White_Space}]`,"gu"),S=[...new Intl.NumberFormat(r.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(S.map((D,F)=>[D,F])),A=new RegExp(`[${S.join("")}]`,"g");return{minusSign:f,plusSign:x,decimal:w,group:T,literals:k,numeral:A,index:D=>String(P.get(D))}}function yi(e,t,r){return e.replaceAll?e.replaceAll(t,r):e.split(t).join(r)}function Ph(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ah=et("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber"),qr=Ah.build(),vS=e=>e.ids?.root??`number-input:${e.id}`,xi=e=>e.ids?.input??`number-input:${e.id}:input`,Rh=e=>e.ids?.incrementTrigger??`number-input:${e.id}:inc`,Oh=e=>e.ids?.decrementTrigger??`number-input:${e.id}:dec`,wS=e=>e.ids?.scrubber??`number-input:${e.id}:scrubber`,$h=e=>`number-input:${e.id}:cursor`,kS=e=>e.ids?.label??`number-input:${e.id}:label`,vi=e=>e.getById(xi(e)),CS=e=>e.getById(Rh(e)),TS=e=>e.getById(Oh(e)),Nh=e=>e.getDoc().getElementById($h(e)),SS=(e,t)=>{let r=null;return t==="increment"&&(r=CS(e)),t==="decrement"&&(r=TS(e)),r},ES=(e,t)=>{if(!Wl())return IS(e,t),()=>{Nh(e)?.remove()}},PS=e=>{let t=e.getDoc(),r=t.documentElement,n=t.body;return n.style.pointerEvents="none",r.style.userSelect="none",r.style.cursor="ew-resize",()=>{n.style.pointerEvents="",r.style.userSelect="",r.style.cursor="",r.style.length||r.removeAttribute("style"),n.style.length||n.removeAttribute("style")}},_S=(e,t)=>{let{point:r,isRtl:n,event:o}=t,i=e.getWin(),a=io(o.movementX,i.devicePixelRatio),s=io(o.movementY,i.devicePixelRatio),l=a>0?"increment":a<0?"decrement":null;n&&l==="increment"&&(l="decrement"),n&&l==="decrement"&&(l="increment");let c={x:r.x+a,y:r.y+s},u=i.innerWidth,d=io(7.5,i.devicePixelRatio);return c.x=Qm(c.x+d,u)-d,{hint:l,point:c}},IS=(e,t)=>{let r=e.getDoc(),n=r.createElement("div");n.className="scrubber--cursor",n.id=$h(e),Object.assign(n.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:_a,transform:t?`translate3d(${t.x}px, ${t.y}px, 0px)`:void 0,willChange:"transform"}),n.innerHTML=`
9
+ `);if(t===null||Dl(t)!=="object")throw new Error(n);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(n)},Ll,id=!1,Fx=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];id=!0;var o=Date.now();return cR(Ll).then(function(i){return uR(i,n,o)})};Fx.setLoadParameters=function(e){if(id&&Ll){var t=Lx(e),n=Object.keys(t),r=n.reduce(function(o,i){var a;return o&&e[i]===((a=Ll)===null||a===void 0?void 0:a[i])},!0);if(r)return}if(id)throw new Error("You cannot change load parameters after calling loadStripe");Ll=Lx(e)};ad.loadStripe=Fx});var jx=It((VG,Vx)=>{"use strict";Vx.exports=Ux()});var Ma={};w1(Ma,{__addDisposableResource:()=>k0,__assign:()=>Fl,__asyncDelegator:()=>p0,__asyncGenerator:()=>f0,__asyncValues:()=>g0,__await:()=>Ti,__awaiter:()=>s0,__classPrivateFieldGet:()=>v0,__classPrivateFieldIn:()=>w0,__classPrivateFieldSet:()=>x0,__createBinding:()=>Vl,__decorate:()=>e0,__disposeResources:()=>T0,__esDecorate:()=>n0,__exportStar:()=>c0,__extends:()=>Jx,__generator:()=>l0,__importDefault:()=>y0,__importStar:()=>b0,__makeTemplateObject:()=>h0,__metadata:()=>a0,__param:()=>t0,__propKey:()=>o0,__read:()=>dd,__rest:()=>Qx,__rewriteRelativeImportExtension:()=>S0,__runInitializers:()=>r0,__setFunctionName:()=>i0,__spread:()=>u0,__spreadArray:()=>m0,__spreadArrays:()=>d0,__values:()=>Ul,default:()=>MR});function Jx(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");cd(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Qx(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function e0(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function t0(e,t){return function(n,r){t(n,r,e)}}function n0(e,t,n,r,o,i){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=r.kind,l=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var y={};for(var h in r)y[h]=h==="access"?{}:r[h];for(var h in r.access)y.access[h]=r.access[h];y.addInitializer=function(C){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(C||null))};var k=(0,n[p])(s==="accessor"?{get:u.get,set:u.set}:u[l],y);if(s==="accessor"){if(k===void 0)continue;if(k===null||typeof k!="object")throw new TypeError("Object expected");(d=a(k.get))&&(u.get=d),(d=a(k.set))&&(u.set=d),(d=a(k.init))&&o.unshift(d)}else(d=a(k))&&(s==="field"?o.unshift(d):u[l]=d)}c&&Object.defineProperty(c,r.name,u),f=!0}function r0(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function o0(e){return typeof e=="symbol"?e:"".concat(e)}function i0(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function a0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function s0(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(d){a(d)}}function l(u){try{c(r.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function l0(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function c0(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Vl(t,e,n)}function Ul(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dd(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function u0(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(dd(arguments[t]));return e}function d0(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function m0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Ti(e){return this instanceof Ti?(this.v=e,this):new Ti(e)}function f0(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(p){return function(y){return Promise.resolve(y).then(p,d)}}function s(p,y){r[p]&&(o[p]=function(h){return new Promise(function(k,C){i.push([p,h,k,C])>1||l(p,h)})},y&&(o[p]=y(o[p])))}function l(p,y){try{c(r[p](y))}catch(h){f(i[0][3],h)}}function c(p){p.value instanceof Ti?Promise.resolve(p.value.v).then(u,d):f(i[0][2],p)}function u(p){l("next",p)}function d(p){l("throw",p)}function f(p,y){p(y),i.shift(),i.length&&l(i[0][0],i[0][1])}}function p0(e){var t,n;return t={},r("next"),r("throw",function(o){throw o}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(o,i){t[o]=e[o]?function(a){return(n=!n)?{value:Ti(e[o](a)),done:!1}:i?i(a):a}:i}}function g0(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Ul=="function"?Ul(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},a)}}function h0(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function b0(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ud(e),r=0;r<n.length;r++)n[r]!=="default"&&Vl(t,e,n[r]);return NR(t,e),t}function y0(e){return e&&e.__esModule?e:{default:e}}function v0(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function x0(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function w0(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function k0(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}function T0(e){function t(i){e.error=e.hasError?new $R(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var n,r=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(a){return t(a),o()})}else r|=1}catch(a){t(a)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function S0(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,o,i,a){return r?t?".jsx":".js":o&&(!i||!a)?n:o+i+"."+a.toLowerCase()+"js"}):e}var cd,Fl,Vl,NR,ud,$R,MR,Da=x1(()=>{"use strict";cd=function(e,t){return cd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},cd(e,t)};Fl=function(){return Fl=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Fl.apply(this,arguments)};Vl=Object.create?(function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]});NR=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},ud=function(e){return ud=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},ud(e)};$R=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};MR={__extends:Jx,__assign:Fl,__rest:Qx,__decorate:e0,__param:t0,__esDecorate:n0,__runInitializers:r0,__propKey:o0,__setFunctionName:i0,__metadata:a0,__awaiter:s0,__generator:l0,__createBinding:Vl,__exportStar:c0,__values:Ul,__read:dd,__spread:u0,__spreadArrays:d0,__spreadArray:m0,__await:Ti,__asyncGenerator:f0,__asyncDelegator:p0,__asyncValues:g0,__makeTemplateObject:h0,__importStar:b0,__importDefault:y0,__classPrivateFieldGet:v0,__classPrivateFieldSet:x0,__classPrivateFieldIn:w0,__addDisposableResource:k0,__disposeResources:T0,__rewriteRelativeImportExtension:S0}});var Si=It(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.WebmBase=void 0;var md=class{constructor(t="Unknown",n=0){this.name=t,this.start=n}getType(){return"Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource()}updateByData(){}setData(t){this.data=t,this.updateByData()}getValue(){return this.data}setValue(t){this.setData(t)}};jl.WebmBase=md});var Gl=It(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.SectionType=void 0;var C0;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"})(C0||(zl.SectionType=C0={}))});var fd=It(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.sections=void 0;var _=Gl();Hl.sections={172351395:{name:"EBML",type:_.SectionType.Container},646:{name:"EBMLVersion",type:_.SectionType.Uint},759:{name:"EBMLReadVersion",type:_.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:_.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:_.SectionType.Uint},642:{name:"DocType",type:_.SectionType.String},647:{name:"DocTypeVersion",type:_.SectionType.Uint},645:{name:"DocTypeReadVersion",type:_.SectionType.Uint},108:{name:"Void",type:_.SectionType.Binary},63:{name:"CRC-32",type:_.SectionType.Binary},190023271:{name:"SignatureSlot",type:_.SectionType.Container},16010:{name:"SignatureAlgo",type:_.SectionType.Uint},16026:{name:"SignatureHash",type:_.SectionType.Uint},16037:{name:"SignaturePublicKey",type:_.SectionType.Binary},16053:{name:"Signature",type:_.SectionType.Binary},15963:{name:"SignatureElements",type:_.SectionType.Container},15995:{name:"SignatureElementList",type:_.SectionType.Container},9522:{name:"SignedElement",type:_.SectionType.Binary},139690087:{name:"Segment",type:_.SectionType.Container},21863284:{name:"SeekHead",type:_.SectionType.Container},3515:{name:"Seek",type:_.SectionType.Container},5035:{name:"SeekID",type:_.SectionType.Binary},5036:{name:"SeekPosition",type:_.SectionType.Uint},88713574:{name:"Info",type:_.SectionType.Container},13220:{name:"SegmentUID",type:_.SectionType.Binary},13188:{name:"SegmentFilename",type:_.SectionType.String},1882403:{name:"PrevUID",type:_.SectionType.Binary},1868715:{name:"PrevFilename",type:_.SectionType.String},2013475:{name:"NextUID",type:_.SectionType.Binary},1999803:{name:"NextFilename",type:_.SectionType.String},1092:{name:"SegmentFamily",type:_.SectionType.Binary},10532:{name:"ChapterTranslate",type:_.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:_.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:_.SectionType.Uint},10661:{name:"ChapterTranslateID",type:_.SectionType.Binary},710577:{name:"TimecodeScale",type:_.SectionType.Uint},1161:{name:"Duration",type:_.SectionType.Float},1121:{name:"DateUTC",type:_.SectionType.Date},15273:{name:"Title",type:_.SectionType.String},3456:{name:"MuxingApp",type:_.SectionType.String},5953:{name:"WritingApp",type:_.SectionType.String},103:{name:"Timecode",type:_.SectionType.Uint},6228:{name:"SilentTracks",type:_.SectionType.Container},6359:{name:"SilentTrackNumber",type:_.SectionType.Uint},39:{name:"Position",type:_.SectionType.Uint},43:{name:"PrevSize",type:_.SectionType.Uint},35:{name:"SimpleBlock",type:_.SectionType.Binary},32:{name:"BlockGroup",type:_.SectionType.Container},33:{name:"Block",type:_.SectionType.Binary},34:{name:"BlockVirtual",type:_.SectionType.Binary},13729:{name:"BlockAdditions",type:_.SectionType.Container},38:{name:"BlockMore",type:_.SectionType.Container},110:{name:"BlockAddID",type:_.SectionType.Uint},37:{name:"BlockAdditional",type:_.SectionType.Binary},27:{name:"BlockDuration",type:_.SectionType.Uint},122:{name:"ReferencePriority",type:_.SectionType.Uint},123:{name:"ReferenceBlock",type:_.SectionType.Int},125:{name:"ReferenceVirtual",type:_.SectionType.Int},36:{name:"CodecState",type:_.SectionType.Binary},13730:{name:"DiscardPadding",type:_.SectionType.Int},14:{name:"Slices",type:_.SectionType.Container},104:{name:"TimeSlice",type:_.SectionType.Container},76:{name:"LaceNumber",type:_.SectionType.Uint},77:{name:"FrameNumber",type:_.SectionType.Uint},75:{name:"BlockAdditionID",type:_.SectionType.Uint},78:{name:"Delay",type:_.SectionType.Uint},79:{name:"SliceDuration",type:_.SectionType.Uint},72:{name:"ReferenceFrame",type:_.SectionType.Container},73:{name:"ReferenceOffset",type:_.SectionType.Uint},74:{name:"ReferenceTimeCode",type:_.SectionType.Uint},47:{name:"EncryptedBlock",type:_.SectionType.Binary},106212971:{name:"Tracks",type:_.SectionType.Container},46:{name:"TrackEntry",type:_.SectionType.Container},87:{name:"TrackNumber",type:_.SectionType.Uint},13253:{name:"TrackUID",type:_.SectionType.Uint},3:{name:"TrackType",type:_.SectionType.Uint},57:{name:"FlagEnabled",type:_.SectionType.Uint},8:{name:"FlagDefault",type:_.SectionType.Uint},5546:{name:"FlagForced",type:_.SectionType.Uint},28:{name:"FlagLacing",type:_.SectionType.Uint},11751:{name:"MinCache",type:_.SectionType.Uint},11768:{name:"MaxCache",type:_.SectionType.Uint},254851:{name:"DefaultDuration",type:_.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:_.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:_.SectionType.Float},4991:{name:"TrackOffset",type:_.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:_.SectionType.Uint},4974:{name:"Name",type:_.SectionType.String},177564:{name:"Language",type:_.SectionType.String},6:{name:"CodecID",type:_.SectionType.String},9122:{name:"CodecPrivate",type:_.SectionType.Binary},362120:{name:"CodecName",type:_.SectionType.String},13382:{name:"AttachmentLink",type:_.SectionType.Uint},1742487:{name:"CodecSettings",type:_.SectionType.String},1785920:{name:"CodecInfoURL",type:_.SectionType.String},438848:{name:"CodecDownloadURL",type:_.SectionType.String},42:{name:"CodecDecodeAll",type:_.SectionType.Uint},12203:{name:"TrackOverlay",type:_.SectionType.Uint},5802:{name:"CodecDelay",type:_.SectionType.Uint},5819:{name:"SeekPreRoll",type:_.SectionType.Uint},9764:{name:"TrackTranslate",type:_.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:_.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:_.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:_.SectionType.Binary},96:{name:"Video",type:_.SectionType.Container},26:{name:"FlagInterlaced",type:_.SectionType.Uint},5048:{name:"StereoMode",type:_.SectionType.Uint},5056:{name:"AlphaMode",type:_.SectionType.Uint},5049:{name:"OldStereoMode",type:_.SectionType.Uint},48:{name:"PixelWidth",type:_.SectionType.Uint},58:{name:"PixelHeight",type:_.SectionType.Uint},5290:{name:"PixelCropBottom",type:_.SectionType.Uint},5307:{name:"PixelCropTop",type:_.SectionType.Uint},5324:{name:"PixelCropLeft",type:_.SectionType.Uint},5341:{name:"PixelCropRight",type:_.SectionType.Uint},5296:{name:"DisplayWidth",type:_.SectionType.Uint},5306:{name:"DisplayHeight",type:_.SectionType.Uint},5298:{name:"DisplayUnit",type:_.SectionType.Uint},5299:{name:"AspectRatioType",type:_.SectionType.Uint},963876:{name:"ColourSpace",type:_.SectionType.Binary},1029411:{name:"GammaValue",type:_.SectionType.Float},230371:{name:"FrameRate",type:_.SectionType.Float},97:{name:"Audio",type:_.SectionType.Container},53:{name:"SamplingFrequency",type:_.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:_.SectionType.Float},31:{name:"Channels",type:_.SectionType.Uint},15739:{name:"ChannelPositions",type:_.SectionType.Binary},8804:{name:"BitDepth",type:_.SectionType.Uint},98:{name:"TrackOperation",type:_.SectionType.Container},99:{name:"TrackCombinePlanes",type:_.SectionType.Container},100:{name:"TrackPlane",type:_.SectionType.Container},101:{name:"TrackPlaneUID",type:_.SectionType.Uint},102:{name:"TrackPlaneType",type:_.SectionType.Uint},105:{name:"TrackJoinBlocks",type:_.SectionType.Container},109:{name:"TrackJoinUID",type:_.SectionType.Uint},64:{name:"TrickTrackUID",type:_.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:_.SectionType.Binary},70:{name:"TrickTrackFlag",type:_.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:_.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:_.SectionType.Binary},11648:{name:"ContentEncodings",type:_.SectionType.Container},8768:{name:"ContentEncoding",type:_.SectionType.Container},4145:{name:"ContentEncodingOrder",type:_.SectionType.Uint},4146:{name:"ContentEncodingScope",type:_.SectionType.Uint},4147:{name:"ContentEncodingType",type:_.SectionType.Uint},4148:{name:"ContentCompression",type:_.SectionType.Container},596:{name:"ContentCompAlgo",type:_.SectionType.Uint},597:{name:"ContentCompSettings",type:_.SectionType.Binary},4149:{name:"ContentEncryption",type:_.SectionType.Container},2017:{name:"ContentEncAlgo",type:_.SectionType.Uint},2018:{name:"ContentEncKeyID",type:_.SectionType.Binary},2019:{name:"ContentSignature",type:_.SectionType.Binary},2020:{name:"ContentSigKeyID",type:_.SectionType.Binary},2021:{name:"ContentSigAlgo",type:_.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:_.SectionType.Uint},206814059:{name:"Cues",type:_.SectionType.Container},59:{name:"CuePoint",type:_.SectionType.Container},51:{name:"CueTime",type:_.SectionType.Uint},55:{name:"CueTrackPositions",type:_.SectionType.Container},119:{name:"CueTrack",type:_.SectionType.Uint},113:{name:"CueClusterPosition",type:_.SectionType.Uint},112:{name:"CueRelativePosition",type:_.SectionType.Uint},50:{name:"CueDuration",type:_.SectionType.Uint},4984:{name:"CueBlockNumber",type:_.SectionType.Uint},106:{name:"CueCodecState",type:_.SectionType.Uint},91:{name:"CueReference",type:_.SectionType.Container},22:{name:"CueRefTime",type:_.SectionType.Uint},23:{name:"CueRefCluster",type:_.SectionType.Uint},4959:{name:"CueRefNumber",type:_.SectionType.Uint},107:{name:"CueRefCodecState",type:_.SectionType.Uint},155296873:{name:"Attachments",type:_.SectionType.Container},8615:{name:"AttachedFile",type:_.SectionType.Container},1662:{name:"FileDescription",type:_.SectionType.String},1646:{name:"FileName",type:_.SectionType.String},1632:{name:"FileMimeType",type:_.SectionType.String},1628:{name:"FileData",type:_.SectionType.Binary},1710:{name:"FileUID",type:_.SectionType.Uint},1653:{name:"FileReferral",type:_.SectionType.Binary},1633:{name:"FileUsedStartTime",type:_.SectionType.Uint},1634:{name:"FileUsedEndTime",type:_.SectionType.Uint},4433776:{name:"Chapters",type:_.SectionType.Container},1465:{name:"EditionEntry",type:_.SectionType.Container},1468:{name:"EditionUID",type:_.SectionType.Uint},1469:{name:"EditionFlagHidden",type:_.SectionType.Uint},1499:{name:"EditionFlagDefault",type:_.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:_.SectionType.Uint},54:{name:"ChapterAtom",type:_.SectionType.Container},13252:{name:"ChapterUID",type:_.SectionType.Uint},5716:{name:"ChapterStringUID",type:_.SectionType.String},17:{name:"ChapterTimeStart",type:_.SectionType.Uint},18:{name:"ChapterTimeEnd",type:_.SectionType.Uint},24:{name:"ChapterFlagHidden",type:_.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:_.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:_.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:_.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:_.SectionType.Uint},15:{name:"ChapterTrack",type:_.SectionType.Container},9:{name:"ChapterTrackNumber",type:_.SectionType.Uint},0:{name:"ChapterDisplay",type:_.SectionType.Container},5:{name:"ChapString",type:_.SectionType.String},892:{name:"ChapLanguage",type:_.SectionType.String},894:{name:"ChapCountry",type:_.SectionType.String},10564:{name:"ChapProcess",type:_.SectionType.Container},10581:{name:"ChapProcessCodecID",type:_.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:_.SectionType.Binary},10513:{name:"ChapProcessCommand",type:_.SectionType.Container},10530:{name:"ChapProcessTime",type:_.SectionType.Uint},10547:{name:"ChapProcessData",type:_.SectionType.Binary},39109479:{name:"Tags",type:_.SectionType.Container},13171:{name:"Tag",type:_.SectionType.Container},9152:{name:"Targets",type:_.SectionType.Container},10442:{name:"TargetTypeValue",type:_.SectionType.Uint},9162:{name:"TargetType",type:_.SectionType.String},9157:{name:"TagTrackUID",type:_.SectionType.Uint},9161:{name:"TagEditionUID",type:_.SectionType.Uint},9156:{name:"TagChapterUID",type:_.SectionType.Uint},9158:{name:"TagAttachmentUID",type:_.SectionType.Uint},10184:{name:"SimpleTag",type:_.SectionType.Container},1443:{name:"TagName",type:_.SectionType.String},1146:{name:"TagLanguage",type:_.SectionType.String},1156:{name:"TagDefault",type:_.SectionType.Uint},1159:{name:"TagString",type:_.SectionType.String},1157:{name:"TagBinary",type:_.SectionType.Binary},5552:{name:"Colour",type:_.SectionType.Container},5553:{name:"MatrixCoefficients",type:_.SectionType.Uint},5554:{name:"BitsPerChannel",type:_.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:_.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:_.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:_.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:_.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:_.SectionType.Uint},5560:{name:"ChromaSitingVert",type:_.SectionType.Uint},5561:{name:"Range",type:_.SectionType.Uint},5562:{name:"TransferCharacteristics",type:_.SectionType.Uint},5563:{name:"Primaries",type:_.SectionType.Uint},5564:{name:"MaxCLL",type:_.SectionType.Uint},5565:{name:"MaxFALL",type:_.SectionType.Uint}}});var gd=It(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.WebmUint=void 0;var DR=Si();function _0(e){return e.length%2===1?"0"+e:e}var pd=class extends DR.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let n=this.source[t].toString(16);this.data+=_0(n)}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let n=0;n<t;n++){let r=this.data.substring(n*2,n*2+2);this.source[n]=parseInt(r,16)}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(_0(t.toString(16)))}};Wl.WebmUint=pd});var bd=It(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.WebmFloat=void 0;var LR=Si(),hd=class extends LR.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),n=this.getFloatArrayType(),r=new n(t.buffer);this.data=r[0]}updateByData(){let t=this.getFloatArrayType(),n=new t([this.data]),r=new Uint8Array(n.buffer);this.source=r.reverse()}};ql.WebmFloat=hd});var vd=It(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.WebmString=void 0;var BR=Si(),yd=class extends BR.WebmBase{constructor(t,n=0){super(t,n)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let t="";return this.source.forEach(n=>{t+=String.fromCharCode(n)}),t}};Zl.WebmString=yd});var wd=It(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.WebmContainer=void 0;var E0=Si(),FR=fd(),Yl=Gl(),UR=gd(),VR=bd(),jR=vd(),xd=class e extends E0.WebmBase{constructor(t,n=!1,r=0){super(t,r),this.isInfinite=n,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),n=8-t.toString(2).length,r=t-(1<<7-n);for(let o=0;o<n;o++)r<<=8,r|=this.readByte();return r}updateBySource(){var t;this.data=[];let n;for(this.offset=0;this.offset<this.source.length;this.offset=n){let r=this.offset,o=this.readUint(),{name:i,type:a}=(t=FR.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();n=this.source.length,s>=0&&(n=Math.min(this.offset+s,n));let l=this.source.slice(this.offset,n),c;switch(a){case Yl.SectionType.Container:c=new e(i,s<0,r);break;case Yl.SectionType.Uint:c=new UR.WebmUint(i,r);break;case Yl.SectionType.Float:c=new VR.WebmFloat(i,r);break;case Yl.SectionType.String:c=new jR.WebmString(i,r);break;default:c=new E0.WebmBase(i,r);break}c.setSource(l),this.data.push({id:o,idHex:o.toString(16),data:c})}}writeUint(t,n=!1){let r;for(r=1;(t<0||t>=1<<7*r)&&r<8;r++);if(!n){for(let o=0;o<r;o++)this.source[this.offset+o]=t>>8*(r-1-o)&255;this.source[this.offset]&=(1<<8-r)-1,this.source[this.offset]|=1<<8-r}this.offset+=r}writeSections(t=!1){this.offset=0;for(let n=0;n<this.data.length;n++){let r=this.data[n],o=r.data.source,i=o.length;this.writeUint(r.id,t),this.writeUint(r.data instanceof e&&r.data.isInfinite?-1:i,t),t||this.source.set(o,this.offset),this.offset+=i}return this.offset}updateByData(){let t=this.writeSections(!0);this.source=new Uint8Array(t),this.writeSections()}getSectionById(t){for(let n=0;n<this.data.length;n++){let r=this.data[n];if(r.id===t)return r.data}return null}};Kl.WebmContainer=xd});var P0=It(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.WebmFile=void 0;var zR=(Da(),Qa(Ma)),GR=wd(),kd=class e extends GR.WebmContainer{constructor(t){super("File"),this.setSource(t)}getType(){return"File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((n,r)=>{try{let o=new FileReader;o.onloadend=()=>{try{n(new Uint8Array(o.result))}catch(i){r(i)}},o.readAsArrayBuffer(t)}catch(o){r(o)}})}static fromBlob(t){return zR.__awaiter(this,void 0,void 0,function*(){let n=yield e.blobToArray(t);return new e(n)})}};Xl.WebmFile=kd});var A0=It(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0})});var Td=It(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});var Jn=(Da(),Qa(Ma));Jn.__exportStar(Si(),xn);Jn.__exportStar(wd(),xn);Jn.__exportStar(P0(),xn);Jn.__exportStar(bd(),xn);Jn.__exportStar(vd(),xn);Jn.__exportStar(gd(),xn);Jn.__exportStar(Gl(),xn);Jn.__exportStar(A0(),xn);Jn.__exportStar(fd(),xn)});var Sd=It(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.fixParsedWebmDuration=void 0;var HR=Td(),WR=(e,t,n={})=>{let r=n.logger;r===void 0?r=l=>console.debug(l):r||(r=()=>{});let o=e.getSectionById(139690087);if(!o)return r("[fix-webm-duration] Segment section is missing"),!1;let i=o.getSectionById(88713574);if(!i)return r("[fix-webm-duration] Info section is missing"),!1;let a=i.getSectionById(710577);if(!a)return r("[fix-webm-duration] TimecodeScale section is missing"),!1;let s=i.getSectionById(1161);if(s)if(s.getValue()<=0)r(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return r(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),!1;else r("[fix-webm-duration] Duration section is missing"),s=new HR.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),!0};Jl.fixParsedWebmDuration=WR});var R0=It(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.fixWebmDuration=void 0;var qR=(Da(),Qa(Ma)),ZR=Td(),YR=Sd(),KR=(e,t,n)=>qR.__awaiter(void 0,void 0,void 0,function*(){try{let r=yield ZR.WebmFile.fromBlob(e);if((0,YR.fixParsedWebmDuration)(r,t,n))return r.toBlob(e.type)}catch{}return e});Ql.fixWebmDuration=KR});var N0=It(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var O0=(Da(),Qa(Ma));O0.__exportStar(R0(),ec);O0.__exportStar(Sd(),ec)});function k1(e){return Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Object.assign({},o),wm(o.value)&&!E1(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function T1(e){return e?Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=wm(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=_1(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function S1(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function C1(e,t){let n=k1(t);return Object.keys(t).forEach(o=>{let i=n[o],a=e.getAttribute(i.attribute),s=e[o];a!=null&&(i.value=i.parse?xm(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&vm(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){let c=i.value;i.value=l,i.reflect&&vm(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function xm(e){if(e)try{return JSON.parse(e)}catch{return e}}function vm(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function _1(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function wm(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function E1(e){return Object.prototype.toString.call(e)==="[object Function]"}function P1(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var vc;function I1(e,t){let n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let o of n)this[o]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=C1(this,t);let o=S1(this.props),i=this.Component,a=vc;try{vc=this,this.__initialized=!0,P1(i)?new i(o,{element:this}):i(o,{element:this})}finally{vc=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?xm(a):a}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}var FN=Symbol("element-context");function km(e,t={},n={}){let{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return a=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=a,s):(s=I1(r,T1(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var Ae={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Tm(this.context.count)},getNextContextId(){return Tm(this.context.count++)}};function Tm(e){let t=String(e),n=t.length-1;return Ae.context.id+(n?String.fromCharCode(96+n):"")+t}function wc(e){Ae.context=e}function A1(){return{...Ae.context,id:Ae.getNextContextId(),count:0}}var R1=!1,O1=(e,t)=>e===t,$o=Symbol("solid-proxy"),Pm=typeof Proxy=="function",Di=Symbol("solid-track"),VN=Symbol("solid-dev-component"),ts={equals:O1},Sm=null,Im=$m,Xt=1,$i=2,Am={owned:null,cleanups:null,context:null,owner:null};var _e=null,X=null,Li=null,No=null,ze=null,nt=null,wt=null,os=0;function Kt(e,t){let n=ze,r=_e,o=e.length===0,i=t===void 0?r:t,a=o?Am:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>Ke(()=>rr(a)));_e=a,ze=null;try{return Sn(s,!0)}finally{ze=n,_e=r}}function O(e,t){t=t?Object.assign({},ts,t):ts;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(X&&X.running&&X.sources.has(n)?o=o(n.tValue):o=o(n.value)),Nm(n,o));return[Om.bind(n),r]}function $(e,t,n){let r=_c(e,t,!1,Xt);Li&&X&&X.running?nt.push(r):Bi(r)}function $e(e,t,n){Im=D1;let r=_c(e,t,!1,Xt),o=kc&&Ir(kc);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),wt?wt.push(r):Bi(r)}function re(e,t,n){n=n?Object.assign({},ts,n):ts;let r=_c(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Li&&X&&X.running?(r.tState=Xt,nt.push(r)):Bi(r),Om.bind(r)}function Ke(e){if(!No&&ze===null)return e();let t=ze;ze=null;try{return No?No.untrack(e):e()}finally{ze=t}}function me(e){$e(()=>Ke(e))}function ie(e){return _e===null||(_e.cleanups===null?_e.cleanups=[e]:_e.cleanups.push(e)),e}function Mo(){return _e}function Rm(e,t){let n=_e,r=ze;_e=e,ze=null;try{return Sn(t,!0)}catch(o){as(o)}finally{_e=n,ze=r}}function N1(e){if(X&&X.running)return e(),X.done;let t=ze,n=_e;return Promise.resolve().then(()=>{ze=t,_e=n;let r;return(Li||kc)&&(r=X||(X={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),Sn(e,!1),ze=_e=null,r?r.done:void 0})}var[jN,Cm]=O(!1);function Do(e,t){let n=Symbol("context");return{id:n,Provider:B1(n),defaultValue:e}}function Ir(e){let t;return _e&&_e.context&&(t=_e.context[e.id])!==void 0?t:e.defaultValue}function is(e){let t=re(e),n=re(()=>Tc(t()));return n.toArray=()=>{let r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var kc;function Om(){let e=X&&X.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Xt)Bi(this);else{let t=nt;nt=null,Sn(()=>ns(this),!1),nt=t}if(ze){let t=this.observers?this.observers.length:0;ze.sources?(ze.sources.push(this),ze.sourceSlots.push(t)):(ze.sources=[this],ze.sourceSlots=[t]),this.observers?(this.observers.push(ze),this.observerSlots.push(ze.sources.length-1)):(this.observers=[ze],this.observerSlots=[ze.sources.length-1])}return e&&X.sources.has(this)?this.tValue:this.value}function Nm(e,t,n){let r=X&&X.running&&X.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(X){let o=X.running;(o||!n&&X.sources.has(e))&&(X.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Sn(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=X&&X.running;a&&X.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?nt.push(i):wt.push(i),i.observers&&Mm(i)),a?i.tState=Xt:i.state=Xt)}if(nt.length>1e6)throw nt=[],new Error},!1)}return t}function Bi(e){if(!e.fn)return;rr(e);let t=os;_m(e,X&&X.running&&X.sources.has(e)?e.tValue:e.value,t),X&&!X.running&&X.sources.has(e)&&queueMicrotask(()=>{Sn(()=>{X&&(X.running=!0),ze=_e=e,_m(e,e.tValue,t),ze=_e=null},!1)})}function _m(e,t,n){let r,o=_e,i=ze;ze=_e=e;try{r=e.fn(t)}catch(a){return e.pure&&(X&&X.running?(e.tState=Xt,e.tOwned&&e.tOwned.forEach(rr),e.tOwned=void 0):(e.state=Xt,e.owned&&e.owned.forEach(rr),e.owned=null)),e.updatedAt=n+1,as(a)}finally{ze=i,_e=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Nm(e,r,!0):X&&X.running&&e.pure?(X.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function _c(e,t,n,r=Xt,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:_e,context:_e?_e.context:null,pure:n};if(X&&X.running&&(i.state=0,i.tState=r),_e===null||_e!==Am&&(X&&X.running&&_e.pure?_e.tOwned?_e.tOwned.push(i):_e.tOwned=[i]:_e.owned?_e.owned.push(i):_e.owned=[i]),No&&i.fn){let[a,s]=O(void 0,{equals:!1}),l=No.factory(i.fn,s);ie(()=>l.dispose());let c=()=>N1(s).then(()=>u.dispose()),u=No.factory(i.fn,c);i.fn=d=>(a(),X&&X.running?u.track(d):l.track(d))}return i}function Mi(e){let t=X&&X.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===$i)return ns(e);if(e.suspense&&Ke(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<os);){if(t&&X.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(X.disposed.has(o))return}if((t?e.tState:e.state)===Xt)Bi(e);else if((t?e.tState:e.state)===$i){let o=nt;nt=null,Sn(()=>ns(e,n[0]),!1),nt=o}}}function Sn(e,t){if(nt)return e();let n=!1;t||(nt=[]),wt?n=!0:wt=[],os++;try{let r=e();return $1(n),r}catch(r){n||(wt=null),nt=null,as(r)}}function $1(e){if(nt&&(Li&&X&&X.running?M1(nt):$m(nt),nt=null),e)return;let t;if(X){if(!X.promises.size&&!X.queue.size){let r=X.sources,o=X.disposed;wt.push.apply(wt,X.effects),t=X.resolve;for(let i of wt)"tState"in i&&(i.state=i.tState),delete i.tState;X=null,Sn(()=>{for(let i of o)rr(i);for(let i of r){if(i.value=i.tValue,i.owned)for(let a=0,s=i.owned.length;a<s;a++)rr(i.owned[a]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}Cm(!1)},!1)}else if(X.running){X.running=!1,X.effects.push.apply(X.effects,wt),wt=null,Cm(!0);return}}let n=wt;wt=null,n.length&&Sn(()=>Im(n),!1),t&&t()}function $m(e){for(let t=0;t<e.length;t++)Mi(e[t])}function M1(e){for(let t=0;t<e.length;t++){let n=e[t],r=X.queue;r.has(n)||(r.add(n),Li(()=>{r.delete(n),Sn(()=>{X.running=!0,Mi(n)},!1),X&&(X.running=!1)}))}}function D1(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Mi(r)}if(Ae.context){if(Ae.count){Ae.effects||(Ae.effects=[]),Ae.effects.push(...e.slice(0,n));return}wc()}for(Ae.effects&&(Ae.done||!Ae.count)&&(e=[...Ae.effects,...e],n+=Ae.effects.length,delete Ae.effects),t=0;t<n;t++)Mi(e[t])}function ns(e,t){let n=X&&X.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=n?o.tState:o.state;i===Xt?o!==t&&(!o.updatedAt||o.updatedAt<os)&&Mi(o):i===$i&&ns(o,t)}}}function Mm(e){let t=X&&X.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=$i:r.state=$i,r.pure?nt.push(r):wt.push(r),r.observers&&Mm(r))}}function rr(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),a=n.observerSlots.pop();r<o.length&&(i.sourceSlots[a]=r,o[r]=i,n.observerSlots[r]=a)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)rr(e.tOwned[t]);delete e.tOwned}if(X&&X.running&&e.pure)Dm(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)rr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}X&&X.running?e.tState=0:e.state=0}function Dm(e,t){if(t||(e.tState=0,X.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)Dm(e.owned[n])}function L1(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Em(e,t,n){try{for(let r of t)r(e)}catch(r){as(r,n&&n.owner||null)}}function as(e,t=_e){let n=Sm&&t&&t.context&&t.context[Sm],r=L1(e);if(!n)throw r;wt?wt.push({fn(){Em(r,n,t)},state:Xt}):Em(r,n,t)}function Tc(e){if(typeof e=="function"&&!e.length)return Tc(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Tc(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function B1(e,t){return function(r){let o;return $(()=>o=Ke(()=>(_e.context={..._e.context,[e]:r.value},is(()=>r.children))),void 0),o}}var Sc=Symbol("fallback");function rs(e){for(let t=0;t<e.length;t++)e[t]()}function Lm(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return ie(()=>rs(i)),()=>{let l=e()||[],c=l.length,u,d;return l[Di],Ke(()=>{let p,y,h,k,C,b,T,g,x;if(c===0)a!==0&&(rs(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[Sc],o[0]=Kt(S=>(i[0]=S,n.fallback())),a=1);else if(a===0){for(o=new Array(c),d=0;d<c;d++)r[d]=l[d],o[d]=Kt(f);a=c}else{for(h=new Array(c),k=new Array(c),s&&(C=new Array(c)),b=0,T=Math.min(a,c);b<T&&r[b]===l[b];b++);for(T=a-1,g=c-1;T>=b&&g>=b&&r[T]===l[g];T--,g--)h[g]=o[T],k[g]=i[T],s&&(C[g]=s[T]);for(p=new Map,y=new Array(g+1),d=g;d>=b;d--)x=l[d],u=p.get(x),y[d]=u===void 0?-1:u,p.set(x,d);for(u=b;u<=T;u++)x=r[u],d=p.get(x),d!==void 0&&d!==-1?(h[d]=o[u],k[d]=i[u],s&&(C[d]=s[u]),d=y[d],p.set(x,d)):i[u]();for(d=b;d<c;d++)d in h?(o[d]=h[d],i[d]=k[d],s&&(s[d]=C[d],s[d](d))):o[d]=Kt(f);o=o.slice(0,a=c),r=l.slice(0)}return o});function f(p){if(i[d]=p,s){let[y,h]=O(d);return s[d]=h,t(l[d],y)}return t(l[d])}}}function F1(e,t,n={}){let r=[],o=[],i=[],a=[],s=0,l;return ie(()=>rs(i)),()=>{let c=e()||[],u=c.length;return c[Di],Ke(()=>{if(u===0)return s!==0&&(rs(i),i=[],r=[],o=[],s=0,a=[]),n.fallback&&(r=[Sc],o[0]=Kt(f=>(i[0]=f,n.fallback())),s=1),o;for(r[0]===Sc&&(i[0](),i=[],r=[],o=[],s=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?a[l](()=>c[l]):l>=r.length&&(o[l]=Kt(d));for(;l<r.length;l++)i[l]();return s=a.length=i.length=u,r=c.slice(0),o=o.slice(0,s)});function d(f){i[l]=f;let[p,y]=O(c[l]);return a[l]=y,t(p,l)}}}var U1=!1;function m(e,t){if(U1&&Ae.context){let n=Ae.context;wc(A1());let r=Ke(()=>e(t||{}));return wc(n),r}return Ke(()=>e(t||{}))}function es(){return!0}var Cc={get(e,t,n){return t===$o?n:e.get(t)},has(e,t){return t===$o?!0:e.has(t)},set:es,deleteProperty:es,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:es,deleteProperty:es}},ownKeys(e){return e.keys()}};function xc(e){return(e=typeof e=="function"?e():e)?e:{}}function V1(){for(let e=0,t=this.length;e<t;++e){let n=this[e]();if(n!==void 0)return n}}function ge(...e){let t=!1;for(let a=0;a<e.length;a++){let s=e[a];t=t||!!s&&$o in s,e[a]=typeof s=="function"?(t=!0,re(s)):s}if(Pm&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let l=xc(e[s])[a];if(l!==void 0)return l}},has(a){for(let s=e.length-1;s>=0;s--)if(a in xc(e[s]))return!0;return!1},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(xc(e[s])));return[...new Set(a)]}},Cc);let n={},r=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){let u=l[c];if(u==="__proto__"||u==="constructor")continue;let d=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:V1.bind(n[u]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{let f=n[u];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value))}}}let o={},i=Object.keys(r);for(let a=i.length-1;a>=0;a--){let s=i[a],l=r[s];l&&l.get?Object.defineProperty(o,s,l):o[s]=l?l.value:void 0}return o}function qe(e,...t){if(Pm&&$o in e){let o=new Set(t.length>1?t.flat():t[0]),i=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Cc));return i.push(new Proxy({get(a){return o.has(a)?void 0:e[a]},has(a){return o.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!o.has(a))}},Cc)),i}let n={},r=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=!1,l=0;for(let c of t)c.includes(o)&&(s=!0,a?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}var j1=0;function Qe(){return Ae.context?Ae.getNextContextId():`cl-${j1++}`}var Bm=e=>`Stale read from <${e}>.`;function Re(e){let t="fallback"in e&&{fallback:()=>e.fallback};return re(Lm(()=>e.each,e.children,t||void 0))}function Fi(e){let t="fallback"in e&&{fallback:()=>e.fallback};return re(F1(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=re(()=>e.when,void 0,void 0),r=t?n:re(n,void 0,{equals:(o,i)=>!o==!i});return re(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?Ke(()=>i(t?o:()=>{if(!Ke(r))throw Bm("Show");return n()})):i}return e.fallback},void 0,void 0)}function Fe(e){let t=is(()=>e.children),n=re(()=>{let r=t(),o=Array.isArray(r)?r:[r],i=()=>{};for(let a=0;a<o.length;a++){let s=a,l=o[a],c=i,u=re(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:re(u,void 0,{equals:(f,p)=>!f==!p});i=()=>c()||(d()?[s,u,l]:void 0)}return i});return re(()=>{let r=n()();if(!r)return e.fallback;let[o,i,a]=r,s=a.children;return typeof s=="function"&&s.length>0?Ke(()=>s(a.keyed?i():()=>{if(Ke(n)()?.[0]!==o)throw Bm("Match");return i()})):s},void 0,void 0)}function ee(e){return e}var z1=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],G1=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...z1]),H1=new Set(["innerHTML","textContent","innerText","children"]),W1=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),q1=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Z1(e,t){let n=q1[e];return typeof n=="object"?n[t]?n.$:void 0:n}var Y1=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),K1=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),X1={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};var L=e=>re(()=>e());function J1(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;){if(t[a]===n[s]){a++,s++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===a){let u=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],u)}else if(i===s)for(;a<o;)(!c||!c.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){let u=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=s;for(;d<i;)c.set(n[d],d++)}let u=c.get(t[a]);if(u!=null)if(s<u&&u<i){let d=a,f=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+f);)f++;if(f>u-s){let y=t[a];for(;s<u;)e.insertBefore(n[s++],y)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}}var Fm="_$DX_DELEGATE";function w(e,t,n,r){let o,i=()=>{let s=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:r?s.firstChild:s.content.firstChild},a=t?()=>Ke(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return a.cloneNode=a,a}function Ne(e,t=window.document){let n=t[Fm]||(t[Fm]=new Set);for(let r=0,o=e.length;r<o;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ik))}}function K(e,t,n){Ar(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Q1(e,t,n,r){Ar(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function ek(e,t,n){Ar(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function G(e,t){Ar(e)||(t==null?e.removeAttribute("class"):e.className=t)}function gt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function tk(e,t,n={}){let r=Object.keys(t||{}),o=Object.keys(n),i,a;for(i=0,a=o.length;i<a;i++){let s=o[i];!s||s==="undefined"||t[s]||(Um(e,s,!1),delete n[s])}for(i=0,a=r.length;i<a;i++){let s=r[i],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(Um(e,s,!0),n[s]=l)}return n}function Ui(e,t,n){if(!t)return n?K(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function ae(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function Ce(e,t={},n,r){let o={};return r||$(()=>o.children=Bo(e,t.children,o.children)),$(()=>typeof t.ref=="function"&&ke(t.ref,e)),$(()=>nk(e,t,n,!0,o,!0)),o}function ke(e,t,n){return Ke(()=>e(t,n))}function v(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Bo(e,t,r,n);$(o=>Bo(e,t(),o,n),r)}function nk(e,t,n,r,o={},i=!1){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=Vm(e,a,null,o[a],n,i,t)}for(let a in t){if(a==="children"){r||Bo(e,t.children);continue}let s=t[a];o[a]=Vm(e,a,s,o[a],n,i,t)}}function rk(e){let t,n;return!Ar()||!(t=Ae.registry.get(n=ak()))?e():(Ae.completed&&Ae.completed.add(t),Ae.registry.delete(n),t)}function Ar(e){return!!Ae.context&&!Ae.done&&(!e||e.isConnected)}function ok(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Um(e,t,n){let r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Vm(e,t,n,r,o,i,a){let s,l,c,u,d;if(t==="style")return Ui(e,n,r);if(t==="classList")return tk(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){let f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){let f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){let f=t.slice(2).toLowerCase(),p=Y1.has(f);if(!p&&r){let y=Array.isArray(r)?r[0]:r;e.removeEventListener(f,y)}(p||n)&&(gt(e,f,n,p),p&&Ne([f]))}else if(t.slice(0,5)==="attr:")K(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")ek(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=H1.has(t))||!o&&((u=Z1(t,e.tagName))||(l=G1.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(d)t=t.slice(5),l=!0;else if(Ar(e))return n;t==="class"||t==="className"?G(e,n):s&&!l&&!c?e[ok(t)]=n:e[u||t]=n}else{let f=o&&t.indexOf(":")>-1&&X1[t.split(":")[0]];f?Q1(e,f,t,n):K(e,W1[t]||t,n)}return n}function ik(e){if(Ae.registry&&Ae.events&&Ae.events.find(([l,c])=>c===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),a=()=>{let l=t[n];if(l&&!t.disabled){let c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ae.registry&&!Ae.done&&(Ae.done=_$HY.done=!0),e.composedPath){let l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!a());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function Bo(e,t,n,r,o){let i=Ar(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){let u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;let a=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(i||a==="number"&&(t=t.toString(),t===n))return n;if(s){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Lo(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean"){if(i)return n;n=Lo(e,n,r)}else{if(a==="function")return $(()=>{let l=t();for(;typeof l=="function";)l=l();n=Bo(e,l,n,r)}),()=>n;if(Array.isArray(t)){let l=[],c=n&&Array.isArray(n);if(Ec(l,t,n,o))return $(()=>n=Bo(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;let d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Lo(e,n,r),s)return n}else c?n.length===0?jm(e,l,r):J1(e,n,l):(n&&Lo(e),jm(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Lo(e,n,r,t);Lo(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ec(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let s=t[i],l=n&&n[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=Ec(e,s,l)||o;else if(c==="function")if(r){for(;typeof s=="function";)s=s();o=Ec(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{let u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function jm(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Lo(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let s=t[a];if(o!==s){let l=s.parentNode===e;!i&&!a?l?e.replaceChild(o,s):e.insertBefore(o,n):l&&s.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function ak(){return Ae.getNextContextId()}var YN=Symbol();var zm=!1;var sk="http://www.w3.org/2000/svg";function Gm(e,t=!1,n=void 0){return t?document.createElementNS(sk,e):document.createElement(e,{is:n})}function ss(e){let{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo(),i,a=!!Ae.context;return $e(()=>{a&&(Mo().user=a=!1),i||(i=Rm(o,()=>re(()=>e.children)));let s=r();if(s instanceof HTMLHeadElement){let[l,c]=O(!1),u=()=>c(!0);Kt(d=>v(s,()=>l()?d():i(),null)),ie(u)}else{let l=Gm(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),v(c,i),s.appendChild(l),e.ref&&e.ref(l),ie(()=>s.removeChild(l))}},void 0,{render:!a}),n}function lk(e,t){let n=re(e);return re(()=>{let r=n();switch(typeof r){case"function":return Ke(()=>r(t));case"string":let o=K1.has(r),i=Ae.context?rk():Gm(r,o,Ke(()=>t.is));return Ce(i,t,o),i}})}function Hm(e){let[,t]=qe(e,["component"]);return lk(()=>e.component,t)}function ck(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(a){i(()=>a)}})}return n}function uk(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function dk(e){return(t,n)=>{let{element:r}=n;return Kt(o=>{let i=ck(t);r.addPropertyChangedCallback((s,l)=>i[s]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});let a=e(i,n);return v(r.renderRoot,a)},uk(r))}}function ls(e,t,n){return arguments.length===2&&(n=t,t={}),km(e,t)(dk(n))}var cs={makebot:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,wsHost:void 0,resultId:void 0,sessionId:void 0},Wm={...cs,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},qm={...cs,isOpen:void 0,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0,inlineStyle:void 0},Vi={xs:440,sm:640,md:768,lg:1024,xl:1280};var Pc=Do(()=>{}),us=()=>Ir(Pc);var Zm=e=>{sessionStorage.setItem("makebotPaymentInProgress",JSON.stringify(e))},Fo=()=>sessionStorage.getItem("makebotPaymentInProgress"),ds=()=>{sessionStorage.removeItem("makebotPaymentInProgress")};var un=(e,t)=>{if(typeof window<"u"){if(!window.__ENV)return;let r=window.__ENV[e];return r===""?t:r??t}if(typeof process>"u")return;let n=process.env[e];return n===""?t:n??t};var mk="https://makebot.it",kt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{let t=un("NEXT_PUBLIC_CHAT_API_URL"),n=un("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some(i=>i===window.location.href)))return t;let r=un("NEXT_PUBLIC_VIEWER_URL")?.split(",");return r?.find(i=>window.location.href.startsWith(i))??r?.[0]??mk};var Ym=async e=>{let t;try{let n=typeof e=="string"?e:e.url;t=await fetch(n,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&ye(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&ye(e.body)?JSON.stringify(e.body):void 0});let r=await t.json();if(!t.ok)throw"error"in r?r.error:r;return{data:r,response:t}}catch(n){return console.error(n),{error:n,response:t}}},ye=e=>e!=null,rt=e=>e==null,ct=e=>e==null||e==="",Ue=e=>e!=null&&e!=="";var Km=e=>{e.split("</noscript>").forEach(n=>{let[r,o]=n.split("<noscript>"),i=document.createRange().createContextualFragment(r??"");if(document.head.append(i),rt(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a)})};var Rr=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var Cn=class extends Error{response;request;options;constructor(t,n,r){let o=t.status||t.status===0?t.status:"",i=t.statusText??"",a=`${o} ${i}`.trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=t,this.request=n,this.options=r}};var Uo=class extends Error{name="NonError";value;constructor(t){let n="Non-error value was thrown";try{typeof t=="string"?n=t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"&&(n=t.message)}catch{}super(n),this.value=t}};var Vo=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){let n=t?.cause?t.cause instanceof Error?t.cause:new Uo(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}};var Ic=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return e&&!t})(),Xm=typeof globalThis.AbortController=="function",ms=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Jm=typeof globalThis.ReadableStream=="function",Qm=typeof globalThis.FormData=="function",fs=["get","post","put","patch","head","delete"],fk=()=>{};fk();var ef={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},ps=2147483647,tf=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,gs=Symbol("stop"),ji=class{options;constructor(t){this.options=t}},nf=e=>new ji(e),rf={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},of={next:!0},af={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var pk=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=tf,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},sf=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(i,a){if(a.enqueue(i),r){o+=r.byteLength;let s=t===0?0:o/t;s>=1&&(s=1-Number.EPSILON),n?.({percent:s,totalBytes:Math.max(t,o),transferredBytes:o},r)}r=i},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},r))}}))},lf=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let n=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(sf(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},cf=(e,t,n)=>{if(!e.body)return e;let r=pk(n??e.body);return new Request(e,{duplex:"half",body:sf(e.body,r,t)})};var or=e=>e!==null&&typeof e=="object";var zi=(...e)=>{for(let t of e)if((!or(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Oc({},...e)},Ac=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[i,a]of o.entries())r&&a==="undefined"||a===void 0?n.delete(i):n.set(i,a);return n};function hs(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Oc(e[n]??[],t[n]??[])}var Rc=(e={},t={})=>({beforeRequest:hs(e,t,"beforeRequest"),beforeRetry:hs(e,t,"beforeRetry"),afterResponse:hs(e,t,"afterResponse"),beforeError:hs(e,t,"beforeError")}),gk=(e,t)=>{let n=new URLSearchParams;for(let r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(let[o,i]of r.entries())n.append(o,i);else if(Array.isArray(r))for(let o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(or(r))for(let[o,i]of Object.entries(r))i!==void 0&&n.append(o,String(i));else{let o=new URLSearchParams(r);for(let[i,a]of o.entries())n.append(i,a)}return n},Oc=(...e)=>{let t={},n={},r={},o,i=[];for(let a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(or(a)){for(let[s,l]of Object.entries(a)){if(s==="signal"&&l instanceof globalThis.AbortSignal){i.push(l);continue}if(s==="context"){if(l!=null&&(!or(l)||Array.isArray(l)))throw new TypeError("The `context` option must be an object");t={...t,context:l==null?{}:{...t.context,...l}};continue}if(s==="searchParams"){l==null?o=void 0:o=o===void 0?l:gk(o,l);continue}or(l)&&s in t&&(l=Oc(t[s],l)),t={...t,[s]:l}}or(a.hooks)&&(r=Rc(r,a.hooks),t.hooks=r),or(a.headers)&&(n=Ac(n,a.headers),t.headers=n)}return o!==void 0&&(t.searchParams=o),i.length>0&&(i.length===1?t.signal=i[0]:ms?t.signal=AbortSignal.any(i):t.signal=i.at(-1)),t};var df=e=>fs.includes(e)?e.toUpperCase():e,hk=["get","put","head","delete","options","trace"],bk=[408,413,429,500,502,503,504],yk=[413,429,503],uf={limit:2,methods:hk,statusCodes:bk,afterStatusCodes:yk,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},mf=(e={})=>{if(typeof e=="number")return{...uf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(n=>n.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");let t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0));return{...uf,...t}};var Or=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};async function Nc(e,t,n,r){return new Promise((o,i)=>{let a=setTimeout(()=>{n&&n.abort(),i(new Or(e))},r.timeout);r.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a)})})}async function $c(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(i),r(t.reason)}let i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var ff=(e,t)=>{let n={};for(let r in t)Object.hasOwn(t,r)&&!(r in af)&&!(r in rf)&&(!(r in e)||r in of)&&(n[r]=t[r]);return n},pf=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function gf(e){return e instanceof Cn||e?.name===Cn.name}function hf(e){return e instanceof Or||e?.name===Or.name}var Gi=class e{static create(t,n){let r=new e(t,n),o=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>ps)throw new RangeError(`The \`timeout\` option cannot be greater than ${ps}`);await Promise.resolve();let a=await r.#b();for(let s of r.#e.hooks.afterResponse){let l=r.#f(a.clone()),c;try{c=await s(r.request,r.#c(),l,{retryCount:r.#r})}catch(d){throw r.#i(l),r.#i(a),d}if(c instanceof ji)throw r.#i(l),r.#i(a),new Vo(c.options);let u=c instanceof globalThis.Response?c:a;l!==u&&r.#i(l),a!==u&&r.#i(a),a=u}if(r.#f(a),!a.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(a.status):r.#e.throwHttpErrors)){let s=new Cn(a,r.request,r.#c());for(let l of r.#e.hooks.beforeError)s=await l(s,{retryCount:r.#r});throw s}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Jm)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let s=a.clone();return r.#i(a),lf(s,r.#e.onDownloadProgress)}return a},i=r.#p(o).finally(()=>{let a=r.#a;r.#d(a?.body??void 0),r.#d(r.request.body??void 0)});for(let[a,s]of Object.entries(ef))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[a]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||s);let l=await i;if(a==="json"){if(l.status===204)return"";let c=await l.text();return c===""?"":n.parseJson?n.parseJson(c):JSON.parse(c)}return l[a]()});return i}static#s(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t}request;#n;#r=0;#t;#e;#a;#o;#l;constructor(t,n={}){if(this.#t=t,this.#e={...n,headers:Ac(this.#t.headers,n.headers),hooks:Rc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:df(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:mf(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Xm&&ms&&(this.#o=this.#e.signal??this.#t.signal,this.#n=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#n.signal]):this.#n.signal),Ic&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(Qm&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),pf(this.#e.searchParams)){let i="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(e.#s(this.#e.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);this.request=new globalThis.Request(a,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Ic)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#u(){let t=this.#e.retry.delay(this.#r),n=t;this.#e.retry.jitter===!0?n=Math.random()*t:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t));let r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#h(t){if(this.#r++,this.#r>this.#e.retry.limit)throw t;let n=t instanceof Error?t:new Uo(t);if(n instanceof Vo)return n.customDelay??this.#u();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(this.#e.retry.shouldRetry!==void 0){let r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#r});if(r===!1)throw t;if(r===!0)return this.#u()}if(hf(t)&&!this.#e.retry.retryOnTimeout)throw t;if(gf(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;let r=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let i=this.#e.retry.maxRetryAfter??o;return o<i?o:i}if(t.response.status===413)throw t}return this.#u()}#f(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#d(t){t&&t.cancel().catch(()=>{})}#i(t){this.#d(t.body??void 0)}async#p(t){try{return await t()}catch(n){let r=Math.min(await this.#h(n),ps);if(this.#r<1)throw n;if(await $c(r,this.#o?{signal:this.#o}:{}),n instanceof Vo&&n.customRequest){let o=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#m(o)}for(let o of this.#e.hooks.beforeRetry){let i=await o({request:this.request,options:this.#c(),error:n,retryCount:this.#r});if(i instanceof globalThis.Request){this.#m(i);break}if(i instanceof globalThis.Response)return i;if(i===gs)return}return this.#p(t)}}async#b(){this.#n?.signal.aborted&&(this.#n=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#n.signal]):this.#n.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let n of this.#e.hooks.beforeRequest){let r=await n(this.request,this.#c(),{retryCount:this.#r});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#m(r);break}}let t=ff(this.request,this.#e);return this.#a=this.request,this.request=this.#a.clone(),this.#e.timeout===!1?this.#e.fetch(this.#a,t):Nc(this.#a,t,this.#n,this.#e)}#c(){if(!this.#l){let{hooks:t,...n}=this.#e;this.#l=Object.freeze(n)}return this.#l}#m(t){this.#l=void 0,this.request=this.#g(t)}#g(t,n){return!this.#e.onUploadProgress||!t.body?t:cf(t,this.#e.onUploadProgress,n??this.#e.body??void 0)}};var Mc=e=>{let t=(n,r)=>Gi.create(n,zi(e,r));for(let n of fs)t[n]=(r,o)=>Gi.create(r,zi(e,o,{method:n}));return t.create=n=>Mc(zi(n)),t.extend=n=>(typeof n=="function"&&(n=n(e??{})),Mc(zi(e,n))),t.stop=gs,t.retry=nf,t},vk=Mc(),ir=vk;async function bf({makebot:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(rt(e))throw new Error("Makebot ID is required to get initial messages");let l=Fo()??void 0,c=l?JSON.parse(l):void 0;if(c)return xk({apiHost:n,stripeRedirectStatus:i,paymentInProgressState:c});let u=typeof e=="string"?e:e.id;if(t)return wk({apiHost:n,makebotId:u,startFrom:a,makebot:e,prefilledVariables:r,sessionId:s});try{let d=parent!==window&&Ue(document.referrer)?new URL(document.referrer).origin:void 0;return{data:await(await ir.post(`${Dc(n)}/api/v1/makebots/${u}/startChat`,{headers:{"x-makebot-iframe-referrer-origin":d},json:{isStreamEnabled:!0,prefilledVariables:r,resultId:o,isOnlyRegistering:!1},timeout:!1})).json()}}catch(d){return{error:d}}}var xk=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:n})=>{ds();try{return{data:{...await ir.post(`${Dc(e)}/api/v1/sessions/${n.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...n}}}catch(r){return{error:r}}},wk=async({apiHost:e,makebotId:t,startFrom:n,makebot:r,prefilledVariables:o,sessionId:i})=>{try{return{data:await ir.post(`${Dc(e)}/api/v1/makebots/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:n,makebot:r,prefilledVariables:o,sessionId:i},timeout:!1}).json()}}catch(a){return{error:a}}},Dc=e=>Ue(e)?e:kt();var bs=class extends Error{constructor(t){super("Este bot s\xF3 pode ser executado em "+t)}};var Hi=(e,t)=>({...e,general:e.general?{...e.general,background:e.general.background?{...e.general.background,content:t?.backgroundUrl??e.general.background?.content}:void 0}:void 0,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}});var Ge={blue:{light:{1:"#fcfdfe",2:"#f6f9ff",3:"#ebf2ff",4:"#ddeaff",5:"#ccdfff",6:"#b7d2ff",7:"#a0bfff",8:"#7fa5fd",9:"#3566fc",10:"#2f5be1",11:"#2c57dd",12:"#172c65"},dark:{1:"#070d1a",2:"#0f1627",3:"#12234e",4:"#162c6a",5:"#1d377e",6:"#25428f",7:"#2e4ea4",8:"#365bc1",9:"#3566fc",10:"#2a57ec",11:"#8db4ff",12:"#d1e2ff"}},orange:{light:{1:"#fefcfb",2:"#fff4f0",3:"#ffe8de",4:"#ffd6c7",5:"#ffc8b5",6:"#ffb8a0",7:"#ffa286",8:"#f98868",9:"#ff5924",10:"#f24905",11:"#dc3b00",12:"#5b2a1c"},dark:{1:"#120b09",2:"#1f1411",3:"#371810",4:"#4e1606",5:"#5e1e0b",6:"#6e2c18",7:"#873c26",8:"#ad4d31",9:"#ff5924",10:"#f14b0f",11:"#ff9776",12:"#ffd7ca"}},green:{light:{1:"#fbfefc",2:"#f2fcf5",3:"#e9f9ee",4:"#ddf3e4",5:"#ccebd7",6:"#b4dfc4",7:"#92ceac",8:"#5bb98c",9:"#30a46c",10:"#299764",11:"#18794e",12:"#153226"},dark:{1:"#0d1912",2:"#0c1f17",3:"#0f291e",4:"#113123",5:"#133929",6:"#164430",7:"#1b543a",8:"#236e4a",9:"#30a46c",10:"#3cb179",11:"#4cc38a",12:"#e5fbeb"}},purple:{light:{1:"#fcfcff",2:"#f9f8ff",3:"#f2f0ff",4:"#e7e4ff",5:"#ddd8ff",6:"#d0c9ff",7:"#bdb3ff",8:"#a595ff",9:"#8055fd",10:"#7447ec",11:"#6841d3",12:"#321e6c"},dark:{1:"#0d0a1b",2:"#17132a",3:"#261b4f",4:"#321d6c",5:"#3b257c",6:"#46318b",7:"#543ea2",8:"#684cc7",9:"#8055fd",10:"#7446ee",11:"#b4a6ff",12:"#e0dcff"}},red:{light:{1:"#fffcfc",2:"#fff7f6",3:"#ffebe9",4:"#ffdad6",5:"#ffcbc6",6:"#ffbab5",7:"#fca5a0",8:"#f48984",9:"#f83b45",10:"#ea2638",11:"#d8062a",12:"#6a0d14"},dark:{1:"#130a0a",2:"#201211",3:"#3e0e0f",4:"#55050c",5:"#670b13",6:"#791b1f",7:"#932b2d",8:"#be3a3c",9:"#f83b45",10:"#e92939",11:"#ff8f89",12:"#ffd0cb"}},gray:{light:{1:"#ffffff",2:"#f1f1f1",3:"#f0f0f0",4:"#e8e8e8",5:"#e0e0e0",6:"#dfdfdf",7:"#cecece",8:"#bbbbbb",9:"#8d8d8d",10:"#838383",11:"#464646",12:"#202020"},dark:{1:"#0D0D0D",2:"#1D1D1D",3:"#222222",4:"#2a2a2a",5:"#313131",6:"#3a3a3a",7:"#484848",8:"#606060",9:"#6e6e6e",10:"#7b7b7b",11:"#b4b4b4",12:"#eeeeee"}}};var yf="Google",jo="Open Sans",zo="Color",vf={6:"#FFFFFF","6.1":Ge.gray.light[2]};var xf={6:"#e0edff","6.1":Ge.green.light[9]},wf={6:Ge.gray.light[3],"6.1":Ge.gray.light[9]},kf=4,ys="absolute",Tf="Top",Nr="medium",At=1,Lc=0,Sf="800px",Cf="100%",$r="transparent";var _f={6:"#F7F8FF","6.1":Ge.gray.light[1]},Ef=Ge.gray.light[12],Pf={6:0,"6.1":1},If=Ge.gray.light[6],Af={6:"#FF8E21","6.1":Ge.green.light[9]},Rf=Ge.gray.light[1],Of={6:0,"6.1":1},Nf=Ge.green.light[6],vs={6:"#0042DA","6.1":Ge.green.light[9]},$f=Ge.gray.light[1],Mf={6:0,"6.1":1},Df=Ge.green.light[8];var Lf="#FFFFFF",Bf=Ge.gray.light[12],Ff="#9095A0",Uf={6:0,"6.1":1},Vf={6:void 0,"6.1":Ge.gray.light[7]},jf={6:"md","6.1":void 0},Ln=!0,Wi=!1,zf="wrap",oe={general:{bgImage:"--makebot-container-bg-image",bgColor:"--makebot-container-bg-color",fontFamily:"--makebot-container-font-family",progressBar:{position:"--makebot-progress-bar-position",color:"--makebot-progress-bar-color",colorRgb:"--makebot-progress-bar-bg-rgb",height:"--makebot-progress-bar-height",top:"--makebot-progress-bar-top",bottom:"--makebot-progress-bar-bottom"}},chat:{container:{maxWidth:"--makebot-chat-container-max-width",maxHeight:"--makebot-chat-container-max-height",bgColor:"--makebot-chat-container-bg-rgb",color:"--makebot-chat-container-color",borderRadius:"--makebot-chat-container-border-radius",borderWidth:"--makebot-chat-container-border-width",borderColor:"--makebot-chat-container-border-rgb",borderOpacity:"--makebot-chat-container-border-opacity",opacity:"--makebot-chat-container-opacity",blur:"--makebot-chat-container-blur",boxShadow:"--makebot-chat-container-box-shadow"},hostBubbles:{bgColor:"--makebot-host-bubble-bg-rgb",color:"--makebot-host-bubble-color",borderRadius:"--makebot-host-bubble-border-radius",borderWidth:"--makebot-host-bubble-border-width",borderColor:"--makebot-host-bubble-border-rgb",borderOpacity:"--makebot-host-bubble-border-opacity",opacity:"--makebot-host-bubble-opacity",blur:"--makebot-host-bubble-blur",boxShadow:"--makebot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--makebot-guest-bubble-bg-rgb",color:"--makebot-guest-bubble-color",borderRadius:"--makebot-guest-bubble-border-radius",borderWidth:"--makebot-guest-bubble-border-width",borderColor:"--makebot-guest-bubble-border-rgb",borderOpacity:"--makebot-guest-bubble-border-opacity",opacity:"--makebot-guest-bubble-opacity",blur:"--makebot-guest-bubble-blur",boxShadow:"--makebot-guest-bubble-box-shadow"},inputs:{bgColor:"--makebot-input-bg-rgb",color:"--makebot-input-color",placeholderColor:"--makebot-input-placeholder-color",borderRadius:"--makebot-input-border-radius",borderWidth:"--makebot-input-border-width",borderColor:"--makebot-input-border-rgb",borderOpacity:"--makebot-input-border-opacity",opacity:"--makebot-input-opacity",blur:"--makebot-input-blur",boxShadow:"--makebot-input-box-shadow"},buttons:{bgRgb:"--makebot-button-bg-rgb",color:"--makebot-button-color",borderRadius:"--makebot-button-border-radius",borderWidth:"--makebot-button-border-width",borderColor:"--makebot-button-border-rgb",borderOpacity:"--makebot-button-border-opacity",opacity:"--makebot-button-opacity",blur:"--makebot-button-blur",boxShadow:"--makebot-button-box-shadow",flexDirection:"--makebot-buttons-input-flex-direction"},checkbox:{bgRgb:"--makebot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},Gf="#F7F8FF",Hf="#303235",Wf="#F7F8FF",qf="#303235";var kk="https://fonts.bunny.net/css2",xs="makebot-font",Bc=e=>{let t=document.getElementById(xs);if(typeof e=="string"||e.type==="Google"){let n=(typeof e=="string"?e:e.family)??jo;if(t?.getAttribute("href")?.includes(n))return;t?.remove();let r=document.createElement("link");r.href=`${kk}?family=${n}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,r.rel="stylesheet",r.id=xs,document.head.appendChild(r);return}if(e.type==="Custom"){if(Ue(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let n=document.createElement("style");n.innerHTML=e.css,n.id=xs,document.head.appendChild(n)}if(Ue(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=xs,document.head.appendChild(n)}}};var ht={general:{isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},typingEmulation:{enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},metadata:{description:"Crie formul\xE1rios de conversa\xE7\xE3o atraentes e incorpore-os diretamente aos seus aplicativos, sem uma linha de c\xF3digo. Triplique sua taxa de resposta e colete respostas com mais valor em compara\xE7\xE3o com um formul\xE1rio tradicional.",favIconUrl:e=>e+"/favicon.svg",imageUrl:e=>e+"/site-preview.png"}},Jt={invalidMessage:"Mensagem inv\xE1lida. Tente novamente.",botClosed:"Este bot est\xE1 fechado agora",networkErrorTitle:"Erro de rede",networkErrorMessage:"Verifique sua conex\xE3o com a internet e tente novamente.",popupBlockedTitle:"Pop-up bloqueado",popupBlockedDescription:"O bot quer abrir uma nova aba, mas foi bloqueado pelo seu navegador. \xC9 necess\xE1ria uma aprova\xE7\xE3o manual.",popupBlockedButtonLabel:"Continuar em nova aba",fileUploadError:"Ocorreu um erro ao carregar os arquivos",fileUploadSizeError:"[[file]] \xE9 maior que [[limit]]MB",sessionFinalized:"Sess\xE3o finalizada pelo administrador."};var Tk=Symbol("store-raw"),Sk=Symbol("store-node"),Go=Symbol("store-has"),Ck=Symbol("store-self");function qi(e){let t;return e!=null&&typeof e=="object"&&(e[$o]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Fc(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Tk])return n;if(!qi(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)o=e[a],(r=Fc(o,t))!==o&&(e[a]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=a.length;l<c;l++)i=a[l],!s[i].get&&(o=e[i],(r=Fc(o,t))!==o&&(e[i]=r))}return e}function _k(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Zf(e,t,n){if(e[t])return e[t];let[r,o]=O(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function ar(e,t,n,r=!1){if(!r&&e[t]===n)return;let o=e[t],i=e.length;n===void 0?(delete e[t],e[Go]&&e[Go][t]&&o!==void 0&&e[Go][t].$()):(e[t]=n,e[Go]&&e[Go][t]&&o===void 0&&e[Go][t].$());let a=_k(e,Sk),s;if((s=Zf(a,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(s=a[l])&&s.$();(s=Zf(a,"length",i))&&s.$(e.length)}(s=a[Ck])&&s.$()}var Uc=Symbol("store-root");function Ho(e,t,n,r,o){let i=t[n];if(e===i)return;let a=Array.isArray(e);if(n!==Uc&&(!qi(e)||!qi(i)||a!==Array.isArray(i)||o&&e[o]!==i[o])){ar(t,n,e);return}if(a){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,p,y,h,k;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]&&i[d][o]===e[d][o]);d++)Ho(e[d],i,d,r,o);let C=new Array(e.length),b=new Map;for(f=i.length-1,p=e.length-1;f>=d&&p>=d&&(i[f]===e[p]||o&&i[f]&&e[p]&&i[f][o]&&i[f][o]===e[p][o]);f--,p--)C[p]=i[f];if(d>p||d>f){for(u=d;u<=p;u++)ar(i,u,e[u]);for(;u<e.length;u++)ar(i,u,C[u]),Ho(e[u],i,u,r,o);i.length>e.length&&ar(i,"length",e.length);return}for(h=new Array(p+1),u=p;u>=d;u--)y=e[u],k=o&&y?y[o]:y,c=b.get(k),h[u]=c===void 0?-1:c,b.set(k,u);for(c=d;c<=f;c++)y=i[c],k=o&&y?y[o]:y,u=b.get(k),u!==void 0&&u!==-1&&(C[u]=i[c],u=h[u],b.set(k,u));for(u=d;u<e.length;u++)u in C?(ar(i,u,C[u]),Ho(e[u],i,u,r,o)):ar(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)Ho(e[c],i,c,r,o);i.length>e.length&&ar(i,"length",e.length);return}let s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)Ho(e[s[c]],i,s[c],r,o);let l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&ar(i,l[c],void 0)}function Yf(e,t={}){let{merge:n,key:r="id"}=t,o=Fc(e);return i=>{if(!qi(i)||!qi(o))return o;let a=Ho(o,{[Uc]:i},Uc,n,r);return a===void 0?i:a}}var Vc="resultId",Kf=e=>{if(e)try{return sessionStorage.getItem(`${Vc}-${e}`)??localStorage.getItem(`${Vc}-${e}`)??void 0}catch{}},Xf=(e="session")=>(t,n)=>{try{Wo(e).setItem(`${Vc}-${t}`,n)}catch{}},Jf=e=>{if(e)try{let t=sessionStorage.getItem(`makebot-${e}-initialChatReply`)??localStorage.getItem(`makebot-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},jc=(e,{makebotId:t,storage:n})=>{try{let r=JSON.stringify(e);Wo(n).setItem(`makebot-${t}-initialChatReply`,r)}catch{}},ws=()=>{try{sessionStorage.setItem("makebot-botOpened","true")}catch{}},ks=()=>{try{sessionStorage.removeItem("makebot-botOpened")}catch{}},Ts=()=>{try{return sessionStorage.getItem("makebot-botOpened")==="true"}catch{return!1}},Wo=e=>(e??ht.general.rememberUser.storage)==="session"?sessionStorage:localStorage,Ss=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&sessionStorage.removeItem(t)})};function Zi(e,t){if(!t.storage)return[...e];let n=Wo(t.storage||ht.general.rememberUser.storage),r=a=>{let s=JSON.parse(JSON.stringify(a));return typeof s!="object"||("blobUrl"in s&&(s.blobUrl=void 0),"attachments"in s&&Array.isArray(s.attachments)&&s.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0)})),JSON.stringify(s)},o=JSON.parse.bind(JSON),i=n.getItem(t.key);if(i){let a=typeof e[0]=="function"?l=>e[1](()=>l):l=>e[1](Yf(l)),s=o(i);t.transformInitDataFromStorage&&(s=t.transformInitDataFromStorage(s),n.setItem(t.key,r(s))),a(s),t.onRecovered?.()}return[e[0],typeof e[0]=="function"?a=>{let s=e[1](a);return a?n.setItem(t.key,r(s)):n.removeItem(t.key),s}:(...a)=>{e[1](...a);let s=r(Ke(()=>e[0]));n.setItem(t.key,s)}]}var ot=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(r,o,i,a)=>o+o+i+i+a+a);let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?[Number.parseInt(n[1]??"",16),Number.parseInt(n[2]??"",16),Number.parseInt(n[3]??"",16)]:[0,0,0]},sr=e=>(([t,n,r])=>(t*299+n*587+r*114)/1e3>155)(ot(e));var qo=({chatContainer:e,generalBackground:t})=>{let n=e?.backgroundColor??$r;if((e?.opacity??At)<=.3||n==="transparent"||ct(n)){let o=t?.type??zo,i=o==="Image"?"#000000":o==="Color"&&Ue(t?.content)?t.content:"#ffffff";return sr(i)}return sr(n)};var ep=({theme:e,container:t,isPreview:n,makebotVersion:r})=>{if(!e)return;let o=t?.style;o&&(Ek({generalTheme:e.general,documentStyle:o,isPreview:n,makebotVersion:r}),Ik({chatTheme:e.chat,generalBackground:e.general?.background,documentStyle:o,makebotVersion:r}))},Ek=({generalTheme:e,documentStyle:t,isPreview:n,makebotVersion:r})=>{zc({background:e?.background,documentStyle:t,makebotVersion:r}),t.setProperty(oe.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??jo),Pk({progressBar:e?.progressBar,documentStyle:t,isPreview:n,makebotVersion:r})},Pk=({progressBar:e,documentStyle:t,isPreview:n,makebotVersion:r})=>{let o=e?.position??ys;t.setProperty(oe.general.progressBar.position,o==="fixed"?n?"absolute":"fixed":o),t.setProperty(oe.general.progressBar.color,e?.color??xf[r]),t.setProperty(oe.general.progressBar.colorRgb,ot(e?.backgroundColor??wf[r]).join(", ")),t.setProperty(oe.general.progressBar.height,`${e?.thickness??kf}px`);let i=e?.placement??Tf;t.setProperty(oe.general.progressBar.top,i==="Top"?"0":"auto"),t.setProperty(oe.general.progressBar.bottom,i==="Bottom"?"0":"auto")},Ik=({chatTheme:e,generalBackground:t,documentStyle:n,makebotVersion:r})=>{Ak({container:e?.container,generalBackground:t,documentStyle:n,legacyRoundness:e?.roundness,makebotVersion:r}),Rk({hostBubbles:e?.hostBubbles,documentStyle:n,legacyRoundness:e?.roundness,makebotVersion:r}),Ok({guestBubbles:e?.guestBubbles,documentStyle:n,legacyRoundness:e?.roundness,makebotVersion:r}),Nk({buttons:e?.buttons,documentStyle:n,legacyRoundness:e?.roundness,makebotVersion:r}),Mk({inputs:e?.inputs,documentStyle:n,legacyRoundness:e?.roundness,makebotVersion:r}),Dk(e?.container,t,n),$k({buttonsInput:e?.buttonsInput,documentStyle:n,makebotVersion:r})},Ak=({container:e,generalBackground:t,documentStyle:n,legacyRoundness:r})=>{let o=e?.backgroundColor??$r,i=o==="transparent"||ct(o);n.setProperty(oe.chat.container.bgColor,i?"0, 0, 0":ot(o).join(", ")),n.setProperty(oe.chat.container.color,ot(e?.color??(qo({chatContainer:e,generalBackground:t})?Ge.gray.light[12]:Ge.gray.dark[12])).join(", ")),n.setProperty(oe.chat.container.maxWidth,e?.maxWidth??Sf),n.setProperty(oe.chat.container.maxHeight,e?.maxHeight??Cf);let a=i?"1":(e?.opacity??At).toString();n.setProperty(oe.chat.container.opacity,i?"0":(e?.opacity??At).toString()),n.setProperty(oe.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??Lc}px`),Ki(e?.shadow,n,oe.chat.container.boxShadow),Yi(e?.border??{roundeness:r??Nr},n,oe.chat.container.borderRadius),n.setProperty(oe.chat.container.borderWidth,ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),n.setProperty(oe.chat.container.borderOpacity,ye(e?.border?.opacity)?e.border.opacity.toString():At.toString()),n.setProperty(oe.chat.container.borderColor,ot(e?.border?.color??"").join(", "))},Rk=({hostBubbles:e,documentStyle:t,legacyRoundness:n,makebotVersion:r})=>{t.setProperty(oe.chat.hostBubbles.bgColor,ot(e?.backgroundColor??_f[r]).join(", ")),t.setProperty(oe.chat.hostBubbles.color,e?.color??Ef),Yi(e?.border??{roundeness:n??Nr},t,oe.chat.hostBubbles.borderRadius);let o=e?.border?.thickness??Pf[r];ye(o)&&t.setProperty(oe.chat.hostBubbles.borderWidth,o+"px"),t.setProperty(oe.chat.hostBubbles.borderColor,ot(e?.border?.color??If).join(", ")),t.setProperty(oe.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":ye(e?.opacity)?e.opacity.toString():At.toString()),t.setProperty(oe.chat.hostBubbles.borderOpacity,ye(e?.border?.opacity)?e.border.opacity.toString():At.toString()),t.setProperty(oe.chat.hostBubbles.blur,ye(e?.blur)?`${e.blur??0}px`:"none"),Ki(e?.shadow,t,oe.chat.hostBubbles.boxShadow)},Ok=({guestBubbles:e,documentStyle:t,legacyRoundness:n,makebotVersion:r})=>{t.setProperty(oe.chat.guestBubbles.bgColor,ot(e?.backgroundColor??Af[r]).join(", ")),t.setProperty(oe.chat.guestBubbles.color,e?.color??Rf),Yi(e?.border??{roundeness:n??Nr},t,oe.chat.guestBubbles.borderRadius);let o=e?.border?.thickness??Of[r];ye(o)&&t.setProperty(oe.chat.guestBubbles.borderWidth,o+"px"),t.setProperty(oe.chat.guestBubbles.borderColor,ot(e?.border?.color??Nf).join(", ")),t.setProperty(oe.chat.guestBubbles.borderOpacity,ye(e?.border?.opacity)?e.border.opacity.toString():At.toString()),t.setProperty(oe.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":ye(e?.opacity)?e.opacity.toString():At.toString()),t.setProperty(oe.chat.guestBubbles.blur,ye(e?.blur)?`${e.blur??0}px`:"none"),Ki(e?.shadow,t,oe.chat.guestBubbles.boxShadow)},Nk=({buttons:e,documentStyle:t,legacyRoundness:n,makebotVersion:r})=>{let o=e?.backgroundColor??vs[r];t.setProperty(oe.chat.buttons.bgRgb,ot(o).join(", ")),t.setProperty(oe.chat.buttons.bgRgb,ot(o).join(", ")),t.setProperty(oe.chat.buttons.color,e?.color??$f),Yi(e?.border??{roundeness:n??Nr},t,oe.chat.buttons.borderRadius),t.setProperty(oe.chat.buttons.borderWidth,ye(e?.border?.thickness)?`${e?.border?.thickness}px`:`${Mf[r]}px`),t.setProperty(oe.chat.buttons.borderColor,ot(e?.border?.color??e?.backgroundColor??Df).join(", ")),t.setProperty(oe.chat.buttons.borderOpacity,ye(e?.border?.opacity)?e.border.opacity.toString():At.toString()),t.setProperty(oe.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":ye(e?.opacity)?e.opacity.toString():At.toString()),t.setProperty(oe.chat.buttons.blur,ye(e?.blur)?`${e.blur??0}px`:Lc.toString()),Ki(e?.shadow,t,oe.chat.buttons.boxShadow)},$k=({buttonsInput:e,documentStyle:t})=>{t.setProperty(oe.chat.buttons.flexDirection,(e?.layout??zf)==="vertical"?"column":"unset")},Mk=({inputs:e,documentStyle:t,legacyRoundness:n,makebotVersion:r})=>{t.setProperty(oe.chat.inputs.bgColor,ot(e?.backgroundColor??Lf).join(", ")),t.setProperty(oe.chat.inputs.color,e?.color??Bf),t.setProperty(oe.chat.inputs.placeholderColor,e?.placeholderColor??Ff),Yi(e?.border??{roundeness:n??Nr},t,oe.chat.inputs.borderRadius),t.setProperty(oe.chat.inputs.borderWidth,`${e?.border?.thickness??Uf[r]}px`);let o=e?.border?.color??Vf[r];ye(o)&&t.setProperty(oe.chat.inputs.borderColor,ot(o).join(", ")),t.setProperty(oe.chat.inputs.borderOpacity,ye(e?.border?.opacity)?e.border.opacity.toString():At.toString()),t.setProperty(oe.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":ye(e?.opacity)?e.opacity.toString():At.toString()),t.setProperty(oe.chat.inputs.blur,ye(e?.blur)?`${e.blur??0}px`:"none"),Ki(e?.shadow??jf[r],t,oe.chat.inputs.boxShadow)},Dk=(e,t,n)=>{let r=e?.backgroundColor??$r;if(r==="transparent"||ct(r)||(e?.opacity??At)<=.2){let i=t?.type??zo;n.setProperty(oe.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":ot((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?n.setProperty(oe.chat.checkbox.alphaRatio,"3"):n.setProperty(oe.chat.checkbox.alphaRatio,t?.content&&sr(t?.content)?"1":"2")}else n.setProperty(oe.chat.checkbox.bgRgb,ot(r).concat(e?.opacity??1).join(", ")),n.setProperty(oe.chat.checkbox.alphaRatio,sr(r)?"1":"2")},zc=({background:e,documentStyle:t,makebotVersion:n})=>{t.setProperty(oe.general.bgImage,null),t.setProperty(oe.general.bgColor,null),t.setProperty((e?.type??zo)==="Image"?oe.general.bgImage:oe.general.bgColor,Lk({type:e?.type??zo,content:e?.content??vf[n]}))},Lk=({type:e,content:t})=>{switch(e){case"None":return"transparent";case void 0:case"Color":return t;case"Image":return`url(${t})`}},Yi=(e,t,n)=>{switch(e?.roundeness??Nr){case"none":{t.setProperty(n,"0");break}case"medium":{t.setProperty(n,"6px");break}case"large":{t.setProperty(n,"20px");break}case"custom":{t.setProperty(n,`${e.customRoundeness??6}px`);break}}},Ki=(e,t,n)=>{if(e===void 0){t.setProperty(n,"0 0 #0000");return}switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var Bk=e=>typeof e=="function";function Fk(e,t){Bk(e)&&e(t)}function lr(...e){return t=>{for(let n of e)Fk(n,t)}}var Be=()=>(e,t)=>qe(e,t);function Uk(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function je(e={}){let{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,a=Do(i);function s(){let l=Ir(a);if(!l&&t){let c=new Error(o??Uk(n,r));throw c.name="ContextError",Error.captureStackTrace?.(c,s),c}return l}return[a.Provider,s,a]}var[Gc,tp]=je({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Xi=e=>Be()(e,["lazyMount","unmountOnExit"]);var Hc=Symbol("fallback");function np(e){for(let t of e)t.dispose()}function Vk(e,t,n,r={}){if(zm){let a=e(),s=[];if(a&&a.length)for(let l=0,c=a.length;l<c;l++)s.push(n(()=>a[l],()=>l));else r.fallback&&(s=[r.fallback()]);return()=>s}let o=new Map;return ie(()=>np(o.values())),()=>{let a=e()||[];return a[Di],Ke(()=>{if(!a.length)return np(o.values()),o.clear(),r.fallback?[Kt(d=>(o.set(Hc,{dispose:d}),r.fallback()))]:[];let s=new Array(a.length),l=o.get(Hc);if(!o.size||l){l?.dispose(),o.delete(Hc);for(let u=0;u<a.length;u++){let d=a[u],f=t(d,u);i(s,d,u,f)}return s}let c=new Set(o.keys());for(let u=0;u<a.length;u++){let d=a[u],f=t(d,u);c.delete(f);let p=o.get(f);p?(s[u]=p.mapped,p.setIndex?.(u),p.setItem(()=>d)):i(s,d,u,f)}for(let u of c)o.get(u)?.dispose(),o.delete(u);return s})};function i(a,s,l,c){Kt(u=>{let[d,f]=O(s),p={setItem:f,dispose:u};if(n.length>1){let[y,h]=O(l);p.setIndex=h,p.mapped=n(d,y)}else p.mapped=n(d);o.set(c,p),a[l]=p.mapped})}}function Wc(e){let{by:t}=e;return re(Vk(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function ip(e){return e?Array.isArray(e)?e:[e]:[]}var ap=e=>e[0],sp=e=>e[e.length-1];var lp=(e,...t)=>e.concat(t),cp=(e,...t)=>e.filter(n=>!t.includes(n));var up=e=>Array.from(new Set(e));function Cs(e,t,n={}){let{step:r=1,loop:o=!0}=n,i=t+r,a=e.length,s=a-1;return t===-1?r>0?0:s:i<0?o?s:0:i>=a?o?0:t>a?a:t:i}function dp(e,t,n={}){return e[Cs(e,t,n)]}function qc(e,t,n={}){let{step:r=1,loop:o=!0}=n;return Cs(e,t,{step:-r,loop:o})}function mp(e,t,n={}){return e[qc(e,t,n)]}var rp=e=>e?.constructor.name==="Array",jk=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_n(e[n],t[n]))return!1;return!0},_n=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(rp(e)&&rp(t))return jk(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){let i=n[o];if(!_n(e[i],t[i]))return!1}return!0};var zk=e=>Array.isArray(e);var Gk=e=>e!=null&&typeof e=="object",_s=e=>Gk(e)&&!zk(e),Ji=e=>typeof e=="number"&&!Number.isNaN(e),Ut=e=>typeof e=="string",Qt=e=>typeof e=="function",fp=e=>e==null;var Hk=Function.prototype.toString,z5=Hk.call(Object);var Mr=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0;var pp=()=>{},dn=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},Zc=(()=>{let e=0;return()=>(e++,e.toString(36))})();function gp(e,t=0){let n=0,r=null;return(...o)=>{let i=Date.now(),a=i-n;a>=t?(r&&(clearTimeout(r),r=null),e(...o),n=i):r||(r=setTimeout(()=>{e(...o),n=Date.now(),r=null},t-a))}}var{floor:Wk,abs:G5,round:qk,min:Zk,max:Yk,pow:H5,sign:W5}=Math,Kk=e=>Number.isNaN(e),cr=e=>Kk(e)?0:e;var hp=(e,t)=>(e%t+t)%t;var bp=(e,t)=>cr(e)>=t,yp=(e,t)=>cr(e)<=t,vp=(e,t,n)=>cr(e)>=t&&cr(e)<=n;var ur=(e,t,n)=>Zk(Yk(cr(e),t),n);var xp=(e,t,n)=>(cr(e)-t)/(n-t);var Zo=(e,t)=>typeof t=="number"?Wk(e*t+.5)/t:qk(e);var op=e=>{if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n},wp=(e,t,n)=>{let r=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){let o=10**Math.max(op(e),op(n));e=Math.round(e*o),n=Math.round(n*o),r=t==="+"?e+n:e-n,r/=o}return r},kp=(e,t)=>wp(cr(e),"+",t),Tp=(e,t)=>wp(cr(e),"-",t);function Dr(e){if(!Xk(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=Dr(o))}return n}var Xk=e=>e&&typeof e=="object"&&e.constructor===Object;function Jk(e,t){let n={},r={},o=new Set(t);for(let i in e)o.has(i)?r[i]=e[i]:n[i]=e[i];return[r,n]}var Tt=e=>function(n){return Jk(n,e)};function Es(e,t){let n=performance.now(),r;function o(i){r=requestAnimationFrame(o),i-n>=t&&e()}return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)}function Yo(...e){let t=e.length===1?e[0]:e[1],n=e.length===2?e[0]:!0}function Sp(e,t){if(e==null)throw new Error(t())}function Ps(e,t,n){let r=[];for(let o of t)e[o]==null&&r.push(o);if(r.length>0)throw new Error(`[zag-js${n?` > ${n}`:""}] missing required props: ${r.join(", ")}`)}var Qk=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]);var _p=()=>{},As=e=>typeof e=="object"&&e!==null,Rs=2147483647,be=e=>e?"":void 0,Fn=e=>e?"true":void 0,eT=1,tT=9,nT=11,Je=e=>As(e)&&e.nodeType===eT&&typeof e.nodeName=="string",Os=e=>As(e)&&e.nodeType===tT,rT=e=>As(e)&&e===e.window;var Ep=e=>Je(e)?e.localName||"":"#document";function oT(e){return["html","body","#document"].includes(Ep(e))}var iT=e=>As(e)&&e.nodeType!==void 0,Xo=e=>iT(e)&&e.nodeType===nT&&"host"in e,aT=e=>Je(e)&&e.localName==="input",Pp=e=>!!e?.matches("a[href]"),sT=e=>Je(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,lT=/(textarea|select)/;function Ns(e){if(e==null||!Je(e))return!1;try{return aT(e)&&e.selectionStart!=null||lT.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function Vt(e,t){if(!e||!t||!Je(e)||!Je(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Xo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function St(e){return Os(e)?e:rT(e)?e.document:e?.ownerDocument??document}function cT(e){return St(e).documentElement}function bt(e){return Xo(e)?bt(e.host):Os(e)?e.defaultView??window:Je(e)?e.ownerDocument?.defaultView??window:window}function $s(e){let t=e.activeElement;for(;t?.shadowRoot;){let n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}function uT(e){if(Ep(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Xo(e)&&e.host||cT(e);return Xo(t)?t.host:t}var Yc=new WeakMap;function mn(e){return Yc.has(e)||Yc.set(e,bt(e).getComputedStyle(e)),Yc.get(e)}var Ms=()=>typeof document<"u";function dT(){return navigator.userAgentData?.platform??navigator.platform}function mT(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Xc=e=>Ms()&&e.test(dT()),fT=e=>Ms()&&e.test(mT()),pT=e=>Ms()&&e.test(navigator.vendor),Jc=()=>Ms()&&!!navigator.maxTouchPoints,gT=()=>Xc(/^iPhone/i),hT=()=>Xc(/^iPad/i)||Qc()&&navigator.maxTouchPoints>1,Qi=()=>gT()||hT(),Ip=()=>Qc()||Qi(),Qc=()=>Xc(/^Mac/i),eu=()=>Ip()&&pT(/apple/i),bT=()=>fT(/Firefox/i);function yT(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function it(e){return yT(e)?.[0]??e.target}var Ds=e=>Vt(e.currentTarget,it(e));function tu(e){let t=e.currentTarget;if(!t)return!1;let n=Ip();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.localName;return r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit"}function nu(e){let t=e.currentTarget;if(!t)return!1;let n=t.localName;return e.altKey?n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit":!1}function Ap(e){return wT(e).isComposing||e.keyCode===229}function Rp(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var ru=e=>e.button===0,Ls=e=>e.button===2||Qc()&&e.ctrlKey&&e.button===0,ea=e=>e.ctrlKey||e.altKey||e.metaKey,vT=e=>"touches"in e&&e.touches.length>0,xT={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Cp={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function ta(e,t={}){let{dir:n="ltr",orientation:r="horizontal"}=t,o=e.key;return o=xT[o]??o,n==="rtl"&&r==="horizontal"&&o in Cp&&(o=Cp[o]),o}function wT(e){return e.nativeEvent??e}var kT=new Set(["PageUp","PageDown"]),TT=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Op(e){return e.ctrlKey||e.metaKey?.1:kT.has(e.key)||e.shiftKey&&TT.has(e.key)?10:1}function dr(e,t="client"){let n=vT(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Me=(e,t,n,r)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function ST(e,t){let{type:n="HTMLInputElement",property:r="value"}=t,o=bt(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function CT(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Np(e,t,n="value"){if(!e)return;let r=CT(e);r&&ST(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}function _T(e){return ET(e)?e.form:e.closest("form")}function ET(e){return e.matches("textarea, input, select, button")}function PT(e,t){if(!e)return;let n=_T(e),r=o=>{o.defaultPrevented||t()};return n?.addEventListener("reset",r,{passive:!0}),()=>n?.removeEventListener("reset",r)}function IT(e,t){let n=e?.closest("fieldset");if(!n)return;t(n.disabled);let r=bt(n),o=new r.MutationObserver(()=>t(n.disabled));return o.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function $p(e,t){if(!e)return;let{onFieldsetDisabledChange:n,onFormReset:r}=t,o=[PT(e,r),IT(e,n)];return()=>o.forEach(i=>i?.())}var Mp=e=>Je(e)&&e.tagName==="IFRAME",AT=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),RT=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,ou="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",iu=(e,t=!1)=>{if(!e)return[];let n=Array.from(e.querySelectorAll(ou));(t==!0||t=="if-empty"&&n.length===0)&&Je(e)&&en(e)&&n.unshift(e);let o=n.filter(en);return o.forEach((i,a)=>{if(Mp(i)&&i.contentDocument){let s=i.contentDocument.body;o.splice(a,1,...iu(s))}}),o};function en(e){return!e||e.closest("[inert]")?!1:e.matches(ou)&&sT(e)}function Lr(e,t){if(!e)return[];let n=Array.from(e.querySelectorAll(ou)),r=n.filter(Bn);return t&&Bn(e)&&r.unshift(e),r.forEach((o,i)=>{if(Mp(o)&&o.contentDocument){let a=o.contentDocument.body,s=Lr(a);r.splice(i,1,...s)}}),!r.length&&t?n:r}function Bn(e){return e!=null&&e.tabIndex>0?!0:en(e)&&!RT(e)}function OT(e,t){let n=Lr(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function Jo(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Ns(e))&&!AT(e)?0:e.tabIndex}function Dp(e){let{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof n=="function"?n():n),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let a=Lr(t);i=r?a.filter(r)[0]:a[0]}return i||t||void 0}function Lp(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=OT(t),o=t.ownerDocument||document;return!(o.activeElement===n&&e.shiftKey||o.activeElement===r&&!e.shiftKey||!n&&!r)}function au(e){let t=new Set;function n(r){let o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function Pe(e){let t,n=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(n),t?.()}}function NT(e,t,n){let r=Pe(()=>{e.removeEventListener(t,o,!0),n()}),o=()=>{r(),n()};return e.addEventListener(t,o,{once:!0,capture:!0}),r}function $T(e,t){if(!e)return;let{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(a=>{for(let s of a)s.type==="attributes"&&s.attributeName&&n.includes(s.attributeName)&&r(s)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Bs(e,t){let{defer:n}=t,r=n?Pe:i=>i(),o=[];return o.push(r(()=>{let i=typeof e=="function"?e():e;o.push($T(i,t))})),()=>{o.forEach(i=>i?.())}}function Bp(e){let t=()=>e.click();bT()?NT(e,"keyup",t):queueMicrotask(t)}function Fs(e){let t=uT(e);return oT(t)?St(t).body:Je(t)&&Fp(t)?t:Fs(t)}var MT=/auto|scroll|overlay|hidden|clip/;function Fp(e){let t=bt(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return MT.test(n+o+r)&&!["inline","contents"].includes(i)}function DT(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Up(e,t){let{rootEl:n,...r}=t||{};!e||!n||!Fp(n)||!DT(n)||e.scrollIntoView(r)}function Vp(e,t){let n=e.body,r="pointerLockElement"in e||"mozPointerLockElement"in e,o=()=>!!e.pointerLockElement;function i(){t?.(o())}function a(l){o()&&t?.(!1),console.error("PointerLock error occurred:",l),e.exitPointerLock()}if(!r)return;try{n.requestPointerLock()}catch{}let s=[Me(e,"pointerlockchange",i,!1),Me(e,"pointerlockerror",a,!1)];return()=>{s.forEach(l=>l()),e.exitPointerLock()}}var Ko="default",Kc="",Is=new WeakMap;function LT(e={}){let{target:t,doc:n}=e,r=n??document,o=r.documentElement;return Qi()?(Ko==="default"&&(Kc=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Ko="disabled"):t&&(Is.set(t,t.style.userSelect),t.style.userSelect="none"),()=>BT({target:t,doc:r})}function BT(e={}){let{target:t,doc:n}=e,o=(n??document).documentElement;if(Qi()){if(Ko!=="disabled")return;Ko="restoring",setTimeout(()=>{au(()=>{Ko==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Kc||""),Kc="",Ko="default")})},300)}else if(t&&Is.has(t)){let i=Is.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Is.delete(t)}}function FT(e={}){let{defer:t,target:n,...r}=e,o=t?Pe:a=>a(),i=[];return i.push(o(()=>{let a=typeof n=="function"?n():n;i.push(LT({...r,target:a}))})),()=>{i.forEach(a=>a?.())}}function jp(e,t){let{onPointerMove:n,onPointerUp:r}=t,i=[Me(e,"pointermove",a=>{let s=dr(a),l=Math.sqrt(s.x**2+s.y**2),c=a.pointerType==="touch"?10:5;if(!(l<c)){if(a.pointerType==="mouse"&&a.button===0){r();return}n({point:s,event:a})}},!1),Me(e,"pointerup",r,!1),Me(e,"pointercancel",r,!1),Me(e,"contextmenu",r,!1),FT({doc:e})];return()=>{i.forEach(a=>a())}}function Us(e,t){return Array.from(e?.querySelectorAll(t)??[])}var su=e=>e.id;function UT(e,t,n=su){return e.find(r=>n(r)===t)}function VT(e,t,n=su){let r=UT(e,t,n);return r?e.indexOf(r):-1}var jT=e=>e.split("").map(t=>{let n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),zT=e=>jT(e.dataset?.valuetext??e.textContent??""),GT=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function HT(e,t,n,r=su){let o=n?VT(e,n,r):-1,i=n?Qk(e,o):e;return t.length===1&&(i=i.filter(s=>r(s)!==n)),i.find(s=>GT(zT(s),t))}function Br(e,t){if(!e)return _p;let n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function zp(e,t,n){if(!e)return _p;let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function WT(e,t){let{state:n,activeId:r,key:o,timeout:i=350,itemToId:a}=t,s=n.keysSoFar+o,c=s.length>1&&Array.from(s).every(y=>y===s[0])?s[0]:s,u=e.slice(),d=HT(u,c,r,a);function f(){clearTimeout(n.timer),n.timer=-1}function p(y){n.keysSoFar=y,f(),y!==""&&(n.timer=+setTimeout(()=>{p(""),f()},i))}return p(s),d}var lu=Object.assign(WT,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:qT});function qT(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var ZT=1e3/60;function YT(e,t){let n=e();if(Je(n)&&n.isConnected)return t(n),()=>{};{let r=setInterval(()=>{let o=e();Je(o)&&o.isConnected&&(t(o),clearInterval(r))},ZT);return()=>clearInterval(r)}}function Gp(e,t){let n=[];return e?.forEach(r=>{let o=YT(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var KT=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),XT=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Hp=e=>{let t={},n;for(;n=XT.exec(e);)t[n[1]]=n[2];return t},JT=(e,t)=>{if(Ut(e)){if(Ut(t))return`${e};${t}`;e=Hp(e)}else Ut(t)&&(t=Hp(t));return Object.assign({},e??{},t??{})};function Wp(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=dn(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=KT(t[r],n[r]);continue}if(r==="style"){t[r]=JT(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}var Fr=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Fr||{}),Vs="__init__";function qp(e){let t=()=>e.getRootNode?.()??document,n=()=>St(t()),r=()=>n().defaultView??window,o=()=>$s(t());return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:o,isActiveElement:s=>s===o(),getById:s=>t().getElementById(s)}}function Zp(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var ut=()=>e=>Array.from(new Set(e));function js(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=O(t),i=re(()=>e().value!=null),a={current:r()},s={current:void 0};$e(()=>{let u=i()?e().value:r();s.current=u,a.current=u});let l=u=>{let d=s.current,f=Qt(u)?u(a.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:f,prev:d}),i()||o(f),n(f,d)||e().onChange?.(f,d)};function c(){let u=i()?e().value:r;return Qt(u)?u():u}return{initial:t,ref:a,get:c,set:l,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}js.cleanup=e=>{ie(()=>e())};js.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function QT(e){let[t,n]=O(e);return{get(r){return t()[r]},set(r,o){n(i=>({...i,[r]:o}))}}}function cu(e){return Qt(e)?e():e}var eS=(e,t)=>{let n=[],r=!0;$e(()=>{if(r){n=e.map(i=>cu(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!_n(n[i],cu(e[i]))){o=!0;break}o&&(n=e.map(i=>cu(i)),t())})};function Rt(e,t={}){let n=re(()=>{let{id:R,ids:N,getRootNode:D}=uu(t);return qp({id:R,ids:N,getRootNode:D})}),r=(...R)=>{e.debug&&console.log(...R)},o=re(()=>e.props?.({props:Dr(uu(t)),scope:n()})??uu(t)),i=tS(o),a=e.context?.({prop:i,bindable:js,get scope(){return n()},flush:Yp,getContext(){return s},getComputed(){return g},getRefs(){return y}}),s={get(R){return a?.[R].get()},set(R,N){a?.[R].set(N)},initial(R){return a?.[R].initial},hash(R){let N=a?.[R].get();return a?.[R].hash(N)}},l={current:new Map},c={current:null},u={current:null},d={current:{type:""}},f=()=>ge(d.current,{current(){return d.current},previous(){return u.current}}),p=()=>ge(x,{matches(...R){let N=x.get();return R.includes(N)},hasTag(R){let N=x.get();return!!e.states[N]?.tags?.includes(R)}}),y=QT(e.refs?.({prop:i,context:s})??{}),h=()=>({state:p(),context:s,event:f(),prop:i,send:P,action:k,guard:C,track:eS,refs:y,computed:g,flush:Yp,get scope(){return n()},choose:T}),k=R=>{let N=Qt(R)?R(h()):R;if(!N)return;let D=N.map(F=>{let A=e.implementations?.actions?.[F];return A||Yo(`[zag-js] No implementation found for action "${JSON.stringify(F)}"`),A});for(let F of D)F?.(h())},C=R=>Qt(R)?R(h()):e.implementations?.guards?.[R](h()),b=R=>{let N=Qt(R)?R(h()):R;if(!N)return;let D=N.map(A=>{let M=e.implementations?.effects?.[A];return M||Yo(`[zag-js] No implementation found for effect "${JSON.stringify(A)}"`),M}),F=[];for(let A of D){let M=A?.(h());M&&F.push(M)}return()=>F.forEach(A=>A?.())},T=R=>ip(R).find(N=>{let D=!N.guard;return Ut(N.guard)?D=!!C(N.guard):Qt(N.guard)&&(D=N.guard(h())),D}),g=R=>{Sp(e.computed,()=>"[zag-js] No computed object found on machine");let N=e.computed[R];return N({context:s,event:d.current,prop:i,refs:y,scope:n(),computed:g})},x=js(()=>({defaultValue:e.initialState({prop:i}),onChange(R,N){N&&(l.current.get(N)?.(),l.current.delete(N)),N&&k(e.states[N]?.exit),k(c.current?.actions);let D=b(e.states[R]?.effects);if(D&&l.current.set(R,D),N===Vs){k(e.entry);let F=b(e.effects);F&&l.current.set(Vs,F)}k(e.states[R]?.entry)}})),S=Fr.NotStarted;me(()=>{let R=S===Fr.Started;S=Fr.Started,r(R?"rehydrating...":"initializing..."),x.invoke(x.initial,Vs)}),ie(()=>{r("unmounting..."),S=Fr.Stopped,l.current.forEach(N=>N?.()),l.current=new Map,c.current=null,k(e.exit)});let P=R=>{if(S!==Fr.Started)return;u.current=d.current,d.current=R,r("send",R);let N=x.get(),D=e.states[N].on?.[R.type]??e.on?.[R.type],F=T(D);if(!F)return;r("transition",F),c.current=F;let A=F.target??N,M=A!==N;M?x.set(A):F.reenter&&!M?x.invoke(N,N):k(F.actions)};return e.watch?.(h()),{state:p(),send:P,context:s,prop:i,get scope(){return n()},refs:y,computed:g,event:f(),getStatus:()=>S}}function Yp(e){e()}function uu(e){return Qt(e)?e():e}function tS(e){return function(n){return e()[n]}}function j(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){let o=Object.getOwnPropertyDescriptors(r);for(let i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let a={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let l=e[s];typeof l=="function"&&(l=l()),a=Wp(a,{[i]:(l||{})[i]})}return a[i]}for(let s=e.length-1;s>=0;s--){let l,c=e[s];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Kp={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},nS=e=>e.startsWith("--")?e:lS(e);function rS(e){return e in Kp?Kp[e]:e}var Ot=Zp(e=>{let t={};for(let n in e){let r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&_s(r)){t.style=oS(r);continue}if(n==="children"){Ut(r)&&(t.textContent=r);continue}t[rS(n)]=r}}return t});function oS(e){let t={};for(let n in e){let r=e[n];!Ut(r)&&!Ji(r)||(t[nS(n)]=r)}return t}var iS=/[A-Z]/g,aS=/^ms-/;function sS(e){return"-"+e.toLowerCase()}var du={};function lS(e){if(du.hasOwnProperty(e))return du[e];var t=e.replace(iS,sS);return du[e]=aS.test(t)?"-"+t:t}var mu=e=>n=>{let[r,o]=qe(n,["asChild"]);if(r.asChild){let i=a=>{let[,s]=qe(o,["ref"]);return j(s,a)};return r.asChild(i)}return m(Hm,ge({component:e},o))};function cS(){let e=new Map;return new Proxy(mu,{apply(t,n,r){return mu(r[0])},get(t,n){let r=n;return e.has(r)||e.set(r,mu(r)),e.get(r)}})}var Z=cS();var uS=e=>typeof e=="function",Ct=(e,...t)=>uS(e)?e(...t):e;function Xp(e,t){let{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(a){a&&r({type:"NODE.SET",node:a})},unmount(){r({type:"UNMOUNT"})}}}var Jp={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,action:t,prop:n}){e([()=>n("present")],()=>{t(["setInitial","syncPresence"])})},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},setNode:({refs:e,event:t})=>{e.set("node",t.node)},setStyles:({refs:e,event:t})=>{e.set("styles",mn(t.node))},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});let i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Pe(()=>{let a=zs(t.get("styles"));e.set("unmountAnimationName",a),a==="none"||a===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Pe(()=>{e.set("prevAnimationName",zs(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n})=>{let r=t.get("node");if(!r)return;let o=s=>{(s.composedPath?.()?.[0]??s.target)===r&&e.set("prevAnimationName",zs(t.get("styles")))},i=s=>{let l=zs(t.get("styles"));it(s)===r&&l===e.get("unmountAnimationName")&&n({type:"UNMOUNT",src:"animationend"})};r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i);let a=Br(r,{animationFillMode:"forwards"});return()=>{r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i),au(()=>a())}}}}};function zs(e){return e?.animationName||"none"}var m6=ut()(["onExitComplete","present","immediate"]);var Qo=e=>Be()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),Ur=e=>{let[t,n]=Xi(Ct(e)),[r,o]=O(!1),i=Rt(Jp,e),a=re(()=>Xp(i,Ot));return $e(()=>{a().present&&o(!0)}),re(()=>({unmounted:!a().present&&!r()&&t.lazyMount||t.unmountOnExit&&!a().present&&r(),present:a().present,ref:a().setNode,presenceProps:{hidden:!a().present,"data-state":a().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))};var[ei,mr]=je({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var[w6,tn]=je({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var[mS,dt]=je({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),fS=w("<span hidden>"),Vr=e=>{let[t,n]=O(),r=()=>Ct(e.value)??t()?.getRootNode()??document,o=re(()=>({getRootNode:r,getDocument:()=>St(r()),getWindow:()=>bt(r())}));return m(mS,{value:o,get children(){return[L(()=>e.children),m(U,{get when(){return!e.value},get children(){var i=fS();return ke(n,i),i}})]}})};var pS=Object.defineProperty,_t=(e,t)=>{for(var n in t)pS(e,n,{get:t[n],enumerable:!0})};var at=(e,t=[])=>({parts:(...n)=>{if(gS(t))return at(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>at(e,[...t,...n]),rename:n=>at(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${ti(e)}"][data-part="${ti(r)}"]`,`& [data-scope="${ti(e)}"][data-part="${ti(r)}"]`].join(", "),attrs:{"data-scope":ti(e),"data-part":ti(r)}}}),{})}),ti=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gS=e=>e.length===0;var tg=["top","right","bottom","left"];var En=Math.min,Nt=Math.max,ra=Math.round,oa=Math.floor,fn=e=>({x:e,y:e}),hS={left:"right",right:"left",bottom:"top",top:"bottom"},bS={start:"end",end:"start"};function Hs(e,t,n){return Nt(e,En(t,n))}function Pn(e,t){return typeof e=="function"?e(t):e}function In(e){return e.split("-")[0]}function jr(e){return e.split("-")[1]}function Ws(e){return e==="x"?"y":"x"}function qs(e){return e==="y"?"height":"width"}var yS=new Set(["top","bottom"]);function pn(e){return yS.has(In(e))?"y":"x"}function Zs(e){return Ws(pn(e))}function ng(e,t,n){n===void 0&&(n=!1);let r=jr(e),o=Zs(e),i=qs(o),a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=na(a)),[a,na(a)]}function rg(e){let t=na(e);return[Gs(e),t,Gs(t)]}function Gs(e){return e.replace(/start|end/g,t=>bS[t])}var Qp=["left","right"],eg=["right","left"],vS=["top","bottom"],xS=["bottom","top"];function wS(e,t,n){switch(e){case"top":case"bottom":return n?t?eg:Qp:t?Qp:eg;case"left":case"right":return t?vS:xS;default:return[]}}function og(e,t,n,r){let o=jr(e),i=wS(In(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Gs)))),i}function na(e){return e.replace(/left|right|bottom|top/g,t=>hS[t])}function kS(e){return{top:0,right:0,bottom:0,left:0,...e}}function fu(e){return typeof e!="number"?kS(e):{top:e,right:e,bottom:e,left:e}}function zr(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ig(e,t,n){let{reference:r,floating:o}=e,i=pn(t),a=Zs(t),s=qs(a),l=In(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2,p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(jr(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}async function lg(e,t){var n;t===void 0&&(t={});let{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Pn(t,e),y=fu(p),k=s[f?d==="floating"?"reference":"floating":d],C=zr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),g=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},x=zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:T,strategy:l}):b);return{top:(C.top-x.top+y.top)/g.y,bottom:(x.bottom-C.bottom+y.bottom)/g.y,left:(C.left-x.left+y.left)/g.x,right:(x.right-C.right+y.right)/g.x}}var cg=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ig(c,r,l),f=r,p={},y=0;for(let k=0;k<s.length;k++){var h;let{name:C,fn:b}=s[k],{x:T,y:g,data:x,reset:S}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:{...a,detectOverflow:(h=a.detectOverflow)!=null?h:lg},elements:{reference:e,floating:t}});u=T??u,d=g??d,p={...p,[C]:{...p[C],...x}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=ig(c,f,l)),k=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}},ug=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Pn(e,t)||{};if(c==null)return{};let d=fu(u),f={x:n,y:r},p=Zs(o),y=qs(p),h=await a.getDimensions(c),k=p==="y",C=k?"top":"left",b=k?"bottom":"right",T=k?"clientHeight":"clientWidth",g=i.reference[y]+i.reference[p]-f[p]-i.floating[y],x=f[p]-i.reference[p],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),P=S?S[T]:0;(!P||!await(a.isElement==null?void 0:a.isElement(S)))&&(P=s.floating[T]||i.floating[y]);let R=g/2-x/2,N=P/2-h[y]/2-1,D=En(d[C],N),F=En(d[b],N),A=D,M=P-h[y]-F,V=P/2-h[y]/2+R,Y=Hs(A,V,M),I=!l.arrow&&jr(o)!=null&&V!==Y&&i.reference[y]/2-(V<A?D:F)-h[y]/2<0,B=I?V<A?V-A:V-M:0;return{[p]:f[p]+B,data:{[p]:Y,centerOffset:V-Y-B,...I&&{alignmentOffset:B}},reset:I}}});var dg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;let{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:h=!0,...k}=Pn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let C=In(o),b=pn(s),T=In(s)===s,g=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(T||!h?[na(s)]:rg(s)),S=y!=="none";!f&&S&&x.push(...og(s,h,y,g));let P=[s,...x],R=await l.detectOverflow(t,k),N=[],D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&N.push(R[C]),d){let V=ng(o,a,g);N.push(R[V[0]],R[V[1]])}if(D=[...D,{placement:o,overflows:N}],!N.every(V=>V<=0)){var F,A;let V=(((F=i.flip)==null?void 0:F.index)||0)+1,Y=P[V];if(Y&&(!(d==="alignment"?b!==pn(Y):!1)||D.every(H=>pn(H.placement)===b?H.overflows[0]>0:!0)))return{data:{index:V,overflows:D},reset:{placement:Y}};let I=(A=D.filter(B=>B.overflows[0]<=0).sort((B,H)=>B.overflows[1]-H.overflows[1])[0])==null?void 0:A.placement;if(!I)switch(p){case"bestFit":{var M;let B=(M=D.filter(H=>{if(S){let we=pn(H.placement);return we===b||we==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(we=>we>0).reduce((we,de)=>we+de,0)]).sort((H,we)=>H[1]-we[1])[0])==null?void 0:M[0];B&&(I=B);break}case"initialPlacement":I=s;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function ag(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sg(e){return tg.some(t=>e[t]>=0)}var mg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Pn(e,t);switch(o){case"referenceHidden":{let a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=ag(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:sg(s)}}}case"escaped":{let a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=ag(a,n.floating);return{data:{escapedOffsets:s,escaped:sg(s)}}}default:return{}}}}};var fg=new Set(["left","top"]);async function TS(e,t){let{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=In(n),s=jr(n),l=pn(n)==="y",c=fg.has(a)?-1:1,u=i&&l?-1:1,d=Pn(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}var pg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:a,middlewareData:s}=t,l=await TS(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},gg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x:b,y:T}=C;return{x:b,y:T}}},...c}=Pn(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),f=pn(In(o)),p=Ws(f),y=u[p],h=u[f];if(a){let C=p==="y"?"top":"left",b=p==="y"?"bottom":"right",T=y+d[C],g=y-d[b];y=Hs(T,y,g)}if(s){let C=f==="y"?"top":"left",b=f==="y"?"bottom":"right",T=h+d[C],g=h-d[b];h=Hs(T,h,g)}let k=l.fn({...t,[p]:y,[f]:h});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[p]:a,[f]:s}}}}}},hg=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Pn(e,t),u={x:n,y:r},d=pn(o),f=Ws(d),p=u[f],y=u[d],h=Pn(s,t),k=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){let T=f==="y"?"height":"width",g=i.reference[f]-i.floating[T]+k.mainAxis,x=i.reference[f]+i.reference[T]-k.mainAxis;p<g?p=g:p>x&&(p=x)}if(c){var C,b;let T=f==="y"?"width":"height",g=fg.has(In(o)),x=i.reference[d]-i.floating[T]+(g&&((C=a.offset)==null?void 0:C[d])||0)+(g?0:k.crossAxis),S=i.reference[d]+i.reference[T]+(g?0:((b=a.offset)==null?void 0:b[d])||0)-(g?k.crossAxis:0);y<x?y=x:y>S&&(y=S)}return{[f]:p,[d]:y}}}},bg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;let{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Pn(e,t),u=await a.detectOverflow(t,c),d=In(o),f=jr(o),p=pn(o)==="y",{width:y,height:h}=i.floating,k,C;d==="top"||d==="bottom"?(k=d,C=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(C=d,k=f==="end"?"top":"bottom");let b=h-u.top-u.bottom,T=y-u.left-u.right,g=En(h-u[k],b),x=En(y-u[C],T),S=!t.middlewareData.shift,P=g,R=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=b),S&&!f){let D=Nt(u.left,0),F=Nt(u.right,0),A=Nt(u.top,0),M=Nt(u.bottom,0);p?R=y-2*(D!==0||F!==0?D+F:Nt(u.left,u.right)):P=h-2*(A!==0||M!==0?A+M:Nt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:P});let N=await a.getDimensions(s.floating);return y!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Ys(){return typeof window<"u"}function Gr(e){return vg(e)?(e.nodeName||"").toLowerCase():"#document"}function jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gn(e){var t;return(t=(vg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vg(e){return Ys()?e instanceof Node||e instanceof jt(e).Node:!1}function nn(e){return Ys()?e instanceof Element||e instanceof jt(e).Element:!1}function hn(e){return Ys()?e instanceof HTMLElement||e instanceof jt(e).HTMLElement:!1}function yg(e){return!Ys()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jt(e).ShadowRoot}var SS=new Set(["inline","contents"]);function ri(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!SS.has(o)}var CS=new Set(["table","td","th"]);function xg(e){return CS.has(Gr(e))}var _S=[":popover-open",":modal"];function ia(e){return _S.some(t=>{try{return e.matches(t)}catch{return!1}})}var ES=["transform","translate","scale","rotate","perspective"],PS=["transform","translate","scale","rotate","perspective","filter"],IS=["paint","layout","strict","content"];function Ks(e){let t=Xs(),n=nn(e)?rn(e):e;return ES.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||PS.some(r=>(n.willChange||"").includes(r))||IS.some(r=>(n.contain||"").includes(r))}function wg(e){let t=Un(e);for(;hn(t)&&!Hr(t);){if(Ks(t))return t;if(ia(t))return null;t=Un(t)}return null}function Xs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var AS=new Set(["html","body","#document"]);function Hr(e){return AS.has(Gr(e))}function rn(e){return jt(e).getComputedStyle(e)}function aa(e){return nn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Un(e){if(Gr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||yg(e)&&e.host||gn(e);return yg(t)?t.host:t}function kg(e){let t=Un(e);return Hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:hn(t)&&ri(t)?t:kg(t)}function ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let o=kg(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=jt(o);if(i){let s=Js(a);return t.concat(a,a.visualViewport||[],ri(o)?o:[],s&&n?ni(s):[])}return t.concat(o,ni(o,[],n))}function Js(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cg(e){let t=rn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=hn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ra(n)!==i||ra(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function gu(e){return nn(e)?e:e.contextElement}function oi(e){let t=gu(e);if(!hn(t))return fn(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Cg(t),a=(i?ra(n.width):n.width)/r,s=(i?ra(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var RS=fn(0);function _g(e){let t=jt(e);return!Xs()||!t.visualViewport?RS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OS(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jt(e)?!1:t}function Wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),i=gu(e),a=fn(1);t&&(r?nn(r)&&(a=oi(r)):a=oi(e));let s=OS(i,n,r)?_g(i):fn(0),l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){let f=jt(i),p=r&&nn(r)?jt(r):r,y=f,h=Js(y);for(;h&&r&&p!==y;){let k=oi(h),C=h.getBoundingClientRect(),b=rn(h),T=C.left+(h.clientLeft+parseFloat(b.paddingLeft))*k.x,g=C.top+(h.clientTop+parseFloat(b.paddingTop))*k.y;l*=k.x,c*=k.y,u*=k.x,d*=k.y,l+=T,c+=g,y=jt(h),h=Js(y)}}return zr({width:u,height:d,x:l,y:c})}function hu(e,t){let n=aa(e).scrollLeft;return t?t.left+n:Wr(gn(e)).left+n}function Eg(e,t,n){n===void 0&&(n=!1);let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:hu(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function NS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i=o==="fixed",a=gn(r),s=t?ia(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=fn(1),u=fn(0),d=hn(r);if((d||!d&&!i)&&((Gr(r)!=="body"||ri(a))&&(l=aa(r)),hn(r))){let p=Wr(r);c=oi(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}let f=a&&!d&&!i?Eg(a,l,!0):fn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function $S(e){return Array.from(e.getClientRects())}function MS(e){let t=gn(e),n=aa(e),r=e.ownerDocument.body,o=Nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+hu(e),s=-n.scrollTop;return rn(r).direction==="rtl"&&(a+=Nt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function DS(e,t){let n=jt(e),r=gn(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let c=Xs();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function LS(e,t){let n=Wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=hn(e)?oi(e):fn(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function Tg(e,t,n){let r;if(t==="viewport")r=DS(e,n);else if(t==="document")r=MS(gn(e));else if(nn(t))r=LS(t,n);else{let o=_g(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return zr(r)}function Pg(e,t){let n=Un(e);return n===t||!nn(n)||Hr(n)?!1:rn(n).position==="fixed"||Pg(n,t)}function BS(e,t){let n=t.get(e);if(n)return n;let r=ni(e,[],!1).filter(s=>nn(s)&&Gr(s)!=="body"),o=null,i=rn(e).position==="fixed",a=i?Un(e):e;for(;nn(a)&&!Hr(a);){let s=rn(a),l=Ks(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ri(a)&&!l&&Pg(e,a))?r=r.filter(u=>u!==a):o=s,a=Un(a)}return t.set(e,r),r}function FS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,a=[...n==="clippingAncestors"?ia(t)?[]:BS(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{let d=Tg(t,u,o);return c.top=Nt(d.top,c.top),c.right=En(d.right,c.right),c.bottom=En(d.bottom,c.bottom),c.left=Nt(d.left,c.left),c},Tg(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function US(e){let{width:t,height:n}=Cg(e);return{width:t,height:n}}function VS(e,t,n){let r=hn(t),o=gn(t),i=n==="fixed",a=Wr(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=fn(0);function c(){l.x=hu(o)}if(r||!r&&!i)if((Gr(t)!=="body"||ri(o))&&(s=aa(t)),r){let p=Wr(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();i&&!r&&o&&c();let u=o&&!r&&!i?Eg(o,s):fn(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function pu(e){return rn(e).position==="static"}function Sg(e,t){if(!hn(e)||rn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gn(e)===n&&(n=n.ownerDocument.body),n}function Ig(e,t){let n=jt(e);if(ia(e))return n;if(!hn(e)){let o=Un(e);for(;o&&!Hr(o);){if(nn(o)&&!pu(o))return o;o=Un(o)}return n}let r=Sg(e,t);for(;r&&xg(r)&&pu(r);)r=Sg(r,t);return r&&Hr(r)&&pu(r)&&!Ks(r)?n:r||wg(e)||n}var jS=async function(e){let t=this.getOffsetParent||Ig,n=this.getDimensions,r=await n(e.floating);return{reference:VS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zS(e){return rn(e).direction==="rtl"}var GS={convertOffsetParentRelativeRectToViewportRelativeRect:NS,getDocumentElement:gn,getClippingRect:FS,getOffsetParent:Ig,getElementRects:jS,getClientRects:$S,getDimensions:US,getScale:oi,isElement:nn,isRTL:zS};function Ag(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HS(e,t){let n=null,r,o=gn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;let y=oa(d),h=oa(o.clientWidth-(u+f)),k=oa(o.clientHeight-(d+p)),C=oa(u),T={rootMargin:-y+"px "+-h+"px "+-k+"px "+-C+"px",threshold:Nt(0,En(1,l))||1},g=!0;function x(S){let P=S[0].intersectionRatio;if(P!==l){if(!g)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!Ag(c,e.getBoundingClientRect())&&a(),g=!1}try{n=new IntersectionObserver(x,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,T)}n.observe(e)}return a(!0),i}function Rg(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=gu(e),u=o||i?[...c?ni(c):[],...ni(t)]:[];u.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),i&&C.addEventListener("resize",n)});let d=c&&s?HS(c,n):null,f=-1,p=null;a&&(p=new ResizeObserver(C=>{let[b]=C;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let y,h=l?Wr(e):null;l&&k();function k(){let C=Wr(e);h&&!Ag(h,C)&&n(),h=C,y=requestAnimationFrame(k)}return n(),()=>{var C;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(C=p)==null||C.disconnect(),p=null,l&&cancelAnimationFrame(y)}}var Og=pg;var Ng=gg,$g=dg,Mg=bg,Dg=mg,Lg=ug;var Bg=hg,Fg=(e,t,n)=>{let r=new Map,o={platform:GS,...n},i={...o.platform,_c:r};return cg(e,t,{...o,platform:i})};function Ug(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);let o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function WS(e){if(!e)return Ug();let{x:t,y:n,width:r,height:o}=e;return Ug(t,n,r,o)}function qS(e,t){return{contextElement:Je(e)?e:void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?WS(r):n.getBoundingClientRect()}}}var sa=e=>({variable:e,reference:`var(${e})`}),Vn={arrowSize:sa("--arrow-size"),arrowSizeHalf:sa("--arrow-size-half"),arrowBg:sa("--arrow-background"),transformOrigin:sa("--transform-origin"),arrowOffset:sa("--arrow-offset")},ZS=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),YS={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){let{arrow:r}=n,o=ZS(r)[e],{floating:i}=t;return i.style.setProperty(Vn.transformOrigin.variable,o),{data:{transformOrigin:o}}}},KS={name:"rects",fn({rects:e}){return{data:e}}},XS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Vn.arrowOffset.reference})`}),{}}}};function JS(e){let[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function jg(e){return e.split("-")[0]}var QS={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Vg(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function zg(e){return Mr(e.boundary)}function eC(e,t){if(e)return Lg({element:e,padding:t.arrowPadding})}function tC(e,t){if(!fp(t.offset??t.gutter))return Og(({placement:n})=>{let r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:a}=JS(n),s=a?void 0:t.shift,l=t.offset?.crossAxis??s;return Dr({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function nC(e){if(e.flip)return $g({boundary:zg(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function rC(e){if(!(!e.slide&&!e.overlap))return Ng({boundary:zg(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Bg()})}function oC(e){return Mg({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){let i=t.floating,a=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function iC(e){if(e.hideWhenDetached)return Dg({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function aC(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function sC(e,t,n={}){let r=qS(e,n.getAnchorRect);if(!t||!r)return;let o=Object.assign({},QS,n),i=t.querySelector("[data-part=arrow]"),a=[tC(i,o),nC(o),rC(o),eC(i,o),XS(i),YS,oC(o),iC(o),KS],{placement:s,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!r||!t)return;let h=await Fg(r,t,{placement:s,middleware:a,strategy:l});c?.(h),u?.({placed:!0});let k=bt(t),C=Vg(k,h.x),b=Vg(k,h.y);t.style.setProperty("--x",`${C}px`),t.style.setProperty("--y",`${b}px`),o.hideWhenDetached&&(h.middlewareData.hide?.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));let T=t.firstElementChild;if(T){let g=mn(T);t.style.setProperty("--z-index",g.zIndex)}},f=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},p=aC(o.listeners),y=o.listeners?Rg(r,t,f,p):pp;return f(),()=>{y?.(),u?.({placed:!1})}}function bu(e,t,n={}){let{defer:r,...o}=n,i=r?Pe:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;a.push(sC(s,l,o))})),()=>{a.forEach(s=>s?.())}}var lC={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Gg(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Vn.arrowSize.reference,height:Vn.arrowSize.reference,[Vn.arrowSizeHalf.variable]:`calc(${Vn.arrowSize.reference} / 2)`,[Vn.arrowOffset.variable]:`calc(${Vn.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?lC[t.split("-")[0]]:void 0,background:Vn.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function cC(e){let t={each(n){for(let r=0;r<e.frames?.length;r+=1){let o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function uC(e){let t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var Hg="pointerdown.outside",Wg="focus.outside";function dC(e){for(let t of e)if(Je(t)&&en(t))return!0;return!1}var Yg=e=>"clientY"in e;function mC(e,t){if(!Yg(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function fC(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function qg(e,t){if(!t||!Yg(e))return!1;let n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,a={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},s={x:e.clientX,y:e.clientY};return fC(a,s)?r||i:!1}function pC(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=St(e),l=bt(e),c=cC(l),u=uC(l);function d(b,T){if(!Je(T)||!T.isConnected||Vt(e,T)||mC(e,b))return!1;let g=s.querySelector(`[aria-controls="${e.id}"]`);if(g){let S=Fs(g);if(qg(b,S))return!1}let x=Fs(e);return qg(b,x)?!1:!n?.(T)}let f=new Set,p=Xo(e?.getRootNode());function y(b){function T(g){let x=a&&!Jc()?Pe:R=>R(),S=g??b,P=S?.composedPath?.()??[S?.target];x(()=>{let R=p?P[0]:it(b);if(!(!e||!d(b,R))){if(o||i){let N=dn(o,i);e.addEventListener(Hg,N,{once:!0})}Zg(e,Hg,{bubbles:!1,cancelable:!0,detail:{originalEvent:S,contextmenu:Ls(S),focusable:dC(P),target:R}})}})}b.pointerType==="touch"?(f.forEach(g=>g()),f.add(Me(s,"click",T,{once:!0})),f.add(u.addEventListener("click",T,{once:!0})),f.add(c.addEventListener("click",T,{once:!0}))):T()}let h=new Set,k=setTimeout(()=>{h.add(Me(s,"pointerdown",y,!0)),h.add(u.addEventListener("pointerdown",y,!0)),h.add(c.addEventListener("pointerdown",y,!0))},0);function C(b){(a?Pe:g=>g())(()=>{let g=it(b);if(!(!e||!d(b,g))){if(r||i){let x=dn(r,i);e.addEventListener(Wg,x,{once:!0})}Zg(e,Wg,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:en(g),target:g}})}})}return Jc()||(h.add(Me(s,"focusin",C,!0)),h.add(u.addEventListener("focusin",C,!0)),h.add(c.addEventListener("focusin",C,!0))),()=>{clearTimeout(k),f.forEach(b=>b()),h.forEach(b=>b())}}function Kg(e,t){let{defer:n}=t,r=n?Pe:i=>i(),o=[];return o.push(r(()=>{let i=typeof e=="function"?e():e;o.push(pC(i,t))})),()=>{o.forEach(i=>i?.())}}function Zg(e,t,n){let r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function gC(e,t){let n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Me(St(e),"keydown",n,{capture:!0})}var Ht={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Vt(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Vt(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},Xg;function Jg(){Ht.layers.forEach(({node:e})=>{e.style.pointerEvents=Ht.isBelowPointerBlockingLayer(e)?"none":"auto"})}function hC(e){e.style.pointerEvents=""}function bC(e,t){let n=St(e),r=[];if(Ht.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Xg=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){let o=Gp(t,i=>{r.push(Br(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ht.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Xg,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function yC(e,t){let{warnOnMissingNode:n=!0}=t;if(n&&!e){Yo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;let{onDismiss:r,pointerBlocking:o,exclude:i,debug:a}=t,s={dismiss:r,node:e,pointerBlocking:o};Ht.add(s),Jg();function l(p){let y=it(p.detail.originalEvent);Ht.isBelowPointerBlockingLayer(e)||Ht.isInBranch(y)||(t.onPointerDownOutside?.(p),t.onInteractOutside?.(p),!p.defaultPrevented&&(a&&console.log("onPointerDownOutside:",p.detail.originalEvent),r?.()))}function c(p){let y=it(p.detail.originalEvent);Ht.isInBranch(y)||(t.onFocusOutside?.(p),t.onInteractOutside?.(p),!p.defaultPrevented&&(a&&console.log("onFocusOutside:",p.detail.originalEvent),r?.()))}function u(p){Ht.isTopMost(e)&&(t.onEscapeKeyDown?.(p),!p.defaultPrevented&&r&&(p.preventDefault(),r()))}function d(p){if(!e)return!1;let y=typeof i=="function"?i():i,h=Array.isArray(y)?y:[y],k=t.persistentElements?.map(C=>C()).filter(Je);return k&&h.push(...k),h.some(C=>Vt(C,p))||Ht.isInNestedLayer(e,p)}let f=[o?bC(e,t.persistentElements):void 0,gC(e,u),Kg(e,{exclude:d,onFocusOutside:c,onPointerDownOutside:l,defer:t.defer})];return()=>{Ht.remove(e),Jg(),hC(e),f.forEach(p=>p?.())}}function Qs(e,t){let{defer:n}=t,r=n?Pe:i=>i(),o=[];return o.push(r(()=>{let i=Qt(e)?e():e;o.push(yC(i,t))})),()=>{o.forEach(i=>i?.())}}function Qg(e,t={}){let{defer:n}=t,r=n?Pe:i=>i(),o=[];return o.push(r(()=>{let i=Qt(e)?e():e;if(!i){Yo("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Ht.addBranch(i),o.push(()=>{Ht.removeBranch(i)})})),()=>{o.forEach(i=>i?.())}}var vC=Object.defineProperty,xC=(e,t,n)=>t in e?vC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t,n)=>xC(e,typeof t!="symbol"?t+"":t,n),eh={activateTrap(e,t){if(e.length>0){let r=e[e.length-1];r!==t&&r.pause()}let n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},wC=[],kC=class{constructor(e,t){Ze(this,"trapStack"),Ze(this,"config"),Ze(this,"doc"),Ze(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ze(this,"listenerCleanups",[]),Ze(this,"handleFocus",r=>{let o=it(r),i=this.findContainerIndex(o,r)>=0;if(i||Os(o))i&&(this.state.mostRecentlyFocusedNode=o);else{r.stopImmediatePropagation();let a,s=!0;if(this.state.mostRecentlyFocusedNode)if(Jo(this.state.mostRecentlyFocusedNode)>0){let l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[l];if(c.length>0){let u=c.findIndex(d=>d===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<c.length&&(a=c[u+1],s=!1):u-1>=0&&(a=c[u-1],s=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(c=>Jo(c)>0))||(s=!1);else s=!1;s&&(a=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),a?this.tryFocus(a):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ze(this,"handlePointerDown",r=>{let o=it(r);if(!(this.findContainerIndex(o,r)>=0)){if(ca(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ca(this.config.allowOutsideClick,r)||r.preventDefault()}}),Ze(this,"handleClick",r=>{let o=it(r);this.findContainerIndex(o,r)>=0||ca(this.config.clickOutsideDeactivates,r)||ca(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Ze(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;let o=this.config.isKeyBackward(r),i=this.findNextNavNode({event:r,isBackward:o});if(!i)return;la(r)&&r.preventDefault(),this.tryFocus(i)}}),Ze(this,"handleEscapeKey",r=>{TC(r)&&ca(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Ze(this,"_mutationObserver"),Ze(this,"setupMutationObserver",()=>{let r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(o=>{o.some(a=>Array.from(a.removedNodes).some(l=>l===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),Ze(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(r=>{this._mutationObserver?.observe(r,{subtree:!0,childList:!0})})}),Ze(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!en(r))if(this.findContainerIndex(this.doc.activeElement)>=0)r=this.doc.activeElement;else{let o=this.state.tabbableGroups[0];r=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Ze(this,"tryFocus",r=>{if(r!==!1&&r!==$s(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,SC(r)&&r.select()}}),Ze(this,"deactivate",r=>{if(!this.state.active)return this;let o={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),eh.deactivateTrap(this.trapStack,this);let i=this.getOption(o,"onDeactivate"),a=this.getOption(o,"onPostDeactivate"),s=this.getOption(o,"checkCanReturnFocus"),l=this.getOption(o,"returnFocus","returnFocusOnDeactivate");i?.();let c=()=>{th(()=>{if(l){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}a?.()})};if(l&&s){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return s(u).then(c,c),this}return c(),this}),Ze(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;let o=this.getOption(r,"onPause"),i=this.getOption(r,"onPostPause");return this.state.paused=!0,o?.(),this.removeListeners(),this.updateObservedNodes(),i?.(),this}),Ze(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;let o=this.getOption(r,"onUnpause"),i=this.getOption(r,"onPostUnpause");return this.state.paused=!1,o?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i?.(),this}),Ze(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ze(this,"getReturnFocusNode",r=>{let o=this.getNodeForOption("setReturnFocus",{params:[r]});return o||(o===!1?!1:r)}),Ze(this,"getOption",(r,o,i)=>r&&r[o]!==void 0?r[o]:this.config[i||o]),Ze(this,"getNodeForOption",(r,{hasFallback:o=!1,params:i=[]}={})=>{let a=this.config[r];if(typeof a=="function"&&(a=a(...i)),a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let s=a;if(typeof a=="string"){try{s=this.doc.querySelector(a)}catch(l){throw new Error(`\`${r}\` appears to be an invalid selector; error="${l.message}"`)}if(!s&&!o)throw new Error(`\`${r}\` as selector refers to no known node`)}return s}),Ze(this,"findNextNavNode",r=>{let{event:o,isBackward:i=!1}=r,a=r.target||it(o);this.updateTabbableNodes();let s=null;if(this.state.tabbableGroups.length>0){let l=this.findContainerIndex(a,o),c=l>=0?this.state.containerGroups[l]:void 0;if(l<0)i?s=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:s=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:d})=>a===d);if(u<0&&(c?.container===a||en(a)&&!Bn(a)&&!c?.nextTabbableNode(a,!1))&&(u=l),u>=0){let d=u===0?this.state.tabbableGroups.length-1:u-1,f=this.state.tabbableGroups[d];s=Jo(a)>=0?f.lastTabbableNode:f.lastDomTabbableNode}else la(o)||(s=c?.nextTabbableNode(a,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:d})=>a===d);if(u<0&&(c?.container===a||en(a)&&!Bn(a)&&!c?.nextTabbableNode(a))&&(u=l),u>=0){let d=u===this.state.tabbableGroups.length-1?0:u+1,f=this.state.tabbableGroups[d];s=Jo(a)>=0?f.firstTabbableNode:f.firstDomTabbableNode}else la(o)||(s=c?.nextTabbableNode(a))}}else s=this.getNodeForOption("fallbackFocus");return s}),this.trapStack=t.trapStack||wC;let n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(r){return la(r)&&!r.shiftKey},isKeyBackward(r){return la(r)&&r.shiftKey},...t};this.doc=n.document||St(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let n=typeof t?.composedPath=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:o})=>r.contains(e)||n?.includes(r)||o.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=Lr(e),n=iu(e),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,i=n.find(c=>Bn(c)),a=n.slice().reverse().find(c=>Bn(c)),s=!!t.find(c=>Jo(c)>0);function l(c,u=!0){let d=t.indexOf(c);return d<0?u?n.slice(n.indexOf(c)+1).find(f=>Bn(f)):n.slice(0,n.indexOf(c)).reverse().find(f=>Bn(f)):t[d+(u?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:i,lastDomTabbableNode:a,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return eh.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?th(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Me(this.doc,"focusin",this.handleFocus,!0),Me(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Me(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Me(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Me(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Me(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;let t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t?.();let o=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n?.()};return r?(r(this.state.containers.concat()).then(o,o),this):(o(),this)}},la=e=>e.key==="Tab",ca=(e,...t)=>typeof e=="function"?e(...t):e,TC=e=>!e.isComposing&&e.key==="Escape",th=e=>setTimeout(e,0),SC=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function nh(e,t={}){let n,r=Pe(()=>{let o=typeof e=="function"?e():e;if(o){n=new kC(o,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o,...t,document:St(o)});try{n.activate()}catch{}}});return function(){n?.deactivate(),r()}}var[rh,ii]=je({hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),CC=e=>e.children(ii()),_C=e=>{let t=ii(),n=j(()=>t().getErrorTextProps(),e);return m(U,{get when(){return t().invalid},get children(){return m(Z.span,n)}})},EC=e=>{let t=ii(),n=j(()=>t().getHelperTextProps(),e);return m(Z.span,n)},PC=e=>{let t=ii(),n=j(()=>t().getLegendProps(),e);return m(Z.legend,n)},IC=at("fieldset").parts("root","errorText","helperText","legend"),el=IC.build(),AC=e=>{dt();let t=ge({disabled:!1,invalid:!1},Ct(e)),n,r=t.id??Qe(),o=`fieldset::${r}::error-text`,i=`fieldset::${r}::helper-text`,[a,s]=O(!1),[l,c]=O(!1);$e(()=>{});let u=[];a()&&t.invalid&&u.push(o),l()&&u.push(i);let d=()=>({...el.root.attrs,disabled:t.disabled,"data-disabled":be(t.disabled),"data-invalid":be(t.invalid),"aria-describedby":u.join(" ")||void 0}),f=()=>({...el.legend.attrs,"data-disabled":be(t.disabled),"data-invalid":be(t.invalid)}),p=()=>({id:i,...el.helperText.attrs}),y=()=>({id:o,...el.errorText.attrs,"aria-live":"polite"});return re(()=>({refs:{rootRef:n},disabled:t.disabled,invalid:t.invalid,getRootProps:d,getLegendProps:f,getHelperTextProps:p,getErrorTextProps:y}))},oh=e=>{let[t,n]=Be()(e,["id","disabled","invalid"]),r=AC(t),o=j(()=>r().getRootProps(),n);return m(rh,{value:r,get children(){return m(Z.fieldset,o)}})};oh.displayName="FieldsetRoot";var RC=e=>{let[{value:t},n]=Be()(e,["value"]),r=j(()=>t().getRootProps(),n);return m(rh,{value:t,get children(){return m(Z.fieldset,r)}})},OC={};_t(OC,{Context:()=>CC,ErrorText:()=>_C,HelperText:()=>EC,Legend:()=>PC,Root:()=>oh,RootProvider:()=>RC});var ih=e=>{if(!e)return;let t=mn(e),n=bt(e),r=St(e),o=()=>{requestAnimationFrame(()=>{e.style.height="auto";let c;t.boxSizing==="content-box"?c=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):c=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&c>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),c=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${c}px`})};e.addEventListener("input",o),e.form?.addEventListener("reset",o);let i=Object.getPrototypeOf(e),a=Object.getOwnPropertyDescriptor(i,"value");Object.defineProperty(e,"value",{...a,set(){a?.set?.apply(this,arguments),o()}});let s=new n.ResizeObserver(()=>{requestAnimationFrame(()=>o())});s.observe(e);let l=new n.MutationObserver(()=>o());return l.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),r.fonts?.addEventListener("loadingdone",o),()=>{e.removeEventListener("input",o),e.form?.removeEventListener("reset",o),r.fonts?.removeEventListener("loadingdone",o),s.disconnect(),l.disconnect()}};var[ah,bn]=je({hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),NC=e=>e.children(bn()),$C=e=>{let t=bn(),n=j(()=>t().getErrorTextProps(),e);return m(U,{get when(){return t?.().invalid},get children(){return m(Z.span,n)}})},MC=e=>{let t=bn(),n=j(()=>t().getHelperTextProps(),e);return m(Z.span,n)},DC=e=>{let t=bn(),n=j(()=>t?.().getInputProps(),e);return m(Z.input,n)},LC=e=>{let t=bn(),n=j(()=>t?.().getLabelProps(),e);return m(Z.label,n)},BC=e=>{let t=bn(),n=j(()=>t().getRequiredIndicatorProps(),e);return m(U,{get when(){return t().required},get fallback(){return e.fallback},get children(){return m(Z.span,ge(n,{get children(){return e.children??"*"}}))}})},FC=at("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator"),fr=FC.build(),UC=e=>{let t=ii(),n=dt(),r=ge({disabled:!!t?.().disabled,required:!1,invalid:!1,readOnly:!1},e),[o,i]=O(!1),[a,s]=O(!1),l=r.id??Qe(),[c,u]=O(void 0),d=r.ids?.control??`field::${l}`,f=r.ids?.errorText??`field::${l}::error-text`,p=r.ids?.helperText??`field::${l}::helper-text`,y=r.ids?.label??`field::${l}::label`;me(()=>{let N=c();if(!N)return;let D=()=>{let M=n().getRootNode();i(!!M.getElementById(f)),s(!!M.getElementById(p))};D();let F=n().getWindow(),A=new F.MutationObserver(D);A.observe(N,{childList:!0,subtree:!0}),ie(()=>A.disconnect())});let h=()=>({...fr.root.attrs,id:d,role:"group","data-disabled":be(r.disabled),"data-invalid":be(r.invalid),"data-readonly":be(r.readOnly)}),k=()=>({...fr.label.attrs,id:y,"data-disabled":be(r.disabled),"data-invalid":be(r.invalid),"data-readonly":be(r.readOnly),htmlFor:l}),C=re(()=>{let N=[];return o()&&r.invalid&&N.push(f),a()&&N.push(p),N}),b=()=>({"aria-describedby":C().join(" ")||void 0,"aria-invalid":Fn(r.invalid),"data-invalid":be(r.invalid),"data-required":be(r.required),"data-readonly":be(r.readOnly),id:l,required:r.required,disabled:r.disabled,readOnly:r.readOnly||void 0}),T=()=>({...b(),...fr.input.attrs}),g=()=>({...b(),...fr.textarea.attrs}),x=()=>({...b(),...fr.select.attrs}),S=()=>({id:p,...fr.helperText.attrs,"data-disabled":be(r.disabled)}),P=()=>({id:f,...fr.errorText.attrs,"aria-live":"polite"}),R=()=>({"aria-hidden":!0,...fr.requiredIndicator.attrs});return re(()=>({ariaDescribedby:C().join(" "),ids:{control:l,label:y,errorText:f,helperText:p},refs:{rootRef:u},disabled:r.disabled,invalid:r.invalid,readOnly:r.readOnly,required:r.required,getLabelProps:k,getRootProps:h,getInputProps:T,getTextareaProps:g,getSelectProps:x,getHelperTextProps:S,getErrorTextProps:P,getRequiredIndicatorProps:R}))},VC=e=>{let[t,n]=Be()(e,["id","ids","disabled","invalid","readOnly","required"]),r=UC(t),o=j(()=>r().getRootProps(),n);return m(ah,{value:r,get children(){return m(Z.div,ge(o,{ref(i){var a=lr(r().refs.rootRef,e.ref);typeof a=="function"&&a(i)}}))}})},jC=e=>{let[{value:t},n]=Be()(e,["value"]),r=j(()=>t().getRootProps(),n);return m(ah,{value:t,get children(){return m(Z.div,r)}})},zC=e=>{let t=bn(),n=j(()=>t?.().getSelectProps(),e);return m(Z.select,n)},GC=e=>{let t=bn(),n,[r,o]=qe(e,["autoresize"]),i=j(()=>t?.().getTextareaProps(),()=>({style:{resize:r.autoresize?"none":void 0}}),o);return me(()=>{if(!r.autoresize)return;let a=ih(n);ie(()=>a?.())}),m(Z.textarea,ge(i,{ref(a){var s=lr(l=>n=l,e.ref);typeof s=="function"&&s(a)}}))},HC={};_t(HC,{Context:()=>NC,ErrorText:()=>$C,HelperText:()=>MC,Input:()=>DC,Label:()=>LC,RequiredIndicator:()=>BC,Root:()=>VC,RootProvider:()=>jC,Select:()=>zC,Textarea:()=>GC});function sh(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}var ph=at("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),ai=ph.build(),WC=e=>`toast-group:${e}`,lh=(e,t)=>e.getById(`toast-group:${t}`),gh=e=>`toast:${e.id}`,ch=e=>e.getById(gh(e)),uh=e=>`toast:${e.id}:title`,dh=e=>`toast:${e.id}:description`,qC=e=>`toast${e.id}:close`,mh={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function yu(e,t){return e??mh[t]??mh.DEFAULT}var ZC=e=>typeof e=="string"?{left:e,right:e,bottom:e,top:e}:e;function YC(e,t){let{prop:n,computed:r,context:o}=e,{offsets:i,gap:a}=n("store").attrs,s=o.get("heights"),l=ZC(i),c=n("dir")==="rtl",u=t.replace("-start",c?"-right":"-left").replace("-end",c?"-left":"-right"),d=u.includes("right"),f=u.includes("left"),p={position:"fixed",pointerEvents:r("count")>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${a}px`,"--first-height":`${s[0]?.height||0}px`,zIndex:Rs},y="center";if(d&&(y="flex-end"),f&&(y="flex-start"),p.alignItems=y,u.includes("top")){let h=l.top;p.top=`max(env(safe-area-inset-top, 0px), ${h})`}if(u.includes("bottom")){let h=l.bottom;p.bottom=`max(env(safe-area-inset-bottom, 0px), ${h})`}if(!u.includes("left")){let h=l.right;p.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${h})`}if(!u.includes("right")){let h=l.left;p.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${h})`}return p}function KC(e,t){let{prop:n,context:r,computed:o}=e,i=n("parent"),a=i.computed("placement"),{gap:s}=i.prop("store").attrs,[l]=a.split("-"),c=r.get("mounted"),u=r.get("remainingTime"),d=o("height"),f=o("frontmost"),p=!f,y=!n("stacked"),h=n("stacked"),C=n("type")==="loading"?Number.MAX_SAFE_INTEGER:u,b=o("heightIndex")*s+o("heightBefore"),T={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${n("removeDelay")}ms`,"--duration":`${C}ms`,"--initial-height":`${d}px`,"--offset":`${b}px`,"--index":n("index"),"--z-index":o("zIndex"),"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},g=x=>Object.assign(T,x);return l==="top"?g({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):l==="bottom"&&g({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),c&&(g({"--y":"0","--opacity":"1"}),h&&g({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||g({"--opacity":"0",pointerEvents:"none"}),p&&y&&(g({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||g({"--y":"calc(var(--sign) * 40%)"})),p&&h&&!t&&g({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),f&&!t&&g({"--y":"calc(var(--lift) * -100%)"}),T}function XC(e,t){let{computed:n}=e,r={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},o=i=>Object.assign(r,i);return n("frontmost")&&!t&&o({height:"calc(var(--initial-height) + 80%)"}),r}function JC(){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function QC(e,t){let{context:n,prop:r,send:o,refs:i,computed:a}=e;return{getCount(){return n.get("toasts").length},getToasts(){return n.get("toasts")},getGroupProps(s={}){let{label:l="Notifications"}=s,{hotkey:c}=r("store").attrs,u=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=a("placement"),[f,p="center"]=d.split("-");return t.element({...ai.group.attrs,dir:r("dir"),tabIndex:-1,"aria-label":`${d} ${l} ${u}`,id:WC(d),"data-placement":d,"data-side":f,"data-align":p,"aria-live":"polite",role:"region",style:YC(e,d),onMouseMove(){o({type:"REGION.POINTER_ENTER",placement:d})},onMouseLeave(){o({type:"REGION.POINTER_LEAVE",placement:d})},onFocus(y){o({type:"REGION.FOCUS",target:y.relatedTarget})},onBlur(y){i.get("isFocusWithin")&&!Vt(y.currentTarget,y.relatedTarget)&&queueMicrotask(()=>o({type:"REGION.BLUR"}))}})},subscribe(s){return r("store").subscribe(()=>s(n.get("toasts")))}}}var e_={props({props:e}){return{dir:"ltr",id:Zc(),...e,store:e.store}},initialState({prop:e}){return e("store").attrs.overlap?"overlap":"stack"},refs(){return{lastFocusedEl:null,isFocusWithin:!1,dismissableCleanup:void 0}},context({bindable:e}){return{toasts:e(()=>({defaultValue:[],sync:!0,hash:t=>t.map(n=>n.id).join(",")})),heights:e(()=>({defaultValue:[],sync:!0}))}},computed:{count:({context:e})=>e.get("toasts").length,overlap:({prop:e})=>e("store").attrs.overlap,placement:({prop:e})=>e("store").attrs.placement},effects:["subscribeToStore","trackDocumentVisibility","trackHotKeyPress"],watch({track:e,context:t,action:n}){e([()=>t.hash("toasts")],()=>{queueMicrotask(()=>{n(["collapsedIfEmpty","setDismissableBranch"])})})},exit:["clearDismissableBranch","clearLastFocusedEl"],on:{"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["collapseToasts","resumeToasts","restoreLastFocusedEl"]},{target:"stack",actions:["resumeToasts","restoreLastFocusedEl"]}],"TOAST.REMOVE":{actions:["removeToast","removeHeight"]},"TOAST.PAUSE":{actions:["pauseToasts"]}},states:{stack:{on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","collapseToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap",actions:["collapseToasts"]},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{on:{"REGION.STACK":{target:"stack",actions:["expandToasts"]},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts","expandToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts","expandToasts"]}}}},implementations:{guards:{isOverlapping:({computed:e})=>e("overlap")},effects:{subscribeToStore({context:e,prop:t}){return t("store").subscribe(n=>{if(n.dismiss){e.set("toasts",r=>r.filter(o=>o.id!==n.id));return}e.set("toasts",r=>{let o=r.findIndex(i=>i.id===n.id);return o!==-1?[...r.slice(0,o),{...r[o],...n},...r.slice(o+1)]:[n,...r]})})},trackHotKeyPress({prop:e,send:t}){return Me(document,"keydown",r=>{let{hotkey:o}=e("store").attrs;o.every(a=>r[a]||r.code===a)&&t({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility({prop:e,send:t,scope:n}){let{pauseOnPageIdle:r}=e("store").attrs;if(!r)return;let o=n.getDoc();return Me(o,"visibilitychange",()=>{let i=o.visibilityState==="hidden";t({type:i?"PAUSE_ALL":"RESUME_ALL"})})}},actions:{setDismissableBranch({refs:e,context:t,computed:n,scope:r}){let o=t.get("toasts"),i=n("placement"),a=o.length>0;if(!a){e.get("dismissableCleanup")?.();return}if(a&&e.get("dismissableCleanup"))return;let l=Qg(()=>lh(r,i),{defer:!0});e.set("dismissableCleanup",l)},clearDismissableBranch({refs:e}){e.get("dismissableCleanup")?.()},focusRegionEl({scope:e,computed:t}){queueMicrotask(()=>{lh(e,t("placement"))?.focus()})},pauseToasts({prop:e}){e("store").pause()},resumeToasts({prop:e}){e("store").resume()},expandToasts({prop:e}){e("store").expand()},collapseToasts({prop:e}){e("store").collapse()},removeToast({prop:e,event:t}){e("store").remove(t.id)},removeHeight({event:e,context:t}){e?.id!=null&&queueMicrotask(()=>{t.set("heights",n=>n.filter(r=>r.id!==e.id))})},collapsedIfEmpty({send:e,computed:t}){!t("overlap")||t("count")>1||e({type:"REGION.OVERLAP"})},setLastFocusedEl({refs:e,event:t}){e.get("isFocusWithin")||!t.target||(e.set("isFocusWithin",!0),e.set("lastFocusedEl",t.target))},restoreLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))},clearLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))}}}};function hh(e,t){let{state:n,send:r,prop:o,scope:i,context:a,computed:s}=e,l=n.hasTag("visible"),c=n.hasTag("paused"),u=a.get("mounted"),d=s("frontmost"),f=o("parent").computed("placement"),p=o("type"),y=o("stacked"),h=o("title"),k=o("description"),C=o("action"),[b,T="center"]=f.split("-");return{type:p,title:h,description:k,placement:f,visible:l,paused:c,closable:!!o("closable"),pause(){r({type:"PAUSE"})},resume(){r({type:"RESUME"})},dismiss(){r({type:"DISMISS",src:"programmatic"})},getRootProps(){return t.element({...ai.root.attrs,dir:o("dir"),id:gh(i),"data-state":l?"open":"closed","data-type":p,"data-placement":f,"data-align":T,"data-side":b,"data-mounted":be(u),"data-paused":be(c),"data-first":be(d),"data-sibling":be(!d),"data-stack":be(y),"data-overlap":be(!y),role:"status","aria-atomic":"true","aria-describedby":k?dh(i):void 0,"aria-labelledby":h?uh(i):void 0,tabIndex:0,style:KC(e,l),onKeyDown(g){g.defaultPrevented||g.key=="Escape"&&(r({type:"DISMISS",src:"keyboard"}),g.preventDefault())}})},getGhostBeforeProps(){return t.element({"data-ghost":"before",style:XC(e,l)})},getGhostAfterProps(){return t.element({"data-ghost":"after",style:JC()})},getTitleProps(){return t.element({...ai.title.attrs,id:uh(i)})},getDescriptionProps(){return t.element({...ai.description.attrs,id:dh(i)})},getActionTriggerProps(){return t.button({...ai.actionTrigger.attrs,type:"button",onClick(g){g.defaultPrevented||(C?.onClick?.(),r({type:"DISMISS",src:"user"}))}})},getCloseTriggerProps(){return t.button({id:qC(i),...ai.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(g){g.defaultPrevented||r({type:"DISMISS",src:"user"})}})}}}var{not:t_}=sh(),bh={props({props:e}){return Ps(e,["id","type","parent","removeDelay"],"toast"),{closable:!0,...e,duration:yu(e.duration,e.type)}},initialState({prop:e}){return e("type")==="loading"||e("duration")===1/0?"visible:persist":"visible"},context({prop:e,bindable:t}){return{remainingTime:t(()=>({defaultValue:yu(e("duration"),e("type"))})),createdAt:t(()=>({defaultValue:Date.now()})),mounted:t(()=>({defaultValue:!1})),initialHeight:t(()=>({defaultValue:0}))}},refs(){return{closeTimerStartTime:Date.now(),lastCloseStartTimerStartTime:0}},computed:{zIndex:({prop:e})=>{let t=e("parent").context.get("toasts"),n=t.findIndex(r=>r.id===e("id"));return t.length-n},height:({prop:e})=>e("parent").context.get("heights").find(r=>r.id===e("id"))?.height??0,heightIndex:({prop:e})=>e("parent").context.get("heights").findIndex(n=>n.id===e("id")),frontmost:({prop:e})=>e("index")===0,heightBefore:({prop:e})=>{let t=e("parent").context.get("heights"),n=t.findIndex(r=>r.id===e("id"));return t.reduce((r,o,i)=>i>=n?r:r+o.height,0)},shouldPersist:({prop:e})=>e("type")==="loading"||e("duration")===1/0},watch({track:e,prop:t,send:n}){e([()=>t("message")],()=>{let r=t("message");r&&n({type:r,src:"programmatic"})}),e([()=>t("type"),()=>t("duration")],()=>{n({type:"UPDATE"})})},on:{UPDATE:[{guard:"shouldPersist",target:"visible:persist",actions:["resetCloseTimer"]},{target:"visible:updating",actions:["resetCloseTimer"]}],MEASURE:{actions:["measureHeight"]}},entry:["setMounted","measureHeight","invokeOnVisible"],effects:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],effects:["waitForNextTick"],on:{SHOW:{target:"visible"}}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:t_("isLoadingType"),target:"visible",actions:["setCloseTimer"]},DISMISS:{target:"dismissing"}}},visible:{tags:["visible"],effects:["waitForDuration"],on:{DISMISS:{target:"dismissing"},PAUSE:{target:"visible:persist",actions:["syncRemainingTime"]}}},dismissing:{entry:["invokeOnDismiss"],effects:["waitForRemoveDelay"],on:{REMOVE:{target:"unmounted",actions:["notifyParentToRemove"]}}},unmounted:{entry:["invokeOnUnmount"]}},implementations:{effects:{waitForRemoveDelay({prop:e,send:t}){return Es(()=>{t({type:"REMOVE",src:"timer"})},e("removeDelay"))},waitForDuration({send:e,context:t,computed:n}){if(!n("shouldPersist"))return Es(()=>{e({type:"DISMISS",src:"timer"})},t.get("remainingTime"))},waitForNextTick({send:e}){return Es(()=>{e({type:"SHOW",src:"timer"})},0)},trackHeight({scope:e,prop:t}){let n;return Pe(()=>{let r=ch(e);if(!r)return;let o=()=>{let s=r.style.height;r.style.height="auto";let l=r.getBoundingClientRect().height;r.style.height=s;let c={id:t("id"),height:l};fh(t("parent"),c)},i=e.getWin(),a=new i.MutationObserver(o);a.observe(r,{childList:!0,subtree:!0,characterData:!0}),n=()=>a.disconnect()}),()=>n?.()}},guards:{isLoadingType:({prop:e})=>e("type")==="loading",shouldPersist:({computed:e})=>e("shouldPersist")},actions:{setMounted({context:e}){Pe(()=>{e.set("mounted",!0)})},measureHeight({scope:e,prop:t,context:n}){queueMicrotask(()=>{let r=ch(e);if(!r)return;let o=r.style.height;r.style.height="auto";let i=r.getBoundingClientRect().height;r.style.height=o,n.set("initialHeight",i);let a={id:t("id"),height:i};fh(t("parent"),a)})},setCloseTimer({refs:e}){e.set("closeTimerStartTime",Date.now())},resetCloseTimer({context:e,refs:t,prop:n}){t.set("closeTimerStartTime",Date.now()),e.set("remainingTime",yu(n("duration"),n("type")))},syncRemainingTime({context:e,refs:t}){e.set("remainingTime",n=>{let r=t.get("closeTimerStartTime"),o=Date.now()-r;return t.set("lastCloseStartTimerStartTime",Date.now()),n-o})},notifyParentToRemove({prop:e}){e("parent").send({type:"TOAST.REMOVE",id:e("id")})},invokeOnDismiss({prop:e,event:t}){e("onStatusChange")?.({status:"dismissing",src:t.src})},invokeOnUnmount({prop:e}){e("onStatusChange")?.({status:"unmounted"})},invokeOnVisible({prop:e}){e("onStatusChange")?.({status:"visible"})}}}};function fh(e,t){let{id:n,height:r}=t;e.context.set("heights",o=>o.find(a=>a.id===n)?o.map(a=>a.id===n?{...a,height:r}:a):[{id:n,height:r},...o])}var n_=(e,t)=>({...t,...Dr(e)});function yh(e){let t=n_(e,{placement:"bottom",overlap:!1,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:!0}),n=[],r=[],o=new Set,i=[],a=A=>(n.push(A),()=>{let M=n.indexOf(A);n.splice(M,1)}),s=A=>(n.forEach(M=>M(A)),A),l=A=>{if(r.length>=t.max){i.push(A);return}s(A),r.unshift(A)},c=()=>{for(;i.length>0&&r.length<t.max;){let A=i.shift();A&&(s(A),r.unshift(A))}},u=A=>{let M=A.id??`toast:${Zc()}`,V=r.find(Y=>Y.id===M);return o.has(M)&&o.delete(M),V?r=r.map(Y=>Y.id===M?s({...Y,...A,id:M}):Y):l({id:M,duration:t.duration,removeDelay:t.removeDelay,type:"info",...A,stacked:!t.overlap,gap:t.gap}),M},d=A=>(o.add(A),A?(n.forEach(M=>M({id:A,dismiss:!0})),r=r.filter(M=>M.id!==A),c()):(r.forEach(M=>{n.forEach(V=>V({id:M.id,dismiss:!0}))}),r=[],i=[]),A);return{attrs:t,subscribe:a,create:u,update:(A,M)=>u({id:A,...M}),remove:d,dismiss:A=>{A!=null?r=r.map(M=>M.id===A?s({...M,message:"DISMISS"}):M):r=r.map(M=>s({...M,message:"DISMISS"}))},error:A=>u({...A,type:"error"}),success:A=>u({...A,type:"success"}),info:A=>u({...A,type:"info"}),warning:A=>u({...A,type:"warning"}),loading:A=>u({...A,type:"loading"}),getVisibleToasts:()=>r.filter(A=>!o.has(A.id)),getCount:()=>r.length,promise:(A,M,V={})=>{if(!M)return;let Y;M.loading!==void 0&&(Y=u({...V,...M.loading,promise:A,type:"loading"}));let I=Y!==void 0,B,H=Mr(A).then(async de=>{if(B=["resolve",de],r_(de)&&!de.ok){I=!1;let te=Mr(M.error,`HTTP Error! status: ${de.status}`);u({...V,...te,id:Y,type:"error"})}else if(M.success!==void 0){I=!1;let te=Mr(M.success,de);u({...V,...te,id:Y,type:"success"})}}).catch(async de=>{if(B=["reject",de],M.error!==void 0){I=!1;let te=Mr(M.error,de);u({...V,...te,id:Y,type:"error"})}}).finally(()=>{I&&(d(Y),Y=void 0),M.finally?.()});return{id:Y,unwrap:()=>new Promise((de,te)=>H.then(()=>B[0]==="reject"?te(B[1]):de(B[1])).catch(te))}},pause:A=>{A!=null?r=r.map(M=>M.id===A?s({...M,message:"PAUSE"}):M):r=r.map(M=>s({...M,message:"PAUSE"}))},resume:A=>{A!=null?r=r.map(M=>M.id===A?s({...M,message:"RESUME"}):M):r=r.map(M=>s({...M,message:"RESUME"}))},isVisible:A=>!o.has(A)&&!!r.find(M=>M.id===A),isDismissed:A=>o.has(A),expand:()=>{r=r.map(A=>s({...A,stacked:!0}))},collapse:()=>{r=r.map(A=>s({...A,stacked:!1}))}}}var r_=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",vu={connect:QC,machine:e_};var xu=e=>yh(e),[i_,qr]=je({hookName:"useToastContext",providerName:"<ToastProvider />"}),vh=e=>{let t=qr(),n=j(()=>t().getActionTriggerProps(),e);return m(Z.button,n)},xh=e=>{let t=qr(),n=j(()=>t().getCloseTriggerProps(),e);return m(Z.button,n)},wh=e=>e.children(qr()),kh=e=>{let t=qr(),n=j(()=>t().getDescriptionProps(),e);return m(Z.div,n)},a_=w("<div><div></div><div>"),Th=e=>{let t=qr(),n=j(()=>t().getRootProps(),e);return(()=>{var r=a_(),o=r.firstChild,i=o.nextSibling;return Ce(r,n,!1,!0),Ce(o,ge(()=>t().getGhostBeforeProps()),!1,!1),v(r,()=>e.children,i),Ce(i,ge(()=>t().getGhostAfterProps()),!1,!1),r})()},Sh=e=>{let t=qr(),n=j(()=>t().getTitleProps(),e);return m(Z.div,n)},wu=e=>{let[t,n]=qe(e,["toaster","children"]),r=tn(),o=dt(),i=Rt(vu.machine,()=>({store:t.toaster,id:Qe(),dir:r()?.dir,getRootNode:o()?.getRootNode})),a=re(()=>vu.connect(i,Ot)),s=re(()=>a().getToasts()),l=j(()=>a().getGroupProps(),n);return m(Z.div,ge(l,{get children(){return m(Wc,{get each(){return s()},by:"id",children:(c,u)=>m(s_,{value:c,index:u,parent:i,children:d=>t.children(d)})})}}))},s_=e=>{let t=dt(),n=re(()=>({...e.value(),parent:e.parent,index:e.index(),getRootNode:t().getRootNode})),r=Rt(bh,n),o=re(()=>hh(r,Ot));return m(i_,{value:o,get children(){return e.children(e.value)}})},Zr={};_t(Zr,{ActionTrigger:()=>vh,CloseTrigger:()=>xh,Context:()=>wh,Description:()=>kh,Root:()=>Th,Title:()=>Sh});var l_=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),c_=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ch=e=>{let t={},n;for(;n=c_.exec(e);)t[n[1]]=n[2];return t},u_=(e,t)=>{if(Ut(e)){if(Ut(t))return`${e};${t}`;e=Ch(e)}else Ut(t)&&(t=Ch(t));return Object.assign({},e??{},t??{})};function _h(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=dn(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=l_(t[r],n[r]);continue}if(r==="style"){t[r]=u_(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Eh(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}var ua=(e,t)=>({x:e,y:t});function d_(e){let{x:t,y:n,width:r,height:o}=e,i=t+r/2,a=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:i,midY:a,center:ua(i,a)}}function m_(e){let t=ua(e.minX,e.minY),n=ua(e.maxX,e.minY),r=ua(e.maxX,e.maxY),o=ua(e.minX,e.maxY);return{top:t,right:n,bottom:r,left:o}}var{min:YM,max:KM}=Math;function Ph(e,t){let n=d_(e),{top:r,right:o,left:i,bottom:a}=m_(n),[s]=t.split("-");return{top:[i,r,o,a],right:[r,o,a,i],bottom:[r,i,a,o],left:[o,r,i,a]}[s]}function Ih(e,t){let{x:n,y:r}=t,o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let s=e[i].x,l=e[i].y,c=e[a].x,u=e[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}var{sign:XM,abs:JM,min:QM}=Math;var $h=at("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),$t=$h.build(),rl=e=>e.ids?.trigger??`menu:${e.id}:trigger`,Mh=e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,da=e=>e.ids?.content??`menu:${e.id}:content`,f_=e=>e.ids?.arrow??`menu:${e.id}:arrow`,Dh=e=>e.ids?.positioner??`menu:${e.id}:popper`,p_=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,ma=(e,t)=>`${e.id}/${t}`,Yr=e=>e?.dataset.value??null,Ah=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,pr=e=>e.getById(da(e)),Rh=e=>e.getById(Dh(e)),tl=e=>e.getById(rl(e)),Lh=(e,t)=>t?e.getById(ma(e,t)):null,Oh=e=>e.getById(Mh(e)),fa=e=>{let n=`[role^="menuitem"][data-ownedby=${CSS.escape(da(e))}]:not([data-disabled])`;return Us(pr(e),n)},g_=e=>ap(fa(e)),h_=e=>sp(fa(e)),Tu=(e,t)=>t?e.id===t||e.dataset.value===t:!1,b_=(e,t)=>{let n=fa(e),r=n.findIndex(o=>Tu(o,t.value));return dp(n,r,{loop:t.loop??t.loopFocus})},y_=(e,t)=>{let n=fa(e),r=n.findIndex(o=>Tu(o,t.value));return mp(n,r,{loop:t.loop??t.loopFocus})},v_=(e,t)=>{let n=fa(e),r=n.find(o=>Tu(o,t.value));return lu(n,{state:t.typeaheadState,key:t.key,activeId:r?.id??null})},nl=e=>Je(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),x_=e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),ku="menu:select";function w_(e,t){if(!e)return;let n=bt(e),r=new n.CustomEvent(ku,{detail:{value:t}});e.dispatchEvent(r)}function Bh(e,t){let{context:n,send:r,state:o,computed:i,prop:a,scope:s}=e,l=o.hasTag("open"),c=i("isSubmenu"),u=i("isTypingAhead"),d=a("composite"),f=n.get("currentPlacement"),p=n.get("anchorPoint"),y=n.get("highlightedValue"),h=Gg({...a("positioning"),placement:p?"bottom":f});function k(g){return{id:ma(s,g.value),disabled:!!g.disabled,highlighted:y===g.value}}function C(g){let x=g.valueText??g.value;return{...g,id:g.value,valueText:x}}function b(g){return{...k(C(g)),checked:!!g.checked}}function T(g){let{closeOnSelect:x,valueText:S,value:P}=g,R=k(g),N=ma(s,P);return t.element({...$t.item.attrs,id:N,role:"menuitem","aria-disabled":Fn(R.disabled),"data-disabled":be(R.disabled),"data-ownedby":da(s),"data-highlighted":be(R.highlighted),"data-value":P,"data-valuetext":S,onDragStart(D){D.currentTarget.matches("a[href]")&&D.preventDefault()},onPointerMove(D){if(R.disabled||D.pointerType!=="mouse")return;let F=D.currentTarget;R.highlighted||r({type:"ITEM_POINTERMOVE",id:N,target:F,closeOnSelect:x})},onPointerLeave(D){if(R.disabled||D.pointerType!=="mouse"||!e.event.previous()?.type.includes("POINTER"))return;let A=D.currentTarget;r({type:"ITEM_POINTERLEAVE",id:N,target:A,closeOnSelect:x})},onPointerDown(D){if(R.disabled)return;let F=D.currentTarget;r({type:"ITEM_POINTERDOWN",target:F,id:N,closeOnSelect:x})},onClick(D){if(nu(D)||tu(D)||R.disabled)return;let F=D.currentTarget;r({type:"ITEM_CLICK",target:F,id:N,closeOnSelect:x})}})}return{highlightedValue:y,open:l,setOpen(g){o.hasTag("open")!==g&&r({type:g?"OPEN":"CLOSE"})},setHighlightedValue(g){r({type:"HIGHLIGHTED.SET",value:g})},setParent(g){r({type:"PARENT.SET",value:g,id:g.prop("id")})},setChild(g){r({type:"CHILD.SET",value:g,id:g.prop("id")})},reposition(g={}){r({type:"POSITIONING.SET",options:g})},addItemListener(g){let x=s.getById(g.id);if(!x)return;let S=()=>g.onSelect?.();return x.addEventListener(ku,S),()=>x.removeEventListener(ku,S)},getContextTriggerProps(){return t.element({...$t.contextTrigger.attrs,dir:a("dir"),id:Mh(s),onPointerDown(g){if(g.pointerType==="mouse")return;let x=dr(g);r({type:"CONTEXT_MENU_START",point:x})},onPointerCancel(g){g.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(g){g.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(g){g.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(g){let x=dr(g);r({type:"CONTEXT_MENU",point:x}),g.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(g){let x=g.getTriggerProps();return _h(T({value:x.id}),x)},getTriggerProps(){return t.button({...c?$t.triggerItem.attrs:$t.trigger.attrs,"data-placement":n.get("currentPlacement"),type:"button",dir:a("dir"),id:rl(s),"data-uid":a("id"),"aria-haspopup":d?"menu":"dialog","aria-controls":da(s),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(g){if(g.pointerType!=="mouse"||nl(g.currentTarget)||!c)return;let S=dr(g);r({type:"TRIGGER_POINTERMOVE",target:g.currentTarget,point:S})},onPointerLeave(g){if(nl(g.currentTarget)||g.pointerType!=="mouse"||!c)return;let x=dr(g);r({type:"TRIGGER_POINTERLEAVE",target:g.currentTarget,point:x})},onPointerDown(g){nl(g.currentTarget)||Ls(g)||g.preventDefault()},onClick(g){g.defaultPrevented||nl(g.currentTarget)||r({type:"TRIGGER_CLICK",target:g.currentTarget})},onBlur(){r({type:"TRIGGER_BLUR"})},onFocus(){r({type:"TRIGGER_FOCUS"})},onKeyDown(g){if(g.defaultPrevented)return;let x={ArrowDown(){r({type:"ARROW_DOWN"})},ArrowUp(){r({type:"ARROW_UP"})},Enter(){r({type:"ARROW_DOWN",src:"enter"})},Space(){r({type:"ARROW_DOWN",src:"space"})}},S=ta(g,{orientation:"vertical",dir:a("dir")}),P=x[S];P&&(g.preventDefault(),P(g))}})},getIndicatorProps(){return t.element({...$t.indicator.attrs,dir:a("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...$t.positioner.attrs,dir:a("dir"),id:Dh(s),style:h.floating})},getArrowProps(){return t.element({id:f_(s),...$t.arrow.attrs,dir:a("dir"),style:h.arrow})},getArrowTipProps(){return t.element({...$t.arrowTip.attrs,dir:a("dir"),style:h.arrowTip})},getContentProps(){return t.element({...$t.content.attrs,id:da(s),"aria-label":a("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:d?"menu":"dialog",tabIndex:0,dir:a("dir"),"aria-activedescendant":i("highlightedId")||void 0,"aria-labelledby":rl(s),"data-placement":f,onPointerEnter(g){g.pointerType==="mouse"&&r({type:"MENU_POINTERENTER"})},onKeyDown(g){if(g.defaultPrevented||!Ds(g))return;let x=it(g);if(!(x?.closest("[role=menu]")===g.currentTarget||x===g.currentTarget))return;if(g.key==="Tab"&&!Lp(g)){g.preventDefault();return}let P=Lh(s,y),R={ArrowDown(){r({type:"ARROW_DOWN"})},ArrowUp(){r({type:"ARROW_UP"})},ArrowLeft(){r({type:"ARROW_LEFT"})},ArrowRight(){r({type:"ARROW_RIGHT"})},Enter(){r({type:"ENTER"}),y!=null&&Pp(P)&&a("navigate")?.({value:y,node:P,href:P.href})},Space(F){u?r({type:"TYPEAHEAD",key:F.key}):R.Enter?.(F)},Home(){r({type:"HOME"})},End(){r({type:"END"})}},N=ta(g,{dir:a("dir")}),D=R[N];if(D){D(g),g.stopPropagation(),g.preventDefault();return}a("typeahead")&&Rp(g)&&(ea(g)||Ns(x)||(r({type:"TYPEAHEAD",key:g.key}),g.preventDefault()))}})},getSeparatorProps(){return t.element({...$t.separator.attrs,role:"separator",dir:a("dir"),"aria-orientation":"horizontal"})},getItemState:k,getItemProps:T,getOptionItemState:b,getOptionItemProps(g){let{type:x,disabled:S,onCheckedChange:P,closeOnSelect:R}=g,N=C(g),D=b(g);return{...T(N),...t.element({"data-type":x,...$t.item.attrs,dir:a("dir"),"data-value":N.value,role:`menuitem${x}`,"aria-checked":!!D.checked,"data-state":D.checked?"checked":"unchecked",onClick(F){if(S||nu(F)||tu(F))return;let A=F.currentTarget;r({type:"ITEM_CLICK",target:A,option:N,closeOnSelect:R}),P?.(!D.checked)}})}},getItemIndicatorProps(g){let x=b(g);return t.element({...$t.itemIndicator.attrs,dir:a("dir"),"data-disabled":be(x.disabled),"data-highlighted":be(x.highlighted),"data-state":x.checked?"checked":"unchecked",hidden:!x.checked})},getItemTextProps(g){let x=b(g);return t.element({...$t.itemText.attrs,dir:a("dir"),"data-disabled":be(x.disabled),"data-highlighted":be(x.highlighted),"data-state":x.checked?"checked":"unchecked"})},getItemGroupLabelProps(g){return t.element({...$t.itemGroupLabel.attrs,id:Ah(s,g.htmlFor),dir:a("dir")})},getItemGroupProps(g){return t.element({id:p_(s,g.id),...$t.itemGroup.attrs,dir:a("dir"),"aria-labelledby":Ah(s,g.id),role:"group"})}}}var{not:on,and:si,or:k_}=Eh(),Fh={props({props:e}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(t){Bp(t.node)},...e,positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},context({bindable:e,prop:t}){return{suspendPointer:e(()=>({defaultValue:!1})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(n){t("onHighlightChange")?.({highlightedValue:n})}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(n){return`x: ${n?.x}, y: ${n?.y}`}}))}},refs(){return{parent:null,children:{},typeaheadState:{...lu.defaultOptions},positioningOverride:{}}},computed:{isSubmenu:({refs:e})=>e.get("parent")!=null,isRtl:({prop:e})=>e("dir")==="rtl",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar!=="",highlightedId:({context:e,scope:t,refs:n})=>S_(n.get("children"),e.get("highlightedValue"),t)},watch({track:e,action:t,context:n,computed:r,prop:o}){e([()=>r("isSubmenu")],()=>{t(["setSubmenuPlacement"])}),e([()=>n.hash("anchorPoint")],()=>{t(["reposition"])}),e([()=>o("open")],()=>{t(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:on("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:k_("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:si(on("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:on("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:si("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:on("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:si(on("isPointerSuspended"),on("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:si(on("isTriggerItemHighlighted"),on("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:si(on("isTriggerItemHighlighted"),on("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:si(on("isTriggerItemHighlighted"),on("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e("closeOnSelect")),isTriggerItem:({event:e})=>x_(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:n})=>!!(e.target??t.getById(n("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({computed:e})=>e("isSubmenu"),isPointerSuspended:({context:e})=>e.get("suspendPointer"),isHighlightedItemEditable:({scope:e,computed:t})=>Ns(e.getById(t("highlightedId"))),isOpenControlled:({prop:e})=>e("open")!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:e})=>e.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:e})=>e.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.OPEN"})},100);return()=>clearTimeout(t)},waitForCloseDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(t)},waitForLongPress({send:e}){let t=setTimeout(()=>{e({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(t)},trackPositioning({context:e,prop:t,scope:n,refs:r}){if(Oh(n))return;let o={...t("positioning"),...r.get("positioningOverride")};e.set("currentPlacement",o.placement);let i=()=>Rh(n);return bu(tl(n),i,{...o,defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})},trackInteractOutside({refs:e,scope:t,prop:n,computed:r,send:o}){let i=()=>pr(t),a=!0;return Qs(i,{defer:!0,exclude:[tl(t)],onInteractOutside:n("onInteractOutside"),onFocusOutside:n("onFocusOutside"),onEscapeKeyDown(s){n("onEscapeKeyDown")?.(s),r("isSubmenu")&&s.preventDefault(),Nh({parent:e.get("parent")})},onPointerDownOutside(s){let l=it(s.detail.originalEvent);if(Vt(Oh(t),l)&&s.detail.contextmenu){s.preventDefault();return}a=!s.detail.focusable,n("onPointerDownOutside")?.(s)},onDismiss(){o({type:"CLOSE",src:"interact-outside",restoreFocus:a})}})},trackPointerMove({context:e,scope:t,send:n,refs:r,flush:o}){let i=r.get("parent");o(()=>{i.context.set("suspendPointer",!0)});let a=t.getDoc();return Me(a,"pointermove",s=>{T_(e.get("intentPolygon"),{x:s.clientX,y:s.clientY})||(n({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),i.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:e,scope:t,computed:n}){let r=()=>{if(e.type.startsWith("ITEM_POINTER"))return;let i=t.getById(n("highlightedId")),a=pr(t);Up(i,{rootEl:a,block:"nearest"})};return Pe(()=>r()),Bs(()=>pr(t),{defer:!0,attributes:["aria-activedescendant"],callback:r})}},actions:{setAnchorPoint({context:e,event:t}){e.set("anchorPoint",t.point)},setSubmenuPlacement({computed:e,refs:t}){if(!e("isSubmenu"))return;let n=e("isRtl")?"left-start":"right-start";t.set("positioningOverride",{placement:n,gutter:0})},reposition({context:e,scope:t,prop:n,event:r,refs:o}){let i=()=>Rh(t),a=e.get("anchorPoint"),s=a?()=>({width:0,height:0,...a}):void 0,l={...n("positioning"),...o.get("positioningOverride")};bu(tl(t),i,{...l,defer:!0,getAnchorRect:s,...r.options??{},listeners:!1,onComplete(c){e.set("currentPlacement",c.placement)}})},setOptionState({event:e}){if(!e.option)return;let{checked:t,onCheckedChange:n,type:r}=e.option;r==="radio"?n?.(!0):r==="checkbox"&&n?.(!t)},clickHighlightedItem({scope:e,computed:t}){let n=e.getById(t("highlightedId"));!n||n.dataset.disabled||queueMicrotask(()=>n.click())},setIntentPolygon({context:e,scope:t,event:n}){let r=pr(t),o=e.get("currentPlacement");if(!r||!o)return;let i=r.getBoundingClientRect(),a=Ph(i,o);if(!a)return;let l=jg(o)==="right"?-5:5;e.set("intentPolygon",[{...n.point,x:n.point.x+l},...a])},clearIntentPolygon({context:e}){e.set("intentPolygon",null)},resumePointer({refs:e,flush:t}){let n=e.get("parent");n&&t(()=>{n.context.set("suspendPointer",!1)})},setHighlightedItem({context:e,event:t}){let n=t.value||Yr(t.target);e.set("highlightedValue",n)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},focusMenu({scope:e}){Pe(()=>{let t=pr(e);Dp({root:t,enabled:!Vt(t,e.getActiveElement()),filter(r){return!r.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:e,scope:t}){(pr(t)?queueMicrotask:Pe)(()=>{let r=g_(t);r&&e.set("highlightedValue",Yr(r))})},highlightLastItem({context:e,scope:t}){(pr(t)?queueMicrotask:Pe)(()=>{let r=h_(t);r&&e.set("highlightedValue",Yr(r))})},highlightNextItem({context:e,scope:t,event:n,prop:r}){let o=b_(t,{loop:n.loop,value:e.get("highlightedValue"),loopFocus:r("loopFocus")});e.set("highlightedValue",Yr(o))},highlightPrevItem({context:e,scope:t,event:n,prop:r}){let o=y_(t,{loop:n.loop,value:e.get("highlightedValue"),loopFocus:r("loopFocus")});e.set("highlightedValue",Yr(o))},invokeOnSelect({context:e,prop:t,scope:n}){let r=e.get("highlightedValue");if(r==null)return;let o=Lh(n,r);w_(o,r),t("onSelect")?.({value:r})},focusTrigger({scope:e,context:t,event:n,computed:r}){r("isSubmenu")||t.get("anchorPoint")||n.restoreFocus===!1||queueMicrotask(()=>tl(e)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:e,context:t,event:n,refs:r}){let o=v_(e,{key:n.key,value:t.get("highlightedValue"),typeaheadState:r.get("typeaheadState")});o&&t.set("highlightedValue",Yr(o))},setParentMenu({refs:e,event:t}){e.set("parent",t.value)},setChildMenu({refs:e,event:t}){let n=e.get("children");n[t.id]=t.value,e.set("children",n)},closeRootMenu({refs:e}){Nh({parent:e.get("parent")})},openSubmenu({refs:e,scope:t,computed:n}){let o=t.getById(n("highlightedId"))?.getAttribute("data-uid"),i=e.get("children");(o?i[o]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:e}){e.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:e,event:t}){e.set("lastHighlightedValue",Yr(t.target))},restoreHighlightedItem({context:e}){e.get("lastHighlightedValue")&&(e.set("highlightedValue",e.get("lastHighlightedValue")),e.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:e}){e.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},toggleVisibility({prop:e,event:t,send:n}){n({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}};function Nh(e){let t=e.parent;for(;t&&t.computed("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"})}function T_(e,t){return e?Ih(e,t):!1}function S_(e,t,n){let r=Object.keys(e).length>0;if(!t)return null;if(!r)return ma(n,t);for(let o in e){let i=e[o],a=rl(i.scope);if(a===t)return a}return ma(n,t)}var C_=ut()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),u9=Tt(C_),__=ut()(["closeOnSelect","disabled","value","valueText"]),d9=Tt(__),E_=ut()(["htmlFor"]),m9=Tt(E_),P_=ut()(["id"]),f9=Tt(P_),I_=ut()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]),p9=Tt(I_);var[Uh,et]=je({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),Vh=e=>{let t=et(),n=j(()=>t().getArrowProps(),e);return m(Z.div,n)},jh=e=>{let t=et(),n=j(()=>t().getArrowTipProps(),e);return m(Z.div,n)},[Su,zh]=je({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Gh,Hh]=je({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),Wh=e=>{let[t,n]=Be()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=j(t,{type:"checkbox"}),o=et(),i=j(()=>o().getOptionItemProps(r),n),a=re(()=>o().getItemState(r));return m(Gh,{value:r,get children(){return m(Su,{value:a,get children(){return m(Z.div,i)}})}})},qh=e=>{let t=et(),n=mr(),r=j(()=>t().getContentProps(),()=>n().presenceProps,e);return m(U,{get when(){return!n().unmounted},get children(){return m(Z.div,ge(r,{ref(o){var i=lr(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},Zh=e=>e.children(et()),Yh=e=>{let t=et(),n=j(()=>t().getContextTriggerProps(),e);return m(Z.button,n)},Kh=e=>{let t=et(),n=j(()=>t().getIndicatorProps(),e);return m(Z.div,n)},Xh=e=>{let[t,n]=Be()(e,["closeOnSelect","disabled","value","valueText","onSelect"]),r=et(),o=j(()=>r().getItemProps(t),n),i=re(()=>r().getItemState(t));return $e(()=>{let a=r().addItemListener({id:i().id,onSelect:t.onSelect});ie(()=>a?.())}),m(Su,{value:i,get children(){return m(Z.div,o)}})},Jh=e=>e.children(zh()),[Qh,eb]=je({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),tb=e=>{let[t,n]=Be()(e,["id"]),r=j({id:Qe()},t),o=et(),i=j(()=>o().getItemGroupProps(r),n);return m(Qh,{value:r,get children(){return m(Z.div,i)}})},nb=e=>{let t=et(),n=eb(),r=j(t().getItemGroupLabelProps({htmlFor:n.id}),e);return m(Z.div,r)},rb=e=>{let t=et(),n=Hh(),r=j(()=>t().getItemIndicatorProps(n),e);return m(Z.div,r)},ob=e=>{let t=et(),n=Hh(),r=j(()=>t().getItemTextProps(n),e);return m(Z.div,r)},ib=e=>{let t=et(),n=mr(),r=j(()=>t().getPositionerProps(),e);return m(U,{get when(){return!n().unmounted},get children(){return m(Z.div,r)}})},ab=e=>{let[t,n]=Be()(e,["closeOnSelect","disabled","value","valueText"]),r=et(),o=eb(),i=j(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=j(()=>r().getOptionItemProps(i),n),s=re(()=>r().getOptionItemState(i));return m(Gh,{value:i,get children(){return m(Su,{value:s,get children(){return m(Z.div,a)}})}})},sb=e=>{let[t,n]=Be()(e,["id","onValueChange","value"]),r=et(),o=j({id:Qe()},t),i=j(()=>r().getItemGroupProps(o),n);return m(Qh,{value:o,get children(){return m(Z.div,i)}})},lb=e=>{let t=Qe(),n=tn(),r=dt(),o=re(()=>({id:t,dir:n().dir,getRootNode:r().getRootNode,...Ct(e)})),i=Rt(Fh,o);return{api:re(()=>Bh(i,Ot)),service:i}},[cb,ub]=je({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[db,R_]=je({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),mb=e=>{let[t,n]=Qo(e),[r,o]=Be()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=et(),a=ub(),s=lb(r),l=Ur(j(t,()=>({present:s.api().open})));return me(()=>{a&&(i?.().setChild(s.service),s.api().setParent(a))}),m(db,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(cb,{get value(){return s.service},get children(){return m(Uh,{get value(){return s.api},get children(){return m(ei,{value:l,get children(){return o.children}})}})}})}})},fb=e=>{let t=et(),n=ub(),[r,o]=Qo(e),i=Ur(j(r,()=>({present:o.value.api().open})));return $e(()=>{n&&(t?.().setChild(o.value.service),o.value.api().setParent(n))}),m(db,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(cb,{get value(){return o.value.service},get children(){return m(Uh,{get value(){return o.value.api},get children(){return m(ei,{value:i,get children(){return o.children}})}})}})}})},pb=e=>{let t=et(),n=j(()=>t().getSeparatorProps(),e);return m(Z.hr,n)},gb=e=>{let t=et(),n=mr(),r=j(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(Z.button,r)},hb=e=>{let t=R_(),n=j(()=>t?.(),e);return m(Z.div,n)},jn={};_t(jn,{Arrow:()=>Vh,ArrowTip:()=>jh,CheckboxItem:()=>Wh,Content:()=>qh,Context:()=>Zh,ContextTrigger:()=>Yh,Indicator:()=>Kh,Item:()=>Xh,ItemContext:()=>Jh,ItemGroup:()=>tb,ItemGroupLabel:()=>nb,ItemIndicator:()=>rb,ItemText:()=>ob,Positioner:()=>ib,RadioItem:()=>ab,RadioItemGroup:()=>sb,Root:()=>mb,RootProvider:()=>fb,Separator:()=>pb,Trigger:()=>gb,TriggerItem:()=>hb});var li=new WeakMap,ol=new WeakMap,il={},Cu=0,bb=e=>e&&(e.host||bb(e.parentNode)),O_=(e,t)=>t.map(n=>{if(e.contains(n))return n;let r=bb(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),N_=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),$_=(e,t)=>{let{parentNode:n,markerName:r,controlAttribute:o}=t,i=O_(n,Array.isArray(e)?e:[e]);il[r]||(il[r]=new WeakMap);let a=il[r],s=[],l=new Set,c=new Set(i),u=f=>{!f||l.has(f)||(l.add(f),u(f.parentNode))};i.forEach(u);let d=f=>{!f||c.has(f)||Array.prototype.forEach.call(f.children,p=>{if(l.has(p))d(p);else try{if(N_(p))return;let h=p.getAttribute(o)==="true",k=(li.get(p)||0)+1,C=(a.get(p)||0)+1;li.set(p,k),a.set(p,C),s.push(p),k===1&&h&&ol.set(p,!0),C===1&&p.setAttribute(r,""),h||p.setAttribute(o,"true")}catch(y){console.error("[zag-js > ariaHidden] cannot operate on ",p,y)}})};return d(n),l.clear(),Cu++,()=>{s.forEach(f=>{let p=li.get(f)-1,y=a.get(f)-1;li.set(f,p),a.set(f,y),p||(ol.has(f)||f.removeAttribute(o),ol.delete(f)),y||f.removeAttribute(r)}),Cu--,Cu||(li=new WeakMap,li=new WeakMap,ol=new WeakMap,il={})}},M_=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,D_=(e,t=M_(e),n="data-aria-hidden")=>{if(t)return $_(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden"})},L_=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function yb(e,t={}){let{defer:n=!0}=t,r=n?L_:i=>i(),o=[];return o.push(r(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&o.push(D_(a))})),()=>{o.forEach(i=>i?.())}}var _u="data-scroll-lock";function B_(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function vb(e){let t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(_u))return;o.setAttribute(_u,"");let a=n.innerWidth-r.clientWidth,s=()=>zp(r,"--scrollbar-width",`${a}px`),l=B_(r),c=()=>Br(o,{overflow:"hidden",[l]:`${a}px`}),u=()=>{let{scrollX:f,scrollY:p,visualViewport:y}=n,h=y?.offsetLeft??0,k=y?.offsetTop??0,C=Br(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(k))}px`,left:`${-(f-Math.floor(h))}px`,right:"0",[l]:`${a}px`});return()=>{C?.(),n.scrollTo({left:f,top:p,behavior:"instant"})}},d=[s(),Qi()?u():c()];return()=>{d.forEach(f=>f?.()),o.removeAttribute(_u)}}function xb(e,t,n){let r=[],o;return i=>{let a=e(i);return(a.length!==r.length||a.some((l,c)=>!_n(r[c],l)))&&(r=a,o=t(...a),n?.onChange?.(o)),o}}var kb=at("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),zn=kb.build(),F_=e=>e.ids?.root??`progress-${e.id}`,U_=e=>e.ids?.track??`progress-${e.id}-track`,V_=e=>e.ids?.label??`progress-${e.id}-label`,j_=e=>e.ids?.circle??`progress-${e.id}-circle`;function Tb(e,t){let{context:n,computed:r,prop:o,send:i,scope:a}=e,s=r("percent"),l=r("isIndeterminate")?"":r("formatter").format(r("percent")/100),c=o("max"),u=o("min"),d=o("orientation"),f=o("translations"),p=r("isIndeterminate"),y=n.get("value"),h=f?.value({value:y,max:c,percent:s,min:u})??"",k=z_(y,c),C={role:"progressbar","aria-label":h,"data-max":c,"aria-valuemin":u,"aria-valuemax":c,"aria-valuenow":y??void 0,"data-orientation":d,"data-state":k},b=H_(e);return{value:y,valueAsString:h,min:u,max:c,percent:s,percentAsString:l,indeterminate:p,setValue(T){i({type:"VALUE.SET",value:T})},setToMax(){i({type:"VALUE.SET",value:c})},setToMin(){i({type:"VALUE.SET",value:u})},getRootProps(){return t.element({dir:o("dir"),...zn.root.attrs,id:F_(a),"data-max":c,"data-value":y??void 0,"data-state":k,"data-orientation":d,style:{"--percent":p?void 0:s}})},getLabelProps(){return t.element({dir:o("dir"),id:V_(a),...zn.label.attrs,"data-orientation":d})},getValueTextProps(){return t.element({dir:o("dir"),"aria-live":"polite",...zn.valueText.attrs})},getTrackProps(){return t.element({dir:o("dir"),id:U_(a),...zn.track.attrs,...C})},getRangeProps(){return t.element({dir:o("dir"),...zn.range.attrs,"data-orientation":d,"data-state":k,style:{[r("isHorizontal")?"width":"height"]:p?void 0:`${s}%`}})},getCircleProps(){return t.element({dir:o("dir"),id:j_(a),...zn.circle.attrs,...C,...b.root})},getCircleTrackProps(){return t.element({dir:o("dir"),"data-orientation":d,...zn.circleTrack.attrs,...b.track})},getCircleRangeProps(){return t.element({dir:o("dir"),...zn.circleRange.attrs,...b.range,"data-state":k})},getViewProps(T){return t.element({dir:o("dir"),...zn.view.attrs,"data-state":T.state,hidden:T.state!==k})}}}function z_(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}var wb={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}},G_={style:{width:"var(--size)",height:"var(--size)"}};function H_(e){let{context:t,computed:n}=e;return{root:G_,track:wb,range:{opacity:t.get("value")===0?0:void 0,style:{...wb.style,"--percent":n("percent"),"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:n("isIndeterminate")?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}var Sb={props({props:e}){let t=e.min??0,n=e.max??100;return{...e,max:n,min:t,defaultValue:e.defaultValue??Z_(t,n),orientation:"horizontal",formatOptions:{style:"percent",...e.formatOptions},translations:{value:({percent:r})=>r===-1?"loading...":`${r} percent`,...e.translations}}},initialState(){return"idle"},entry:["validateContext"],context({bindable:e,prop:t}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(n){t("onValueChange")?.({value:n})}}))}},computed:{isIndeterminate:({context:e})=>e.get("value")===null,percent({context:e,prop:t}){let n=e.get("value");return Ji(n)?xp(n,t("min"),t("max"))*100:-1},formatter:xb(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>new Intl.NumberFormat(e,t)),isHorizontal:({prop:e})=>e("orientation")==="horizontal"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}},implementations:{actions:{setValue:({context:e,event:t,prop:n})=>{let r=t.value===null?null:Math.max(0,Math.min(t.value,n("max")));e.set("value",r)},validateContext:({context:e,prop:t})=>{let n=t("max"),r=t("min"),o=e.get("value");if(o!=null){if(!Eu(n))throw new Error(`[progress] The max value passed \`${n}\` is not a valid number`);if(!W_(o,n))throw new Error(`[progress] The value passed \`${o}\` exceeds the max value \`${n}\``);if(!q_(o,r))throw new Error(`[progress] The value passed \`${o}\` exceeds the min value \`${r}\``)}}}}},Eu=e=>Ji(e)&&!isNaN(e),W_=(e,t)=>Eu(e)&&e<=t,q_=(e,t)=>Eu(e)&&e>=t,Z_=(e,t)=>e+(t-e)/2,Y_=ut()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange","defaultValue","formatOptions","locale"]),B9=Tt(Y_);var[Cb,An]=je({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),_b=e=>{let t=An(),n=j(()=>t().getCircleProps(),e);return m(Z.svg,n)},Eb=e=>{let t=An(),n=j(()=>t().getCircleRangeProps(),e);return m(Z.circle,n)},Pb=e=>{let t=An(),n=j(()=>t().getCircleTrackProps(),e);return m(Z.circle,n)},Ib=e=>e.children(An()),Ab=e=>{let t=An(),n=j(()=>t().getLabelProps(),e);return m(Z.label,n)},Rb=e=>{let t=An(),n=j(()=>t().getRangeProps(),e);return m(Z.div,n)},Ob=e=>{let t=Qe(),n=tn(),r=dt(),o=re(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...Ct(e)})),i=Rt(Sb,o);return re(()=>Tb(i,Ot))},Nb=e=>{let[t,n]=Be()(e,["defaultValue","formatOptions","id","ids","locale","max","min","onValueChange","orientation","translations","value"]),r=Ob(t),o=j(()=>r().getRootProps(),n);return m(Cb,{value:r,get children(){return m(Z.div,o)}})},$b=e=>{let[{value:t},n]=Be()(e,["value"]),r=j(()=>t().getRootProps(),n);return m(Cb,{value:t,get children(){return m(Z.div,r)}})},Mb=e=>{let t=An(),n=j(()=>t().getTrackProps(),e);return m(Z.div,n)},Db=e=>{let t=An(),n=j(()=>t().getValueTextProps(),e);return m(Z.span,ge(n,{get children(){return e.children||t().percentAsString}}))},Lb=e=>{let[t,n]=Be()(e,["state"]),r=An(),o=j(()=>r().getViewProps(t),n);return m(Z.span,o)},Kr={};_t(Kr,{Circle:()=>_b,CircleRange:()=>Eb,CircleTrack:()=>Pb,Context:()=>Ib,Label:()=>Ab,Range:()=>Rb,Root:()=>Nb,RootProvider:()=>$b,Track:()=>Mb,ValueText:()=>Db,View:()=>Lb});function Pu(e,t,n){let r=[],o;return i=>{let a=e(i);return(a.length!==r.length||a.some((l,c)=>!_n(r[c],l)))&&(r=a,o=t(...a),n?.onChange?.(o)),o}}function X_(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function Bb(){return{guards:X_(),createMachine:e=>e,choose:e=>function({choose:n}){return n(e)?.actions}}}var Iu=new Map,Au=!1;try{Au=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}var al=!1;try{al=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}var Fb={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}},sl=class{format(t){let n="";if(!Au&&this.options.signDisplay!=null?n=Q_(this.numberFormatter,this.options.signDisplay,t):n=this.numberFormatter.format(t),this.options.style==="unit"&&!al){var r;let{unit:o,unitDisplay:i="short",locale:a}=this.resolvedOptions();if(!o)return n;let s=(r=Fb[o])===null||r===void 0?void 0:r[i];n+=s[a]||s.default}return n}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.format(t)} \u2013 ${this.format(n)}`}formatRangeToParts(t,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(t),o=this.numberFormatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!Au&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!al&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,n={}){this.numberFormatter=J_(t,n),this.options=n}};function J_(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),t.style==="unit"&&!al){var r;let{unit:a,unitDisplay:s="short"}=t;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=Fb[a])===null||r===void 0)&&r[s]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${s}`);t={...t,style:"decimal"}}let o=e+(t?Object.entries(t).sort((a,s)=>a[0]<s[0]?-1:1).join():"");if(Iu.has(o))return Iu.get(o);let i=new Intl.NumberFormat(e,t);return Iu.set(o,i),i}function Q_(e,t,n){if(t==="auto")return e.format(n);if(t==="never")return e.format(Math.abs(n));{let r=!1;if(t==="always"?r=n>0||Object.is(n,0):t==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let o=e.format(-n),i=e.format(n),a=o.replace(i,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),o.replace(i,"!!!").replace(a,"+").replace("!!!",i)}else return e.format(n)}}var eE=new RegExp("^.*\\(.*\\).*$"),tE=["latn","arab","hanidec","deva","beng"],ci=class{parse(t){return Ru(this.locale,this.options,t).parse(t)}isValidPartialNumber(t,n,r){return Ru(this.locale,this.options,t).isValidPartialNumber(t,n,r)}getNumberingSystem(t){return Ru(this.locale,this.options,t).options.numberingSystem}constructor(t,n={}){this.locale=t,this.options=n}},Ub=new Map;function Ru(e,t,n){let r=Vb(e,t);if(!e.includes("-nu-")&&!r.isValidPartialNumber(n)){for(let o of tE)if(o!==r.options.numberingSystem){let i=Vb(e+(e.includes("-u-")?"-nu-":"-u-nu-")+o,t);if(i.isValidPartialNumber(n))return i}}return r}function Vb(e,t){let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():""),r=Ub.get(n);return r||(r=new Ou(e,t),Ub.set(n,r)),r}var Ou=class{parse(t){let n=this.sanitize(t);if(this.symbols.group&&(n=pa(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let a=n.indexOf("-");n=n.replace("-","");let s=n.indexOf(".");s===-1&&(s=n.length),n=n.replace(".",""),s-2===0?n=`0.${n}`:s-2===-1?n=`0.0${n}`:s-2===-2?n="0.00":n=`${n.slice(0,s-2)}.${n.slice(s-2)}`,a>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var o,i;let a={...this.options,style:"decimal",minimumFractionDigits:Math.min(((o=this.options.minimumFractionDigits)!==null&&o!==void 0?o:0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)+2,20)};return new ci(this.locale,a).parse(new sl(this.locale,a).format(r))}return this.options.currencySign==="accounting"&&eE.test(t)&&(r=-1*r),r}sanitize(t){return t=t.replace(this.symbols.literals,""),this.symbols.minusSign&&(t=t.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(t=t.replace(",",this.symbols.decimal),t=t.replace("\u060C",this.symbols.decimal)),this.symbols.group&&(t=pa(t,".",this.symbols.group))),this.options.locale==="fr-FR"&&this.symbols.group&&(t=pa(t," ",this.symbols.group),t=pa(t,/\u00A0/g,this.symbols.group)),t}isValidPartialNumber(t,n=-1/0,r=1/0){return t=this.sanitize(t),this.symbols.minusSign&&t.startsWith(this.symbols.minusSign)&&n<0?t=t.slice(this.symbols.minusSign.length):this.symbols.plusSign&&t.startsWith(this.symbols.plusSign)&&r>0&&(t=t.slice(this.symbols.plusSign.length)),this.symbols.group&&t.startsWith(this.symbols.group)||this.symbols.decimal&&t.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(t=pa(t,this.symbols.group,"")),t=t.replace(this.symbols.numeral,""),this.symbols.decimal&&(t=t.replace(this.symbols.decimal,"")),t.length===0)}constructor(t,n={}){this.locale=t,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(t,n),this.options=this.formatter.resolvedOptions(),this.symbols=rE(t,this.formatter,this.options,n);var r,o;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}},jb=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),nE=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function rE(e,t,n,r){var o,i,a,s;let l=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=nE.map(D=>l.formatToParts(D));var f;let p=(f=(o=c.find(D=>D.type==="minusSign"))===null||o===void 0?void 0:o.value)!==null&&f!==void 0?f:"-",y=(i=u.find(D=>D.type==="plusSign"))===null||i===void 0?void 0:i.value;!y&&(r?.signDisplay==="exceptZero"||r?.signDisplay==="always")&&(y="+");let k=(a=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(D=>D.type==="decimal"))===null||a===void 0?void 0:a.value,C=(s=c.find(D=>D.type==="group"))===null||s===void 0?void 0:s.value,b=c.filter(D=>!jb.has(D.type)).map(D=>zb(D.value)),T=d.flatMap(D=>D.filter(F=>!jb.has(F.type)).map(F=>zb(F.value))),g=[...new Set([...b,...T])].sort((D,F)=>F.length-D.length),x=g.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${g.join("|")}|[\\p{White_Space}]`,"gu"),S=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(S.map((D,F)=>[D,F])),R=new RegExp(`[${S.join("")}]`,"g");return{minusSign:p,plusSign:y,decimal:k,group:C,literals:x,numeral:R,index:D=>String(P.get(D))}}function pa(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function zb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Wb=at("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber"),gr=Wb.build(),oE=e=>e.ids?.root??`number-input:${e.id}`,ga=e=>e.ids?.input??`number-input:${e.id}:input`,qb=e=>e.ids?.incrementTrigger??`number-input:${e.id}:inc`,Zb=e=>e.ids?.decrementTrigger??`number-input:${e.id}:dec`,iE=e=>e.ids?.scrubber??`number-input:${e.id}:scrubber`,Yb=e=>`number-input:${e.id}:cursor`,aE=e=>e.ids?.label??`number-input:${e.id}:label`,ha=e=>e.getById(ga(e)),sE=e=>e.getById(qb(e)),lE=e=>e.getById(Zb(e)),Kb=e=>e.getDoc().getElementById(Yb(e)),cE=(e,t)=>{let n=null;return t==="increment"&&(n=sE(e)),t==="decrement"&&(n=lE(e)),n},uE=(e,t)=>{if(!eu())return fE(e,t),()=>{Kb(e)?.remove()}},dE=e=>{let t=e.getDoc(),n=t.documentElement,r=t.body;return r.style.pointerEvents="none",n.style.userSelect="none",n.style.cursor="ew-resize",()=>{r.style.pointerEvents="",n.style.userSelect="",n.style.cursor="",n.style.length||n.removeAttribute("style"),r.style.length||r.removeAttribute("style")}},mE=(e,t)=>{let{point:n,isRtl:r,event:o}=t,i=e.getWin(),a=Zo(o.movementX,i.devicePixelRatio),s=Zo(o.movementY,i.devicePixelRatio),l=a>0?"increment":a<0?"decrement":null;r&&l==="increment"&&(l="decrement"),r&&l==="decrement"&&(l="increment");let c={x:n.x+a,y:n.y+s},u=i.innerWidth,d=Zo(7.5,i.devicePixelRatio);return c.x=hp(c.x+d,u)-d,{hint:l,point:c}},fE=(e,t)=>{let n=e.getDoc(),r=n.createElement("div");r.className="scrubber--cursor",r.id=Yb(e),Object.assign(r.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:Rs,transform:t?`translate3d(${t.x}px, ${t.y}px, 0px)`:void 0,willChange:"transform"}),r.innerHTML=`
10
10
  <svg width="46" height="15" style="left: -15.5px; position: absolute; top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
11
11
  <g transform="translate(2 3)">
12
12
  <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z" style="stroke-width: 2px; stroke: white;"></path>
13
13
  <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z"></path>
14
14
  </g>
15
- </svg>`,r.body.appendChild(n)};function Mh(e,t){let{state:r,send:n,prop:o,scope:i,computed:a}=e,s=r.hasTag("focus"),l=a("isDisabled"),c=o("readOnly"),u=a("isValueEmpty"),d=a("isOutOfRange")||!!o("invalid"),p=l||!a("canIncrement")||c,f=l||!a("canDecrement")||c,x=o("translations");return{focused:s,invalid:d,empty:u,value:a("formattedValue"),valueAsNumber:a("valueAsNumber"),setValue(h){n({type:"VALUE.SET",value:h})},clearValue(){n({type:"VALUE.CLEAR"})},increment(){n({type:"VALUE.INCREMENT"})},decrement(){n({type:"VALUE.DECREMENT"})},setToMax(){n({type:"VALUE.SET",value:o("max")})},setToMin(){n({type:"VALUE.SET",value:o("min")})},focus(){vi(i)?.focus()},getRootProps(){return t.element({id:vS(i),...qr.root.attrs,dir:o("dir"),"data-disabled":fe(l),"data-focus":fe(s),"data-invalid":fe(d)})},getLabelProps(){return t.label({...qr.label.attrs,dir:o("dir"),"data-disabled":fe(l),"data-focus":fe(s),"data-invalid":fe(d),id:kS(i),htmlFor:xi(i)})},getControlProps(){return t.element({...qr.control.attrs,dir:o("dir"),role:"group","aria-disabled":l,"data-focus":fe(s),"data-disabled":fe(l),"data-invalid":fe(d),"aria-invalid":vr(d)})},getValueTextProps(){return t.element({...qr.valueText.attrs,dir:o("dir"),"data-disabled":fe(l),"data-invalid":fe(d),"data-focus":fe(s)})},getInputProps(){return t.input({...qr.input.attrs,dir:o("dir"),name:o("name"),form:o("form"),id:xi(i),role:"spinbutton",defaultValue:a("formattedValue"),pattern:o("pattern"),inputMode:o("inputMode"),"aria-invalid":vr(d),"data-invalid":fe(d),disabled:l,"data-disabled":fe(l),readOnly:c,required:o("required"),autoComplete:"off",autoCorrect:"off",spellCheck:"false",type:"text","aria-roledescription":"numberfield","aria-valuemin":o("min"),"aria-valuemax":o("max"),"aria-valuenow":Number.isNaN(a("valueAsNumber"))?void 0:a("valueAsNumber"),"aria-valuetext":a("valueText"),onFocus(){n({type:"INPUT.FOCUS"})},onBlur(){n({type:"INPUT.BLUR"})},onInput(h){n({type:"INPUT.CHANGE",target:h.currentTarget,hint:"set"})},onBeforeInput(h){try{let{selectionStart:w,selectionEnd:T,value:b}=h.currentTarget,y=b.slice(0,w)+(h.data??"")+b.slice(T);a("parser").isValidPartialNumber(y)||h.preventDefault()}catch{}},onKeyDown(h){if(h.defaultPrevented||c||pf(h))return;let w=hf(h)*o("step"),b={ArrowUp(){n({type:"INPUT.ARROW_UP",step:w}),h.preventDefault()},ArrowDown(){n({type:"INPUT.ARROW_DOWN",step:w}),h.preventDefault()},Home(){oi(h)||(n({type:"INPUT.HOME"}),h.preventDefault())},End(){oi(h)||(n({type:"INPUT.END"}),h.preventDefault())},Enter(){n({type:"INPUT.ENTER"})}}[h.key];b?.(h)}})},getDecrementTriggerProps(){return t.button({...qr.decrementTrigger.attrs,dir:o("dir"),id:Oh(i),disabled:f,"data-disabled":fe(f),"aria-label":x.decrementLabel,type:"button",tabIndex:-1,"aria-controls":xi(i),onPointerDown(h){f||!Kl(h)||(n({type:"TRIGGER.PRESS_DOWN",hint:"decrement",pointerType:h.pointerType}),h.pointerType==="mouse"&&h.preventDefault(),h.pointerType==="touch"&&h.currentTarget?.focus({preventScroll:!0}))},onPointerUp(h){n({type:"TRIGGER.PRESS_UP",hint:"decrement",pointerType:h.pointerType})},onPointerLeave(){f||n({type:"TRIGGER.PRESS_UP",hint:"decrement"})}})},getIncrementTriggerProps(){return t.button({...qr.incrementTrigger.attrs,dir:o("dir"),id:Rh(i),disabled:p,"data-disabled":fe(p),"aria-label":x.incrementLabel,type:"button",tabIndex:-1,"aria-controls":xi(i),onPointerDown(h){p||!Kl(h)||(n({type:"TRIGGER.PRESS_DOWN",hint:"increment",pointerType:h.pointerType}),h.pointerType==="mouse"&&h.preventDefault(),h.pointerType==="touch"&&h.currentTarget?.focus({preventScroll:!0}))},onPointerUp(h){n({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:h.pointerType})},onPointerLeave(h){n({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:h.pointerType})}})},getScrubberProps(){return t.element({...qr.scrubber.attrs,dir:o("dir"),"data-disabled":fe(l),id:wS(i),role:"presentation",onMouseDown(h){if(l)return;let w=Gr(h),b=st(h.currentTarget).devicePixelRatio;w.x=w.x-io(7.5,b),w.y=w.y-io(7.5,b),n({type:"SCRUBBER.PRESS_DOWN",point:w}),h.preventDefault()},style:{cursor:l?void 0:"ew-resize"}})}}}function AS(e){if(!(!e||e.ownerDocument.activeElement!==e))try{let{selectionStart:t,selectionEnd:r,value:n}=e,o=n.substring(0,t),i=n.substring(r);return{start:t,end:r,value:n,beforeTxt:o,afterTxt:i}}catch{}}function RS(e,t){if(!(!e||e.ownerDocument.activeElement!==e)){if(!t){e.setSelectionRange(e.value.length,e.value.length);return}try{let{value:r}=e,{beforeTxt:n="",afterTxt:o="",start:i}=t,a=r.length;if(r.endsWith(o))a=r.length-o.length;else if(r.startsWith(n))a=n.length;else if(i!=null){let s=n[i-1],l=r.indexOf(s,i-1);l!==-1&&(a=l+1)}e.setSelectionRange(a,a)}catch{}}}var OS=(e,t={})=>new Intl.NumberFormat(e,t),$S=(e,t={})=>new wo(e,t),Sc=(e,t)=>{let{prop:r,computed:n}=t;return r("formatOptions")?n("parser").parse(String(e)):parseFloat(e)},Tn=(e,t)=>{let{prop:r,computed:n}=t;return Number.isNaN(e)?"":r("formatOptions")?n("formatter").format(e):e.toString()},NS=(e,t)=>{let r=e!==void 0&&!Number.isNaN(e)?e:1;return t?.style==="percent"&&(e===void 0||Number.isNaN(e))&&(r=.01),r},{choose:MS,guards:DS,createMachine:LS}=kh(),{not:_h,and:Ih}=DS,Dh=LS({props({props:e}){let t=NS(e.step,e.formatOptions);return{dir:"ltr",locale:"en-US",focusInputOnChange:!0,clampValueOnBlur:!e.allowOverflow,allowOverflow:!1,inputMode:"decimal",pattern:"[0-9]*(.[0-9]+)?",defaultValue:"",step:t,min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,spinOnPress:!0,...e,translations:{incrementLabel:"increment value",decrementLabel:"decrease value",...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t,getComputed:r}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){let o=r(),i=Sc(n,{computed:o,prop:e});e("onValueChange")?.({value:n,valueAsNumber:i})}})),hint:t(()=>({defaultValue:null})),scrubberCursorPoint:t(()=>({defaultValue:null,hash(n){return n?`x:${n.x}, y:${n.y}`:""}})),fieldsetDisabled:t(()=>({defaultValue:!1}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",valueAsNumber:({context:e,computed:t,prop:r})=>Sc(e.get("value"),{computed:t,prop:r}),formattedValue:({computed:e,prop:t})=>Tn(e("valueAsNumber"),{computed:e,prop:t}),isAtMin:({computed:e,prop:t})=>tf(e("valueAsNumber"),t("min")),isAtMax:({computed:e,prop:t})=>ef(e("valueAsNumber"),t("max")),isOutOfRange:({computed:e,prop:t})=>!rf(e("valueAsNumber"),t("min"),t("max")),isValueEmpty:({context:e})=>e.get("value")==="",isDisabled:({prop:e,context:t})=>!!e("disabled")||t.get("fieldsetDisabled"),canIncrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMax"),canDecrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMin"),valueText:({prop:e,context:t})=>e("translations").valueText?.(t.get("value")),formatter:vc(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>OS(e,t)),parser:vc(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>$S(e,t))},watch({track:e,action:t,context:r,computed:n,prop:o}){e([()=>r.get("value"),()=>o("locale")],()=>{t(["syncInputElement"])}),e([()=>n("isOutOfRange")],()=>{t(["invokeOnInvalid"])}),e([()=>r.hash("scrubberCursorPoint")],()=>{t(["setVirtualCursorPosition"])})},effects:["trackFormControl"],on:{"VALUE.SET":{actions:["setRawValue"]},"VALUE.CLEAR":{actions:["clearValue"]},"VALUE.INCREMENT":{actions:["increment"]},"VALUE.DECREMENT":{actions:["decrement"]}},states:{idle:{on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","invokeOnFocus","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","invokeOnFocus","setHint","setCursorPoint"]},"INPUT.FOCUS":{target:"focused",actions:["focusInput","invokeOnFocus"]}}},focused:{tags:["focus"],effects:["attachWheelListener"],on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","setHint","setCursorPoint"]},"INPUT.ARROW_UP":{actions:["increment"]},"INPUT.ARROW_DOWN":{actions:["decrement"]},"INPUT.HOME":{actions:["decrementToMin"]},"INPUT.END":{actions:["incrementToMax"]},"INPUT.CHANGE":{actions:["setValue","setHint"]},"INPUT.BLUR":[{guard:Ih("clampValueOnBlur",_h("isInRange")),target:"idle",actions:["setClampedValue","clearHint","invokeOnBlur"]},{guard:_h("isInRange"),target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur","invokeOnInvalid"]},{target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur"]}],"INPUT.ENTER":{actions:["setFormattedValue","clearHint","invokeOnBlur"]}}},"before:spin":{tags:["focus"],effects:["trackButtonDisabled","waitForChangeDelay"],entry:MS([{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}]),on:{CHANGE_DELAY:{target:"spinning",guard:Ih("isInRange","spinOnPress")},"TRIGGER.PRESS_UP":[{guard:"isTouchPointer",target:"focused",actions:["clearHint"]},{target:"focused",actions:["focusInput","clearHint"]}]}},spinning:{tags:["focus"],effects:["trackButtonDisabled","spinValue"],on:{SPIN:[{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}],"TRIGGER.PRESS_UP":{target:"focused",actions:["focusInput","clearHint"]}}},scrubbing:{tags:["focus"],effects:["activatePointerLock","trackMousemove","setupVirtualCursor","preventTextSelection"],on:{"SCRUBBER.POINTER_UP":{target:"focused",actions:["focusInput","clearCursorPoint"]},"SCRUBBER.POINTER_MOVE":[{guard:"isIncrementHint",actions:["increment","setCursorPoint"]},{guard:"isDecrementHint",actions:["decrement","setCursorPoint"]}]}}},implementations:{guards:{clampValueOnBlur:({prop:e})=>e("clampValueOnBlur"),spinOnPress:({prop:e})=>!!e("spinOnPress"),isInRange:({computed:e})=>!e("isOutOfRange"),isDecrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="decrement",isIncrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="increment",isTouchPointer:({event:e})=>e.pointerType==="touch"},effects:{waitForChangeDelay({send:e}){let t=setTimeout(()=>{e({type:"CHANGE_DELAY"})},300);return()=>clearTimeout(t)},spinValue({send:e}){let t=setInterval(()=>{e({type:"SPIN"})},50);return()=>clearInterval(t)},trackFormControl({context:e,scope:t}){let r=vi(t);return yf(r,{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("value",e.initial("value"))}})},setupVirtualCursor({context:e,scope:t}){let r=e.get("scrubberCursorPoint");return ES(t,r)},preventTextSelection({scope:e}){return PS(e)},trackButtonDisabled({context:e,scope:t,send:r}){let n=e.get("hint"),o=SS(t,n);return Ma(o,{attributes:["disabled"],callback(){r({type:"TRIGGER.PRESS_UP",src:"attr"})}})},attachWheelListener({scope:e,send:t,prop:r}){let n=vi(e);if(!n||!e.isActiveElement(n)||!r("allowMouseWheel"))return;function o(i){i.preventDefault();let a=Math.sign(i.deltaY)*-1;a===1?t({type:"VALUE.INCREMENT"}):a===-1&&t({type:"VALUE.DECREMENT"})}return Ee(n,"wheel",o,{passive:!1})},activatePointerLock({scope:e}){if(!Wl())return Sf(e.getDoc())},trackMousemove({scope:e,send:t,context:r,computed:n}){let o=e.getDoc();function i(s){let l=r.get("scrubberCursorPoint"),c=n("isRtl"),u=_S(e,{point:l,isRtl:c,event:s});u.hint&&t({type:"SCRUBBER.POINTER_MOVE",hint:u.hint,point:u.point})}function a(){t({type:"SCRUBBER.POINTER_UP"})}return Yt(Ee(o,"mousemove",i,!1),Ee(o,"mouseup",a,!1))}},actions:{focusInput({scope:e,prop:t}){if(!t("focusInputOnChange"))return;let r=vi(e);e.isActiveElement(r)||ke(()=>r?.focus({preventScroll:!0}))},increment({context:e,event:t,prop:r,computed:n}){let o=af(n("valueAsNumber"),t.step??r("step"));r("allowOverflow")||(o=zr(o,r("min"),r("max"))),e.set("value",Tn(o,{computed:n,prop:r}))},decrement({context:e,event:t,prop:r,computed:n}){let o=sf(n("valueAsNumber"),t.step??r("step"));r("allowOverflow")||(o=zr(o,r("min"),r("max"))),e.set("value",Tn(o,{computed:n,prop:r}))},setClampedValue({context:e,prop:t,computed:r}){let n=zr(r("valueAsNumber"),t("min"),t("max"));e.set("value",Tn(n,{computed:r,prop:t}))},setRawValue({context:e,event:t,prop:r,computed:n}){let o=Sc(t.value,{computed:n,prop:r});r("allowOverflow")||(o=zr(o,r("min"),r("max"))),e.set("value",Tn(o,{computed:n,prop:r}))},setValue({context:e,event:t}){let r=t.target?.value??t.value;e.set("value",r)},clearValue({context:e}){e.set("value","")},incrementToMax({context:e,prop:t,computed:r}){let n=Tn(t("max"),{computed:r,prop:t});e.set("value",n)},decrementToMin({context:e,prop:t,computed:r}){let n=Tn(t("min"),{computed:r,prop:t});e.set("value",n)},setHint({context:e,event:t}){e.set("hint",t.hint)},clearHint({context:e}){e.set("hint",null)},invokeOnFocus({computed:e,prop:t}){t("onFocusChange")?.({focused:!0,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnBlur({computed:e,prop:t}){t("onFocusChange")?.({focused:!1,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnInvalid({computed:e,prop:t,event:r}){if(r.type==="INPUT.CHANGE")return;let n=e("valueAsNumber")>t("max")?"rangeOverflow":"rangeUnderflow";t("onValueInvalid")?.({reason:n,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},syncInputElement({context:e,event:t,computed:r,scope:n}){let o=t.type.endsWith("CHANGE")?e.get("value"):r("formattedValue"),i=vi(n),a=AS(i);ke(()=>{bf(i,o),RS(i,a)})},setFormattedValue({context:e,computed:t}){e.set("value",t("formattedValue"))},setCursorPoint({context:e,event:t}){e.set("scrubberCursorPoint",t.point)},clearCursorPoint({context:e}){e.set("scrubberCursorPoint",null)},setVirtualCursorPosition({context:e,scope:t}){let r=Nh(t),n=e.get("scrubberCursorPoint");!r||!n||(r.style.transform=`translate3d(${n.x}px, ${n.y}px, 0px)`)}}}}),BS=rt()(["allowMouseWheel","allowOverflow","clampValueOnBlur","dir","disabled","focusInputOnChange","form","formatOptions","getRootNode","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","required","readOnly","spinOnPress","step","translations","value","defaultValue"]),C6=mt(BS);var[Lh,Sr]=Oe({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),Bh=e=>e.children(Sr()),Fh=e=>{let t=Sr(),r=H(()=>t().getControlProps(),e);return m(Y.div,r)},Uh=e=>{let t=Sr(),r=H(()=>t().getDecrementTriggerProps(),e);return m(Y.button,r)},Vh=e=>{let t=Sr(),r=H(()=>t().getIncrementTriggerProps(),e);return m(Y.button,r)},zh=e=>{let t=Sr(),r=H(()=>t().getInputProps(),e),n=er();return m(Y.input,ce({get"aria-describedby"(){return n?.().ariaDescribedby}},r))},Gh=e=>{let t=Sr(),r=H(()=>t().getLabelProps(),e);return m(Y.label,r)},is=e=>{let t=We(),r=Ut(),n=nt(),o=er(),i=ee(()=>({id:t,ids:{label:o?.().ids.label,input:o?.().ids.control},disabled:o?.().disabled,readOnly:o?.().readOnly,required:o?.().required,invalid:o?.().invalid,dir:r().dir,locale:r().locale,getRootNode:n().getRootNode,...pt(e)})),a=xt(Dh,i);return ee(()=>Mh(a,vt))},Hh=e=>{let[t,r]=Ae()(e,["allowMouseWheel","allowOverflow","clampValueOnBlur","defaultValue","disabled","focusInputOnChange","form","formatOptions","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","readOnly","required","spinOnPress","step","translations","value"]),n=is(t),o=H(()=>n().getRootProps(),r);return m(Lh,{value:n,get children(){return m(Y.div,o)}})},jh=e=>{let[{value:t},r]=Ae()(e,["value"]),n=H(()=>t().getRootProps(),r);return m(Lh,{value:t,get children(){return m(Y.div,n)}})},Wh=e=>{let t=Sr(),r=H(()=>t().getScrubberProps(),e);return m(Y.div,r)},qh=e=>{let t=Sr(),r=H(()=>t().getValueTextProps(),e);return m(Y.span,r)},Yr={};gt(Yr,{Context:()=>Bh,Control:()=>Fh,DecrementTrigger:()=>Uh,IncrementTrigger:()=>Vh,Input:()=>zh,Label:()=>Gh,Root:()=>Hh,RootProvider:()=>jh,Scrubber:()=>Wh,ValueText:()=>qh});var Yh=et("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Sn=Yh.build(),Kh=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Xh=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Ec=e=>e.ids?.content??`dialog:${e.id}:content`,Zh=e=>e.ids?.trigger??`dialog:${e.id}:trigger`,Pc=e=>e.ids?.title??`dialog:${e.id}:title`,_c=e=>e.ids?.description??`dialog:${e.id}:description`,Jh=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,as=e=>e.getById(Ec(e)),US=e=>e.getById(Kh(e)),VS=e=>e.getById(Xh(e)),zS=e=>e.getById(Zh(e)),GS=e=>e.getById(Pc(e)),HS=e=>e.getById(_c(e)),jS=e=>e.getById(Jh(e));function Qh(e,t){let{state:r,send:n,context:o,prop:i,scope:a}=e,s=i("aria-label"),l=r.matches("open");return{open:l,setOpen(c){r.matches("open")!==c&&n({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...Sn.trigger.attrs,dir:i("dir"),id:Zh(a),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":Ec(a),onClick(c){c.defaultPrevented||n({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...Sn.backdrop.attrs,dir:i("dir"),hidden:!l,id:Xh(a),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...Sn.positioner.attrs,dir:i("dir"),id:Kh(a),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){let c=o.get("rendered");return t.element({...Sn.content.attrs,dir:i("dir"),role:i("role"),hidden:!l,id:Ec(a),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":s||void 0,"aria-labelledby":s||!c.title?void 0:Pc(a),"aria-describedby":c.description?_c(a):void 0})},getTitleProps(){return t.element({...Sn.title.attrs,dir:i("dir"),id:Pc(a)})},getDescriptionProps(){return t.element({...Sn.description.attrs,dir:i("dir"),id:_c(a)})},getCloseTriggerProps(){return t.button({...Sn.closeTrigger.attrs,dir:i("dir"),id:Jh(a),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),n({type:"CLOSE"}))}})}}}var eb={props({props:e,scope:t}){let r=e.role==="alertdialog";return{role:"dialog",modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!r,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r?()=>jS(t):void 0,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:r}){e([()=>r("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:r}){return Xa(()=>as(e),{defer:!0,pointerBlocking:r("modal"),exclude:[zS(e)],onInteractOutside(o){r("onInteractOutside")?.(o),r("closeOnInteractOutside")||o.preventDefault()},persistentElements:r("persistentElements"),onFocusOutside:r("onFocusOutside"),onPointerDownOutside:r("onPointerDownOutside"),onEscapeKeyDown(o){r("onEscapeKeyDown")?.(o),r("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return nh(e.getDoc())},trapFocus({scope:e,prop:t}){return!t("trapFocus")||!t("modal")?void 0:Up(()=>as(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:n=>t("finalFocusEl")?.()??n})},hideContentBelow({scope:e,prop:t}){return t("modal")?rh(()=>[as(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){ke(()=>{e.set("rendered",{title:!!GS(t),description:!!HS(t)})})},syncZIndex({scope:e}){ke(()=>{let t=as(e);if(!t)return;let r=Kt(t);[US(e),VS(e)].forEach(o=>{o?.style.setProperty("--z-index",r.zIndex)})})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},toggleVisibility({prop:e,send:t,event:r}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}}},WS=rt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),H6=mt(WS);var[tb,Er]=Oe({hookName:"useDialogContext",providerName:"<DialogProvider />"}),rb=e=>{let t=Er(),r=Bm(),n=fn(H(r,()=>({present:t().open}))),o=H(()=>t().getBackdropProps(),()=>n().presenceProps,e);return m(U,{get when(){return!n().unmounted},get children(){return m(Y.div,ce(o,{ref(i){var a=Ur(n().ref,e.ref);typeof a=="function"&&a(i)}}))}})},nb=e=>{let t=Er(),r=H(()=>t().getCloseTriggerProps(),e);return m(Y.button,r)},ob=e=>{let t=Er(),r=Hr(),n=H(()=>t().getContentProps(),()=>r().presenceProps,e);return m(U,{get when(){return!r().unmounted},get children(){return m(Y.div,ce(n,{ref(o){var i=Ur(r().ref,e.ref);typeof i=="function"&&i(o)}}))}})},ib=e=>e.children(Er()),ab=e=>{let t=Er(),r=H(()=>t().getDescriptionProps(),e);return m(Y.div,r)},sb=e=>{let t=Er(),r=Hr(),n=H(()=>t().getPositionerProps(),e);return m(U,{get when(){return!r().unmounted},get children(){return m(Y.div,n)}})},lb=e=>{let t=We(),r=Ut(),n=nt(),o=ee(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...pt(e)})),i=xt(eb,o);return ee(()=>Qh(i,vt))},cb=e=>{let[t,r]=uo(e),[n]=ti(t),[o,i]=Ae()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=lb(o),s=fn(H(t,()=>({present:a().open})));return m(tb,{value:a,get children(){return m(Dl,{value:n,get children(){return m(mo,{value:s,get children(){return i.children}})}})}})},ub=e=>{let[t,r]=uo(e),[n]=ti(t),o=fn(H(t,()=>({present:r.value().open})));return m(tb,{get value(){return r.value},get children(){return m(Dl,{value:n,get children(){return m(mo,{value:o,get children(){return r.children}})}})}})},db=e=>{let t=Er(),r=H(()=>t().getTitleProps(),e);return m(Y.h2,r)},mb=e=>{let t=Er(),r=Hr(),n=H(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(Y.button,n)},Kr={};gt(Kr,{Backdrop:()=>rb,CloseTrigger:()=>nb,Content:()=>ob,Context:()=>ib,Description:()=>ab,Positioner:()=>sb,Root:()=>cb,RootProvider:()=>ub,Title:()=>db,Trigger:()=>mb});function YS(e){let t=Kt(e),r=e.getBoundingClientRect(),n=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),o=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),i=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function s(p,f){let x=parseFloat(p);return/%/.test(p)&&(x/=100,x*=f),Number.isNaN(x)?0:x}let l=s(n,r.width),c=s(o,r.height),u=s(i,r.width),d=s(a,r.height);return{x:{before:l,after:u},y:{before:c,after:d}}}function KS(e,t,r="both"){return r==="x"&&e.right>=t.left&&e.left<=t.right||r==="y"&&e.bottom>=t.top&&e.top<=t.bottom||r==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function gb(e){let t=[];for(let r of e.children)t=t.concat(r,gb(r));return t}function hb(e,t=!1){let r=e.getBoundingClientRect(),n={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},o=t?gb(e):e.children;for(let i of["x","y"]){let a=i==="x"?"y":"x",s=i==="x"?"left":"top",l=i==="x"?"width":"height",c=i==="x"?"scrollLeft":"scrollTop";for(let u of o){let d=u.getBoundingClientRect();if(!KS(r,d,a))continue;let p=Kt(u),[f,x]=p.getPropertyValue("scroll-snap-align").split(" ");typeof x>"u"&&(x=f);let h=i==="x"?x:f,w=d[s]-r[s]+e[c];switch(h){case"none":break;case"start":n[i].start.push({node:u,position:w});break;case"center":n[i].center.push({node:u,position:w+d[l]/2});break;case"end":n[i].end.push({node:u,position:w+d[l]});break}}}return n}function Ic(e){let t=e.getBoundingClientRect(),r=YS(e),n=hb(e),o={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:fb([...n.x.start.map(i=>i.position-r.x.before),...n.x.center.map(i=>i.position-t.width/2),...n.x.end.map(i=>i.position-t.width+r.x.after)].map(pb(0,o.x))),y:fb([...n.y.start.map(i=>i.position-r.y.before),...n.y.center.map(i=>i.position-t.height/2),...n.y.end.map(i=>i.position-t.height+r.y.after)].map(pb(0,o.y)))}}function bb(e,t,r){let n=hb(e),o=[...n[t].start,...n[t].center,...n[t].end];for(let i of o)if(r(i.node))return i.position}var fb=e=>[...new Set(e)],pb=(e,t)=>r=>Math.max(e,Math.min(t,r));var vb=et("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),Pr=vb.build(),XS=e=>e.ids?.root??`carousel:${e.id}`,ZS=(e,t)=>e.ids?.item?.(t)??`carousel:${e.id}:item:${t}`,ss=e=>e.ids?.itemGroup??`carousel:${e.id}:item-group`,JS=e=>e.ids?.nextTrigger??`carousel:${e.id}:next-trigger`,QS=e=>e.ids?.prevTrigger??`carousel:${e.id}:prev-trigger`,eE=e=>e.ids?.indicatorGroup??`carousel:${e.id}:indicator-group`,wb=(e,t)=>e.ids?.indicator?.(t)??`carousel:${e.id}:indicator:${t}`,Rt=e=>e.getById(ss(e)),yb=e=>La(Rt(e),"[data-part=item]"),tE=(e,t)=>e.getById(wb(e,t)),xb=e=>{let t=Rt(e);if(!t)return;let r=un(t);t.setAttribute("tabindex",r.length>0?"-1":"0")};function kb(e,t){let{state:r,context:n,computed:o,send:i,scope:a,prop:s}=e,l=r.matches("autoplay"),c=r.matches("dragging"),u=o("canScrollNext"),d=o("canScrollPrev"),p=o("isHorizontal"),f=Array.from(n.get("pageSnapPoints")),x=n.get("page"),h=s("slidesPerPage"),w=s("padding"),T=s("translations");return{isPlaying:l,isDragging:c,page:x,pageSnapPoints:f,canScrollNext:u,canScrollPrev:d,getProgress(){return x/f.length},scrollToIndex(b,y){i({type:"INDEX.SET",index:b,instant:y})},scrollTo(b,y){i({type:"PAGE.SET",index:b,instant:y})},scrollNext(b){i({type:"PAGE.NEXT",instant:b})},scrollPrev(b){i({type:"PAGE.PREV",instant:b})},play(){i({type:"AUTOPLAY.START"})},pause(){i({type:"AUTOPLAY.PAUSE"})},isInView(b){return Array.from(n.get("slidesInView")).includes(b)},refresh(){i({type:"SNAP.REFRESH"})},getRootProps(){return t.element({...Pr.root.attrs,id:XS(a),role:"region","aria-roledescription":"carousel","data-orientation":s("orientation"),dir:s("dir"),style:{"--slides-per-page":h,"--slide-spacing":s("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}})},getItemGroupProps(){return t.element({...Pr.itemGroup.attrs,id:ss(a),"data-orientation":s("orientation"),"data-dragging":fe(c),dir:s("dir"),"aria-live":l?"off":"polite",onFocus(b){$a(b)&&i({type:"VIEWPORT.FOCUS"})},onBlur(b){It(b.currentTarget,b.relatedTarget)||i({type:"VIEWPORT.BLUR"})},onMouseDown(b){if(!s("allowMouseDrag")||b.button!==0||b.defaultPrevented)return;let y=Qe(b);Ft(y)&&y!==b.currentTarget||(b.preventDefault(),i({type:"DRAGGING.START"}))},onWheel:Jm(b=>{let y=s("orientation")==="horizontal"?"deltaX":"deltaY";b[y]<0&&!o("canScrollPrev")||b[y]>0&&!o("canScrollNext")||i({type:"USER.SCROLL"})},150),onTouchStart(){i({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[p?"x":"y",s("snapType")].join(" "),gridAutoFlow:p?"column":"row",scrollbarWidth:"none",overscrollBehavior:"contain",[p?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[p?"scrollPaddingInline":"scrollPaddingBlock"]:w,[p?"paddingInline":"paddingBlock"]:w,[p?"overflowX":"overflowY"]:"auto"}})},getItemProps(b){let y=n.get("slidesInView").includes(b.index);return t.element({...Pr.item.attrs,id:ZS(a,b.index),dir:s("dir"),role:"group","data-index":b.index,"data-inview":fe(y),"aria-roledescription":"slide","data-orientation":s("orientation"),"aria-label":T.item(b.index,s("slideCount")),"aria-hidden":vr(!y),style:{scrollSnapAlign:(()=>{let g=b.snapAlign??"start",k=s("slidesPerMove"),S=k==="auto"?Math.floor(s("slidesPerPage")):k;return(b.index+S)%S===0?g:void 0})()}})},getControlProps(){return t.element({...Pr.control.attrs,"data-orientation":s("orientation")})},getPrevTriggerProps(){return t.button({...Pr.prevTrigger.attrs,id:QS(a),type:"button",disabled:!d,dir:s("dir"),"aria-label":T.prevTrigger,"data-orientation":s("orientation"),"aria-controls":ss(a),onClick(b){b.defaultPrevented||i({type:"PAGE.PREV",src:"trigger"})}})},getNextTriggerProps(){return t.button({...Pr.nextTrigger.attrs,dir:s("dir"),id:JS(a),type:"button","aria-label":T.nextTrigger,"data-orientation":s("orientation"),"aria-controls":ss(a),disabled:!u,onClick(b){b.defaultPrevented||i({type:"PAGE.NEXT",src:"trigger"})}})},getIndicatorGroupProps(){return t.element({...Pr.indicatorGroup.attrs,dir:s("dir"),id:eE(a),"data-orientation":s("orientation"),onKeyDown(b){if(b.defaultPrevented)return;let y="indicator",g={ArrowDown(P){p||(i({type:"PAGE.NEXT",src:y}),P.preventDefault())},ArrowUp(P){p||(i({type:"PAGE.PREV",src:y}),P.preventDefault())},ArrowRight(P){p&&(i({type:"PAGE.NEXT",src:y}),P.preventDefault())},ArrowLeft(P){p&&(i({type:"PAGE.PREV",src:y}),P.preventDefault())},Home(P){i({type:"PAGE.SET",index:0,src:y}),P.preventDefault()},End(P){i({type:"PAGE.SET",index:f.length-1,src:y}),P.preventDefault()}},k=ii(b,{dir:s("dir"),orientation:s("orientation")}),S=g[k];S?.(b)}})},getIndicatorProps(b){return t.button({...Pr.indicator.attrs,dir:s("dir"),id:wb(a,b.index),type:"button","data-orientation":s("orientation"),"data-index":b.index,"data-readonly":fe(b.readOnly),"data-current":fe(b.index===x),"aria-label":T.indicator(b.index),onClick(y){y.defaultPrevented||b.readOnly||i({type:"PAGE.SET",index:b.index,src:"indicator"})}})},getAutoplayTriggerProps(){return t.button({...Pr.autoplayTrigger.attrs,type:"button","data-orientation":s("orientation"),"data-pressed":fe(l),"aria-label":l?T.autoplayStop:T.autoplayStart,onClick(b){b.defaultPrevented||i({type:l?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}})}}}var Cb={props({props:e}){return Sa(e,["slideCount"],"carousel"),{dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6,...e,translations:{nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,r)=>`${t+1} of ${r}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation",...e.translations}}},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:r}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(n){let i=r().get("pageSnapPoints");e("onPageChange")?.({page:n,pageSnapPoint:i[n]})}})),pageSnapPoints:t(()=>({defaultValue:rE(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{let t=e("autoplay");return Ca(t)?t.delay:4e3}},watch({track:e,action:t,context:r,prop:n}){e([()=>n("slidesPerPage"),()=>n("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>r.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>n("orientation")],()=>{t(["setSnapPoints","scrollToPage"])})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(Rt(e))},effects:{autoUpdateSlide({computed:e,send:t}){let r=setInterval(()=>{t({type:"AUTOPLAY.TICK",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(r)},trackSlideMutation({scope:e,send:t}){let r=Rt(e);if(!r)return;let n=e.getWin(),o=new n.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),xb(e)});return xb(e),o.observe(r,{childList:!0,subtree:!0}),()=>o.disconnect()},trackSlideResize({scope:e,send:t}){if(!Rt(e))return;let n=e.getWin(),o=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};ke(()=>{o(),ke(()=>{t({type:"PAGE.SCROLL",instant:!0})})});let i=new n.ResizeObserver(o);return yb(e).forEach(a=>i.observe(a)),()=>i.disconnect()},trackSlideIntersections({scope:e,prop:t,context:r}){let n=Rt(e),o=e.getWin(),i=new o.IntersectionObserver(a=>{let s=a.reduce((l,c)=>{let u=c.target,d=Number(u.dataset.index??"-1");return d==null||Number.isNaN(d)||d===-1?l:c.isIntersecting?jm(l,d):Wm(l,d)},r.get("slidesInView"));r.set("slidesInView",qm(s))},{root:n,threshold:t("inViewThreshold")});return yb(e).forEach(a=>i.observe(a)),()=>i.disconnect()},trackScroll({send:e,refs:t,scope:r}){let n=Rt(r);return n?Ee(n,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){let r=e.getDoc();return Ee(r,"visibilitychange",()=>{r.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){let r=e.getDoc();return Ef(r,{onPointerMove({event:n}){t({type:"DRAGGING",left:-n.movementX,top:-n.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:r}){let n=e.getWin();return Ee(n,"keydown",i=>{switch(i.key){case"ArrowRight":i.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":i.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":i.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":i.preventDefault(),t({type:"PAGE.SET",index:r.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:r,computed:n,flush:o}){let i=t.instant?"instant":"smooth",a=zr(t.index??e.get("page"),0,e.get("pageSnapPoints").length-1),s=Rt(r);if(!s)return;let l=n("isHorizontal")?"left":"top";o(()=>{s.scrollTo({[l]:e.get("pageSnapPoints")[a],behavior:i})})},setClosestPage({context:e,scope:t,computed:r}){let n=Rt(t);if(!n)return;let o=r("isHorizontal")?n.scrollLeft:n.scrollTop,i=e.get("pageSnapPoints").findIndex(a=>Math.abs(a-o)<1);i!==-1&&e.set("page",i)},setNextPage({context:e,prop:t,state:r}){let n=r.matches("autoplay")||t("loop"),o=ka(e.get("pageSnapPoints"),e.get("page"),{loop:n});e.set("page",o)},setPrevPage({context:e,prop:t,state:r}){let n=r.matches("autoplay")||t("loop"),o=Fl(e.get("pageSnapPoints"),e.get("page"),{loop:n});e.set("page",o)},setMatchingPage({context:e,event:t,computed:r,scope:n}){let o=Rt(n);if(!o)return;let i=bb(o,r("isHorizontal")?"x":"y",s=>s.dataset.index===t.index.toString());if(i==null)return;let a=e.get("pageSnapPoints").findIndex(s=>Math.abs(s-i)<1);e.set("page",a)},setPage({context:e,event:t}){let r=t.index??e.get("page");e.set("page",r)},clampPage({context:e}){let t=zr(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:r}){let n=Rt(r);if(!n)return;let o=Ic(n);e.set("pageSnapPoints",t("isHorizontal")?o.x:o.y)},disableScrollSnap({scope:e}){let t=Rt(e);if(!t)return;let r=getComputedStyle(t);t.dataset.scrollSnapType=r.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){Rt(e)?.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:r}){let n=Rt(e);if(!n)return;let o=n.scrollLeft,i=n.scrollTop,a=Ic(n),s=a.x.reduce((c,u)=>Math.abs(u-o)<Math.abs(c-o)?u:c,a.x[0]),l=a.y.reduce((c,u)=>Math.abs(u-i)<Math.abs(c-i)?u:c,a.y[0]);ke(()=>{n.scrollTo({left:s,top:l,behavior:"smooth"});let c=r("isHorizontal")?s:l;t.set("page",t.get("pageSnapPoints").indexOf(c));let u=n.dataset.scrollSnapType;u&&(n.style.setProperty("scroll-snap-type",u),delete n.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:r}){if(t.src!=="indicator")return;let n=tE(r,e.get("page"));n&&ke(()=>n.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function rE(e,t,r){if(e==null)return[];let n=[],o=t==="auto"?Math.floor(r):t;for(let i=0;i<e-1;i+=o)n.push(i);return n}var nE=rt()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),mM=mt(nE),oE=rt()(["index","readOnly"]),fM=mt(oE),iE=rt()(["index","snapAlign"]),pM=mt(iE);var[Tb,fr]=Oe({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),Sb=e=>{let t=fr(),r=H(()=>t().getAutoplayTriggerProps(),e);return m(Y.button,r)},Eb=e=>e.children(fr()),Pb=e=>{let t=fr(),r=H(()=>t().getControlProps(),e);return m(Y.div,r)},_b=e=>{let[t,r]=Ae()(e,["index","readOnly"]),n=fr(),o=H(()=>n().getIndicatorProps(t),r);return m(Y.button,o)},Ib=e=>{let t=fr(),r=H(()=>t().getIndicatorGroupProps(),e);return m(Y.div,r)},Ab=e=>{let[t,r]=Ae()(e,["index","snapAlign"]),n=fr(),o=H(()=>n().getItemProps(t),r);return m(Y.div,o)},Rb=e=>{let t=fr(),r=H(()=>t().getItemGroupProps(),e);return m(Y.div,r)},Ob=e=>{let t=fr(),r=H(()=>t().getNextTriggerProps(),e);return m(Y.button,r)},$b=e=>{let t=fr(),r=H(()=>t().getPrevTriggerProps(),e);return m(Y.button,r)},Nb=e=>{let t=We(),r=Ut(),n=nt(),o=ee(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...pt(e)})),i=xt(Cb,o);return ee(()=>kb(i,vt))},Mb=e=>{let[t,r]=Ae()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),n=Nb(t),o=H(()=>n().getRootProps(),r);return m(Tb,{value:n,get children(){return m(Y.div,o)}})},Db=e=>{let[{value:t},r]=Ae()(e,["value"]),n=H(()=>t().getRootProps(),r);return m(Tb,{value:t,get children(){return m(Y.div,n)}})},_r={};gt(_r,{AutoplayTrigger:()=>Sb,Context:()=>Eb,Control:()=>Pb,Indicator:()=>_b,IndicatorGroup:()=>Ib,Item:()=>Ab,ItemGroup:()=>Rb,NextTrigger:()=>Ob,PrevTrigger:()=>$b,Root:()=>Mb,RootProvider:()=>Db});var $t=mc({placement:"bottom-end",gap:24});var ls=e=>Number(e)>=6;function Lb(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=Lb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Bb(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Lb(e))&&(n&&(n+=" "),n+=t);return n}var Fb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,q=Bb,Ac=(e,t)=>r=>{var n;if(t?.variants==null)return q(e,r?.class,r?.className);let{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{let u=r?.[c],d=i?.[c];if(u===null)return null;let p=Fb(u)||Fb(d);return o[c][p]}),s=r&&Object.entries(r).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:p,...f}=u;return Object.entries(f).every(x=>{let[h,w]=x;return Array.isArray(w)?w.includes({...i,...s}[h]):{...i,...s}[h]===w})?[...c,d,p]:c},[]);return q(e,a,l,r?.class,r?.className)};var sE=e=>{let t=cE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{let s=a.split("-");return s[0]===""&&s.length!==1&&s.shift(),jb(s,t)||lE(a)},getConflictingClassGroupIds:(a,s)=>{let l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},jb=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?jb(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join("-");return t.validators.find(({validator:a})=>a(i))?.classGroupId},Ub=/^\[(.+)\]$/,lE=e=>{if(Ub.test(e)){let t=Ub.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},cE=e=>{let{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(let o in r)Oc(r[o],n,o,t);return n},Oc=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:Vb(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(uE(o)){Oc(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Oc(a,Vb(t,i),r,n)})})},Vb=(e,t)=>{let r=e;return t.split("-").forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},uE=e=>e.isThemeGetter,dE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}};var mE=e=>{let{prefix:t,experimentalParseClassName:r}=e,n=o=>{let i=[],a=0,s=0,l=0,c;for(let x=0;x<o.length;x++){let h=o[x];if(a===0&&s===0){if(h===":"){i.push(o.slice(l,x)),l=x+1;continue}if(h==="/"){c=x;continue}}h==="["?a++:h==="]"?a--:h==="("?s++:h===")"&&s--}let u=i.length===0?o:o.substring(l),d=fE(u),p=d!==u,f=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:f}};if(t){let o=t+":",i=n;n=a=>a.startsWith(o)?i(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){let o=n;n=i=>r({className:i,parseClassName:o})}return n},fE=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,pE=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;let o=[],i=[];return n.forEach(a=>{a[0]==="["||t[a]?(o.push(...i.sort(),a),i=[]):i.push(a)}),o.push(...i.sort()),o}},gE=e=>({cache:dE(e.cacheSize),parseClassName:mE(e),sortModifiers:pE(e),...sE(e)}),hE=/\s+/,bE=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(hE),l="";for(let c=s.length-1;c>=0;c-=1){let u=s[c],{isExternal:d,modifiers:p,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:h}=r(u);if(d){l=u+(l.length>0?" "+l:l);continue}let w=!!h,T=n(w?x.substring(0,h):x);if(!T){if(!w){l=u+(l.length>0?" "+l:l);continue}if(T=n(x),!T){l=u+(l.length>0?" "+l:l);continue}w=!1}let b=i(p).join(":"),y=f?b+"!":b,g=y+T;if(a.includes(g))continue;a.push(g);let k=o(T,w);for(let S=0;S<k.length;++S){let P=k[S];a.push(y+P)}l=u+(l.length>0?" "+l:l)}return l};function yE(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Wb(t))&&(n&&(n+=" "),n+=r);return n}var Wb=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Wb(e[n]))&&(r&&(r+=" "),r+=t);return r};function zb(e,...t){let r,n,o,i=a;function a(l){let c=t.reduce((u,d)=>d(u),e());return r=gE(c),n=r.cache.get,o=r.cache.set,i=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=bE(l,r);return o(l,u),u}return function(){return i(yE.apply(null,arguments))}}var ot=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},qb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Yb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xE=/^\d+\/\d+$/,vE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wE=/\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$/,kE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,CE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,TE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ko=e=>xE.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),En=e=>!!e&&Number.isInteger(Number(e)),Gb=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),Xr=e=>vE.test(e),SE=()=>!0,EE=e=>wE.test(e)&&!kE.test(e),$c=()=>!1,PE=e=>CE.test(e),_E=e=>TE.test(e),IE=e=>!oe(e)&&!ie(e),AE=e=>Co(e,Zb,$c),oe=e=>qb.test(e),Pn=e=>Co(e,Jb,EE),Rc=e=>Co(e,VE,Ce),RE=e=>Co(e,Kb,$c),OE=e=>Co(e,Xb,_E),$E=e=>Co(e,$c,PE),ie=e=>Yb.test(e),cs=e=>To(e,Jb),NE=e=>To(e,zE),ME=e=>To(e,Kb),DE=e=>To(e,Zb),LE=e=>To(e,Xb),BE=e=>To(e,GE,!0),Co=(e,t,r)=>{let n=qb.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},To=(e,t,r=!1)=>{let n=Yb.exec(e);return n?n[1]?t(n[1]):r:!1},Kb=e=>e==="position",FE=new Set(["image","url"]),Xb=e=>FE.has(e),UE=new Set(["length","size","percentage"]),Zb=e=>UE.has(e),Jb=e=>e==="length",VE=e=>e==="number",zE=e=>e==="family-name",GE=e=>e==="shadow";var Hb=()=>{let e=ot("color"),t=ot("font"),r=ot("text"),n=ot("font-weight"),o=ot("tracking"),i=ot("leading"),a=ot("breakpoint"),s=ot("container"),l=ot("spacing"),c=ot("radius"),u=ot("shadow"),d=ot("inset-shadow"),p=ot("drop-shadow"),f=ot("blur"),x=ot("perspective"),h=ot("aspect"),w=ot("ease"),T=ot("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],g=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],S=()=>[ie,oe,l],P=()=>[ko,"full","auto",...S()],A=()=>[En,"none","subgrid",ie,oe],N=()=>["auto",{span:["full",En,ie,oe]},ie,oe],D=()=>[En,"auto",ie,oe],F=()=>["auto","min","max","fr",ie,oe],R=()=>["start","end","center","between","around","evenly","stretch","baseline"],M=()=>["start","end","center","stretch"],z=()=>["auto",...S()],K=()=>[ko,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],I=()=>[e,ie,oe],B=()=>[Gb,Pn],j=()=>["","none","full",c,ie,oe],he=()=>["",Ce,cs,Pn],le=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ge=()=>["","none",f,ie,oe],_e=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie,oe],jt=()=>["none",Ce,ie,oe],Me=()=>["none",Ce,ie,oe],gr=()=>[Ce,ie,oe],Nr=()=>[ko,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xr],breakpoint:[Xr],color:[SE],container:[Xr],"drop-shadow":[Xr],ease:["in","out","in-out"],font:[IE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xr],shadow:[Xr],spacing:["px",Ce],text:[Xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ko,oe,ie,h]}],container:["container"],columns:[{columns:[Ce,oe,ie,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:[...y(),oe,ie]}],overflow:[{overflow:g()}],"overflow-x":[{"overflow-x":g()}],"overflow-y":[{"overflow-y":g()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[En,"auto",ie,oe]}],basis:[{basis:[ko,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,ko,"auto","initial","none",oe]}],grow:[{grow:["",Ce,ie,oe]}],shrink:[{shrink:["",Ce,ie,oe]}],order:[{order:[En,"first","last","none",ie,oe]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...M(),"baseline"]}],"align-self":[{self:["auto",...M(),"baseline"]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen",...K()]}],"min-h":[{"min-h":["screen","none",...K()]}],"max-h":[{"max-h":["screen",...K()]}],"font-size":[{text:["base",r,cs,Pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ie,Rc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gb,oe]}],"font-family":[{font:[NE,oe,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,ie,oe]}],"line-clamp":[{"line-clamp":[Ce,"none",ie,Rc]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",ie,oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ie,Pn]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Ce,"auto",ie,oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie,oe]}],"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(),ME,RE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",DE,AE]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},En,ie,oe],radial:["",ie,oe],conic:[En,ie,oe]},LE,OE]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ie,oe]}],"outline-w":[{outline:["",Ce,cs,Pn]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,BE,$E]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",ie,oe,d]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Ce,Pn]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":I()}],opacity:[{opacity:[Ce,ie,oe]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none",ie,oe]}],blur:[{blur:Ge()}],brightness:[{brightness:[Ce,ie,oe]}],contrast:[{contrast:[Ce,ie,oe]}],"drop-shadow":[{"drop-shadow":["","none",p,ie,oe]}],grayscale:[{grayscale:["",Ce,ie,oe]}],"hue-rotate":[{"hue-rotate":[Ce,ie,oe]}],invert:[{invert:["",Ce,ie,oe]}],saturate:[{saturate:[Ce,ie,oe]}],sepia:[{sepia:["",Ce,ie,oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,oe]}],"backdrop-blur":[{"backdrop-blur":Ge()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ie,oe]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ie,oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ie,oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ie,oe]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ie,oe]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ie,oe]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ie,oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ie,oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ie,oe]}],ease:[{ease:["linear","initial",w,ie,oe]}],delay:[{delay:[Ce,ie,oe]}],animate:[{animate:["none",T,ie,oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ie,oe]}],"perspective-origin":[{"perspective-origin":_e()}],rotate:[{rotate:jt()}],"rotate-x":[{"rotate-x":jt()}],"rotate-y":[{"rotate-y":jt()}],"rotate-z":[{"rotate-z":jt()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:gr()}],"skew-x":[{"skew-x":gr()}],"skew-y":[{"skew-y":gr()}],transform:[{transform:[ie,oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:_e()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Nr()}],"translate-x":[{"translate-x":Nr()}],"translate-y":[{"translate-y":Nr()}],"translate-z":[{"translate-z":Nr()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",ie,oe]}],"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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",ie,oe]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Ce,cs,Pn,Rc]}],stroke:[{stroke:["none",...I()]}],"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-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-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:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},HE=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:i={}})=>(wi(e,"cacheSize",t),wi(e,"prefix",r),wi(e,"experimentalParseClassName",n),us(e.theme,i.theme),us(e.classGroups,i.classGroups),us(e.conflictingClassGroups,i.conflictingClassGroups),us(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),wi(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),ds(e.theme,o.theme),ds(e.classGroups,o.classGroups),ds(e.conflictingClassGroups,o.conflictingClassGroups),ds(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Qb(e,o,"orderSensitiveModifiers"),e),wi=(e,t,r)=>{r!==void 0&&(e[t]=r)},us=(e,t)=>{if(t)for(let r in t)wi(e,r,t[r])},ds=(e,t)=>{if(t)for(let r in t)Qb(e,t,r)},Qb=(e,t,r)=>{let n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},ey=(e,...t)=>typeof e=="function"?zb(Hb,e,...t):zb(()=>HE(Hb(),e),...t);var jE=ey({extend:{classGroups:{"border-w":["border-host-bubble","border-button","border-input"],"border-color":["border-host-bubble-border","border-button-border","border-input-border"]}}});function Zr(...e){return jE(q(e))}var WE=C('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),ms=e=>(()=>{var t=WE();return be(t,ce(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})();var qE=C("<button>"),fs=Ac("font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0 transition-[filter] duration-200",{variants:{variant:{primary:"makebot-button bg-button-bg text-button-text border-button-border rounded-button border-button blur-button shadow-button",secondary:"secondary-button bg-host-bubble-bg text-host-bubble-text rounded-host-bubble border-host-bubble border-host-bubble-border"},size:{icon:"text-sm size-6 pt-[3px]",sm:"py-2 px-4 text-sm",md:"py-2 px-4"}},defaultVariants:{variant:"primary",size:"md"}}),Ct=e=>{let t=ra(()=>e.children),[r,n]=De(e,["variant","size","isDisabled","isLoading"]);return(()=>{var o=qE();return be(o,ce(n,{get disabled(){return r.isDisabled||r.isLoading},get class(){return Zr(fs({variant:r.variant,size:r.size}),n.class)}}),!1,!0),v(o,m(U,{get when(){return!r.isLoading},get fallback(){return m(ms,{})},get children(){return t()}})),o})()};var YE="lg",Nc=qn(()=>YE),ps=()=>rn(Nc),ry=e=>{let[t,r]=O("lg"),n=new ResizeObserver(()=>{let o=e();o&&r(ty(o))});return ae(()=>{let o=e();o&&(r(ty(o)),n.observe(o))}),re(()=>{let o=e();o&&n.unobserve(o)}),t},ty=e=>{let t=e.clientWidth;return t<jo.xs?"xs":t<jo.sm?"sm":t<jo.md?"md":t<jo.lg?"lg":"xl"};var ki=async({apiHost:e,message:t,sessionId:r})=>{console.log("\u{1F50D} continueChatQuery - chamada:",{apiHost:e,message:t,sessionId:r});try{let n=`${pe(e)?e:dt()}/api/v1/sessions/${r}/continueChat`;console.log("\u{1F50D} continueChatQuery - URL:",n),console.log("\u{1F50D} continueChatQuery - payload:",{message:t});let o=await Lr.post(n,{json:{message:t},timeout:!1}).json();return console.log("\u{1F50D} continueChatQuery - resposta:",o),{data:o}}catch(n){return n?.response&&n.response.status===404?{error:{code:"NOT_FOUND",message:"Sess\xE3o n\xE3o encontrada.",status:404,type:"HTTP_ERROR"}}:{error:n}}};var Mc=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await Lr.post(`${pe(e)?e:dt()}/api/v2/sessions/${t}/clientLogs`,{json:{clientLogs:r}})}catch(n){console.log(n)}};var ny=e=>de(window.gtag)?Promise.resolve():new Promise(t=>{let r=document.getElementById("gtag");if(!r){let n=document.createElement("script");n.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,n.id="gtag";let o=document.createElement("script");o.innerHTML=`window.dataLayer = window.dataLayer || [];
15
+ </svg>`,n.body.appendChild(r)};function Xb(e,t){let{state:n,send:r,prop:o,scope:i,computed:a}=e,s=n.hasTag("focus"),l=a("isDisabled"),c=o("readOnly"),u=a("isValueEmpty"),d=a("isOutOfRange")||!!o("invalid"),f=l||!a("canIncrement")||c,p=l||!a("canDecrement")||c,y=o("translations");return{focused:s,invalid:d,empty:u,value:a("formattedValue"),valueAsNumber:a("valueAsNumber"),setValue(h){r({type:"VALUE.SET",value:h})},clearValue(){r({type:"VALUE.CLEAR"})},increment(){r({type:"VALUE.INCREMENT"})},decrement(){r({type:"VALUE.DECREMENT"})},setToMax(){r({type:"VALUE.SET",value:o("max")})},setToMin(){r({type:"VALUE.SET",value:o("min")})},focus(){ha(i)?.focus()},getRootProps(){return t.element({id:oE(i),...gr.root.attrs,dir:o("dir"),"data-disabled":be(l),"data-focus":be(s),"data-invalid":be(d)})},getLabelProps(){return t.label({...gr.label.attrs,dir:o("dir"),"data-disabled":be(l),"data-focus":be(s),"data-invalid":be(d),id:aE(i),htmlFor:ga(i)})},getControlProps(){return t.element({...gr.control.attrs,dir:o("dir"),role:"group","aria-disabled":l,"data-focus":be(s),"data-disabled":be(l),"data-invalid":be(d),"aria-invalid":Fn(d)})},getValueTextProps(){return t.element({...gr.valueText.attrs,dir:o("dir"),"data-disabled":be(l),"data-invalid":be(d),"data-focus":be(s)})},getInputProps(){return t.input({...gr.input.attrs,dir:o("dir"),name:o("name"),form:o("form"),id:ga(i),role:"spinbutton",defaultValue:a("formattedValue"),pattern:o("pattern"),inputMode:o("inputMode"),"aria-invalid":Fn(d),"data-invalid":be(d),disabled:l,"data-disabled":be(l),readOnly:c,required:o("required"),autoComplete:"off",autoCorrect:"off",spellCheck:"false",type:"text","aria-roledescription":"numberfield","aria-valuemin":o("min"),"aria-valuemax":o("max"),"aria-valuenow":Number.isNaN(a("valueAsNumber"))?void 0:a("valueAsNumber"),"aria-valuetext":a("valueText"),onFocus(){r({type:"INPUT.FOCUS"})},onBlur(){r({type:"INPUT.BLUR"})},onInput(h){r({type:"INPUT.CHANGE",target:h.currentTarget,hint:"set"})},onBeforeInput(h){try{let{selectionStart:k,selectionEnd:C,value:b}=h.currentTarget,T=b.slice(0,k)+(h.data??"")+b.slice(C);a("parser").isValidPartialNumber(T)||h.preventDefault()}catch{}},onKeyDown(h){if(h.defaultPrevented||c||Ap(h))return;let k=Op(h)*o("step"),b={ArrowUp(){r({type:"INPUT.ARROW_UP",step:k}),h.preventDefault()},ArrowDown(){r({type:"INPUT.ARROW_DOWN",step:k}),h.preventDefault()},Home(){ea(h)||(r({type:"INPUT.HOME"}),h.preventDefault())},End(){ea(h)||(r({type:"INPUT.END"}),h.preventDefault())},Enter(){r({type:"INPUT.ENTER"})}}[h.key];b?.(h)}})},getDecrementTriggerProps(){return t.button({...gr.decrementTrigger.attrs,dir:o("dir"),id:Zb(i),disabled:p,"data-disabled":be(p),"aria-label":y.decrementLabel,type:"button",tabIndex:-1,"aria-controls":ga(i),onPointerDown(h){p||!ru(h)||(r({type:"TRIGGER.PRESS_DOWN",hint:"decrement",pointerType:h.pointerType}),h.pointerType==="mouse"&&h.preventDefault(),h.pointerType==="touch"&&h.currentTarget?.focus({preventScroll:!0}))},onPointerUp(h){r({type:"TRIGGER.PRESS_UP",hint:"decrement",pointerType:h.pointerType})},onPointerLeave(){p||r({type:"TRIGGER.PRESS_UP",hint:"decrement"})}})},getIncrementTriggerProps(){return t.button({...gr.incrementTrigger.attrs,dir:o("dir"),id:qb(i),disabled:f,"data-disabled":be(f),"aria-label":y.incrementLabel,type:"button",tabIndex:-1,"aria-controls":ga(i),onPointerDown(h){f||!ru(h)||(r({type:"TRIGGER.PRESS_DOWN",hint:"increment",pointerType:h.pointerType}),h.pointerType==="mouse"&&h.preventDefault(),h.pointerType==="touch"&&h.currentTarget?.focus({preventScroll:!0}))},onPointerUp(h){r({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:h.pointerType})},onPointerLeave(h){r({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:h.pointerType})}})},getScrubberProps(){return t.element({...gr.scrubber.attrs,dir:o("dir"),"data-disabled":be(l),id:iE(i),role:"presentation",onMouseDown(h){if(l)return;let k=dr(h),b=bt(h.currentTarget).devicePixelRatio;k.x=k.x-Zo(7.5,b),k.y=k.y-Zo(7.5,b),r({type:"SCRUBBER.PRESS_DOWN",point:k}),h.preventDefault()},style:{cursor:l?void 0:"ew-resize"}})}}}function pE(e){if(!(!e||e.ownerDocument.activeElement!==e))try{let{selectionStart:t,selectionEnd:n,value:r}=e,o=r.substring(0,t),i=r.substring(n);return{start:t,end:n,value:r,beforeTxt:o,afterTxt:i}}catch{}}function gE(e,t){if(!(!e||e.ownerDocument.activeElement!==e)){if(!t){e.setSelectionRange(e.value.length,e.value.length);return}try{let{value:n}=e,{beforeTxt:r="",afterTxt:o="",start:i}=t,a=n.length;if(n.endsWith(o))a=n.length-o.length;else if(n.startsWith(r))a=r.length;else if(i!=null){let s=r[i-1],l=n.indexOf(s,i-1);l!==-1&&(a=l+1)}e.setSelectionRange(a,a)}catch{}}}var hE=(e,t={})=>new Intl.NumberFormat(e,t),bE=(e,t={})=>new ci(e,t),Nu=(e,t)=>{let{prop:n,computed:r}=t;return n("formatOptions")?r("parser").parse(String(e)):parseFloat(e)},Xr=(e,t)=>{let{prop:n,computed:r}=t;return Number.isNaN(e)?"":n("formatOptions")?r("formatter").format(e):e.toString()},yE=(e,t)=>{let n=e!==void 0&&!Number.isNaN(e)?e:1;return t?.style==="percent"&&(e===void 0||Number.isNaN(e))&&(n=.01),n},{choose:vE,guards:xE,createMachine:wE}=Bb(),{not:Gb,and:Hb}=xE,Jb=wE({props({props:e}){let t=yE(e.step,e.formatOptions);return{dir:"ltr",locale:"en-US",focusInputOnChange:!0,clampValueOnBlur:!e.allowOverflow,allowOverflow:!1,inputMode:"decimal",pattern:"[0-9]*(.[0-9]+)?",defaultValue:"",step:t,min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,spinOnPress:!0,...e,translations:{incrementLabel:"increment value",decrementLabel:"decrease value",...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t,getComputed:n}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(r){let o=n(),i=Nu(r,{computed:o,prop:e});e("onValueChange")?.({value:r,valueAsNumber:i})}})),hint:t(()=>({defaultValue:null})),scrubberCursorPoint:t(()=>({defaultValue:null,hash(r){return r?`x:${r.x}, y:${r.y}`:""}})),fieldsetDisabled:t(()=>({defaultValue:!1}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",valueAsNumber:({context:e,computed:t,prop:n})=>Nu(e.get("value"),{computed:t,prop:n}),formattedValue:({computed:e,prop:t})=>Xr(e("valueAsNumber"),{computed:e,prop:t}),isAtMin:({computed:e,prop:t})=>yp(e("valueAsNumber"),t("min")),isAtMax:({computed:e,prop:t})=>bp(e("valueAsNumber"),t("max")),isOutOfRange:({computed:e,prop:t})=>!vp(e("valueAsNumber"),t("min"),t("max")),isValueEmpty:({context:e})=>e.get("value")==="",isDisabled:({prop:e,context:t})=>!!e("disabled")||t.get("fieldsetDisabled"),canIncrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMax"),canDecrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMin"),valueText:({prop:e,context:t})=>e("translations").valueText?.(t.get("value")),formatter:Pu(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>hE(e,t)),parser:Pu(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>bE(e,t))},watch({track:e,action:t,context:n,computed:r,prop:o}){e([()=>n.get("value"),()=>o("locale")],()=>{t(["syncInputElement"])}),e([()=>r("isOutOfRange")],()=>{t(["invokeOnInvalid"])}),e([()=>n.hash("scrubberCursorPoint")],()=>{t(["setVirtualCursorPosition"])})},effects:["trackFormControl"],on:{"VALUE.SET":{actions:["setRawValue"]},"VALUE.CLEAR":{actions:["clearValue"]},"VALUE.INCREMENT":{actions:["increment"]},"VALUE.DECREMENT":{actions:["decrement"]}},states:{idle:{on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","invokeOnFocus","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","invokeOnFocus","setHint","setCursorPoint"]},"INPUT.FOCUS":{target:"focused",actions:["focusInput","invokeOnFocus"]}}},focused:{tags:["focus"],effects:["attachWheelListener"],on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","setHint","setCursorPoint"]},"INPUT.ARROW_UP":{actions:["increment"]},"INPUT.ARROW_DOWN":{actions:["decrement"]},"INPUT.HOME":{actions:["decrementToMin"]},"INPUT.END":{actions:["incrementToMax"]},"INPUT.CHANGE":{actions:["setValue","setHint"]},"INPUT.BLUR":[{guard:Hb("clampValueOnBlur",Gb("isInRange")),target:"idle",actions:["setClampedValue","clearHint","invokeOnBlur"]},{guard:Gb("isInRange"),target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur","invokeOnInvalid"]},{target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur"]}],"INPUT.ENTER":{actions:["setFormattedValue","clearHint","invokeOnBlur"]}}},"before:spin":{tags:["focus"],effects:["trackButtonDisabled","waitForChangeDelay"],entry:vE([{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}]),on:{CHANGE_DELAY:{target:"spinning",guard:Hb("isInRange","spinOnPress")},"TRIGGER.PRESS_UP":[{guard:"isTouchPointer",target:"focused",actions:["clearHint"]},{target:"focused",actions:["focusInput","clearHint"]}]}},spinning:{tags:["focus"],effects:["trackButtonDisabled","spinValue"],on:{SPIN:[{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}],"TRIGGER.PRESS_UP":{target:"focused",actions:["focusInput","clearHint"]}}},scrubbing:{tags:["focus"],effects:["activatePointerLock","trackMousemove","setupVirtualCursor","preventTextSelection"],on:{"SCRUBBER.POINTER_UP":{target:"focused",actions:["focusInput","clearCursorPoint"]},"SCRUBBER.POINTER_MOVE":[{guard:"isIncrementHint",actions:["increment","setCursorPoint"]},{guard:"isDecrementHint",actions:["decrement","setCursorPoint"]}]}}},implementations:{guards:{clampValueOnBlur:({prop:e})=>e("clampValueOnBlur"),spinOnPress:({prop:e})=>!!e("spinOnPress"),isInRange:({computed:e})=>!e("isOutOfRange"),isDecrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="decrement",isIncrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="increment",isTouchPointer:({event:e})=>e.pointerType==="touch"},effects:{waitForChangeDelay({send:e}){let t=setTimeout(()=>{e({type:"CHANGE_DELAY"})},300);return()=>clearTimeout(t)},spinValue({send:e}){let t=setInterval(()=>{e({type:"SPIN"})},50);return()=>clearInterval(t)},trackFormControl({context:e,scope:t}){let n=ha(t);return $p(n,{onFieldsetDisabledChange(r){e.set("fieldsetDisabled",r)},onFormReset(){e.set("value",e.initial("value"))}})},setupVirtualCursor({context:e,scope:t}){let n=e.get("scrubberCursorPoint");return uE(t,n)},preventTextSelection({scope:e}){return dE(e)},trackButtonDisabled({context:e,scope:t,send:n}){let r=e.get("hint"),o=cE(t,r);return Bs(o,{attributes:["disabled"],callback(){n({type:"TRIGGER.PRESS_UP",src:"attr"})}})},attachWheelListener({scope:e,send:t,prop:n}){let r=ha(e);if(!r||!e.isActiveElement(r)||!n("allowMouseWheel"))return;function o(i){i.preventDefault();let a=Math.sign(i.deltaY)*-1;a===1?t({type:"VALUE.INCREMENT"}):a===-1&&t({type:"VALUE.DECREMENT"})}return Me(r,"wheel",o,{passive:!1})},activatePointerLock({scope:e}){if(!eu())return Vp(e.getDoc())},trackMousemove({scope:e,send:t,context:n,computed:r}){let o=e.getDoc();function i(s){let l=n.get("scrubberCursorPoint"),c=r("isRtl"),u=mE(e,{point:l,isRtl:c,event:s});u.hint&&t({type:"SCRUBBER.POINTER_MOVE",hint:u.hint,point:u.point})}function a(){t({type:"SCRUBBER.POINTER_UP"})}return dn(Me(o,"mousemove",i,!1),Me(o,"mouseup",a,!1))}},actions:{focusInput({scope:e,prop:t}){if(!t("focusInputOnChange"))return;let n=ha(e);e.isActiveElement(n)||Pe(()=>n?.focus({preventScroll:!0}))},increment({context:e,event:t,prop:n,computed:r}){let o=kp(r("valueAsNumber"),t.step??n("step"));n("allowOverflow")||(o=ur(o,n("min"),n("max"))),e.set("value",Xr(o,{computed:r,prop:n}))},decrement({context:e,event:t,prop:n,computed:r}){let o=Tp(r("valueAsNumber"),t.step??n("step"));n("allowOverflow")||(o=ur(o,n("min"),n("max"))),e.set("value",Xr(o,{computed:r,prop:n}))},setClampedValue({context:e,prop:t,computed:n}){let r=ur(n("valueAsNumber"),t("min"),t("max"));e.set("value",Xr(r,{computed:n,prop:t}))},setRawValue({context:e,event:t,prop:n,computed:r}){let o=Nu(t.value,{computed:r,prop:n});n("allowOverflow")||(o=ur(o,n("min"),n("max"))),e.set("value",Xr(o,{computed:r,prop:n}))},setValue({context:e,event:t}){let n=t.target?.value??t.value;e.set("value",n)},clearValue({context:e}){e.set("value","")},incrementToMax({context:e,prop:t,computed:n}){let r=Xr(t("max"),{computed:n,prop:t});e.set("value",r)},decrementToMin({context:e,prop:t,computed:n}){let r=Xr(t("min"),{computed:n,prop:t});e.set("value",r)},setHint({context:e,event:t}){e.set("hint",t.hint)},clearHint({context:e}){e.set("hint",null)},invokeOnFocus({computed:e,prop:t}){t("onFocusChange")?.({focused:!0,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnBlur({computed:e,prop:t}){t("onFocusChange")?.({focused:!1,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnInvalid({computed:e,prop:t,event:n}){if(n.type==="INPUT.CHANGE")return;let r=e("valueAsNumber")>t("max")?"rangeOverflow":"rangeUnderflow";t("onValueInvalid")?.({reason:r,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},syncInputElement({context:e,event:t,computed:n,scope:r}){let o=t.type.endsWith("CHANGE")?e.get("value"):n("formattedValue"),i=ha(r),a=pE(i);Pe(()=>{Np(i,o),gE(i,a)})},setFormattedValue({context:e,computed:t}){e.set("value",t("formattedValue"))},setCursorPoint({context:e,event:t}){e.set("scrubberCursorPoint",t.point)},clearCursorPoint({context:e}){e.set("scrubberCursorPoint",null)},setVirtualCursorPosition({context:e,scope:t}){let n=Kb(t),r=e.get("scrubberCursorPoint");!n||!r||(n.style.transform=`translate3d(${r.x}px, ${r.y}px, 0px)`)}}}}),kE=ut()(["allowMouseWheel","allowOverflow","clampValueOnBlur","dir","disabled","focusInputOnChange","form","formatOptions","getRootNode","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","required","readOnly","spinOnPress","step","translations","value","defaultValue"]),cD=Tt(kE);var[Qb,Gn]=je({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),ey=e=>e.children(Gn()),ty=e=>{let t=Gn(),n=j(()=>t().getControlProps(),e);return m(Z.div,n)},ny=e=>{let t=Gn(),n=j(()=>t().getDecrementTriggerProps(),e);return m(Z.button,n)},ry=e=>{let t=Gn(),n=j(()=>t().getIncrementTriggerProps(),e);return m(Z.button,n)},oy=e=>{let t=Gn(),n=j(()=>t().getInputProps(),e),r=bn();return m(Z.input,ge({get"aria-describedby"(){return r?.().ariaDescribedby}},n))},iy=e=>{let t=Gn(),n=j(()=>t().getLabelProps(),e);return m(Z.label,n)},ll=e=>{let t=Qe(),n=tn(),r=dt(),o=bn(),i=re(()=>({id:t,ids:{label:o?.().ids.label,input:o?.().ids.control},disabled:o?.().disabled,readOnly:o?.().readOnly,required:o?.().required,invalid:o?.().invalid,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...Ct(e)})),a=Rt(Jb,i);return re(()=>Xb(a,Ot))},ay=e=>{let[t,n]=Be()(e,["allowMouseWheel","allowOverflow","clampValueOnBlur","defaultValue","disabled","focusInputOnChange","form","formatOptions","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","readOnly","required","spinOnPress","step","translations","value"]),r=ll(t),o=j(()=>r().getRootProps(),n);return m(Qb,{value:r,get children(){return m(Z.div,o)}})},sy=e=>{let[{value:t},n]=Be()(e,["value"]),r=j(()=>t().getRootProps(),n);return m(Qb,{value:t,get children(){return m(Z.div,r)}})},ly=e=>{let t=Gn(),n=j(()=>t().getScrubberProps(),e);return m(Z.div,n)},cy=e=>{let t=Gn(),n=j(()=>t().getValueTextProps(),e);return m(Z.span,n)},hr={};_t(hr,{Context:()=>ey,Control:()=>ty,DecrementTrigger:()=>ny,IncrementTrigger:()=>ry,Input:()=>oy,Label:()=>iy,Root:()=>ay,RootProvider:()=>sy,Scrubber:()=>ly,ValueText:()=>cy});var uy=at("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Jr=uy.build(),dy=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,my=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,$u=e=>e.ids?.content??`dialog:${e.id}:content`,fy=e=>e.ids?.trigger??`dialog:${e.id}:trigger`,Mu=e=>e.ids?.title??`dialog:${e.id}:title`,Du=e=>e.ids?.description??`dialog:${e.id}:description`,py=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,cl=e=>e.getById($u(e)),SE=e=>e.getById(dy(e)),CE=e=>e.getById(my(e)),_E=e=>e.getById(fy(e)),EE=e=>e.getById(Mu(e)),PE=e=>e.getById(Du(e)),IE=e=>e.getById(py(e));function gy(e,t){let{state:n,send:r,context:o,prop:i,scope:a}=e,s=i("aria-label"),l=n.matches("open");return{open:l,setOpen(c){n.matches("open")!==c&&r({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...Jr.trigger.attrs,dir:i("dir"),id:fy(a),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":$u(a),onClick(c){c.defaultPrevented||r({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...Jr.backdrop.attrs,dir:i("dir"),hidden:!l,id:my(a),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...Jr.positioner.attrs,dir:i("dir"),id:dy(a),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){let c=o.get("rendered");return t.element({...Jr.content.attrs,dir:i("dir"),role:i("role"),hidden:!l,id:$u(a),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":s||void 0,"aria-labelledby":s||!c.title?void 0:Mu(a),"aria-describedby":c.description?Du(a):void 0})},getTitleProps(){return t.element({...Jr.title.attrs,dir:i("dir"),id:Mu(a)})},getDescriptionProps(){return t.element({...Jr.description.attrs,dir:i("dir"),id:Du(a)})},getCloseTriggerProps(){return t.button({...Jr.closeTrigger.attrs,dir:i("dir"),id:py(a),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),r({type:"CLOSE"}))}})}}}var hy={props({props:e,scope:t}){let n=e.role==="alertdialog";return{role:"dialog",modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:n?()=>IE(t):void 0,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return Qs(()=>cl(e),{defer:!0,pointerBlocking:n("modal"),exclude:[_E(e)],onInteractOutside(o){n("onInteractOutside")?.(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onEscapeKeyDown(o){n("onEscapeKeyDown")?.(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return vb(e.getDoc())},trapFocus({scope:e,prop:t}){return!t("trapFocus")||!t("modal")?void 0:nh(()=>cl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>t("finalFocusEl")?.()??r})},hideContentBelow({scope:e,prop:t}){return t("modal")?yb(()=>[cl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){Pe(()=>{e.set("rendered",{title:!!EE(t),description:!!PE(t)})})},syncZIndex({scope:e}){Pe(()=>{let t=cl(e);if(!t)return;let n=mn(t);[SE(e),CE(e)].forEach(o=>{o?.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}},AE=ut()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),AD=Tt(AE);var[by,Hn]=je({hookName:"useDialogContext",providerName:"<DialogProvider />"}),yy=e=>{let t=Hn(),n=tp(),r=Ur(j(n,()=>({present:t().open}))),o=j(()=>t().getBackdropProps(),()=>r().presenceProps,e);return m(U,{get when(){return!r().unmounted},get children(){return m(Z.div,ge(o,{ref(i){var a=lr(r().ref,e.ref);typeof a=="function"&&a(i)}}))}})},vy=e=>{let t=Hn(),n=j(()=>t().getCloseTriggerProps(),e);return m(Z.button,n)},xy=e=>{let t=Hn(),n=mr(),r=j(()=>t().getContentProps(),()=>n().presenceProps,e);return m(U,{get when(){return!n().unmounted},get children(){return m(Z.div,ge(r,{ref(o){var i=lr(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},wy=e=>e.children(Hn()),ky=e=>{let t=Hn(),n=j(()=>t().getDescriptionProps(),e);return m(Z.div,n)},Ty=e=>{let t=Hn(),n=mr(),r=j(()=>t().getPositionerProps(),e);return m(U,{get when(){return!n().unmounted},get children(){return m(Z.div,r)}})},Sy=e=>{let t=Qe(),n=tn(),r=dt(),o=re(()=>({id:t,dir:n().dir,getRootNode:r().getRootNode,...Ct(e)})),i=Rt(hy,o);return re(()=>gy(i,Ot))},Cy=e=>{let[t,n]=Qo(e),[r]=Xi(t),[o,i]=Be()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=Sy(o),s=Ur(j(t,()=>({present:a().open})));return m(by,{value:a,get children(){return m(Gc,{value:r,get children(){return m(ei,{value:s,get children(){return i.children}})}})}})},_y=e=>{let[t,n]=Qo(e),[r]=Xi(t),o=Ur(j(t,()=>({present:n.value().open})));return m(by,{get value(){return n.value},get children(){return m(Gc,{value:r,get children(){return m(ei,{value:o,get children(){return n.children}})}})}})},Ey=e=>{let t=Hn(),n=j(()=>t().getTitleProps(),e);return m(Z.h2,n)},Py=e=>{let t=Hn(),n=mr(),r=j(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return m(Z.button,r)},br={};_t(br,{Backdrop:()=>yy,CloseTrigger:()=>vy,Content:()=>xy,Context:()=>wy,Description:()=>ky,Positioner:()=>Ty,Root:()=>Cy,RootProvider:()=>_y,Title:()=>Ey,Trigger:()=>Py});function OE(e){let t=mn(e),n=e.getBoundingClientRect(),r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),o=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),i=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function s(f,p){let y=parseFloat(f);return/%/.test(f)&&(y/=100,y*=p),Number.isNaN(y)?0:y}let l=s(r,n.width),c=s(o,n.height),u=s(i,n.width),d=s(a,n.height);return{x:{before:l,after:u},y:{before:c,after:d}}}function NE(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function Ry(e){let t=[];for(let n of e.children)t=t.concat(n,Ry(n));return t}function Oy(e,t=!1){let n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},o=t?Ry(e):e.children;for(let i of["x","y"]){let a=i==="x"?"y":"x",s=i==="x"?"left":"top",l=i==="x"?"width":"height",c=i==="x"?"scrollLeft":"scrollTop";for(let u of o){let d=u.getBoundingClientRect();if(!NE(n,d,a))continue;let f=mn(u),[p,y]=f.getPropertyValue("scroll-snap-align").split(" ");typeof y>"u"&&(y=p);let h=i==="x"?y:p,k=d[s]-n[s]+e[c];switch(h){case"none":break;case"start":r[i].start.push({node:u,position:k});break;case"center":r[i].center.push({node:u,position:k+d[l]/2});break;case"end":r[i].end.push({node:u,position:k+d[l]});break}}}return r}function Lu(e){let t=e.getBoundingClientRect(),n=OE(e),r=Oy(e),o={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Iy([...r.x.start.map(i=>i.position-n.x.before),...r.x.center.map(i=>i.position-t.width/2),...r.x.end.map(i=>i.position-t.width+n.x.after)].map(Ay(0,o.x))),y:Iy([...r.y.start.map(i=>i.position-n.y.before),...r.y.center.map(i=>i.position-t.height/2),...r.y.end.map(i=>i.position-t.height+n.y.after)].map(Ay(0,o.y)))}}function Ny(e,t,n){let r=Oy(e),o=[...r[t].start,...r[t].center,...r[t].end];for(let i of o)if(n(i.node))return i.position}var Iy=e=>[...new Set(e)],Ay=(e,t)=>n=>Math.max(e,Math.min(t,n));var Dy=at("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),Wn=Dy.build(),$E=e=>e.ids?.root??`carousel:${e.id}`,ME=(e,t)=>e.ids?.item?.(t)??`carousel:${e.id}:item:${t}`,ul=e=>e.ids?.itemGroup??`carousel:${e.id}:item-group`,DE=e=>e.ids?.nextTrigger??`carousel:${e.id}:next-trigger`,LE=e=>e.ids?.prevTrigger??`carousel:${e.id}:prev-trigger`,BE=e=>e.ids?.indicatorGroup??`carousel:${e.id}:indicator-group`,Ly=(e,t)=>e.ids?.indicator?.(t)??`carousel:${e.id}:indicator:${t}`,zt=e=>e.getById(ul(e)),$y=e=>Us(zt(e),"[data-part=item]"),FE=(e,t)=>e.getById(Ly(e,t)),My=e=>{let t=zt(e);if(!t)return;let n=Lr(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function By(e,t){let{state:n,context:r,computed:o,send:i,scope:a,prop:s}=e,l=n.matches("autoplay"),c=n.matches("dragging"),u=o("canScrollNext"),d=o("canScrollPrev"),f=o("isHorizontal"),p=Array.from(r.get("pageSnapPoints")),y=r.get("page"),h=s("slidesPerPage"),k=s("padding"),C=s("translations");return{isPlaying:l,isDragging:c,page:y,pageSnapPoints:p,canScrollNext:u,canScrollPrev:d,getProgress(){return y/p.length},scrollToIndex(b,T){i({type:"INDEX.SET",index:b,instant:T})},scrollTo(b,T){i({type:"PAGE.SET",index:b,instant:T})},scrollNext(b){i({type:"PAGE.NEXT",instant:b})},scrollPrev(b){i({type:"PAGE.PREV",instant:b})},play(){i({type:"AUTOPLAY.START"})},pause(){i({type:"AUTOPLAY.PAUSE"})},isInView(b){return Array.from(r.get("slidesInView")).includes(b)},refresh(){i({type:"SNAP.REFRESH"})},getRootProps(){return t.element({...Wn.root.attrs,id:$E(a),role:"region","aria-roledescription":"carousel","data-orientation":s("orientation"),dir:s("dir"),style:{"--slides-per-page":h,"--slide-spacing":s("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}})},getItemGroupProps(){return t.element({...Wn.itemGroup.attrs,id:ul(a),"data-orientation":s("orientation"),"data-dragging":be(c),dir:s("dir"),"aria-live":l?"off":"polite",onFocus(b){Ds(b)&&i({type:"VIEWPORT.FOCUS"})},onBlur(b){Vt(b.currentTarget,b.relatedTarget)||i({type:"VIEWPORT.BLUR"})},onMouseDown(b){if(!s("allowMouseDrag")||b.button!==0||b.defaultPrevented)return;let T=it(b);en(T)&&T!==b.currentTarget||(b.preventDefault(),i({type:"DRAGGING.START"}))},onWheel:gp(b=>{let T=s("orientation")==="horizontal"?"deltaX":"deltaY";b[T]<0&&!o("canScrollPrev")||b[T]>0&&!o("canScrollNext")||i({type:"USER.SCROLL"})},150),onTouchStart(){i({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[f?"x":"y",s("snapType")].join(" "),gridAutoFlow:f?"column":"row",scrollbarWidth:"none",overscrollBehavior:"contain",[f?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[f?"scrollPaddingInline":"scrollPaddingBlock"]:k,[f?"paddingInline":"paddingBlock"]:k,[f?"overflowX":"overflowY"]:"auto"}})},getItemProps(b){let T=r.get("slidesInView").includes(b.index);return t.element({...Wn.item.attrs,id:ME(a,b.index),dir:s("dir"),role:"group","data-index":b.index,"data-inview":be(T),"aria-roledescription":"slide","data-orientation":s("orientation"),"aria-label":C.item(b.index,s("slideCount")),"aria-hidden":Fn(!T),style:{scrollSnapAlign:(()=>{let g=b.snapAlign??"start",x=s("slidesPerMove"),S=x==="auto"?Math.floor(s("slidesPerPage")):x;return(b.index+S)%S===0?g:void 0})()}})},getControlProps(){return t.element({...Wn.control.attrs,"data-orientation":s("orientation")})},getPrevTriggerProps(){return t.button({...Wn.prevTrigger.attrs,id:LE(a),type:"button",disabled:!d,dir:s("dir"),"aria-label":C.prevTrigger,"data-orientation":s("orientation"),"aria-controls":ul(a),onClick(b){b.defaultPrevented||i({type:"PAGE.PREV",src:"trigger"})}})},getNextTriggerProps(){return t.button({...Wn.nextTrigger.attrs,dir:s("dir"),id:DE(a),type:"button","aria-label":C.nextTrigger,"data-orientation":s("orientation"),"aria-controls":ul(a),disabled:!u,onClick(b){b.defaultPrevented||i({type:"PAGE.NEXT",src:"trigger"})}})},getIndicatorGroupProps(){return t.element({...Wn.indicatorGroup.attrs,dir:s("dir"),id:BE(a),"data-orientation":s("orientation"),onKeyDown(b){if(b.defaultPrevented)return;let T="indicator",g={ArrowDown(P){f||(i({type:"PAGE.NEXT",src:T}),P.preventDefault())},ArrowUp(P){f||(i({type:"PAGE.PREV",src:T}),P.preventDefault())},ArrowRight(P){f&&(i({type:"PAGE.NEXT",src:T}),P.preventDefault())},ArrowLeft(P){f&&(i({type:"PAGE.PREV",src:T}),P.preventDefault())},Home(P){i({type:"PAGE.SET",index:0,src:T}),P.preventDefault()},End(P){i({type:"PAGE.SET",index:p.length-1,src:T}),P.preventDefault()}},x=ta(b,{dir:s("dir"),orientation:s("orientation")}),S=g[x];S?.(b)}})},getIndicatorProps(b){return t.button({...Wn.indicator.attrs,dir:s("dir"),id:Ly(a,b.index),type:"button","data-orientation":s("orientation"),"data-index":b.index,"data-readonly":be(b.readOnly),"data-current":be(b.index===y),"aria-label":C.indicator(b.index),onClick(T){T.defaultPrevented||b.readOnly||i({type:"PAGE.SET",index:b.index,src:"indicator"})}})},getAutoplayTriggerProps(){return t.button({...Wn.autoplayTrigger.attrs,type:"button","data-orientation":s("orientation"),"data-pressed":be(l),"aria-label":l?C.autoplayStop:C.autoplayStart,onClick(b){b.defaultPrevented||i({type:l?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}})}}}var Fy={props({props:e}){return Ps(e,["slideCount"],"carousel"),{dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6,...e,translations:{nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation",...e.translations}}},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){let i=n().get("pageSnapPoints");e("onPageChange")?.({page:r,pageSnapPoint:i[r]})}})),pageSnapPoints:t(()=>({defaultValue:UE(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{let t=e("autoplay");return _s(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(zt(e))},effects:{autoUpdateSlide({computed:e,send:t}){let n=setInterval(()=>{t({type:"AUTOPLAY.TICK",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){let n=zt(e);if(!n)return;let r=e.getWin(),o=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),My(e)});return My(e),o.observe(n,{childList:!0,subtree:!0}),()=>o.disconnect()},trackSlideResize({scope:e,send:t}){if(!zt(e))return;let r=e.getWin(),o=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};Pe(()=>{o(),Pe(()=>{t({type:"PAGE.SCROLL",instant:!0})})});let i=new r.ResizeObserver(o);return $y(e).forEach(a=>i.observe(a)),()=>i.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){let r=zt(e),o=e.getWin(),i=new o.IntersectionObserver(a=>{let s=a.reduce((l,c)=>{let u=c.target,d=Number(u.dataset.index??"-1");return d==null||Number.isNaN(d)||d===-1?l:c.isIntersecting?lp(l,d):cp(l,d)},n.get("slidesInView"));n.set("slidesInView",up(s))},{root:r,threshold:t("inViewThreshold")});return $y(e).forEach(a=>i.observe(a)),()=>i.disconnect()},trackScroll({send:e,refs:t,scope:n}){let r=zt(n);return r?Me(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){let n=e.getDoc();return Me(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){let n=e.getDoc();return jp(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){let r=e.getWin();return Me(r,"keydown",i=>{switch(i.key){case"ArrowRight":i.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":i.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":i.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":i.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:o}){let i=t.instant?"instant":"smooth",a=ur(t.index??e.get("page"),0,e.get("pageSnapPoints").length-1),s=zt(n);if(!s)return;let l=r("isHorizontal")?"left":"top";o(()=>{s.scrollTo({[l]:e.get("pageSnapPoints")[a],behavior:i})})},setClosestPage({context:e,scope:t,computed:n}){let r=zt(t);if(!r)return;let o=n("isHorizontal")?r.scrollLeft:r.scrollTop,i=e.get("pageSnapPoints").findIndex(a=>Math.abs(a-o)<1);i!==-1&&e.set("page",i)},setNextPage({context:e,prop:t,state:n}){let r=n.matches("autoplay")||t("loop"),o=Cs(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setPrevPage({context:e,prop:t,state:n}){let r=n.matches("autoplay")||t("loop"),o=qc(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",o)},setMatchingPage({context:e,event:t,computed:n,scope:r}){let o=zt(r);if(!o)return;let i=Ny(o,n("isHorizontal")?"x":"y",s=>s.dataset.index===t.index.toString());if(i==null)return;let a=e.get("pageSnapPoints").findIndex(s=>Math.abs(s-i)<1);e.set("page",a)},setPage({context:e,event:t}){let n=t.index??e.get("page");e.set("page",n)},clampPage({context:e}){let t=ur(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){let r=zt(n);if(!r)return;let o=Lu(r);e.set("pageSnapPoints",t("isHorizontal")?o.x:o.y)},disableScrollSnap({scope:e}){let t=zt(e);if(!t)return;let n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){zt(e)?.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){let r=zt(e);if(!r)return;let o=r.scrollLeft,i=r.scrollTop,a=Lu(r),s=a.x.reduce((c,u)=>Math.abs(u-o)<Math.abs(c-o)?u:c,a.x[0]),l=a.y.reduce((c,u)=>Math.abs(u-i)<Math.abs(c-i)?u:c,a.y[0]);Pe(()=>{r.scrollTo({left:s,top:l,behavior:"smooth"});let c=n("isHorizontal")?s:l;t.set("page",t.get("pageSnapPoints").indexOf(c));let u=r.dataset.scrollSnapType;u&&(r.style.setProperty("scroll-snap-type",u),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;let r=FE(n,e.get("page"));r&&Pe(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function UE(e,t,n){if(e==null)return[];let r=[],o=t==="auto"?Math.floor(n):t;for(let i=0;i<e-1;i+=o)r.push(i);return r}var VE=ut()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),JD=Tt(VE),jE=ut()(["index","readOnly"]),QD=Tt(jE),zE=ut()(["index","snapAlign"]),eL=Tt(zE);var[Uy,Rn]=je({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),Vy=e=>{let t=Rn(),n=j(()=>t().getAutoplayTriggerProps(),e);return m(Z.button,n)},jy=e=>e.children(Rn()),zy=e=>{let t=Rn(),n=j(()=>t().getControlProps(),e);return m(Z.div,n)},Gy=e=>{let[t,n]=Be()(e,["index","readOnly"]),r=Rn(),o=j(()=>r().getIndicatorProps(t),n);return m(Z.button,o)},Hy=e=>{let t=Rn(),n=j(()=>t().getIndicatorGroupProps(),e);return m(Z.div,n)},Wy=e=>{let[t,n]=Be()(e,["index","snapAlign"]),r=Rn(),o=j(()=>r().getItemProps(t),n);return m(Z.div,o)},qy=e=>{let t=Rn(),n=j(()=>t().getItemGroupProps(),e);return m(Z.div,n)},Zy=e=>{let t=Rn(),n=j(()=>t().getNextTriggerProps(),e);return m(Z.button,n)},Yy=e=>{let t=Rn(),n=j(()=>t().getPrevTriggerProps(),e);return m(Z.button,n)},Ky=e=>{let t=Qe(),n=tn(),r=dt(),o=re(()=>({id:t,dir:n().dir,getRootNode:r().getRootNode,...Ct(e)})),i=Rt(Fy,o);return re(()=>By(i,Ot))},Xy=e=>{let[t,n]=Be()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),r=Ky(t),o=j(()=>r().getRootProps(),n);return m(Uy,{value:r,get children(){return m(Z.div,o)}})},Jy=e=>{let[{value:t},n]=Be()(e,["value"]),r=j(()=>t().getRootProps(),n);return m(Uy,{value:t,get children(){return m(Z.div,r)}})},qn={};_t(qn,{AutoplayTrigger:()=>Vy,Context:()=>jy,Control:()=>zy,Indicator:()=>Gy,IndicatorGroup:()=>Hy,Item:()=>Wy,ItemGroup:()=>qy,NextTrigger:()=>Zy,PrevTrigger:()=>Yy,Root:()=>Xy,RootProvider:()=>Jy});var Wt=xu({placement:"bottom-end",gap:24});var dl=e=>Number(e)>=6;function Qy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Qy(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ev(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Qy(e))&&(r&&(r+=" "),r+=t);return r}var tv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,q=ev,Bu=(e,t)=>n=>{var r;if(t?.variants==null)return q(e,n?.class,n?.className);let{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{let u=n?.[c],d=i?.[c];if(u===null)return null;let f=tv(u)||tv(d);return o[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[h,k]=y;return Array.isArray(k)?k.includes({...i,...s}[h]):{...i,...s}[h]===k})?[...c,d,f]:c},[]);return q(e,a,l,n?.class,n?.className)};var HE=e=>{let t=qE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let s=a.split("-");return s[0]===""&&s.length!==1&&s.shift(),sv(s,t)||WE(a)},getConflictingClassGroupIds:(a,s)=>{let l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},sv=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?sv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join("-");return t.validators.find(({validator:a})=>a(i))?.classGroupId},nv=/^\[(.+)\]$/,WE=e=>{if(nv.test(e)){let t=nv.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qE=e=>{let{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(let o in n)Uu(n[o],r,o,t);return r},Uu=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:rv(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(ZE(o)){Uu(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Uu(a,rv(t,i),n,r)})})},rv=(e,t)=>{let n=e;return t.split("-").forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ZE=e=>e.isThemeGetter,YE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}};var KE=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=o=>{let i=[],a=0,s=0,l=0,c;for(let y=0;y<o.length;y++){let h=o[y];if(a===0&&s===0){if(h===":"){i.push(o.slice(l,y)),l=y+1;continue}if(h==="/"){c=y;continue}}h==="["?a++:h==="]"?a--:h==="("?s++:h===")"&&s--}let u=i.length===0?o:o.substring(l),d=XE(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){let o=t+":",i=r;r=a=>a.startsWith(o)?i(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){let o=r;r=i=>n({className:i,parseClassName:o})}return r},XE=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,JE=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;let o=[],i=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...i.sort(),a),i=[]):i.push(a)}),o.push(...i.sort()),o}},QE=e=>({cache:YE(e.cacheSize),parseClassName:KE(e),sortModifiers:JE(e),...HE(e)}),eP=/\s+/,tP=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(eP),l="";for(let c=s.length-1;c>=0;c-=1){let u=s[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:h}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let k=!!h,C=r(k?y.substring(0,h):y);if(!C){if(!k){l=u+(l.length>0?" "+l:l);continue}if(C=r(y),!C){l=u+(l.length>0?" "+l:l);continue}k=!1}let b=i(f).join(":"),T=p?b+"!":b,g=T+C;if(a.includes(g))continue;a.push(g);let x=o(C,k);for(let S=0;S<x.length;++S){let P=x[S];a.push(T+P)}l=u+(l.length>0?" "+l:l)}return l};function nP(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=lv(t))&&(r&&(r+=" "),r+=n);return r}var lv=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=lv(e[r]))&&(n&&(n+=" "),n+=t);return n};function ov(e,...t){let n,r,o,i=a;function a(l){let c=t.reduce((u,d)=>d(u),e());return n=QE(c),r=n.cache.get,o=n.cache.set,i=s,s(l)}function s(l){let c=r(l);if(c)return c;let u=tP(l,n);return o(l,u),u}return function(){return i(nP.apply(null,arguments))}}var mt=e=>{let t=n=>n[e]||[];return t.isThemeGetter=!0,t},cv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rP=/^\d+\/\d+$/,oP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iP=/\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$/,aP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ui=e=>rP.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Qr=e=>!!e&&Number.isInteger(Number(e)),iv=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),yr=e=>oP.test(e),cP=()=>!0,uP=e=>iP.test(e)&&!aP.test(e),Vu=()=>!1,dP=e=>sP.test(e),mP=e=>lP.test(e),fP=e=>!se(e)&&!le(e),pP=e=>di(e,fv,Vu),se=e=>cv.test(e),eo=e=>di(e,pv,uP),Fu=e=>di(e,CP,Ie),gP=e=>di(e,dv,Vu),hP=e=>di(e,mv,mP),bP=e=>di(e,Vu,dP),le=e=>uv.test(e),ml=e=>mi(e,pv),yP=e=>mi(e,_P),vP=e=>mi(e,dv),xP=e=>mi(e,fv),wP=e=>mi(e,mv),kP=e=>mi(e,EP,!0),di=(e,t,n)=>{let r=cv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mi=(e,t,n=!1)=>{let r=uv.exec(e);return r?r[1]?t(r[1]):n:!1},dv=e=>e==="position",TP=new Set(["image","url"]),mv=e=>TP.has(e),SP=new Set(["length","size","percentage"]),fv=e=>SP.has(e),pv=e=>e==="length",CP=e=>e==="number",_P=e=>e==="family-name",EP=e=>e==="shadow";var av=()=>{let e=mt("color"),t=mt("font"),n=mt("text"),r=mt("font-weight"),o=mt("tracking"),i=mt("leading"),a=mt("breakpoint"),s=mt("container"),l=mt("spacing"),c=mt("radius"),u=mt("shadow"),d=mt("inset-shadow"),f=mt("drop-shadow"),p=mt("blur"),y=mt("perspective"),h=mt("aspect"),k=mt("ease"),C=mt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],g=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],S=()=>[le,se,l],P=()=>[ui,"full","auto",...S()],R=()=>[Qr,"none","subgrid",le,se],N=()=>["auto",{span:["full",Qr,le,se]},le,se],D=()=>[Qr,"auto",le,se],F=()=>["auto","min","max","fr",le,se],A=()=>["start","end","center","between","around","evenly","stretch","baseline"],M=()=>["start","end","center","stretch"],V=()=>["auto",...S()],Y=()=>[ui,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],I=()=>[e,le,se],B=()=>[iv,eo],H=()=>["","none","full",c,le,se],we=()=>["",Ie,ml,eo],de=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ye=()=>["","none",p,le,se],Le=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le,se],cn=()=>["none",Ie,le,se],He=()=>["none",Ie,le,se],$n=()=>[Ie,le,se],nr=()=>[ui,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yr],breakpoint:[yr],color:[cP],container:[yr],"drop-shadow":[yr],ease:["in","out","in-out"],font:[fP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yr],shadow:[yr],spacing:["px",Ie],text:[yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ui,se,le,h]}],container:["container"],columns:[{columns:[Ie,se,le,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:[...T(),se,le]}],overflow:[{overflow:g()}],"overflow-x":[{"overflow-x":g()}],"overflow-y":[{"overflow-y":g()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Qr,"auto",le,se]}],basis:[{basis:[ui,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,ui,"auto","initial","none",se]}],grow:[{grow:["",Ie,le,se]}],shrink:[{shrink:["",Ie,le,se]}],order:[{order:[Qr,"first","last","none",le,se]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...M(),"baseline"]}],"align-self":[{self:["auto",...M(),"baseline"]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[s,"screen",...Y()]}],"min-w":[{"min-w":[s,"screen","none",...Y()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen",...Y()]}],"min-h":[{"min-h":["screen","none",...Y()]}],"max-h":[{"max-h":["screen",...Y()]}],"font-size":[{text:["base",n,ml,eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,le,Fu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",iv,se]}],"font-family":[{font:[yP,se,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,le,se]}],"line-clamp":[{"line-clamp":[Ie,"none",le,Fu]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",le,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",le,eo]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Ie,"auto",le,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),vP,gP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",xP,pP]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qr,le,se],radial:["",le,se],conic:[Qr,le,se]},wP,hP]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:we()}],"border-w-x":[{"border-x":we()}],"border-w-y":[{"border-y":we()}],"border-w-s":[{"border-s":we()}],"border-w-e":[{"border-e":we()}],"border-w-t":[{"border-t":we()}],"border-w-r":[{"border-r":we()}],"border-w-b":[{"border-b":we()}],"border-w-l":[{"border-l":we()}],"divide-x":[{"divide-x":we()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":we()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,le,se]}],"outline-w":[{outline:["",Ie,ml,eo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,kP,bP]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",le,se,d]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Ie,eo]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":we()}],"inset-ring-color":[{"inset-ring":I()}],opacity:[{opacity:[Ie,le,se]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none",le,se]}],blur:[{blur:Ye()}],brightness:[{brightness:[Ie,le,se]}],contrast:[{contrast:[Ie,le,se]}],"drop-shadow":[{"drop-shadow":["","none",f,le,se]}],grayscale:[{grayscale:["",Ie,le,se]}],"hue-rotate":[{"hue-rotate":[Ie,le,se]}],invert:[{invert:["",Ie,le,se]}],saturate:[{saturate:[Ie,le,se]}],sepia:[{sepia:["",Ie,le,se]}],"backdrop-filter":[{"backdrop-filter":["","none",le,se]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,le,se]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,le,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,le,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,le,se]}],"backdrop-invert":[{"backdrop-invert":["",Ie,le,se]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,le,se]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,le,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,le,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",le,se]}],ease:[{ease:["linear","initial",k,le,se]}],delay:[{delay:[Ie,le,se]}],animate:[{animate:["none",C,le,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,le,se]}],"perspective-origin":[{"perspective-origin":Le()}],rotate:[{rotate:cn()}],"rotate-x":[{"rotate-x":cn()}],"rotate-y":[{"rotate-y":cn()}],"rotate-z":[{"rotate-z":cn()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:$n()}],"skew-x":[{"skew-x":$n()}],"skew-y":[{"skew-y":$n()}],transform:[{transform:[le,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:Le()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:nr()}],"translate-x":[{"translate-x":nr()}],"translate-y":[{"translate-y":nr()}],"translate-z":[{"translate-z":nr()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",le,se]}],"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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",le,se]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Ie,ml,eo,Fu]}],stroke:[{stroke:["none",...I()]}],"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-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-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:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},PP=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:o={},override:i={}})=>(ba(e,"cacheSize",t),ba(e,"prefix",n),ba(e,"experimentalParseClassName",r),fl(e.theme,i.theme),fl(e.classGroups,i.classGroups),fl(e.conflictingClassGroups,i.conflictingClassGroups),fl(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),ba(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),pl(e.theme,o.theme),pl(e.classGroups,o.classGroups),pl(e.conflictingClassGroups,o.conflictingClassGroups),pl(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),gv(e,o,"orderSensitiveModifiers"),e),ba=(e,t,n)=>{n!==void 0&&(e[t]=n)},fl=(e,t)=>{if(t)for(let n in t)ba(e,n,t[n])},pl=(e,t)=>{if(t)for(let n in t)gv(e,t,n)},gv=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},hv=(e,...t)=>typeof e=="function"?ov(av,e,...t):ov(()=>PP(av(),e),...t);var IP=hv({extend:{classGroups:{"border-w":["border-host-bubble","border-button","border-input"],"border-color":["border-host-bubble-border","border-button-border","border-input-border"]}}});function vr(...e){return IP(q(e))}var AP=w('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),gl=e=>(()=>{var t=AP();return Ce(t,ge(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})();var RP=w("<button>"),hl=Bu("font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0 transition-[filter] duration-200",{variants:{variant:{primary:"makebot-button bg-button-bg text-button-text border-button-border rounded-button border-button blur-button shadow-button",secondary:"secondary-button bg-host-bubble-bg text-host-bubble-text rounded-host-bubble border-host-bubble border-host-bubble-border"},size:{icon:"text-sm size-6 pt-[3px]",sm:"py-2 px-4 text-sm",md:"py-2 px-4"}},defaultVariants:{variant:"primary",size:"md"}}),yt=e=>{let t=is(()=>e.children),[n,r]=qe(e,["variant","size","isDisabled","isLoading"]);return(()=>{var o=RP();return Ce(o,ge(r,{get disabled(){return n.isDisabled||n.isLoading},get class(){return vr(hl({variant:n.variant,size:n.size}),r.class)}}),!1,!0),v(o,m(U,{get when(){return!n.isLoading},get fallback(){return m(gl,{})},get children(){return t()}})),o})()};var OP="lg",ju=Do(()=>OP),bl=()=>Ir(ju),yv=e=>{let[t,n]=O("lg"),r=new ResizeObserver(()=>{let o=e();o&&n(bv(o))});return me(()=>{let o=e();o&&(n(bv(o)),r.observe(o))}),ie(()=>{let o=e();o&&r.unobserve(o)}),t},bv=e=>{let t=e.clientWidth;return t<Vi.xs?"xs":t<Vi.sm?"sm":t<Vi.md?"md":t<Vi.lg?"lg":"xl"};var ya=async({apiHost:e,message:t,sessionId:n})=>{console.log("\u{1F50D} continueChatQuery - chamada:",{apiHost:e,message:t,sessionId:n});try{let r=`${Ue(e)?e:kt()}/api/v1/sessions/${n}/continueChat`;console.log("\u{1F50D} continueChatQuery - URL:",r),console.log("\u{1F50D} continueChatQuery - payload:",{message:t});let o=await ir.post(r,{json:{message:t},timeout:!1}).json();return console.log("\u{1F50D} continueChatQuery - resposta:",o),{data:o}}catch(r){return r?.response&&r.response.status===404?{error:{code:"NOT_FOUND",message:"Sess\xE3o n\xE3o encontrada.",status:404,type:"HTTP_ERROR"}}:{error:r}}};var zu=async({apiHost:e,sessionId:t,clientLogs:n})=>{try{await ir.post(`${Ue(e)?e:kt()}/api/v2/sessions/${t}/clientLogs`,{json:{clientLogs:n}})}catch(r){console.log(r)}};var vv=e=>ye(window.gtag)?Promise.resolve():new Promise(t=>{let n=document.getElementById("gtag");if(!n){let r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,r.id="gtag";let o=document.createElement("script");o.innerHTML=`window.dataLayer = window.dataLayer || [];
16
16
  function gtag(){dataLayer.push(arguments);}
17
17
  gtag('js', new Date());
18
18
 
19
19
  gtag('config', '${e}');
20
- `,document.body.appendChild(n),document.body.appendChild(o),n.onload=()=>{t()}}r&&t()}),oy=e=>{if(e){if(!window.gtag){console.error("Google Analytics was not properly initialized");return}window.gtag("event",e.action,{event_category:Ue(e.category)?void 0:e.category,event_label:Ue(e.label)?void 0:e.label,value:e.value,send_to:Ue(e.sendTo)?void 0:e.sendTo})}};var iy=async e=>{e?.trackingId&&oy(e)};var ay=async e=>{let{url:t,method:r,body:n,headers:o}=e;try{let i=await fetch(t,{method:r,body:r!=="GET"&&n?JSON.stringify(n):void 0,headers:o}),a=i.status,s=await i.json();return JSON.stringify({statusCode:a,data:s})}catch(i){return console.error(i),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}};var KE=Symbol("Let zodToJsonSchema decide on which parser to use");var Ti={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Si={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Ei={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Pi={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},_i={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},JE=[Ti,Si,Ei,Pi,_i],S8={[Ti.code]:Ti,[Si.code]:Si,[Ei.code]:Ei,[Pi.code]:Pi,[_i.code]:_i},E8={[Ti.name]:Ti.code,[Si.name]:Si.code,[Ei.name]:Ei.code,[Pi.name]:Pi.code,[_i.name]:_i.code},P8=JE.map(e=>e.code);var QE={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},eP={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},tP={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},rP={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},nP={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},oP={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},iP={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},aP={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},sP={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},lP={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},cP={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},uP={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},dP={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},mP={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},fP={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},pP={code:"k",name:"file",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string"||!("mimeType"in e)||typeof e.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}},Dc=[QE,eP,tP,rP,nP,oP,iP,aP,sP,lP,cP,uP,dP,mP,fP,pP],gP=Object.fromEntries(Dc.map(e=>[e.code,e])),_8=Object.fromEntries(Dc.map(e=>[e.name,e.code])),hP=Dc.map(e=>e.code),bP=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!hP.includes(r))throw new Error(`Failed to parse stream string. Invalid code ${r}.`);let n=r,o=e.slice(t+1),i=JSON.parse(o);return gP[n].parse(i)};var yP=10;function xP(e,t){let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return e.length=0,r}async function sy({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:n,onRedactedReasoningPart:o,onSourcePart:i,onFilePart:a,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:c,onToolCallDeltaPart:u,onToolCallPart:d,onToolResultPart:p,onMessageAnnotationsPart:f,onFinishMessagePart:x,onFinishStepPart:h,onStartStepPart:w}){let T=e.getReader(),b=new TextDecoder,y=[],g=0;for(;;){let{value:k}=await T.read();if(k&&(y.push(k),g+=k.length,k[k.length-1]!==yP))continue;if(y.length===0)break;let S=xP(y,g);g=0;let P=b.decode(S,{stream:!0}).split(`
21
- `).filter(A=>A!=="").map(bP);for(let{type:A,value:N}of P)switch(A){case"text":await t?.(N);break;case"reasoning":await r?.(N);break;case"reasoning_signature":await n?.(N);break;case"redacted_reasoning":await o?.(N);break;case"file":await a?.(N);break;case"source":await i?.(N);break;case"data":await s?.(N);break;case"error":await l?.(N);break;case"message_annotations":await f?.(N);break;case"tool_call_streaming_start":await c?.(N);break;case"tool_call_delta":await u?.(N);break;case"tool_call":await d?.(N);break;case"tool_result":await p?.(N);break;case"finish_message":await x?.(N);break;case"finish_step":await h?.(N);break;case"start_step":await w?.(N);break;default:{let D=A;throw new Error(`Unknown stream part type: ${D}`)}}}}var A8=Symbol.for("vercel.ai.schema");var Jr=async({err:e,context:t})=>{try{return typeof e=="string"?{context:t,description:e,details:void 0}:e instanceof Error?"response"in e&&typeof e.response=="object"&&e.response&&"text"in e.response&&typeof e.response.text=="function"?{context:t,description:e.message,details:JSON.stringify(await e.response.text())}:{context:t,description:e.message,details:typeof e.cause=="string"?e.cause:JSON.stringify(e.cause)}:{context:t,description:JSON.stringify(e)}}catch{return{context:t,description:"Erro desconhecido (falha na an\xE1lise)"}}};var gs=null,vP=3,wP=1,Lc=e=>async({messages:t,onMessageStream:r,onError:n})=>{try{gs=new AbortController;let o=e.apiHost,i=await fetch((pe(o)?o:dt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:gs.signal});if(!i.ok)return(e.retryAttempt??0)<wP&&(i.status===403||i.status===500||i.status===503)?(await new Promise(l=>setTimeout(l,vP*1e3)),Lc({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:r})):{error:{description:"Falha ao buscar o streaming do chat",details:await i.text(),context:"Durante o streaming do chat"}};if(!i.body)return{error:{description:"O corpo da resposta do fluxo do chat est\xE1 vazio"}};let a="",s=We();return await sy({stream:i.body,onTextPart:async l=>{a+=l,r&&r({id:s,message:a})},onErrorPart:l=>{n?.(JSON.parse(l))}}),gs=null,{message:a}}catch(o){return console.error(o),o.name==="AbortError"?(gs=null,{error:{description:"Solicita\xE7\xE3o anulada"}}):{error:await Jr({err:o,context:"Durante o streaming do chat"})}}};var ly=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
20
+ `,document.body.appendChild(r),document.body.appendChild(o),r.onload=()=>{t()}}n&&t()}),xv=e=>{if(e){if(!window.gtag){console.error("Google Analytics was not properly initialized");return}window.gtag("event",e.action,{event_category:ct(e.category)?void 0:e.category,event_label:ct(e.label)?void 0:e.label,value:e.value,send_to:ct(e.sendTo)?void 0:e.sendTo})}};var wv=async e=>{e?.trackingId&&xv(e)};var kv=async e=>{let{url:t,method:n,body:r,headers:o}=e;try{let i=await fetch(t,{method:n,body:n!=="GET"&&r?JSON.stringify(r):void 0,headers:o}),a=i.status,s=await i.json();return JSON.stringify({statusCode:a,data:s})}catch(i){return console.error(i),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}};var NP=Symbol("Let zodToJsonSchema decide on which parser to use");var Oe;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Oe||(Oe={}));var Hu;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Hu||(Hu={}));var ne=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xr=e=>{switch(typeof e){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(e)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(e)?ne.array:e===null?ne.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ne.promise:typeof Map<"u"&&e instanceof Map?ne.map:typeof Set<"u"&&e instanceof Set?ne.set:typeof Date<"u"&&e instanceof Date?ne.date:ne.object;default:return ne.unknown}},z=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$P=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),qt=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};qt.create=e=>new qt(e);var gi=(e,t)=>{let n;switch(e.code){case z.invalid_type:e.received===ne.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case z.invalid_union:n="Invalid input";break;case z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case z.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case z.invalid_arguments:n="Invalid function arguments";break;case z.invalid_return_type:n="Invalid function return type";break;case z.invalid_date:n="Invalid date";break;case z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Oe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case z.custom:n="Invalid input";break;case z.invalid_intersection_types:n="Intersection results could not be merged";break;case z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case z.not_finite:n="Number must be finite";break;default:n=t.defaultError,Oe.assertNever(e)}return{message:n}},Cv=gi;function MP(e){Cv=e}function yl(){return Cv}var vl=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},DP=[];function J(e,t){let n=yl(),r=vl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===gi?void 0:gi].filter(o=>!!o)});e.common.issues.push(r)}var Et=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let o of n){if(o.status==="aborted")return xe;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n){let i=await o.key,a=await o.value;r.push({key:i,value:a})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:t.value,value:r}}},xe=Object.freeze({status:"aborted"}),pi=e=>({status:"dirty",value:e}),Mt=e=>({status:"valid",value:e}),Wu=e=>e.status==="aborted",qu=e=>e.status==="dirty",wa=e=>e.status==="valid",ka=e=>typeof Promise<"u"&&e instanceof Promise;function xl(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function _v(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(fe||(fe={}));var va,xa,sn=class{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Tv=(e,t)=>{if(wa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new qt(e.common.issues);return this._error=n,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,s)=>{var l,c;let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:s.defaultError}},description:o}}var Se=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return xr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Et,ctx:{common:t.parent.common,data:t.data,parsedType:xr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ka(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let o={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xr(t)},i=this._parseSync({data:t,path:o.path,parent:o});return Tv(o,i)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xr(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(ka(o)?o:Promise.resolve(o));return Tv(r,i)}refine(t,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:z.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Zt({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return an.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kn.create(this,this._def)}promise(){return Tr.create(this,this._def)}or(t){return so.create([this,t],this._def)}and(t){return lo.create(this,t,this._def)}transform(t){return new Zt({...Te(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new po({...Te(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Ta({typeName:ve.ZodBranded,type:this,...Te(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new go({...Te(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Sa.create(this,t)}readonly(){return ho.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},LP=/^c[^\s-]{8,}$/i,BP=/^[0-9a-z]+$/,FP=/^[0-9A-HJKMNP-TV-Z]{26}$/,UP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,VP=/^[a-z0-9_-]{21}$/i,jP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gu,HP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WP=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,qP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ev="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ZP=new RegExp(`^${Ev}$`);function Pv(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function YP(e){return new RegExp(`^${Pv(e)}$`)}function Iv(e){let t=`${Ev}T${Pv(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function KP(e,t){return!!((t==="v4"||!t)&&HP.test(e)||(t==="v6"||!t)&&WP.test(e))}var wr=class e extends Se{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ne.string){let i=this._getOrReturnCtx(t);return J(i,{code:z.invalid_type,expected:ne.string,received:i.parsedType}),xe}let r=new Et,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:z.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:z.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?J(o,{code:z.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&J(o,{code:z.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")zP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"email",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Gu||(Gu=new RegExp(GP,"u")),Gu.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"emoji",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")UP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"uuid",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")VP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"nanoid",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")LP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")BP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid2",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")FP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ulid",code:z.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),J(o,{validation:"url",code:z.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"regex",code:z.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Iv(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?ZP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?YP(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:z.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?jP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"duration",code:z.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?KP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ip",code:z.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?qP.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"base64",code:z.invalid_string,message:i.message}),r.dirty()):Oe.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:z.invalid_string,...fe.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...fe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...fe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...fe.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...fe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...fe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...fe.errToObj(n)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};wr.create=e=>{var t;return new wr({checks:[],typeName:ve.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Te(e)})};function XP(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return i%a/Math.pow(10,o)}var to=class e extends Se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ne.number){let i=this._getOrReturnCtx(t);return J(i,{code:z.invalid_type,expected:ne.number,received:i.parsedType}),xe}let r,o=new Et;for(let i of this._def.checks)i.kind==="int"?Oe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),J(r,{code:z.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?XP(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),J(r,{code:z.not_finite,message:i.message}),o.dirty()):Oe.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fe.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:fe.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Oe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};to.create=e=>new to({checks:[],typeName:ve.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var no=class e extends Se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ne.bigint){let i=this._getOrReturnCtx(t);return J(i,{code:z.invalid_type,expected:ne.bigint,received:i.parsedType}),xe}let r,o=new Et;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),J(r,{code:z.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Oe.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fe.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:fe.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};no.create=e=>{var t;return new no({checks:[],typeName:ve.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Te(e)})};var ro=class extends Se{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ne.boolean){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.boolean,received:r.parsedType}),xe}return Mt(t.data)}};ro.create=e=>new ro({typeName:ve.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var oo=class e extends Se{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ne.date){let i=this._getOrReturnCtx(t);return J(i,{code:z.invalid_type,expected:ne.date,received:i.parsedType}),xe}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return J(i,{code:z.invalid_date}),xe}let r=new Et,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:z.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:z.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Oe.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};oo.create=e=>new oo({checks:[],coerce:e?.coerce||!1,typeName:ve.ZodDate,...Te(e)});var hi=class extends Se{_parse(t){if(this._getType(t)!==ne.symbol){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.symbol,received:r.parsedType}),xe}return Mt(t.data)}};hi.create=e=>new hi({typeName:ve.ZodSymbol,...Te(e)});var io=class extends Se{_parse(t){if(this._getType(t)!==ne.undefined){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.undefined,received:r.parsedType}),xe}return Mt(t.data)}};io.create=e=>new io({typeName:ve.ZodUndefined,...Te(e)});var ao=class extends Se{_parse(t){if(this._getType(t)!==ne.null){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.null,received:r.parsedType}),xe}return Mt(t.data)}};ao.create=e=>new ao({typeName:ve.ZodNull,...Te(e)});var kr=class extends Se{constructor(){super(...arguments),this._any=!0}_parse(t){return Mt(t.data)}};kr.create=e=>new kr({typeName:ve.ZodAny,...Te(e)});var Yn=class extends Se{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Mt(t.data)}};Yn.create=e=>new Yn({typeName:ve.ZodUnknown,...Te(e)});var yn=class extends Se{_parse(t){let n=this._getOrReturnCtx(t);return J(n,{code:z.invalid_type,expected:ne.never,received:n.parsedType}),xe}};yn.create=e=>new yn({typeName:ve.ZodNever,...Te(e)});var bi=class extends Se{_parse(t){if(this._getType(t)!==ne.undefined){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.void,received:r.parsedType}),xe}return Mt(t.data)}};bi.create=e=>new bi({typeName:ve.ZodVoid,...Te(e)});var Kn=class e extends Se{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ne.array)return J(n,{code:z.invalid_type,expected:ne.array,received:n.parsedType}),xe;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(a||s)&&(J(n,{code:a?z.too_big:z.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(J(n,{code:z.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(J(n,{code:z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>o.type._parseAsync(new sn(n,a,n.path,s)))).then(a=>Et.mergeArray(r,a));let i=[...n.data].map((a,s)=>o.type._parseSync(new sn(n,a,n.path,s)));return Et.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:fe.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:fe.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:fe.toString(n)}})}nonempty(t){return this.min(1,t)}};Kn.create=(e,t)=>new Kn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Te(t)});function fi(e){if(e instanceof Gt){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=an.create(fi(r))}return new Gt({...e._def,shape:()=>t})}else return e instanceof Kn?new Kn({...e._def,type:fi(e.element)}):e instanceof an?an.create(fi(e.unwrap())):e instanceof Nn?Nn.create(fi(e.unwrap())):e instanceof On?On.create(e.items.map(t=>fi(t))):e}var Gt=class e extends Se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Oe.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ne.object){let c=this._getOrReturnCtx(t);return J(c,{code:z.invalid_type,expected:ne.object,received:c.parsedType}),xe}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yn&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new sn(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof yn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")s.length>0&&(J(o,{code:z.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new sn(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>Et.mergeObjectSync(r,c)):Et.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,a,s;let l=(a=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=fe.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return Oe.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return Oe.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return fi(this)}partial(t){let n={};return Oe.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return Oe.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof an;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return Av(Oe.objectKeys(this.shape))}};Gt.create=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strip",catchall:yn.create(),typeName:ve.ZodObject,...Te(t)});Gt.strictCreate=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strict",catchall:yn.create(),typeName:ve.ZodObject,...Te(t)});Gt.lazycreate=(e,t)=>new Gt({shape:e,unknownKeys:"strip",catchall:yn.create(),typeName:ve.ZodObject,...Te(t)});var so=class extends Se{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new qt(s.ctx.common.issues));return J(n,{code:z.invalid_union,unionErrors:a}),xe}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(l=>new qt(l));return J(n,{code:z.invalid_union,unionErrors:s}),xe}}get options(){return this._def.options}};so.create=(e,t)=>new so({options:e,typeName:ve.ZodUnion,...Te(t)});var Zn=e=>e instanceof co?Zn(e.schema):e instanceof Zt?Zn(e.innerType()):e instanceof uo?[e.value]:e instanceof mo?e.options:e instanceof fo?Oe.objectValues(e.enum):e instanceof po?Zn(e._def.innerType):e instanceof io?[void 0]:e instanceof ao?[null]:e instanceof an?[void 0,...Zn(e.unwrap())]:e instanceof Nn?[null,...Zn(e.unwrap())]:e instanceof Ta||e instanceof ho?Zn(e.unwrap()):e instanceof go?Zn(e._def.innerType):[],wl=class e extends Se{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.object)return J(n,{code:z.invalid_type,expected:ne.object,received:n.parsedType}),xe;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(J(n,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let o=new Map;for(let i of n){let a=Zn(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Te(r)})}};function Zu(e,t){let n=xr(e),r=xr(t);if(e===t)return{valid:!0,data:e};if(n===ne.object&&r===ne.object){let o=Oe.objectKeys(t),i=Oe.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let l=Zu(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===ne.array&&r===ne.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],l=Zu(a,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ne.date&&r===ne.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var lo=class extends Se{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,a)=>{if(Wu(i)||Wu(a))return xe;let s=Zu(i.value,a.value);return s.valid?((qu(i)||qu(a))&&n.dirty(),{status:n.value,value:s.data}):(J(r,{code:z.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};lo.create=(e,t,n)=>new lo({left:e,right:t,typeName:ve.ZodIntersection,...Te(n)});var On=class e extends Se{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.array)return J(r,{code:z.invalid_type,expected:ne.array,received:r.parsedType}),xe;if(r.data.length<this._def.items.length)return J(r,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&r.data.length>this._def.items.length&&(J(r,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new sn(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>Et.mergeArray(n,a)):Et.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};On.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new On({items:e,typeName:ve.ZodTuple,rest:null,...Te(t)})};var kl=class e extends Se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.object)return J(r,{code:z.invalid_type,expected:ne.object,received:r.parsedType}),xe;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in r.data)o.push({key:i._parse(new sn(r,s,r.path,s)),value:a._parse(new sn(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Et.mergeObjectAsync(n,o):Et.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Se?new e({keyType:t,valueType:n,typeName:ve.ZodRecord,...Te(r)}):new e({keyType:wr.create(),valueType:t,typeName:ve.ZodRecord,...Te(n)})}},yi=class extends Se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.map)return J(r,{code:z.invalid_type,expected:ne.map,received:r.parsedType}),xe;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:o._parse(new sn(r,s,r.path,[c,"key"])),value:i._parse(new sn(r,l,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return xe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return xe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};yi.create=(e,t,n)=>new yi({valueType:t,keyType:e,typeName:ve.ZodMap,...Te(n)});var vi=class e extends Se{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.set)return J(r,{code:z.invalid_type,expected:ne.set,received:r.parsedType}),xe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(J(r,{code:z.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(J(r,{code:z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return xe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...r.data.values()].map((l,c)=>i._parse(new sn(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:fe.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:fe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};vi.create=(e,t)=>new vi({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Te(t)});var Tl=class e extends Se{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.function)return J(n,{code:z.invalid_type,expected:ne.function,received:n.parsedType}),xe;function r(s,l){return vl({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yl(),gi].filter(c=>!!c),issueData:{code:z.invalid_arguments,argumentsError:l}})}function o(s,l){return vl({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yl(),gi].filter(c=>!!c),issueData:{code:z.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Tr){let s=this;return Mt(async function(...l){let c=new qt([]),u=await s._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(o(d,p)),c})})}else{let s=this;return Mt(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new qt([r(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new qt([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:On.create(t).rest(Yn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||On.create([]).rest(Yn.create()),returns:n||Yn.create(),typeName:ve.ZodFunction,...Te(r)})}},co=class extends Se{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};co.create=(e,t)=>new co({getter:e,typeName:ve.ZodLazy,...Te(t)});var uo=class extends Se{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return J(n,{received:n.data,code:z.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}};uo.create=(e,t)=>new uo({value:e,typeName:ve.ZodLiteral,...Te(t)});function Av(e,t){return new mo({values:e,typeName:ve.ZodEnum,...Te(t)})}var mo=class e extends Se{constructor(){super(...arguments),va.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return J(n,{expected:Oe.joinValues(r),received:n.parsedType,code:z.invalid_type}),xe}if(xl(this,va,"f")||_v(this,va,new Set(this._def.values),"f"),!xl(this,va,"f").has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return J(n,{received:n.data,code:z.invalid_enum_value,options:r}),xe}return Mt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};va=new WeakMap;mo.create=Av;var fo=class extends Se{constructor(){super(...arguments),xa.set(this,void 0)}_parse(t){let n=Oe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){let o=Oe.objectValues(n);return J(r,{expected:Oe.joinValues(o),received:r.parsedType,code:z.invalid_type}),xe}if(xl(this,xa,"f")||_v(this,xa,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!xl(this,xa,"f").has(t.data)){let o=Oe.objectValues(n);return J(r,{received:r.data,code:z.invalid_enum_value,options:o}),xe}return Mt(t.data)}get enum(){return this._def.values}};xa=new WeakMap;fo.create=(e,t)=>new fo({values:e,typeName:ve.ZodNativeEnum,...Te(t)});var Tr=class extends Se{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.promise&&n.common.async===!1)return J(n,{code:z.invalid_type,expected:ne.promise,received:n.parsedType}),xe;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return Mt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Tr.create=(e,t)=>new Tr({type:e,typeName:ve.ZodPromise,...Te(t)});var Zt=class extends Se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{J(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return xe;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?xe:l.status==="dirty"||n.value==="dirty"?pi(l.value):l});{if(n.value==="aborted")return xe;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?xe:s.status==="dirty"||n.value==="dirty"?pi(s.value):s}}if(o.type==="refinement"){let a=s=>{let l=o.refinement(s,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!wa(a))return a;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>wa(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:n.value,value:s})):a);Oe.assertNever(o)}};Zt.create=(e,t,n)=>new Zt({schema:e,typeName:ve.ZodEffects,effect:t,...Te(n)});Zt.createWithPreprocess=(e,t,n)=>new Zt({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Te(n)});var an=class extends Se{_parse(t){return this._getType(t)===ne.undefined?Mt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};an.create=(e,t)=>new an({innerType:e,typeName:ve.ZodOptional,...Te(t)});var Nn=class extends Se{_parse(t){return this._getType(t)===ne.null?Mt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Nn.create=(e,t)=>new Nn({innerType:e,typeName:ve.ZodNullable,...Te(t)});var po=class extends Se{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};po.create=(e,t)=>new po({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var go=class extends Se{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ka(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qt(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};go.create=(e,t)=>new go({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var xi=class extends Se{_parse(t){if(this._getType(t)!==ne.nan){let r=this._getOrReturnCtx(t);return J(r,{code:z.invalid_type,expected:ne.nan,received:r.parsedType}),xe}return{status:"valid",value:t.data}}};xi.create=e=>new xi({typeName:ve.ZodNaN,...Te(e)});var JP=Symbol("zod_brand"),Ta=class extends Se{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Sa=class e extends Se{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),pi(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:ve.ZodPipeline})}},ho=class extends Se{_parse(t){let n=this._def.innerType._parse(t),r=o=>(wa(o)&&(o.value=Object.freeze(o.value)),o);return ka(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};ho.create=(e,t)=>new ho({innerType:e,typeName:ve.ZodReadonly,...Te(t)});function Rv(e,t={},n){return e?kr.create().superRefine((r,o)=>{var i,a;if(!e(r)){let s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(i=s.fatal)!==null&&i!==void 0?i:n)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;o.addIssue({code:"custom",...c,fatal:l})}}):kr.create()}var QP={object:Gt.lazycreate},ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));var e2=(e,t={message:`Input not instance of ${e.name}`})=>Rv(n=>n instanceof e,t),Ov=wr.create,Nv=to.create,t2=xi.create,n2=no.create,$v=ro.create,r2=oo.create,o2=hi.create,i2=io.create,a2=ao.create,s2=kr.create,l2=Yn.create,c2=yn.create,u2=bi.create,d2=Kn.create,m2=Gt.create,f2=Gt.strictCreate,p2=so.create,g2=wl.create,h2=lo.create,b2=On.create,y2=kl.create,v2=yi.create,x2=vi.create,w2=Tl.create,k2=co.create,T2=uo.create,S2=mo.create,C2=fo.create,_2=Tr.create,Sv=Zt.create,E2=an.create,P2=Nn.create,I2=Zt.createWithPreprocess,A2=Sa.create,R2=()=>Ov().optional(),O2=()=>Nv().optional(),N2=()=>$v().optional(),$2={string:(e=>wr.create({...e,coerce:!0})),number:(e=>to.create({...e,coerce:!0})),boolean:(e=>ro.create({...e,coerce:!0})),bigint:(e=>no.create({...e,coerce:!0})),date:(e=>oo.create({...e,coerce:!0}))},M2=xe,ue=Object.freeze({__proto__:null,defaultErrorMap:gi,setErrorMap:MP,getErrorMap:yl,makeIssue:vl,EMPTY_PATH:DP,addIssueToContext:J,ParseStatus:Et,INVALID:xe,DIRTY:pi,OK:Mt,isAborted:Wu,isDirty:qu,isValid:wa,isAsync:ka,get util(){return Oe},get objectUtil(){return Hu},ZodParsedType:ne,getParsedType:xr,ZodType:Se,datetimeRegex:Iv,ZodString:wr,ZodNumber:to,ZodBigInt:no,ZodBoolean:ro,ZodDate:oo,ZodSymbol:hi,ZodUndefined:io,ZodNull:ao,ZodAny:kr,ZodUnknown:Yn,ZodNever:yn,ZodVoid:bi,ZodArray:Kn,ZodObject:Gt,ZodUnion:so,ZodDiscriminatedUnion:wl,ZodIntersection:lo,ZodTuple:On,ZodRecord:kl,ZodMap:yi,ZodSet:vi,ZodFunction:Tl,ZodLazy:co,ZodLiteral:uo,ZodEnum:mo,ZodNativeEnum:fo,ZodPromise:Tr,ZodEffects:Zt,ZodTransformer:Zt,ZodOptional:an,ZodNullable:Nn,ZodDefault:po,ZodCatch:go,ZodNaN:xi,BRAND:JP,ZodBranded:Ta,ZodPipeline:Sa,ZodReadonly:ho,custom:Rv,Schema:Se,ZodSchema:Se,late:QP,get ZodFirstPartyTypeKind(){return ve},coerce:$2,any:s2,array:d2,bigint:n2,boolean:$v,date:r2,discriminatedUnion:g2,effect:Sv,enum:S2,function:w2,instanceof:e2,intersection:h2,lazy:k2,literal:T2,map:v2,nan:t2,nativeEnum:C2,never:c2,null:a2,nullable:P2,number:Nv,object:m2,oboolean:N2,onumber:O2,optional:E2,ostring:R2,pipeline:A2,preprocess:I2,promise:_2,record:y2,set:x2,strictObject:f2,string:Ov,symbol:o2,transformer:Sv,tuple:b2,undefined:i2,union:p2,unknown:l2,void:u2,NEVER:M2,ZodIssueCode:z,quotelessJson:$P,ZodError:qt});var _a={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Ea={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Pa={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Ia={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Aa={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},B2=[_a,Ea,Pa,Ia,Aa],mF={[_a.code]:_a,[Ea.code]:Ea,[Pa.code]:Pa,[Ia.code]:Ia,[Aa.code]:Aa},fF={[_a.name]:_a.code,[Ea.name]:Ea.code,[Pa.name]:Pa.code,[Ia.name]:Ia.code,[Aa.name]:Aa.code},pF=B2.map(e=>e.code);var F2={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},U2={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},V2={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},j2={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},z2={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},G2={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},H2={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},W2={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},q2={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Z2={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},Y2={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},K2={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},X2={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},J2={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},Q2={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},eI={code:"k",name:"file",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string"||!("mimeType"in e)||typeof e.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}},Yu=[F2,U2,V2,j2,z2,G2,H2,W2,q2,Z2,Y2,K2,X2,J2,Q2,eI],tI=Object.fromEntries(Yu.map(e=>[e.code,e])),gF=Object.fromEntries(Yu.map(e=>[e.name,e.code])),nI=Yu.map(e=>e.code),rI=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let n=e.slice(0,t);if(!nI.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);let r=n,o=e.slice(t+1),i=JSON.parse(o);return tI[r].parse(i)};var oI=10;function iI(e,t){let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function Mv({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onFilePart:a,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:c,onToolCallDeltaPart:u,onToolCallPart:d,onToolResultPart:f,onMessageAnnotationsPart:p,onFinishMessagePart:y,onFinishStepPart:h,onStartStepPart:k}){let C=e.getReader(),b=new TextDecoder,T=[],g=0;for(;;){let{value:x}=await C.read();if(x&&(T.push(x),g+=x.length,x[x.length-1]!==oI))continue;if(T.length===0)break;let S=iI(T,g);g=0;let P=b.decode(S,{stream:!0}).split(`
21
+ `).filter(R=>R!=="").map(rI);for(let{type:R,value:N}of P)switch(R){case"text":await t?.(N);break;case"reasoning":await n?.(N);break;case"reasoning_signature":await r?.(N);break;case"redacted_reasoning":await o?.(N);break;case"file":await a?.(N);break;case"source":await i?.(N);break;case"data":await s?.(N);break;case"error":await l?.(N);break;case"message_annotations":await p?.(N);break;case"tool_call_streaming_start":await c?.(N);break;case"tool_call_delta":await u?.(N);break;case"tool_call":await d?.(N);break;case"tool_result":await f?.(N);break;case"finish_message":await y?.(N);break;case"finish_step":await h?.(N);break;case"start_step":await k?.(N);break;default:{let D=R;throw new Error(`Unknown stream part type: ${D}`)}}}}var bF=Symbol.for("vercel.ai.schema");var Sr=async({err:e,context:t})=>{try{return typeof e=="string"?{context:t,description:e,details:void 0}:e instanceof Error?"response"in e&&typeof e.response=="object"&&e.response&&"text"in e.response&&typeof e.response.text=="function"?{context:t,description:e.message,details:JSON.stringify(await e.response.text())}:{context:t,description:e.message,details:typeof e.cause=="string"?e.cause:JSON.stringify(e.cause)}:{context:t,description:JSON.stringify(e)}}catch{return{context:t,description:"Erro desconhecido (falha na an\xE1lise)"}}};var Sl=null,aI=3,sI=1,Ku=e=>async({messages:t,onMessageStream:n,onError:r})=>{try{Sl=new AbortController;let o=e.apiHost,i=await fetch((Ue(o)?o:kt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Sl.signal});if(!i.ok)return(e.retryAttempt??0)<sI&&(i.status===403||i.status===500||i.status===503)?(await new Promise(l=>setTimeout(l,aI*1e3)),Ku({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:n})):{error:{description:"Falha ao buscar o streaming do chat",details:await i.text(),context:"Durante o streaming do chat"}};if(!i.body)return{error:{description:"O corpo da resposta do fluxo do chat est\xE1 vazio"}};let a="",s=Qe();return await Mv({stream:i.body,onTextPart:async l=>{a+=l,n&&n({id:s,message:a})},onErrorPart:l=>{r?.(JSON.parse(l))}}),Sl=null,{message:a}}catch(o){return console.error(o),o.name==="AbortError"?(Sl=null,{error:{description:"Solicita\xE7\xE3o anulada"}}):{error:await Sr({err:o,context:"Durante o streaming do chat"})}}};var Dv=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
22
22
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
23
23
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
24
24
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
@@ -26,9 +26,9 @@ but received
26
26
  t.src=v;s=b.getElementsByTagName(e)[0];
27
27
  s.parentNode.insertBefore(t,s)}(window, document,'script',
28
28
  'https://connect.facebook.net/en_US/fbevents.js');
29
- ${e.map(r=>`fbq('init', '${r}');`).join(`
29
+ ${e.map(n=>`fbq('init', '${n}');`).join(`
30
30
  `)}
31
- fbq('track', 'PageView');`,document.head.appendChild(t)},cy=e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq){console.error("Facebook Pixel was not properly initialized");return}let t=e.params?.length?e.params.reduce((r,n)=>!n.key||!n.value?r:{...r,[n.key]:n.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)};var uy=async e=>{Ue(e?.pixelId)||cy(e)};var dy=({url:e,isNewTab:t}={})=>{if(!e)return;if(!window.open(e,t?"_blank":"_top"))return{blockedPopupUrl:e}};var my=Object.getPrototypeOf(async()=>{}).constructor,fy=async({content:e,args:t})=>{try{let n=await my(...t.map(o=>o.id),kP(e))(...t.map(o=>o.value));if(n&&typeof n=="string")return{scriptCallbackMessage:n}}catch(r){return console.log(r),{logs:[await Jr({err:r,context:"Durante a execu\xE7\xE3o do script"})]}}},kP=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),Ii=async({args:e,content:t})=>{try{let n=await my(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(n&&typeof n=="string")return{scriptCallbackMessage:n}}catch(r){console.warn("Script erro:",r)}};var Bc=e=>{if(Ze(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return console.warn("Falha ao converter o valor da vari\xE1vel em string com seguran\xE7a",e),null}};var CP=Object.getPrototypeOf(async()=>{}).constructor,py=async({content:e,args:t,isCode:r})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};let o=await CP(...t.map(i=>i.id),e.includes("return ")?e:`return ${e}`)(...t.map(i=>i.value));return{replyToSend:Bc(o)??void 0}}catch(n){return console.error(n),{replyToSend:Bc(e)??void 0,logs:r?[await Jr({err:n,context:"Ao executar a vari\xE1vel definida"})]:void 0}}};var gy=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3))};var TP="partykit.makebot.it",hy=e=>e??Wt("NEXT_PUBLIC_PARTYKIT_HOST")??TP;(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
31
+ fbq('track', 'PageView');`,document.head.appendChild(t)},Lv=e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq){console.error("Facebook Pixel was not properly initialized");return}let t=e.params?.length?e.params.reduce((n,r)=>!r.key||!r.value?n:{...n,[r.key]:r.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)};var Bv=async e=>{ct(e?.pixelId)||Lv(e)};var Fv=({url:e,isNewTab:t}={})=>{if(!e)return;if(!window.open(e,t?"_blank":"_top"))return{blockedPopupUrl:e}};var Uv=Object.getPrototypeOf(async()=>{}).constructor,Vv=async({content:e,args:t})=>{try{let r=await Uv(...t.map(o=>o.id),lI(e))(...t.map(o=>o.value));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(n){return console.log(n),{logs:[await Sr({err:n,context:"Durante a execu\xE7\xE3o do script"})]}}},lI=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),Ra=async({args:e,content:t})=>{try{let r=await Uv(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(n){console.warn("Script erro:",n)}};var Xu=e=>{if(rt(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return console.warn("Falha ao converter o valor da vari\xE1vel em string com seguran\xE7a",e),null}};var cI=Object.getPrototypeOf(async()=>{}).constructor,jv=async({content:e,args:t,isCode:n})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};let o=await cI(...t.map(i=>i.id),e.includes("return ")?e:`return ${e}`)(...t.map(i=>i.value));return{replyToSend:Xu(o)??void 0}}catch(r){return console.error(r),{replyToSend:Xu(e)??void 0,logs:n?[await Sr({err:r,context:"Ao executar a vari\xE1vel definida"})]:void 0}}};var zv=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3))};var uI="partykit.makebot.it",Gv=e=>e??un("NEXT_PUBLIC_PARTYKIT_HOST")??uI;(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
32
32
  PartySocket requires a global 'EventTarget' class to be available!
33
33
  You can polyfill this global by adding this to your code before any partysocket imports:
34
34
 
@@ -36,7 +36,7 @@ but received
36
36
  import 'partysocket/event-target-polyfill';
37
37
  \`\`\`
38
38
  Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
39
- `);var yy=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e}},xy=class extends Event{code;reason;wasClean=!0;constructor(e=1e3,t="",r){super("close",r),this.code=e,this.reason=t}},Fc={Event,ErrorEvent:yy,CloseEvent:xy};function SP(e,t){if(!e)throw new Error(t)}function EP(e){return new e.constructor(e.type,e)}function PP(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new xy(e.code||1999,e.reason||"unknown reason",e):"error"in e?new yy(e.error,e):new Event(e.type,e)}var _P=typeof process<"u"&&typeof process.versions?.node<"u",IP=typeof navigator<"u"&&navigator.product==="ReactNative",hs=_P||IP?PP:EP,_n={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:Number.POSITIVE_INFINITY,maxEnqueuedMessages:Number.POSITIVE_INFINITY,startClosed:!1,debug:!1},by=!1,vy=class In extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType="blob";_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,r,n={}){super(),this._url=t,this._protocols=r,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return In.CONNECTING}get OPEN(){return In.OPEN}get CLOSING(){return In.CLOSING}get CLOSED(){return In.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((t,r)=>(typeof r=="string"?t+=r.length:r instanceof Blob?t+=r.size:t+=r.byteLength,t),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?In.CLOSED:In.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,r){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,r)}reconnect(t,r){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,r),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{let{maxEnqueuedMessages:r=_n.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){let{reconnectionDelayGrowFactor:t=_n.reconnectionDelayGrowFactor,minReconnectionDelay:r=_n.minReconnectionDelay,maxReconnectionDelay:n=_n.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=r*t**(this._retryCount-1),o>n&&(o=n)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let r=t();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let r=t();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:t=_n.maxRetries,connectionTimeout:r=_n.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t),this._connectLock=!1;return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([n,o])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!by&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
39
+ `);var Wv=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e}},qv=class extends Event{code;reason;wasClean=!0;constructor(e=1e3,t="",n){super("close",n),this.code=e,this.reason=t}},Ju={Event,ErrorEvent:Wv,CloseEvent:qv};function dI(e,t){if(!e)throw new Error(t)}function mI(e){return new e.constructor(e.type,e)}function fI(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new qv(e.code||1999,e.reason||"unknown reason",e):"error"in e?new Wv(e.error,e):new Event(e.type,e)}var pI=typeof process<"u"&&typeof process.versions?.node<"u",gI=typeof navigator<"u"&&navigator.product==="ReactNative",Cl=pI||gI?fI:mI,bo={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:Number.POSITIVE_INFINITY,maxEnqueuedMessages:Number.POSITIVE_INFINITY,startClosed:!1,debug:!1},Hv=!1,Zv=class yo extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType="blob";_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,n,r={}){super(),this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return yo.CONNECTING}get OPEN(){return yo.OPEN}get CLOSING(){return yo.CLOSING}get CLOSED(){return yo.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((t,n)=>(typeof n=="string"?t+=n.length:n instanceof Blob?t+=n.size:t+=n.byteLength,t),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?yo.CLOSED:yo.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{let{maxEnqueuedMessages:n=bo.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){let{reconnectionDelayGrowFactor:t=bo.reconnectionDelayGrowFactor,minReconnectionDelay:n=bo.minReconnectionDelay,maxReconnectionDelay:r=bo.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=n*t**(this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let n=t();if(!n)return Promise.resolve(null);if(typeof n=="string"||Array.isArray(n))return Promise.resolve(n);if(n.then)return n}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let n=t();if(typeof n=="string")return Promise.resolve(n);if(n.then)return n}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:t=bo.maxRetries,connectionTimeout:n=bo.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t),this._connectLock=!1;return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([r,o])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Hv&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
40
40
 
41
41
  For example, if you're using node.js, run \`npm install ws\`, and then in your code:
42
42
 
@@ -49,9 +49,9 @@ const partysocket = new PartySocket({
49
49
  WebSocket: WS
50
50
  });
51
51
 
52
- `),by=!0);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:o}),this._ws=o?new i(n,o):new i(n),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r)}).catch(n=>{this._connectLock=!1,this._handleError(new Fc.ErrorEvent(Error(n.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Fc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{(this._ws.readyState===this.OPEN||this._ws.readyState===this.CONNECTING)&&this._ws.close(t,r),this._handleClose(new Fc.CloseEvent(t,r,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");let{minUptime:r=_n.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),SP(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(n=>{this._ws?.send(n)}),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(hs(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(hs(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(hs(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(hs(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};var AP=e=>e[1]!==null&&e[1]!==void 0;function RP(){if(crypto?.randomUUID)return crypto.randomUUID();let e=Date.now(),t=performance?.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function ky(e,t,r={}){let{host:n,path:o,protocol:i,room:a,party:s,basePath:l,prefix:c,query:u}=e,d=n.replace(/^(http|https|ws|wss):\/\//,"");if(d.endsWith("/")&&(d=d.slice(0,-1)),o?.startsWith("/"))throw new Error("path must not start with a slash");let p=s??"main",f=o?`/${o}`:"",x=i||(d.startsWith("localhost:")||d.startsWith("127.0.0.1:")||d.startsWith("192.168.")||d.startsWith("10.")||d.startsWith("172.")&&d.split(".")[1]>="16"&&d.split(".")[1]<="31"||d.startsWith("[::ffff:7f00:1]:")?t:`${t}s`),h=`${x}://${d}/${l||`${c||"parties"}/${p}/${a}`}${f}`,w=(b={})=>`${h}?${new URLSearchParams([...Object.entries(r),...Object.entries(b).filter(AP)])}`,T=typeof u=="function"?async()=>w(await u()):w(u);return{host:d,path:f,room:a,name:p,protocol:x,partyUrl:h,urlProvider:T}}var Cy=class extends vy{_pk;_pkurl;name;room;host;path;basePath;constructor(e){let t=wy(e);if(super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t),!e.startClosed&&!this.room&&!this.basePath)throw this.close(),new Error("Either room or basePath must be provided to connect. Use startClosed: true to create a socket and set them via updateProperties before calling reconnect().");e.disableNameValidation||(e.party?.includes("/")&&console.warn(`PartySocket: party name "${e.party}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`),e.room?.includes("/")&&console.warn(`PartySocket: room name "${e.room}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`))}updateProperties(e){let t=wy({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path,basePath:e.basePath??this.basePath});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:r,name:n,room:o,host:i,path:a,basePath:s}=e;this._pk=t,this._pkurl=r,this.name=n,this.room=o,this.host=i,this.path=a,this.basePath=s}reconnect(e,t){if(!this.host)throw new Error("The host must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");if(!this.room&&!this.basePath)throw new Error("The room (or basePath) must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let r=ky(e,"http"),n=typeof r.urlProvider=="string"?r.urlProvider:await r.urlProvider();return(e.fetch??fetch)(n,t)}};function wy(e){let{id:t,host:r,path:n,party:o,room:i,protocol:a,query:s,protocols:l,...c}=e,u=t||RP(),d=ky(e,"ws",{_pk:u});return{_pk:u,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,basePath:e.basePath,protocols:l,socketOptions:c,urlProvider:d.urlProvider}}var Ty=({sessionId:e,resultId:t,context:r})=>{let n=new Cy({host:hy(r.wsHost),room:OP({sessionId:e,resultId:t})});return new Promise(o=>{n.addEventListener("message",i=>{n.close(),o({replyToSend:i.data})}),n.addEventListener("error",i=>{o({logs:[{status:"error",description:"Websocket retornou um erro",details:JSON.stringify(i,null,2)}],replyToSend:void 0})})})},OP=({sessionId:e,resultId:t})=>{if(t)return`${t}/webhooks`;let[r,n]=e.split("-");return`${n}/${r}/webhooks`};var Sy=e=>{if(document.getElementById("gtm-noscript"))return"";let t=document.createElement("noscript");t.id="gtm-noscript";let r=document.createElement("iframe");return r.src=`https://www.googletagmanager.com/ns.html?id=${e}`,r.height="0",r.width="0",r.style.display="none",r.style.visibility="hidden",t.appendChild(r),t};var Ey=async e=>{let t=e.customHeadCode;pe(t)&&Nd(t);let r=e.gtmId;pe(r)&&document.body.prepend(Sy(r));let n=e.googleAnalyticsId;pe(n)&&await ny(n);let o=e.pixelIds;de(o)&&ly(o)};var Py=async({clientSideAction:e,context:t,onMessageStream:r,onStreamError:n})=>{if("googleAnalytics"in e)return iy(e.googleAnalytics);if("scriptToExecute"in e)return fy(e.scriptToExecute);if("redirect"in e)return dy(e.redirect);if("wait"in e)return await gy(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return py(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:o,message:i}=await Lc(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:r,onError:n});return o?{replyToSend:void 0,logs:[{status:"error",description:"O streaming de mensagens retornou um erro",details:JSON.stringify(o,null,2)}]}:{replyToSend:i}}if("httpRequestToExecute"in e)return{replyToSend:await ay(e.httpRequestToExecute)};if("startPropsToInject"in e)return Ey(e.startPropsToInject);if("pixel"in e)return uy(e.pixel);if("codeToExecute"in e)return Ii(e.codeToExecute);if(e.type==="listenForWebhook")return Ty({sessionId:t.sessionId,resultId:t.resultId,context:t})};var _y=e=>e.type==="text"?e.label??e.value:e.url;var Iy=(e,{storage:t,makebotId:r})=>{if(e.length===0)return[];if("version"in e[0])return e;let n=no(t),o=LP({storage:n,makebotId:r});return e.map((i,a)=>({version:"2",messages:i.messages,clientSideActions:a===e.length-1?MP({storage:n,makebotId:r}):[],input:NP({input:i.input,storage:n,makebotId:r,chunkIndex:a}),streamingMessage:i.streamingMessageId?$P({streamingMessageId:i.streamingMessageId,storage:n}):void 0,dynamicTheme:DP({chunkIndex:a,avatarsHistory:o})}))},$P=({streamingMessageId:e,storage:t})=>{let r=`makebot-streaming-message-${e}`,n=t.getItem(r)??void 0,o=n?JSON.parse(n):void 0;return t.removeItem(r),o},NP=({input:e,storage:t,makebotId:r,chunkIndex:n})=>{if(!e)return e;let o=`makebot-${r}-input-${n}`,i=t.getItem(o)??void 0,a=i?JSON.parse(i):void 0;return t.removeItem(o),{...e,answer:a}},MP=({storage:e,makebotId:t})=>{let r=`makebot-${t}-clientSideActions`,n=e.getItem(r);if(e.removeItem(r),n)return JSON.parse(n)},DP=({chunkIndex:e,avatarsHistory:t})=>{let r=t.filter(n=>n.chunkIndex===e);if(r.length>0)return{hostAvatarUrl:r.find(n=>n.role==="host")?.avatarUrl,guestAvatarUrl:r.find(n=>n.role==="guest")?.avatarUrl}},LP=({storage:e,makebotId:t})=>{let r=`makebot-${t}-avatarsHistory`,n=e.getItem(r);return e.removeItem(r),n?JSON.parse(n):[]};var Ye="Enviar";var BP=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,FP=/CrOS/,UP=/android|ipad|playbook|silk/i,ze=e=>{let t=navigator.userAgent,r=BP.test(t)&&!FP.test(t)||!!e?.includeTablet&&UP.test(t);return!r&&e?.includeTablet&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r};var VP=C('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),zP=C('<div class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),GP=C('<h2 class="px-4 font-semibold">'),HP=C("<p class=px-4>"),jP=C('<span class="flex items-center gap-2">'),WP=C("<span class=relative>"),qP=C('<svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd>'),YP=C('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),KP=C('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),Ay=e=>{let t,r=e.options,n=r?.areInitialSearchButtonsVisible??!0,[o,i]=O(r?.isSearchable&&!n?[]:e.defaultItems),[a,s]=O({}),[l,c]=O(!1);ae(()=>{!ze()&&t&&t.focus({preventScroll:!0})});let u=p=>{if(l()){console.log("\u{1F50D} Button click ignorado - fluxo j\xE1 foi executado");return}let f=o()[p],{value:x,content:h}=f,w=`${p}`;s(T=>({...T,[w]:!0})),console.log("\u{1F50D} Button clicado - continuando fluxo"),e.onSubmit({type:"text",value:x||h||"",label:x?h:void 0}),c(!0),console.log("\u{1F50D} Fluxo executado - desabilitando outros bot\xF5es")},d=p=>{if(p===""||p.trim().length===0){i(n?e.defaultItems:[]);return}i(e.defaultItems.filter(f=>f.content?.toLowerCase().includes(p.toLowerCase())))};return(()=>{var p=zP(),f=p.firstChild,x=f.firstChild,h=x.firstChild,w=x.nextSibling;return v(f,m(U,{get when(){return r?.imageUrl},get children(){var T=VP();return $(()=>G(T,"src",r?.imageUrl)),T}}),x),v(h,m(U,{get when(){return r?.title},children:T=>(()=>{var b=GP();return v(b,T),b})()}),null),v(h,m(U,{get when(){return r?.description},children:T=>(()=>{var b=HP();return v(b,T),b})()}),null),v(w,m(we,{get each(){return o()},children:(T,b)=>(()=>{var y=WP();return v(y,m(Ct,{"on:click":()=>u(b()),get"data-itemid"(){return T.id},variant:"secondary",get class(){return q("w-full font-normal text-sm border-host-bubble-border rounded-none",b()===0&&"rounded-t-host-bubble border border-b-0",b()!==0&&"border border-b-0",b()===(o().length??1)-1&&"rounded-b-host-bubble border-b",a()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",l()&&!a()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm",get isDisabled(){return a()[`${b()}`]||l()&&!a()[`${b()}`]},get children(){var g=jP();return v(g,(()=>{var k=L(()=>!!a()[`${b()}`]);return()=>k()?[qP(),"Enviado"]:[YP(),L(()=>T.content)]})()),g}}),null),v(y,(()=>{var g=L(()=>e.chunkIndex===0&&e.defaultItems.length===1);return()=>g()&&KP()})(),null),y})()})),p})()};var XP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor stroke=currentColor stroke-width=0 stroke-linecap=round stroke-linejoin=round><path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"></path><path d="M6 12h16">'),Ry=e=>(()=>{var t=XP();return be(t,e,!0,!0),t})();var Fe=e=>{let t=ps(),[r,n]=De(e,["isDisabled","isLoading","disableIcon"]),o=t()==="sm"&&!r.disableIcon||!n.children||typeof n.children=="string"&&Ue(n.children);return m(Ct,ce(n,{type:"submit",get class(){return q(n.class,"flex items-center")},"aria-label":o?"Enviar":void 0,get children(){return m(Ie,{get children(){return[m(Z,{when:o,get children(){return m(Ry,{get class(){return"send-icon flex w-6 h-6 "+(r.disableIcon?"hidden":"")}})}}),m(Z,{when:!o,get children(){return e.children}})]}})}}))};var Oy={buttonLabel:Ye,imageUrl:"",title:"",description:"",isMultipleChoice:!1,isSearchable:!1,areInitialSearchButtonsVisible:!0};var ZP=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),$y=e=>(()=>{var t=ZP();return be(t,e,!0,!0),t})();var JP=C("<div>"),So=e=>(()=>{var t=JP();return v(t,m(U,{get when(){return e.isChecked},get children(){return m($y,{})}})),$(()=>V(t,"w-4 h-4 makebot-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var QP=C('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),e2=C('<form class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),t2=C('<h2 class="px-4 font-semibold">'),r2=C("<p class=px-4>"),n2=C('<span class="relative w-full @xs:w-auto"><div role=checkbox><div class="flex items-center gap-2"><span>'),o2=C('<span class="relative w-full @xs:w-auto"><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable selected border-host-bubble-border rounded-none border border-b-0"><div class="flex items-center gap-2"><span>'),Ny=e=>{let t,r=e.options,[n,o]=O(r?.isSearchable&&!r?.areInitialSearchButtonsVisible?[]:e.defaultItems),[i,a]=O([]),[s,l]=O({}),[c,u]=O(!1);ae(()=>{!ze()&&t&&t.focus({preventScroll:!0})});let d=h=>{p(h)},p=h=>{let w=i().indexOf(h);a(w!==-1?T=>T.filter(b=>b!==h):T=>[...T,h])},f=()=>{if(c()){console.log("\u{1F50D} Multiple choice submit ignorado - fluxo j\xE1 foi executado");return}let h=i().map(T=>e.defaultItems.find(b=>b.id===T)),w=h.some(T=>T?.value);console.log("\u{1F50D} Multiple choice submit - continuando fluxo"),e.onSubmit({type:"text",value:h.map(T=>T?.value??T?.content).join(", "),label:w?h.map(T=>T?.content??T?.value).join(", "):void 0}),u(!0),console.log("\u{1F50D} Fluxo executado - desabilitando m\xFAltipla escolha")},x=h=>{if(h===""||h.trim().length===0){o(r?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}o(e.defaultItems.filter(w=>w.content?.toLowerCase().includes(h.toLowerCase())))};return(()=>{var h=e2(),w=h.firstChild,T=w.firstChild,b=T.firstChild,y=T.nextSibling;return h.addEventListener("submit",f),v(w,m(U,{get when(){return r?.imageUrl},get children(){var g=QP();return $(()=>G(g,"src",r?.imageUrl)),g}}),T),v(b,m(U,{get when(){return e.options?.title},children:g=>(()=>{var k=t2();return v(k,g),k})()}),null),v(b,m(U,{get when(){return e.options?.description},children:g=>(()=>{var k=r2();return v(k,g),k})()}),null),v(y,m(we,{get each(){return n()},children:(g,k)=>(()=>{var S=n2(),P=S.firstChild,A=P.firstChild,N=A.firstChild;return Be(P,"click",()=>d(g.id)),v(A,m(So,{get isChecked(){return i().some(D=>D===g.id)},class:"flex-shrink-0"}),N),v(N,()=>g.content),$(D=>{var F=i().some(z=>z===g.id),R=q("w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable border-host-bubble-border rounded-none",k()===0&&"rounded-t-host-bubble border border-b-0",k()!==0&&"border border-b-0",k()===(n().length??1)-1&&"rounded-b-host-bubble border-b",i().some(z=>z===g.id)&&"selected"),M=g.id;return F!==D.e&&G(P,"aria-checked",D.e=F),R!==D.t&&V(P,D.t=R),M!==D.a&&G(P,"data-itemid",D.a=M),D},{e:void 0,t:void 0,a:void 0}),S})()}),null),v(y,m(we,{get each(){return i().filter(g=>n().every(k=>k.id!==g))},children:g=>(()=>{var k=o2(),S=k.firstChild,P=S.firstChild,A=P.firstChild;return Be(S,"click",()=>d(g)),G(S,"data-itemid",g),v(P,m(So,{isChecked:!0}),A),v(A,()=>e.defaultItems.find(N=>N.id===g)?.content),k})()}),null),v(h,(()=>{var g=L(()=>i().length>0);return()=>g()&&m(Fe,{class:"h-[43px]",get children(){return e.options?.buttonLabel??Oy.buttonLabel}})})(),null),h})()};var i2=e=>m(_r.Root,e),a2=e=>m(_r.Control,e),s2=e=>m(_r.PrevTrigger,e),l2=e=>m(_r.NextTrigger,e),c2=e=>m(_r.ItemGroup,e),u2=e=>m(_r.Item,e),An={Root:i2,Control:a2,PrevTrigger:s2,NextTrigger:l2,ItemGroup:c2,Item:u2};var d2=C('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m12 19-7-7 7-7"></path><path d="M19 12H5">'),My=e=>(()=>{var t=d2();return be(t,e,!0,!0),t})();var m2=C('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M5 12h14"></path><path d="m12 5 7 7-7 7">'),Dy=e=>(()=>{var t=m2();return be(t,e,!0,!0),t})();var Ly=C('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),f2=C('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">'),p2=C('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">'),g2=C('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M15 11a3 3 0 11-6 0 3 3 0 016 0z">'),h2=C('<div class="flex justify-end mb-2">'),b2=C('<div class="absolute inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-4"><img alt="Imagem ampliada"class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto object-contain">'),y2=C('<div class="flex flex-col gap-4"><img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer"><div class="flex flex-col gap-2">'),x2=C('<div class="px-3 pb-2">'),v2=C('<h2 class="px-4 font-semibold">'),w2=C("<p class=px-4>"),k2=C('<span class="flex items-center gap-2"><svg class="animate-spin h-4 w-4 text-current"xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),C2=C('<span class="flex items-center gap-2"><svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd></path></svg>Enviado'),T2=C('<span class="flex items-center gap-2">'),S2=C("<div>"),E2=e=>{if(console.log("\u{1F50D} convertSubmitContentToMessage - input:",e),!e){console.log("\u{1F50D} convertSubmitContentToMessage - answer \xE9 undefined");return}if(e.type==="text"){let t={type:"text",text:e.value};return console.log("\u{1F50D} convertSubmitContentToMessage - resultado:",t),t}console.log("\u{1F50D} convertSubmitContentToMessage - tipo n\xE3o suportado:",e.type)},By=e=>{let[t,r]=O({}),[n,o]=O({}),[i,a]=O({}),[s,l]=O(!1),c=b=>{switch(b){case"quick_reply":return Ly();case"cta_url":return f2();case"cta_copy":return p2();case"send_location":return g2();default:return Ly()}},u=(b,y,g=3e3)=>{r(k=>({...k,[b]:!0})),o(k=>({...k,[b]:y})),setTimeout(()=>{o(k=>{let S={...k};return delete S[b],S}),r(k=>({...k,[b]:!1}))},g)},d=async b=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(b),!0;{let y=document.createElement("textarea");y.value=b,y.style.position="fixed",y.style.left="-999999px",y.style.top="-999999px",document.body.appendChild(y),y.focus(),y.select();let g=document.execCommand("copy");return y.remove(),g}}catch(y){return console.error("Erro ao copiar:",y),!1}},p=async b=>{if(!e.context?.sessionId){console.error("\u274C sessionId n\xE3o encontrado no contexto");return}try{console.log("\u{1F50D} Enviando mensagem diretamente para API:",b);let{data:y,error:g}=await ki({apiHost:e.context.apiHost??dt(),sessionId:e.context.sessionId,message:E2(b)});if(g){console.error("\u274C Erro ao enviar mensagem:",g);return}console.log("\u2705 Mensagem enviada com sucesso:",y);let k=new CustomEvent("makebot-api-response",{detail:{sessionId:e.context.sessionId,response:y}});window.dispatchEvent(k),console.log("\u2705 Evento de resposta da API disparado")}catch(y){console.error("\u274C Erro ao enviar mensagem:",y)}},[f,x]=O();console.log("\u{1F50D} CardsCaroussel renderizado:",{blockItems:e.block.items,firstItemPaths:e.block.items[0]?.paths,firstPathType:e.block.items[0]?.paths?.[0]?.type,firstPathConfig:e.block.items[0]?.paths?.[0]?.config}),console.log("\u{1F50D} Detalhes completos dos paths:",JSON.stringify(e.block.items.map(b=>({id:b.id,paths:b.paths?.map(y=>({id:y.id,text:y.text,type:y.type,config:y.config,outgoingEdgeId:y.outgoingEdgeId}))})),null,2));let h=async(b,y,g)=>{if(b.type==="quick_reply"&&s()){console.log("\u{1F50D} Quick reply ignorado - fluxo j\xE1 foi executado");return}switch(a(k=>({...k,[y]:!0})),b.type){case"cta_url":b.config?.url&&window.open(b.config.url,"_blank"),u(y,"Link aberto!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"cta_copy":let k=await d(b.config?.copyValue||"");u(y,k?"Copiado!":"Erro ao copiar"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"send_location":"geolocation"in navigator?navigator.geolocation.getCurrentPosition(async P=>{let{latitude:A,longitude:N}=P.coords,D=`${A},${N}`;u(y,"Localiza\xE7\xE3o enviada!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"))},P=>{console.error("Erro ao obter localiza\xE7\xE3o:",P),u(y,"Erro ao obter localiza\xE7\xE3o",3e3)}):u(y,"Geolocaliza\xE7\xE3o n\xE3o suportada",3e3);break;default:console.log("\u{1F50D} Bot\xE3o quick_reply clicado:",{pathId:b.id,pathText:b.text,outgoingEdgeId:b.outgoingEdgeId,imageUrl:e.block.items[g].imageUrl});let S=b.id;if(!S){console.log("\u{1F50D} Bot\xE3o quick_reply sem ID v\xE1lido - IGNORADO"),u(y,"Bot\xE3o n\xE3o configurado",2e3);return}console.log("\u{1F50D} Bot\xE3o quick_reply clicado - continuando fluxo"),e.onSubmit({type:"text",value:S,label:b.text??""}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"),console.log("\u{1F50D} Bot\xE3o quick_reply marcado como clicado:",y);break}},w=ps(),T=ee(()=>_2(e.block.items.length,{containerSize:w()}));return[m(An.Root,{get slideCount(){return e.block.items.length},get slidesPerPage(){return T()},slidesPerMove:1,spacing:"12px",class:"overflow-visible @xs:-mr-5 -mr-4",get children(){return[(()=>{var b=h2();return v(b,m(An.Control,{class:"flex gap-2 @xs:mr-5 mr-4",get children(){return[m(An.PrevTrigger,{asChild:y=>m(Ct,ce({variant:"secondary"},y,{get children(){return m(My,{class:"w-4 h-4"})}}))}),m(An.NextTrigger,{asChild:y=>m(Ct,ce({variant:"secondary"},y,{get children(){return m(Dy,{class:"w-4 h-4"})}}))})]}})),$(y=>ne(b,"display",e.block.items.length>T()?void 0:"none")),b})(),m(An.ItemGroup,{class:"rounded-l-host-bubble @xs:pr-5 pr-4 p-4",get children(){return m(Go,{get each(){return e.block.items},children:(b,y)=>m(An.Item,{index:y,get children(){return m(P2,{class:"h-full",get children(){return[(()=>{var g=y2(),k=g.firstChild,S=k.nextSibling;return k.$$click=()=>x(b().imageUrl??void 0),v(S,m(U,{get when(){return b().title},children:P=>(()=>{var A=v2();return v(A,P),A})()}),null),v(S,m(U,{get when(){return b().description},children:P=>(()=>{var A=w2();return v(A,P),A})()}),null),$(()=>G(k,"src",b().imageUrl??"")),g})(),(()=>{var g=x2();return v(g,m(we,{get each(){return b().paths},children:(k,S)=>m(Ct,{variant:"secondary",get class(){return Zr("w-full font-normal text-sm border-host-bubble-border rounded-none",S()===0&&"rounded-t-host-bubble border border-b-0",S()!==0&&"border border-b-0",S()===(b().paths?.length??1)-1&&"rounded-b-host-bubble border-b",k.type==="quick_reply"&&i()[`${y}-${S()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",k.type==="quick_reply"&&s()&&!i()[`${y}-${S()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm","on:click":()=>h(k,`${y}-${S()}`,y),get isDisabled(){return t()[`${y}-${S()}`]||k.type==="quick_reply"&&i()[`${y}-${S()}`]||k.type==="quick_reply"&&s()&&!i()[`${y}-${S()}`]},get children(){return L(()=>!!t()[`${y}-${S()}`])()?(()=>{var P=k2(),A=P.firstChild;return v(P,()=>n()[`${y}-${S()}`],null),P})():L(()=>!!(k.type==="quick_reply"&&i()[`${y}-${S()}`]))()?C2():(()=>{var P=T2();return v(P,()=>c(k.type),null),v(P,()=>k.text,null),P})()}})})),g})()]}})}})})}})]}}),m(U,{get when(){return f()},get children(){var b=b2(),y=b.firstChild;return b.$$click=()=>x(void 0),$(()=>G(y,"src",f())),b}})]},P2=e=>(()=>{var t=S2();return v(t,()=>e.children),$(()=>V(t,Zr("makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden",e.class))),t})(),_2=(e,{containerSize:t})=>t==="xs"?e>1?1.2:1:t==="sm"?e>1?1.5:1:t==="md"||t==="lg"?e>2?2.2:e:e>3?3.2:e;Se(["click"]);var bs={hasTime:!1,isRange:!1,labels:{button:Ye,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};var I2=C('<div class="makebot-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input makebot-datetime-input"data-testid=from-date style=min-height:24px;min-width:100px;font-size:16px>'),Fy=C("<p class=font-semibold>"),A2=C('<div class="flex items-center p-2"><input class="focus:outline-none flex-1 w-full text-input ml-2 makebot-datetime-input"data-testid=to-date style=min-height:24px;min-width:100px;font-size:16px>'),Uy=e=>{let[t,r]=O(R2(e.defaultValue??"")),n=()=>{t().from===""&&t().to===""||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})},o=i=>{i.key==="Enter"&&(i.preventDefault(),n())};return(()=>{var i=I2(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.firstChild;return a.addEventListener("submit",u=>{u.preventDefault(),n()}),v(l,(()=>{var u=L(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=Fy();return v(d,()=>e.options.labels?.from??bs.labels.from),d})()})(),c),c.$$keydown=o,c.addEventListener("change",u=>r({...t(),from:u.currentTarget.value})),v(s,(()=>{var u=L(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=A2(),p=d.firstChild;return v(d,(()=>{var f=L(()=>!!e.options.isRange);return()=>f()&&(()=>{var x=Fy();return v(x,()=>e.options.labels?.to??bs.labels.to),x})()})(),p),p.$$keydown=o,p.addEventListener("change",f=>r({...t(),to:f.currentTarget.value})),$(f=>{var x=e.options.hasTime?"datetime-local":"date",h=e.options?.min,w=e.options?.max;return x!==f.e&&G(p,"type",f.e=x),h!==f.t&&G(p,"min",f.t=h),w!==f.a&&G(p,"max",f.a=w),f},{e:void 0,t:void 0,a:void 0}),$(()=>p.value=t().to),d})()})(),null),v(i,m(Fe,{class:"h-[43px]","on:click":n,get children(){return e.options?.labels?.button??bs.labels.button}}),null),$(u=>{var d=q("flex makebot-input",e.options?.isRange?"items-end":"items-center"),p="flex items-center p-2 "+(e.options?.isRange?"pb-0 gap-2":""),f=e.options?.hasTime?"datetime-local":"date",x=e.options?.min,h=e.options?.max;return d!==u.e&&V(a,u.e=d),p!==u.t&&V(l,u.t=p),f!==u.a&&G(c,"type",u.a=f),x!==u.o&&G(c,"min",u.o=x),h!==u.i&&G(c,"max",u.i=h),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),$(()=>c.value=t().from),i})()},R2=e=>{if(!e.includes("to"))return{from:e,to:""};let[t,r]=e.split(" to ");return{from:t,to:r}};Se(["keydown"]);var O2=C('<input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input"type=text>'),Qr=e=>{let[t,r]=De(e,["ref","onInput","inputmode"]);return(()=>{var n=O2();n.$$input=i=>t.onInput(i.currentTarget.value);var o=e.ref;return typeof o=="function"?ge(o,n):e.ref=n,be(n,ce({get inputmode(){return t.inputmode}},r),!1,!1),n})()};Se(["input"]);var Uc={labels:{button:Ye,placeholder:"Digite seu e-mail..."},retryMessageContent:"Este e-mail parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var $2=C('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),Vy=e=>{let[t,r]=O(e.defaultValue??""),n,o=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&a()};ae(()=>{!ze()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),re(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=$2(),u=c.firstChild;return c.$$keydown=s,v(u,m(Qr,{ref(d){var p=n;typeof p=="function"?p(d):n=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Uc.labels.placeholder},onInput:o,type:"email",autocomplete:"email"})),v(c,m(Fe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.block.options?.labels?.button??Uc.labels.button}}),null),c})()};Se(["keydown"]);var tr={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:`<strong>Escolha uma imagem</strong>
52
+ `),Hv=!0);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:r,protocols:o}),this._ws=o?new i(r,o):new i(r),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new Ju.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Ju.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{(this._ws.readyState===this.OPEN||this._ws.readyState===this.CONNECTING)&&this._ws.close(t,n),this._handleClose(new Ju.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");let{minUptime:n=bo.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),dI(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>{this._ws?.send(r)}),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Cl(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Cl(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Cl(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Cl(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};var hI=e=>e[1]!==null&&e[1]!==void 0;function bI(){if(crypto?.randomUUID)return crypto.randomUUID();let e=Date.now(),t=performance?.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function Kv(e,t,n={}){let{host:r,path:o,protocol:i,room:a,party:s,basePath:l,prefix:c,query:u}=e,d=r.replace(/^(http|https|ws|wss):\/\//,"");if(d.endsWith("/")&&(d=d.slice(0,-1)),o?.startsWith("/"))throw new Error("path must not start with a slash");let f=s??"main",p=o?`/${o}`:"",y=i||(d.startsWith("localhost:")||d.startsWith("127.0.0.1:")||d.startsWith("192.168.")||d.startsWith("10.")||d.startsWith("172.")&&d.split(".")[1]>="16"&&d.split(".")[1]<="31"||d.startsWith("[::ffff:7f00:1]:")?t:`${t}s`),h=`${y}://${d}/${l||`${c||"parties"}/${f}/${a}`}${p}`,k=(b={})=>`${h}?${new URLSearchParams([...Object.entries(n),...Object.entries(b).filter(hI)])}`,C=typeof u=="function"?async()=>k(await u()):k(u);return{host:d,path:p,room:a,name:f,protocol:y,partyUrl:h,urlProvider:C}}var Xv=class extends Zv{_pk;_pkurl;name;room;host;path;basePath;constructor(e){let t=Yv(e);if(super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t),!e.startClosed&&!this.room&&!this.basePath)throw this.close(),new Error("Either room or basePath must be provided to connect. Use startClosed: true to create a socket and set them via updateProperties before calling reconnect().");e.disableNameValidation||(e.party?.includes("/")&&console.warn(`PartySocket: party name "${e.party}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`),e.room?.includes("/")&&console.warn(`PartySocket: room name "${e.room}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`))}updateProperties(e){let t=Yv({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path,basePath:e.basePath??this.basePath});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:n,name:r,room:o,host:i,path:a,basePath:s}=e;this._pk=t,this._pkurl=n,this.name=r,this.room=o,this.host=i,this.path=a,this.basePath=s}reconnect(e,t){if(!this.host)throw new Error("The host must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");if(!this.room&&!this.basePath)throw new Error("The room (or basePath) must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let n=Kv(e,"http"),r=typeof n.urlProvider=="string"?n.urlProvider:await n.urlProvider();return(e.fetch??fetch)(r,t)}};function Yv(e){let{id:t,host:n,path:r,party:o,room:i,protocol:a,query:s,protocols:l,...c}=e,u=t||bI(),d=Kv(e,"ws",{_pk:u});return{_pk:u,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,basePath:e.basePath,protocols:l,socketOptions:c,urlProvider:d.urlProvider}}var Jv=({sessionId:e,resultId:t,context:n})=>{let r=new Xv({host:Gv(n.wsHost),room:yI({sessionId:e,resultId:t})});return new Promise(o=>{r.addEventListener("message",i=>{r.close(),o({replyToSend:i.data})}),r.addEventListener("error",i=>{o({logs:[{status:"error",description:"Websocket retornou um erro",details:JSON.stringify(i,null,2)}],replyToSend:void 0})})})},yI=({sessionId:e,resultId:t})=>{if(t)return`${t}/webhooks`;let[n,r]=e.split("-");return`${r}/${n}/webhooks`};var Qv=e=>{if(document.getElementById("gtm-noscript"))return"";let t=document.createElement("noscript");t.id="gtm-noscript";let n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t};var ex=async e=>{let t=e.customHeadCode;Ue(t)&&Km(t);let n=e.gtmId;Ue(n)&&document.body.prepend(Qv(n));let r=e.googleAnalyticsId;Ue(r)&&await vv(r);let o=e.pixelIds;ye(o)&&Dv(o)};var tx=async({clientSideAction:e,context:t,onMessageStream:n,onStreamError:r})=>{if("googleAnalytics"in e)return wv(e.googleAnalytics);if("scriptToExecute"in e)return Vv(e.scriptToExecute);if("redirect"in e)return Fv(e.redirect);if("wait"in e)return await zv(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return jv(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:o,message:i}=await Ku(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n,onError:r});return o?{replyToSend:void 0,logs:[{status:"error",description:"O streaming de mensagens retornou um erro",details:JSON.stringify(o,null,2)}]}:{replyToSend:i}}if("httpRequestToExecute"in e)return{replyToSend:await kv(e.httpRequestToExecute)};if("startPropsToInject"in e)return ex(e.startPropsToInject);if("pixel"in e)return Bv(e.pixel);if("codeToExecute"in e)return Ra(e.codeToExecute);if(e.type==="listenForWebhook")return Jv({sessionId:t.sessionId,resultId:t.resultId,context:t})};var nx=e=>e.type==="text"?e.label??e.value:e.url;var rx=(e,{storage:t,makebotId:n})=>{if(e.length===0)return[];if("version"in e[0])return e;let r=Wo(t),o=TI({storage:r,makebotId:n});return e.map((i,a)=>({version:"2",messages:i.messages,clientSideActions:a===e.length-1?wI({storage:r,makebotId:n}):[],input:xI({input:i.input,storage:r,makebotId:n,chunkIndex:a}),streamingMessage:i.streamingMessageId?vI({streamingMessageId:i.streamingMessageId,storage:r}):void 0,dynamicTheme:kI({chunkIndex:a,avatarsHistory:o})}))},vI=({streamingMessageId:e,storage:t})=>{let n=`makebot-streaming-message-${e}`,r=t.getItem(n)??void 0,o=r?JSON.parse(r):void 0;return t.removeItem(n),o},xI=({input:e,storage:t,makebotId:n,chunkIndex:r})=>{if(!e)return e;let o=`makebot-${n}-input-${r}`,i=t.getItem(o)??void 0,a=i?JSON.parse(i):void 0;return t.removeItem(o),{...e,answer:a}},wI=({storage:e,makebotId:t})=>{let n=`makebot-${t}-clientSideActions`,r=e.getItem(n);if(e.removeItem(n),r)return JSON.parse(r)},kI=({chunkIndex:e,avatarsHistory:t})=>{let n=t.filter(r=>r.chunkIndex===e);if(n.length>0)return{hostAvatarUrl:n.find(r=>r.role==="host")?.avatarUrl,guestAvatarUrl:n.find(r=>r.role==="guest")?.avatarUrl}},TI=({storage:e,makebotId:t})=>{let n=`makebot-${t}-avatarsHistory`,r=e.getItem(n);return e.removeItem(n),r?JSON.parse(r):[]};var ft="Enviar",ox="Ver opcoes";var SI=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,CI=/CrOS/,_I=/android|ipad|playbook|silk/i,st=e=>{let t=navigator.userAgent,n=SI.test(t)&&!CI.test(t)||!!e?.includeTablet&&_I.test(t);return!n&&e?.includeTablet&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(n=!0),n};var EI=w('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),PI=w('<div class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),II=w('<h2 class="px-4 font-semibold">'),AI=w("<p class=px-4>"),RI=w('<span class="flex items-center gap-2">'),OI=w("<span class=relative>"),NI=w('<svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd>'),$I=w('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),MI=w('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),ix=e=>{let t,n=e.options,r=n?.areInitialSearchButtonsVisible??!0,[o,i]=O(n?.isSearchable&&!r?[]:e.defaultItems),[a,s]=O({}),[l,c]=O(!1);me(()=>{!st()&&t&&t.focus({preventScroll:!0})});let u=f=>{if(l()){console.log("\u{1F50D} Button click ignorado - fluxo j\xE1 foi executado");return}let p=o()[f],{value:y,content:h}=p,k=`${f}`;s(C=>({...C,[k]:!0})),console.log("\u{1F50D} Button clicado - continuando fluxo"),e.onSubmit({type:"text",value:y||h||"",label:y?h:void 0}),c(!0),console.log("\u{1F50D} Fluxo executado - desabilitando outros bot\xF5es")},d=f=>{if(f===""||f.trim().length===0){i(r?e.defaultItems:[]);return}i(e.defaultItems.filter(p=>p.content?.toLowerCase().includes(f.toLowerCase())))};return(()=>{var f=PI(),p=f.firstChild,y=p.firstChild,h=y.firstChild,k=y.nextSibling;return v(p,m(U,{get when(){return n?.imageUrl},get children(){var C=EI();return $(()=>K(C,"src",n?.imageUrl)),C}}),y),v(h,m(U,{get when(){return n?.title},children:C=>(()=>{var b=II();return v(b,C),b})()}),null),v(h,m(U,{get when(){return n?.description},children:C=>(()=>{var b=AI();return v(b,C),b})()}),null),v(k,m(Re,{get each(){return o()},children:(C,b)=>(()=>{var T=OI();return v(T,m(yt,{"on:click":()=>u(b()),get"data-itemid"(){return C.id},variant:"secondary",get class(){return q("w-full font-normal text-sm border-host-bubble-border rounded-none",b()===0&&"rounded-t-host-bubble border border-b-0",b()!==0&&"border border-b-0",b()===(o().length??1)-1&&"rounded-b-host-bubble border-b",a()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",l()&&!a()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm",get isDisabled(){return a()[`${b()}`]||l()&&!a()[`${b()}`]},get children(){var g=RI();return v(g,(()=>{var x=L(()=>!!a()[`${b()}`]);return()=>x()?[NI(),"Enviado"]:[$I(),L(()=>C.content)]})()),g}}),null),v(T,(()=>{var g=L(()=>e.chunkIndex===0&&e.defaultItems.length===1);return()=>g()&&MI()})(),null),T})()})),f})()};var DI=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor stroke=currentColor stroke-width=0 stroke-linecap=round stroke-linejoin=round><path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"></path><path d="M6 12h16">'),ax=e=>(()=>{var t=DI();return Ce(t,e,!0,!0),t})();var Xe=e=>{let t=bl(),[n,r]=qe(e,["isDisabled","isLoading","disableIcon"]),o=t()==="sm"&&!n.disableIcon||!r.children||typeof r.children=="string"&&ct(r.children);return m(yt,ge(r,{type:"submit",get class(){return q(r.class,"flex items-center")},"aria-label":o?"Enviar":void 0,get children(){return m(Fe,{get children(){return[m(ee,{when:o,get children(){return m(ax,{get class(){return"send-icon flex w-6 h-6 "+(n.disableIcon?"hidden":"")}})}}),m(ee,{when:!o,get children(){return e.children}})]}})}}))};var sx={buttonLabel:ft,imageUrl:"",title:"",description:"",isMultipleChoice:!1,isSearchable:!1,areInitialSearchButtonsVisible:!0};var LI=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),lx=e=>(()=>{var t=LI();return Ce(t,e,!0,!0),t})();var BI=w("<div>"),Qu=e=>(()=>{var t=BI();return v(t,m(U,{get when(){return e.isChecked},get children(){return m(lx,{})}})),$(()=>G(t,"w-4 h-4 makebot-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var FI=w('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),UI=w('<form class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),VI=w('<h2 class="px-4 font-semibold">'),jI=w("<p class=px-4>"),zI=w('<span class="relative w-full @xs:w-auto"><div role=checkbox><div class="flex items-center gap-2"><span>'),GI=w('<span class="relative w-full @xs:w-auto"><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable selected border-host-bubble-border rounded-none border border-b-0"><div class="flex items-center gap-2"><span>'),cx=e=>{let t,n=e.options,[r,o]=O(n?.isSearchable&&!n?.areInitialSearchButtonsVisible?[]:e.defaultItems),[i,a]=O([]),[s,l]=O({}),[c,u]=O(!1);me(()=>{!st()&&t&&t.focus({preventScroll:!0})});let d=h=>{f(h)},f=h=>{let k=i().indexOf(h);a(k!==-1?C=>C.filter(b=>b!==h):C=>[...C,h])},p=()=>{if(c()){console.log("\u{1F50D} Multiple choice submit ignorado - fluxo j\xE1 foi executado");return}let h=i().map(C=>e.defaultItems.find(b=>b.id===C)),k=h.some(C=>C?.value);console.log("\u{1F50D} Multiple choice submit - continuando fluxo"),e.onSubmit({type:"text",value:h.map(C=>C?.value??C?.content).join(", "),label:k?h.map(C=>C?.content??C?.value).join(", "):void 0}),u(!0),console.log("\u{1F50D} Fluxo executado - desabilitando m\xFAltipla escolha")},y=h=>{if(h===""||h.trim().length===0){o(n?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}o(e.defaultItems.filter(k=>k.content?.toLowerCase().includes(h.toLowerCase())))};return(()=>{var h=UI(),k=h.firstChild,C=k.firstChild,b=C.firstChild,T=C.nextSibling;return h.addEventListener("submit",p),v(k,m(U,{get when(){return n?.imageUrl},get children(){var g=FI();return $(()=>K(g,"src",n?.imageUrl)),g}}),C),v(b,m(U,{get when(){return e.options?.title},children:g=>(()=>{var x=VI();return v(x,g),x})()}),null),v(b,m(U,{get when(){return e.options?.description},children:g=>(()=>{var x=jI();return v(x,g),x})()}),null),v(T,m(Re,{get each(){return r()},children:(g,x)=>(()=>{var S=zI(),P=S.firstChild,R=P.firstChild,N=R.firstChild;return gt(P,"click",()=>d(g.id)),v(R,m(Qu,{get isChecked(){return i().some(D=>D===g.id)},class:"flex-shrink-0"}),N),v(N,()=>g.content),$(D=>{var F=i().some(V=>V===g.id),A=q("w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable border-host-bubble-border rounded-none",x()===0&&"rounded-t-host-bubble border border-b-0",x()!==0&&"border border-b-0",x()===(r().length??1)-1&&"rounded-b-host-bubble border-b",i().some(V=>V===g.id)&&"selected"),M=g.id;return F!==D.e&&K(P,"aria-checked",D.e=F),A!==D.t&&G(P,D.t=A),M!==D.a&&K(P,"data-itemid",D.a=M),D},{e:void 0,t:void 0,a:void 0}),S})()}),null),v(T,m(Re,{get each(){return i().filter(g=>r().every(x=>x.id!==g))},children:g=>(()=>{var x=GI(),S=x.firstChild,P=S.firstChild,R=P.firstChild;return gt(S,"click",()=>d(g)),K(S,"data-itemid",g),v(P,m(Qu,{isChecked:!0}),R),v(R,()=>e.defaultItems.find(N=>N.id===g)?.content),x})()}),null),v(h,(()=>{var g=L(()=>i().length>0);return()=>g()&&m(Xe,{class:"h-[43px]",get children(){return e.options?.buttonLabel??sx.buttonLabel}})})(),null),h})()};var HI=e=>m(qn.Root,e),WI=e=>m(qn.Control,e),qI=e=>m(qn.PrevTrigger,e),ZI=e=>m(qn.NextTrigger,e),YI=e=>m(qn.ItemGroup,e),KI=e=>m(qn.Item,e),vo={Root:HI,Control:WI,PrevTrigger:qI,NextTrigger:ZI,ItemGroup:YI,Item:KI};var XI=w('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m12 19-7-7 7-7"></path><path d="M19 12H5">'),ux=e=>(()=>{var t=XI();return Ce(t,e,!0,!0),t})();var JI=w('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M5 12h14"></path><path d="m12 5 7 7-7 7">'),dx=e=>(()=>{var t=JI();return Ce(t,e,!0,!0),t})();var mx=w('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),QI=w('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">'),eA=w('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">'),tA=w('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M15 11a3 3 0 11-6 0 3 3 0 016 0z">'),nA=w('<div class="flex justify-end mb-2">'),rA=w('<div class="absolute inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-4"><img alt="Imagem ampliada"class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto object-contain">'),oA=w('<div class="flex flex-col gap-4"><img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer"><div class="flex flex-col gap-2">'),iA=w('<div class="px-3 pb-2">'),aA=w('<h2 class="px-4 font-semibold">'),sA=w("<p class=px-4>"),lA=w('<span class="flex items-center gap-2"><svg class="animate-spin h-4 w-4 text-current"xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),cA=w('<span class="flex items-center gap-2"><svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd></path></svg>Enviado'),uA=w('<span class="flex items-center gap-2">'),dA=w("<div>"),mA=e=>{if(console.log("\u{1F50D} convertSubmitContentToMessage - input:",e),!e){console.log("\u{1F50D} convertSubmitContentToMessage - answer \xE9 undefined");return}if(e.type==="text"){let t={type:"text",text:e.value};return console.log("\u{1F50D} convertSubmitContentToMessage - resultado:",t),t}console.log("\u{1F50D} convertSubmitContentToMessage - tipo n\xE3o suportado:",e.type)},fx=e=>{let[t,n]=O({}),[r,o]=O({}),[i,a]=O({}),[s,l]=O(!1),c=b=>{switch(b){case"quick_reply":return mx();case"cta_url":return QI();case"cta_copy":return eA();case"send_location":return tA();default:return mx()}},u=(b,T,g=3e3)=>{n(x=>({...x,[b]:!0})),o(x=>({...x,[b]:T})),setTimeout(()=>{o(x=>{let S={...x};return delete S[b],S}),n(x=>({...x,[b]:!1}))},g)},d=async b=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(b),!0;{let T=document.createElement("textarea");T.value=b,T.style.position="fixed",T.style.left="-999999px",T.style.top="-999999px",document.body.appendChild(T),T.focus(),T.select();let g=document.execCommand("copy");return T.remove(),g}}catch(T){return console.error("Erro ao copiar:",T),!1}},f=async b=>{if(!e.context?.sessionId){console.error("\u274C sessionId n\xE3o encontrado no contexto");return}try{console.log("\u{1F50D} Enviando mensagem diretamente para API:",b);let{data:T,error:g}=await ya({apiHost:e.context.apiHost??kt(),sessionId:e.context.sessionId,message:mA(b)});if(g){console.error("\u274C Erro ao enviar mensagem:",g);return}console.log("\u2705 Mensagem enviada com sucesso:",T);let x=new CustomEvent("makebot-api-response",{detail:{sessionId:e.context.sessionId,response:T}});window.dispatchEvent(x),console.log("\u2705 Evento de resposta da API disparado")}catch(T){console.error("\u274C Erro ao enviar mensagem:",T)}},[p,y]=O();console.log("\u{1F50D} CardsCaroussel renderizado:",{blockItems:e.block.items,firstItemPaths:e.block.items[0]?.paths,firstPathType:e.block.items[0]?.paths?.[0]?.type,firstPathConfig:e.block.items[0]?.paths?.[0]?.config}),console.log("\u{1F50D} Detalhes completos dos paths:",JSON.stringify(e.block.items.map(b=>({id:b.id,paths:b.paths?.map(T=>({id:T.id,text:T.text,type:T.type,config:T.config,outgoingEdgeId:T.outgoingEdgeId}))})),null,2));let h=async(b,T,g)=>{if(b.type==="quick_reply"&&s()){console.log("\u{1F50D} Quick reply ignorado - fluxo j\xE1 foi executado");return}switch(a(x=>({...x,[T]:!0})),b.type){case"cta_url":b.config?.url&&window.open(b.config.url,"_blank"),u(T,"Link aberto!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"cta_copy":let x=await d(b.config?.copyValue||"");u(T,x?"Copiado!":"Erro ao copiar"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"send_location":"geolocation"in navigator?navigator.geolocation.getCurrentPosition(async P=>{let{latitude:R,longitude:N}=P.coords,D=`${R},${N}`;u(T,"Localiza\xE7\xE3o enviada!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"))},P=>{console.error("Erro ao obter localiza\xE7\xE3o:",P),u(T,"Erro ao obter localiza\xE7\xE3o",3e3)}):u(T,"Geolocaliza\xE7\xE3o n\xE3o suportada",3e3);break;default:console.log("\u{1F50D} Bot\xE3o quick_reply clicado:",{pathId:b.id,pathText:b.text,outgoingEdgeId:b.outgoingEdgeId,imageUrl:e.block.items[g].imageUrl});let S=b.id;if(!S){console.log("\u{1F50D} Bot\xE3o quick_reply sem ID v\xE1lido - IGNORADO"),u(T,"Bot\xE3o n\xE3o configurado",2e3);return}console.log("\u{1F50D} Bot\xE3o quick_reply clicado - continuando fluxo"),e.onSubmit({type:"text",value:S,label:b.text??""}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"),console.log("\u{1F50D} Bot\xE3o quick_reply marcado como clicado:",T);break}},k=bl(),C=re(()=>pA(e.block.items.length,{containerSize:k()}));return[m(vo.Root,{get slideCount(){return e.block.items.length},get slidesPerPage(){return C()},slidesPerMove:1,spacing:"12px",class:"overflow-visible @xs:-mr-5 -mr-4",get children(){return[(()=>{var b=nA();return v(b,m(vo.Control,{class:"flex gap-2 @xs:mr-5 mr-4",get children(){return[m(vo.PrevTrigger,{asChild:T=>m(yt,ge({variant:"secondary"},T,{get children(){return m(ux,{class:"w-4 h-4"})}}))}),m(vo.NextTrigger,{asChild:T=>m(yt,ge({variant:"secondary"},T,{get children(){return m(dx,{class:"w-4 h-4"})}}))})]}})),$(T=>ae(b,"display",e.block.items.length>C()?void 0:"none")),b})(),m(vo.ItemGroup,{class:"rounded-l-host-bubble @xs:pr-5 pr-4 p-4",get children(){return m(Fi,{get each(){return e.block.items},children:(b,T)=>m(vo.Item,{index:T,get children(){return m(fA,{class:"h-full",get children(){return[(()=>{var g=oA(),x=g.firstChild,S=x.nextSibling;return x.$$click=()=>y(b().imageUrl??void 0),v(S,m(U,{get when(){return b().title},children:P=>(()=>{var R=aA();return v(R,P),R})()}),null),v(S,m(U,{get when(){return b().description},children:P=>(()=>{var R=sA();return v(R,P),R})()}),null),$(()=>K(x,"src",b().imageUrl??"")),g})(),(()=>{var g=iA();return v(g,m(Re,{get each(){return b().paths},children:(x,S)=>m(yt,{variant:"secondary",get class(){return vr("w-full font-normal text-sm border-host-bubble-border rounded-none",S()===0&&"rounded-t-host-bubble border border-b-0",S()!==0&&"border border-b-0",S()===(b().paths?.length??1)-1&&"rounded-b-host-bubble border-b",x.type==="quick_reply"&&i()[`${T}-${S()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",x.type==="quick_reply"&&s()&&!i()[`${T}-${S()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm","on:click":()=>h(x,`${T}-${S()}`,T),get isDisabled(){return t()[`${T}-${S()}`]||x.type==="quick_reply"&&i()[`${T}-${S()}`]||x.type==="quick_reply"&&s()&&!i()[`${T}-${S()}`]},get children(){return L(()=>!!t()[`${T}-${S()}`])()?(()=>{var P=lA(),R=P.firstChild;return v(P,()=>r()[`${T}-${S()}`],null),P})():L(()=>!!(x.type==="quick_reply"&&i()[`${T}-${S()}`]))()?cA():(()=>{var P=uA();return v(P,()=>c(x.type),null),v(P,()=>x.text,null),P})()}})})),g})()]}})}})})}})]}}),m(U,{get when(){return p()},get children(){var b=rA(),T=b.firstChild;return b.$$click=()=>y(void 0),$(()=>K(T,"src",p())),b}})]},fA=e=>(()=>{var t=dA();return v(t,()=>e.children),$(()=>G(t,vr("makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden",e.class))),t})(),pA=(e,{containerSize:t})=>t==="xs"?e>1?1.2:1:t==="sm"?e>1?1.5:1:t==="md"||t==="lg"?e>2?2.2:e:e>3?3.2:e;Ne(["click"]);var _l={hasTime:!1,isRange:!1,labels:{button:ft,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};var gA=w('<div class="makebot-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input makebot-datetime-input"data-testid=from-date style=min-height:24px;min-width:100px;font-size:16px>'),px=w("<p class=font-semibold>"),hA=w('<div class="flex items-center p-2"><input class="focus:outline-none flex-1 w-full text-input ml-2 makebot-datetime-input"data-testid=to-date style=min-height:24px;min-width:100px;font-size:16px>'),gx=e=>{let[t,n]=O(bA(e.defaultValue??"")),r=()=>{t().from===""&&t().to===""||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})},o=i=>{i.key==="Enter"&&(i.preventDefault(),r())};return(()=>{var i=gA(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.firstChild;return a.addEventListener("submit",u=>{u.preventDefault(),r()}),v(l,(()=>{var u=L(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=px();return v(d,()=>e.options.labels?.from??_l.labels.from),d})()})(),c),c.$$keydown=o,c.addEventListener("change",u=>n({...t(),from:u.currentTarget.value})),v(s,(()=>{var u=L(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=hA(),f=d.firstChild;return v(d,(()=>{var p=L(()=>!!e.options.isRange);return()=>p()&&(()=>{var y=px();return v(y,()=>e.options.labels?.to??_l.labels.to),y})()})(),f),f.$$keydown=o,f.addEventListener("change",p=>n({...t(),to:p.currentTarget.value})),$(p=>{var y=e.options.hasTime?"datetime-local":"date",h=e.options?.min,k=e.options?.max;return y!==p.e&&K(f,"type",p.e=y),h!==p.t&&K(f,"min",p.t=h),k!==p.a&&K(f,"max",p.a=k),p},{e:void 0,t:void 0,a:void 0}),$(()=>f.value=t().to),d})()})(),null),v(i,m(Xe,{class:"h-[43px]","on:click":r,get children(){return e.options?.labels?.button??_l.labels.button}}),null),$(u=>{var d=q("flex makebot-input",e.options?.isRange?"items-end":"items-center"),f="flex items-center p-2 "+(e.options?.isRange?"pb-0 gap-2":""),p=e.options?.hasTime?"datetime-local":"date",y=e.options?.min,h=e.options?.max;return d!==u.e&&G(a,u.e=d),f!==u.t&&G(l,u.t=f),p!==u.a&&K(c,"type",u.a=p),y!==u.o&&K(c,"min",u.o=y),h!==u.i&&K(c,"max",u.i=h),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),$(()=>c.value=t().from),i})()},bA=e=>{if(!e.includes("to"))return{from:e,to:""};let[t,n]=e.split(" to ");return{from:t,to:n}};Ne(["keydown"]);var yA=w('<input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input"type=text>'),Cr=e=>{let[t,n]=qe(e,["ref","onInput","inputmode"]);return(()=>{var r=yA();r.$$input=i=>t.onInput(i.currentTarget.value);var o=e.ref;return typeof o=="function"?ke(o,r):e.ref=r,Ce(r,ge({get inputmode(){return t.inputmode}},n),!1,!1),r})()};Ne(["input"]);var ed={labels:{button:ft,placeholder:"Digite seu e-mail..."},retryMessageContent:"Este e-mail parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var vA=w('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),hx=e=>{let[t,n]=O(e.defaultValue??""),r,o=c=>n(c),i=()=>r?.value!==""&&r?.reportValidity(),a=()=>{i()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=c=>{c.key==="Enter"&&a()};me(()=>{!st()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",l)}),ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&n(u.value)};return(()=>{var c=vA(),u=c.firstChild;return c.$$keydown=s,v(u,m(Cr,{ref(d){var f=r;typeof f=="function"?f(d):r=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??ed.labels.placeholder},onInput:o,type:"email",autocomplete:"email"})),v(c,m(Xe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.block.options?.labels?.button??ed.labels.button}}),null),c})()};Ne(["keydown"]);var vn={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:`<strong>Escolha uma imagem</strong>
53
53
  ou arraste e solte<br>
54
- (limite de tamanho: 10MB)`,button:"Upload",clear:"Limpar",skip:"Pular",success:{single:"Arquivo enviado",multiple:"{total} arquivos enviados"}}};var ys=({newFile:e,existingFiles:t,params:r,context:n,onError:o})=>{let i=r.sizeLimit??Wt("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(i&&e.size>Number(i)*1024*1024){o({description:(n.makebot.settings.general?.systemMessages?.fileUploadSizeError??Lt.fileUploadSizeError).replace("[[file]]",e.name).replace("[[limit]]",i)});return}if(t.length===0)return e;let a=e.name,s=1;for(;t.some(l=>l.name===a);){let l=e.name.lastIndexOf("."),c=l!==-1?e.name.slice(l):"";a=`${e.name.slice(0,l)}(${s})${c}`,s++}return new File([e],a,{type:e.type})};var Eo=async({apiHost:e,files:t,onUploadProgress:r})=>{let n=[],o=[],i=0;for(let{input:a,file:s}of t){r&&r({progress:i/t.length*100,fileIndex:i}),i+=1;let{data:l,error:c}=await $d({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:a.fileName,sessionId:a.sessionId,fileType:s.type,blockId:a.blockId}});if(c){o.push(c.message);continue}if(l?.presignedUrl){let u=new FormData;if(Object.entries(l.formData).forEach(([p,f])=>{u.append(p,f)}),u.append("file",s),!(await fetch(l.presignedUrl,{method:"POST",body:u})).ok)continue;n.push({url:l.fileUrl,type:s.type})}else continue}return o.length>0?{type:"error",error:o.join(", ")}:{type:"success",urls:n}};var N2=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),pr=e=>(()=>{var t=N2();return be(t,e,!0,!0),t})();var M2=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),xs=e=>(()=>{var t=M2();return be(t,e,!0,!0),t})();var D2=C('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),vs=e=>{let t=B2(e.file);return(()=>{var r=D2(),n=r.firstChild,o=n.nextSibling,i=o.firstChild,a=i.nextSibling;return v(n,m(xs,{class:"w-6 h-6"})),v(i,()=>e.file.name),v(a,()=>L2(e.file)),$(()=>V(n,q("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),r})()},L2=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},B2=e=>{let t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}};var F2=C('<img class="rounded-md object-cover w-[58px] h-[58px]">'),U2=C('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remover anexo">'),V2=C('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),ws=e=>(()=>{var t=U2(),r=t.firstChild;return v(t,m(Ie,{get children(){return[m(Z,{get when(){return e.file.type.startsWith("image")},get children(){var n=F2();return $(o=>{var i=URL.createObjectURL(e.file),a=e.file.name;return i!==o.e&&G(n,"src",o.e=i),a!==o.t&&G(n,"alt",o.t=a),o},{e:void 0,t:void 0}),n}}),m(Z,{when:!0,get children(){return m(vs,{get file(){return e.file}})}})]}}),r),Be(r,"click",e.onRemoveClick),v(r,m(pr,{class:"w-4"})),v(t,m(U,{get when(){return L(()=>!!de(e.uploadProgressPercent))()&&e.uploadProgressPercent!==100},get children(){return m(z2,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),z2=e=>{let[t,r]=O(e.progressPercent??0),n;return ve(()=>{e.progressPercent===20&&(n=setInterval(()=>{t()<100&&r(i=>i+(Math.floor(Math.random()*10)+1))},1e3))}),re(()=>{clearInterval(n)}),(()=>{var o=V2();return v(o,m(Cn.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m(Cn.Circle,{get children(){return[m(Cn.CircleTrack,{}),m(Cn.CircleRange,{})]}})}})),o})()};var G2=C('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full"style="transition:width 150ms cubic-bezier(0.4, 0, 0.2, 1)">'),H2=C('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),j2=C('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),W2=C("<input id=dropzone-file type=file class=hidden>"),q2=C('<div class="flex justify-end">'),Y2=C('<div class="flex justify-end"><div class="flex gap-2">'),K2=C('<form class="flex flex-col w-full gap-2"><label for=dropzone-file>'),X2=C('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-500><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),Gy=e=>{let[t,r]=O([]),[n,o]=O(!1),[i,a]=O(0),[s,l]=O(!1),c=e.context.makebot.settings.general?.systemMessages?.fileUploadError??Lt.fileUploadError,u=g=>{let k=Array.from(g).map(S=>ys({existingFiles:t(),newFile:S,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},context:e.context,onError:({description:P})=>$t.create({description:P})})).filter(de);if(k.length!==0){if(!e.block.options?.isMultipleAllowed)return p(k[0]);r([...t(),...k])}},d=async g=>{g.preventDefault(),t().length!==0&&f(t())},p=async g=>{o(!0);let k=await Eo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:!0}),files:[{file:g,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:g.name}}]});if(o(!1),k.type==="success"&&k.urls.length&&k.urls[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??tr.labels.success.single,value:k.urls[0]?zy(k.urls[0].url):"",attachments:[{type:g.type,url:k.urls[0].url,blobUrl:URL.createObjectURL(g)}]});k.type==="error"&&$t.create({description:k.error})},f=async g=>{o(!0);let k=await Eo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:!0}),files:g.map(S=>({file:S,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:S.name}})),onUploadProgress:a});if(o(!1),a(0),k.type==="error")return $t.create({description:k.error});e.onSubmit({type:"text",label:k.urls.length>1?(e.block.options?.labels?.success?.multiple??tr.labels.success.multiple).replaceAll("{total}",k.urls.length.toString()):e.block.options?.labels?.success?.single??tr.labels.success.single,value:k.urls.filter(de).map(({url:S})=>zy(S)).join(", "),attachments:k.urls.map((S,P)=>S?{...S,blobUrl:URL.createObjectURL(t()[P])}:null).filter(de)})},x=g=>{g.preventDefault(),l(!0)},h=()=>l(!1),w=g=>{g.preventDefault(),g.stopPropagation(),g.dataTransfer?.files&&u(g.dataTransfer.files)},T=()=>r([]),b=()=>e.onSkip(e.block.options?.labels?.skip??tr.labels.skip),y=g=>{r(k=>k.filter((S,P)=>P!==g))};return(()=>{var g=K2(),k=g.firstChild;return g.addEventListener("submit",d),k.addEventListener("drop",w),k.addEventListener("dragleave",h),k.addEventListener("dragover",x),v(k,m(Ie,{get children(){return[m(Z,{get when(){return n()},get children(){return m(U,{get when(){return t().length>1},get fallback(){return m(ms,{})},get children(){var S=G2(),P=S.firstChild;return $(A=>ne(P,"width",`${i()>0?i:10}%`)),S}})}}),m(Z,{get when(){return!n()},get children(){return[(()=>{var S=j2(),P=S.firstChild;return v(S,m(U,{get when(){return t().length},get fallback(){return m(Z2,{})},get children(){var A=H2();return Be(A,"click",N=>{N.preventDefault(),N.stopPropagation()}),v(A,m(we,{get each(){return t()},children:(N,D)=>m(ws,{file:N,onRemoveClick:()=>y(D())})})),A}}),P),$(()=>P.innerHTML=e.block.options?.labels?.placeholder??tr.labels.placeholder),S})(),(()=>{var S=W2();return S.addEventListener("change",P=>{P.currentTarget.files&&(u(P.currentTarget.files),P.currentTarget.value="")}),$(P=>{var A=e.block.options?.allowedFileTypes?.isEnabled?e.block.options?.allowedFileTypes?.types?.join(", "):void 0,N=e.block.options?.isMultipleAllowed??tr.isMultipleAllowed;return A!==P.e&&G(S,"accept",P.e=A),N!==P.t&&(S.multiple=P.t=N),P},{e:void 0,t:void 0}),S})()]}})]}})),v(g,m(U,{get when(){return L(()=>t().length===0)()&&e.block.options?.isRequired===!1},get children(){var S=q2();return v(S,m(Ct,{"on:click":b,get children(){return e.block.options?.labels?.skip??tr.labels.skip}})),S}}),null),v(g,m(U,{get when(){return L(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!n()},get children(){var S=Y2(),P=S.firstChild;return v(P,m(U,{get when(){return t().length},get children(){return m(Ct,{variant:"secondary","on:click":T,get children(){return e.block.options?.labels?.clear??tr.labels.clear}})}}),null),v(P,m(Fe,{type:"submit",disableIcon:!0,get children(){return L(()=>(e.block.options?.labels?.button??tr.labels.button)===tr.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),S}}),null),$(()=>V(k,"makebot-upload-input py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8 "+(s()?"dragging-over":""))),g})()},Z2=()=>X2(),zy=e=>{let t=e.split("/").pop();if(!t)return e;let r=encodeURIComponent(t);return e.replace(t,r)};var J2=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),ks=e=>(()=>{var t=J2();return be(t,e,!0,!0),t})();var Q2=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 15l-6-6-6 6">'),Hy=e=>(()=>{var t=Q2();return be(t,e,!0,!0),t})();var jy="decimal",Wy=Ye,qy="Digite um n\xFAmero...";var Cs=e=>{if(typeof e=="number")return e;if(!e)return;let t=Number.parseFloat(e.toString().replace(",","."));return isNaN(t)?void 0:t};var e_=C('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]">'),Yy=e=>{let t=is({locale:navigator.language,formatOptions:t_(e.block.options),min:Cs(e.block.options?.min),max:Cs(e.block.options?.max),step:Cs(e.block.options?.step)}),r,n=()=>t().invalid?(r?.reportValidity(),!1):!0,o=()=>{n()?e.onSubmit({type:"text",value:t().valueAsNumber.toString(),label:t().value.toString()}):t().focus()},i=s=>{s.key==="Enter"&&o()};ae(()=>{!ze()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",a)}),re(()=>{window.removeEventListener("message",a)});let a=s=>{let{data:l}=s;l.isFromMakebot&&l.command==="setInputValue"&&t().setValue(Number(l.value))};return(()=>{var s=e_();return s.$$keydown=i,v(s,m(Yr.RootProvider,{value:t,class:"flex makebot-input w-full",get children(){return[m(Yr.Input,{ref(l){var c=r;typeof c=="function"?c(l):r=l},class:"focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input ml-2",style:{"font-size":"16px",appearance:"auto"},get placeholder(){return e.block.options?.labels?.placeholder??qy}}),m(Yr.Control,{class:"flex flex-col rounded-r-md overflow-hidden divide-y h-[42px]",get children(){return[m(Yr.IncrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return m(Hy,{class:"size-4"})}}),m(Yr.DecrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return m(ks,{class:"size-4"})}})]}})]}}),null),v(s,m(Fe,{type:"button",class:"h-[42px]","on:click":o,get children(){return e.block.options?.labels?.button??Wy}}),null),s})()},t_=e=>{let t={style:jy};return e?.style==="currency"&&e.currency?{style:e.style,currency:e.currency}:e?.style==="unit"&&e.unit?{style:e.style,unit:e.unit}:t};Se(["keydown"]);var Ts={provider:"Stripe",labels:{button:"Pagar",success:"Sucesso"},retryMessageContent:"O pagamento falhou. Tente novamente.",currency:"BRL"};var rx=rd(tx(),1);var l_=C('<div class="makebot-input-error-message mt-4 text-center animate-fade-in">'),c_=C('<form id=payment-form class="flex flex-col p-4 makebot-input w-full items-center"><slot name=stripe-payment-form>'),u_="stripe-payment-form",Ai,Ri=null,_s=null,nx=e=>{let[t,r]=O(),[n,o]=O(!1),[i,a]=O(!1);ae(async()=>{if(!Ai)return;if(d_(Ai),!e.options?.publicKey)return r("Missing Stripe public key");if(Ri=await(0,rx.loadStripe)(e.options?.publicKey),!Ri)return;_s=Ri.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(Ai).getPropertyValue("--makebot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});let l=_s.create("payment",{layout:"tabs"});l.on("ready",()=>{o(!0),e.onTransitionEnd()}),l.mount("#payment-element")});let s=async l=>{if(l.preventDefault(),!Ri||!_s)return;a(!0),Od({sessionId:e.context.sessionId,resultId:e.context.resultId,makebot:e.context.makebot});let{postalCode:c,...u}=e.options?.additionalInformation?.address??{},{error:d,paymentIntent:p}=await Ri.confirmPayment({elements:_s,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:c}}}},redirect:"if_required"});if(la(),a(!1),d?.type!=="validation_error"){if(d?.type==="card_error")return r(d.message);if(!d&&p.status==="succeeded")return e.onSuccess()}};return(()=>{var l=c_(),c=l.firstChild;l.addEventListener("submit",s);var u=Ai;return typeof u=="function"?ge(u,c):Ai=c,c._$owner=Wn(),v(l,m(U,{get when(){return n()},get children(){return m(Fe,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[L(()=>e.options?.labels?.button??Ts.labels.button)," ",L(()=>e.options?.amountLabel)]}})}}),null),v(l,m(U,{get when(){return t()},get children(){var d=l_();return v(d,t),d}}),null),l})()},d_=e=>{let r=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot=u_,r.appendChild(n);let o=document.createElement("div");o.id="payment-element",n.appendChild(o)};var ox=e=>m(nx,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var Gc={labels:{button:Ye,placeholder:"Digite seu n\xFAmero de telefone..."},retryMessageContent:"Este n\xFAmero de telefone parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var en=[{name:"Internacional",flag:"/flags/m/INT.svg",code:"INT",dial_code:""},{name:"Brasil",flag:"/flags/m/BR.svg",code:"BR",dial_code:"+55"},{name:"Arg\xE9lia",flag:"/flags/m/DZ.svg",code:"DZ",dial_code:"+213"},{name:"Andorra",flag:"/flags/m/AD.svg",code:"AD",dial_code:"+376"},{name:"Angola",flag:"/flags/m/AO.svg",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"/flags/m/AI.svg",code:"AI",dial_code:"+1264"},{name:"Ant\xEDgua e Barbuda",flag:"/flags/m/AG.svg",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"/flags/m/AR.svg",code:"AR",dial_code:"+54"},{name:"Arm\xEAnia",flag:"/flags/m/AM.svg",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"/flags/m/AW.svg",code:"AW",dial_code:"+297"},{name:"Austr\xE1lia",flag:"/flags/m/AU.svg",code:"AU",dial_code:"+61"},{name:"\xC1ustria",flag:"/flags/m/AT.svg",code:"AT",dial_code:"+43"},{name:"Azerbaij\xE3o",flag:"/flags/m/AZ.svg",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"/flags/m/BS.svg",code:"BS",dial_code:"+1242"},{name:"Bahrein",flag:"/flags/m/BH.svg",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"/flags/m/BD.svg",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"/flags/m/BB.svg",code:"BB",dial_code:"+1246"},{name:"Bielorr\xFAssia",flag:"/flags/m/BY.svg",code:"BY",dial_code:"+375"},{name:"B\xE9lgica",flag:"/flags/m/BE.svg",code:"BE",dial_code:"+32"},{name:"Belize",flag:"/flags/m/BZ.svg",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"/flags/m/BJ.svg",code:"BJ",dial_code:"+229"},{name:"Bermudas",flag:"/flags/m/BM.svg",code:"BM",dial_code:"+1441"},{name:"But\xE3o",flag:"/flags/m/BT.svg",code:"BT",dial_code:"+975"},{name:"Bol\xEDvia",flag:"/flags/m/BO.svg",code:"BO",dial_code:"+591"},{name:"B\xF3snia e Herzegovina",flag:"/flags/m/BA.svg",code:"BA",dial_code:"+387"},{name:"Botsuana",flag:"/flags/m/BW.svg",code:"BW",dial_code:"+267"},{name:"Brunei",flag:"/flags/m/BN.svg",code:"BN",dial_code:"+673"},{name:"Bulg\xE1ria",flag:"/flags/m/BG.svg",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"/flags/m/BF.svg",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"/flags/m/BI.svg",code:"BI",dial_code:"+257"},{name:"Camboja",flag:"/flags/m/KH.svg",code:"KH",dial_code:"+855"},{name:"Camar\xF5es",flag:"/flags/m/CM.svg",code:"CM",dial_code:"+237"},{name:"Canad\xE1",flag:"/flags/m/CA.svg",code:"CA",dial_code:"+1"},{name:"Ilhas de Cabo Verde",flag:"/flags/m/CV.svg",code:"CV",dial_code:"+238"},{name:"Ilhas Cayman",flag:"/flags/m/KY.svg",code:"KY",dial_code:"+1345"},{name:"Rep\xFAblica Centro-Africana",flag:"/flags/m/CF.svg",code:"CF",dial_code:"+236"},{name:"Chile",flag:"/flags/m/CL.svg",code:"CL",dial_code:"+56"},{name:"China",flag:"/flags/m/CN.svg",code:"CN",dial_code:"+86"},{name:"Col\xF4mbia",flag:"/flags/m/CO.svg",code:"CO",dial_code:"+57"},{name:"Comores",flag:"/flags/m/KM.svg",code:"KM",dial_code:"+269"},{name:"Congo",flag:"/flags/m/CG.svg",code:"CG",dial_code:"+242"},{name:"Ilhas Cook",flag:"/flags/m/CK.svg",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"/flags/m/CR.svg",code:"CR",dial_code:"+506"},{name:"Costa do Marfim",flag:"/flags/m/CI.svg",code:"CI",dial_code:"+225"},{name:"Cro\xE1cia",flag:"/flags/m/HR.svg",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"/flags/m/CU.svg",code:"CU",dial_code:"+53"},{name:"Chipre Norte",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+90392"},{name:"Chipre Sul",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+357"},{name:"Rep\xFAblica Tcheca",flag:"/flags/m/CZ.svg",code:"CZ",dial_code:"+420"},{name:"Dinamarca",flag:"/flags/m/DK.svg",code:"DK",dial_code:"+45"},{name:"Djibuti",flag:"/flags/m/DJ.svg",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"/flags/m/DM.svg",code:"DM",dial_code:"+1809"},{name:"Rep\xFAblica Dominicana",flag:"/flags/m/DO.svg",code:"DO",dial_code:"+1809"},{name:"Equador",flag:"/flags/m/EC.svg",code:"EC",dial_code:"+593"},{name:"Egito",flag:"/flags/m/EG.svg",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"/flags/m/SV.svg",code:"SV",dial_code:"+503"},{name:"Guin\xE9 Equatorial",flag:"/flags/m/GQ.svg",code:"GQ",dial_code:"+240"},{name:"Eritreia",flag:"/flags/m/ER.svg",code:"ER",dial_code:"+291"},{name:"Est\xF4nia",flag:"/flags/m/EE.svg",code:"EE",dial_code:"+372"},{name:"Eti\xF3pia",flag:"/flags/m/ET.svg",code:"ET",dial_code:"+251"},{name:"Ilhas Malvinas",flag:"/flags/m/FK.svg",code:"FK",dial_code:"+500"},{name:"Ilhas Faro\xE9",flag:"/flags/m/FO.svg",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"/flags/m/FJ.svg",code:"FJ",dial_code:"+679"},{name:"Finl\xE2ndia",flag:"/flags/m/FI.svg",code:"FI",dial_code:"+358"},{name:"Fran\xE7a",flag:"/flags/m/FR.svg",code:"FR",dial_code:"+33"},{name:"Guiana Francesa",flag:"/flags/m/GF.svg",code:"GF",dial_code:"+594"},{name:"Polin\xE9sia Francesa",flag:"/flags/m/PF.svg",code:"PF",dial_code:"+689"},{name:"Gab\xE3o",flag:"/flags/m/GA.svg",code:"GA",dial_code:"+241"},{name:"G\xE2mbia",flag:"/flags/m/GM.svg",code:"GM",dial_code:"+220"},{name:"Ge\xF3rgia",flag:"/flags/m/GE.svg",code:"GE",dial_code:"+995"},{name:"Alemanha",flag:"/flags/m/DE.svg",code:"DE",dial_code:"+49"},{name:"Gana",flag:"/flags/m/GH.svg",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"/flags/m/GI.svg",code:"GI",dial_code:"+350"},{name:"Gr\xE9cia",flag:"/flags/m/GR.svg",code:"GR",dial_code:"+30"},{name:"Groenl\xE2ndia",flag:"/flags/m/GL.svg",code:"GL",dial_code:"+299"},{name:"Granada",flag:"/flags/m/GD.svg",code:"GD",dial_code:"+1473"},{name:"Guadalupe",flag:"/flags/m/GP.svg",code:"GP",dial_code:"+590"},{name:"Guam",flag:"/flags/m/GU.svg",code:"GU",dial_code:"+671"},{name:"Guatemala",flag:"/flags/m/GT.svg",code:"GT",dial_code:"+502"},{name:"Guin\xE9",flag:"/flags/m/GN.svg",code:"GN",dial_code:"+224"},{name:"Guin\xE9-Bissau",flag:"/flags/m/GW.svg",code:"GW",dial_code:"+245"},{name:"Guiana",flag:"/flags/m/GY.svg",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"/flags/m/HT.svg",code:"HT",dial_code:"+509"},{name:"Honduras",flag:"/flags/m/HN.svg",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"/flags/m/HK.svg",code:"HK",dial_code:"+852"},{name:"Hungria",flag:"/flags/m/HU.svg",code:"HU",dial_code:"+36"},{name:"Isl\xE2ndia",flag:"/flags/m/IS.svg",code:"IS",dial_code:"+354"},{name:"\xCDndia",flag:"/flags/m/IN.svg",code:"IN",dial_code:"+91"},{name:"Indon\xE9sia",flag:"/flags/m/ID.svg",code:"ID",dial_code:"+62"},{name:"Ir\xE3",flag:"/flags/m/IR.svg",code:"IR",dial_code:"+98"},{name:"Iraque",flag:"/flags/m/IQ.svg",code:"IQ",dial_code:"+964"},{name:"Irlanda",flag:"/flags/m/IE.svg",code:"IE",dial_code:"+353"},{name:"Israel",flag:"/flags/m/IL.svg",code:"IL",dial_code:"+972"},{name:"It\xE1lia",flag:"/flags/m/IT.svg",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"/flags/m/JM.svg",code:"JM",dial_code:"+1876"},{name:"Jap\xE3o",flag:"/flags/m/JP.svg",code:"JP",dial_code:"+81"},{name:"Jord\xE2nia",flag:"/flags/m/JO.svg",code:"JO",dial_code:"+962"},{name:"Cazaquist\xE3o",flag:"/flags/m/KZ.svg",code:"KZ",dial_code:"+7"},{name:"Qu\xEAnia",flag:"/flags/m/KE.svg",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"/flags/m/KI.svg",code:"KI",dial_code:"+686"},{name:"Coreia do Norte",flag:"/flags/m/KP.svg",code:"KP",dial_code:"+850"},{name:"Coreia do Sul",flag:"/flags/m/KR.svg",code:"KR",dial_code:"+82"},{name:"Kuwait",flag:"/flags/m/KW.svg",code:"KW",dial_code:"+965"},{name:"Quirguist\xE3o",flag:"/flags/m/KG.svg",code:"KG",dial_code:"+996"},{name:"Laos",flag:"/flags/m/LA.svg",code:"LA",dial_code:"+856"},{name:"Let\xF4nia",flag:"/flags/m/LV.svg",code:"LV",dial_code:"+371"},{name:"L\xEDbano",flag:"/flags/m/LB.svg",code:"LB",dial_code:"+961"},{name:"Lesoto",flag:"/flags/m/LS.svg",code:"LS",dial_code:"+266"},{name:"Lib\xE9ria",flag:"/flags/m/LR.svg",code:"LR",dial_code:"+231"},{name:"L\xEDbia",flag:"/flags/m/LY.svg",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"/flags/m/LI.svg",code:"LI",dial_code:"+417"},{name:"Litu\xE2nia",flag:"/flags/m/LT.svg",code:"LT",dial_code:"+370"},{name:"Luxemburgo",flag:"/flags/m/LU.svg",code:"LU",dial_code:"+352"},{name:"Macau",flag:"/flags/m/MO.svg",code:"MO",dial_code:"+853"},{name:"Maced\xF4nia",flag:"/flags/m/MK.svg",code:"MK",dial_code:"+389"},{name:"Madag\xE1scar",flag:"/flags/m/MG.svg",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"/flags/m/MW.svg",code:"MW",dial_code:"+265"},{name:"Mal\xE1sia",flag:"/flags/m/MY.svg",code:"MY",dial_code:"+60"},{name:"Maldivas",flag:"/flags/m/MV.svg",code:"MV",dial_code:"+960"},{name:"Mali",flag:"/flags/m/ML.svg",code:"ML",dial_code:"+223"},{name:"Malta",flag:"/flags/m/MT.svg",code:"MT",dial_code:"+356"},{name:"Ilhas Marshall",flag:"/flags/m/MH.svg",code:"MH",dial_code:"+692"},{name:"Martinica",flag:"/flags/m/MQ.svg",code:"MQ",dial_code:"+596"},{name:"Maurit\xE2nia",flag:"/flags/m/MR.svg",code:"MR",dial_code:"+222"},{name:"Mayotte",flag:"/flags/m/YT.svg",code:"YT",dial_code:"+269"},{name:"M\xE9xico",flag:"/flags/m/MX.svg",code:"MX",dial_code:"+52"},{name:"Micron\xE9sia",flag:"/flags/m/FM.svg",code:"FM",dial_code:"+691"},{name:"Mold\xE1via",flag:"/flags/m/MD.svg",code:"MD",dial_code:"+373"},{name:"M\xF4naco",flag:"/flags/m/MC.svg",code:"MC",dial_code:"+377"},{name:"Mong\xF3lia",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+976"},{name:"Montserrat",flag:"/flags/m/MS.svg",code:"MS",dial_code:"+1664"},{name:"Marrocos",flag:"/flags/m/MA.svg",code:"MA",dial_code:"+212"},{name:"Mo\xE7ambique",flag:"/flags/m/MZ.svg",code:"MZ",dial_code:"+258"},{name:"Mianmar",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+95"},{name:"Nam\xEDbia",flag:"/flags/m/NA.svg",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"/flags/m/NR.svg",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+977"},{name:"Holanda",flag:"/flags/m/NL.svg",code:"NL",dial_code:"+31"},{name:"Nova Caled\xF4nia",flag:"/flags/m/NC.svg",code:"NC",dial_code:"+687"},{name:"Nova Zel\xE2ndia",flag:"/flags/m/NZ.svg",code:"NZ",dial_code:"+64"},{name:"Nicar\xE1gua",flag:"/flags/m/NI.svg",code:"NI",dial_code:"+505"},{name:"N\xEDger",flag:"/flags/m/NE.svg",code:"NE",dial_code:"+227"},{name:"Nig\xE9ria",flag:"/flags/m/NG.svg",code:"NG",dial_code:"+234"},{name:"Niue",flag:"/flags/m/NU.svg",code:"NU",dial_code:"+683"},{name:"Ilhas Norfolk",flag:"/flags/m/NF.svg",code:"NF",dial_code:"+672"},{name:"Marianas do Norte",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+670"},{name:"Noruega",flag:"/flags/m/NO.svg",code:"NO",dial_code:"+47"},{name:"Om\xE3",flag:"/flags/m/OM.svg",code:"OM",dial_code:"+968"},{name:"Palau",flag:"/flags/m/PW.svg",code:"PW",dial_code:"+680"},{name:"Panam\xE1",flag:"/flags/m/PA.svg",code:"PA",dial_code:"+507"},{name:"Papua Nova Guin\xE9",flag:"/flags/m/PG.svg",code:"PG",dial_code:"+675"},{name:"Paraguai",flag:"/flags/m/PY.svg",code:"PY",dial_code:"+595"},{name:"Peru",flag:"/flags/m/PE.svg",code:"PE",dial_code:"+51"},{name:"Filipinas",flag:"/flags/m/PH.svg",code:"PH",dial_code:"+63"},{name:"Pol\xF4nia",flag:"/flags/m/PL.svg",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"/flags/m/PT.svg",code:"PT",dial_code:"+351"},{name:"Porto Rico",flag:"/flags/m/PR.svg",code:"PR",dial_code:"+1787"},{name:"Catar",flag:"/flags/m/QA.svg",code:"QA",dial_code:"+974"},{name:"Reuni\xE3o",flag:"/flags/m/RE.svg",code:"RE",dial_code:"+262"},{name:"Rom\xEAnia",flag:"/flags/m/RO.svg",code:"RO",dial_code:"+40"},{name:"R\xFAssia",flag:"/flags/m/RU.svg",code:"RU",dial_code:"+7"},{name:"Ruanda",flag:"/flags/m/RW.svg",code:"RW",dial_code:"+250"},{name:"San Marino",flag:"/flags/m/SM.svg",code:"SM",dial_code:"+378"},{name:"S\xE3o Tom\xE9 e Pr\xEDncipe",flag:"/flags/m/ST.svg",code:"ST",dial_code:"+239"},{name:"Ar\xE1bia Saudita",flag:"/flags/m/SA.svg",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"/flags/m/SN.svg",code:"SN",dial_code:"+221"},{name:"S\xE9rvia",flag:"/flags/m/RS.svg",code:"RS",dial_code:"+381"},{name:"Seicheles",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+248"},{name:"Serra Leoa",flag:"/flags/m/SL.svg",code:"SL",dial_code:"+232"},{name:"Singapura",flag:"/flags/m/SG.svg",code:"SG",dial_code:"+65"},{name:"Rep\xFAblica Eslovaca",flag:"/flags/m/SK.svg",code:"SK",dial_code:"+421"},{name:"Eslov\xEAnia",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+386"},{name:"Ilhas Salom\xE3o",flag:"/flags/m/SB.svg",code:"SB",dial_code:"+677"},{name:"Som\xE1lia",flag:"/flags/m/SO.svg",code:"SO",dial_code:"+252"},{name:"\xC1frica do Sul",flag:"/flags/m/ZA.svg",code:"ZA",dial_code:"+27"},{name:"Espanha",flag:"/flags/m/ES.svg",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"/flags/m/LK.svg",code:"LK",dial_code:"+94"},{name:"Santa Helena",flag:"/flags/m/SH.svg",code:"SH",dial_code:"+290"},{name:"S\xE3o Crist\xF3v\xE3o",flag:"/flags/m/KN.svg",code:"KN",dial_code:"+1869"},{name:"Santa L\xFAcia",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+1758"},{name:"Sud\xE3o",flag:"/flags/m/SD.svg",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"/flags/m/SR.svg",code:"SR",dial_code:"+597"},{name:"Suazil\xE2ndia",flag:"/flags/m/SZ.svg",code:"SZ",dial_code:"+268"},{name:"Su\xE9cia",flag:"/flags/m/SE.svg",code:"SE",dial_code:"+46"},{name:"Su\xED\xE7a",flag:"/flags/m/CH.svg",code:"CH",dial_code:"+41"},{name:"S\xEDria",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+963"},{name:"Taiwan",flag:"/flags/m/TW.svg",code:"TW",dial_code:"+886"},{name:"Tajiquist\xE3o",flag:"/flags/m/TJ.svg",code:"TJ",dial_code:"+992"},{name:"Tail\xE2ndia",flag:"/flags/m/TH.svg",code:"TH",dial_code:"+66"},{name:"Tanz\xE2nia - Rep\xFAblica Unida",flag:"/flags/m/TZ.svg",code:"TZ",dial_code:"+255"},{name:"Togo",flag:"/flags/m/TG.svg",code:"TG",dial_code:"+228"},{name:"Tonga",flag:"/flags/m/TO.svg",code:"TO",dial_code:"+676"},{name:"Trinidad e Tobago",flag:"/flags/m/TT.svg",code:"TT",dial_code:"+1868"},{name:"Tun\xEDsia",flag:"/flags/m/TN.svg",code:"TN",dial_code:"+216"},{name:"Turquia",flag:"/flags/m/TR.svg",code:"TR",dial_code:"+90"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turks & Ilhas Caicos",flag:"/flags/m/TC.svg",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"/flags/m/TV.svg",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"/flags/m/UG.svg",code:"UG",dial_code:"+256"},{name:"Reino Unido",flag:"/flags/m/GB-UKM.svg",code:"GB-UKM",dial_code:"+44"},{name:"Ucr\xE2nia",flag:"/flags/m/UA.svg",code:"UA",dial_code:"+380"},{name:"Emirados \xC1rabes Unidos",flag:"/flags/m/AE.svg",code:"AE",dial_code:"+971"},{name:"Uruguai",flag:"/flags/m/UY.svg",code:"UY",dial_code:"+598"},{name:"Estados Unidos",flag:"/flags/m/US.svg",code:"US",dial_code:"+1"},{name:"Uzbequist\xE3o",flag:"/flags/m/UZ.svg",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"/flags/m/VU.svg",code:"VU",dial_code:"+678"},{name:"Cidade do Vaticano",flag:"/flags/m/VA.svg",code:"VA",dial_code:"+379"},{name:"Venezuela",flag:"/flags/m/VE.svg",code:"VE",dial_code:"+58"},{name:"Vietn\xE3",flag:"/flags/m/VN.svg",code:"VN",dial_code:"+84"},{name:"Ilhas Virgens Brit\xE2nicas",flag:"/flags/m/VG.svg",code:"VG",dial_code:"+1284"},{name:"Ilhas Virgens Americanas",flag:"/flags/m/VI.svg",code:"VI",dial_code:"+1340"},{name:"Wallis e Futuna",flag:"/flags/m/WF.svg",code:"WF",dial_code:"+681"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"Z\xE2mbia",flag:"/flags/m/ZM.svg",code:"ZM",dial_code:"+260"},{name:"Zimb\xE1bue",flag:"/flags/m/ZW.svg",code:"ZW",dial_code:"+263"}];var m_=C('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><div class="relative makebot-country-select flex justify-center items-center"><div class="pl-3 pr-0 flex items-center gap-1"><img alt=Bandeira class="w-8 h-6 rounded-sm"></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),f_=C("<option>"),ix=e=>{let[t,r]=O(Ue(e.defaultCountryCode)?"INT":e.defaultCountryCode),[n,o]=O(e.defaultValue??""),i,a=p=>{if(o(p),p?.startsWith("+")&&p.length>2){let f=en.reduce((x,h)=>!h?.dial_code||x!==null&&!x.dial_code?x:p?.startsWith(h.dial_code)&&h.dial_code.length>(x?.dial_code.length??0)?h:x,null);f&&r(f.code)}},s=()=>i?.value!==""&&i?.reportValidity(),l=()=>{let p=en.find(f=>f.code===t())?.dial_code;if(s()){let f=i?.value??n();e.onSubmit({type:"text",value:f.startsWith("+")?f:`${p??""}${f}`})}else i?.focus()},c=p=>{p.key==="Enter"&&l()},u=p=>{let f=en.find(h=>h.code===p.currentTarget.value);if(!f)return;let x=en.find(h=>h.code===t());(n()===""||x&&n()===x.dial_code)&&o(f.dial_code),r(f.code),i?.focus()};ae(()=>{if(!ze()&&i&&i.focus({preventScroll:!0}),Ue(n())){let p=en.find(f=>f.code===t());p?.dial_code&&o(p.dial_code)}window.addEventListener("message",d)}),re(()=>{window.removeEventListener("message",d)});let d=p=>{let{data:f}=p;f.isFromMakebot&&f.command==="setInputValue"&&o(f.value)};return(()=>{var p=m_(),f=p.firstChild,x=f.firstChild,h=x.firstChild,w=h.firstChild,T=h.nextSibling;return p.$$keydown=c,v(h,m(ks,{class:"w-3"}),null),T.addEventListener("change",u),v(T,m(we,{each:en,children:b=>(()=>{var y=f_();return v(y,()=>b.name,null),v(y,(()=>{var g=L(()=>!!(b.dial_code&&String(b.dial_code).trim()!==""));return()=>g()?` (${b.dial_code})`:""})(),null),$(()=>y.selected=b.code===t()),$(()=>y.value=b.code),y})()})),v(f,m(Qr,{type:"tel",ref(b){var y=i;typeof y=="function"?y(b):i=b},get value(){return n()},onInput:a,get placeholder(){return e.labels?.placeholder??Gc.labels.placeholder},get autofocus(){return!ze()}}),null),v(p,m(Fe,{type:"button",class:"h-[42px]","on:click":l,get children(){return e.labels?.button??Gc.labels.button}}),null),$(()=>G(w,"src",en.find(b=>t()===b.code)?.flag)),p})()};Se(["keydown"]);var p_=C('<button class="w-5 h-5">'),g_=C('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),Is=e=>{let[t,r]=O(""),[n,o]=De(e,["onInput","ref"]),i=s=>{r(s),n.onInput(s)},a=()=>{r(""),e.onClear()};return(()=>{var s=g_(),l=s.firstChild;l.$$input=u=>i(u.currentTarget.value);var c=e.ref;return typeof c=="function"?ge(c,l):e.ref=l,be(l,ce({get value(){return t()}},o),!1,!1),v(s,m(U,{get when(){return t().length>0},get children(){var u=p_();return Be(u,"click",a),v(u,m(pr,{})),u}}),null),s})()};Se(["input"]);var Hc={buttonLabel:Ye,searchInputPlaceholder:"Filtre as op\xE7\xF5es...",isMultipleChoice:!1,isSearchable:!1,dynamicItems:{isEnabled:!1}};var h_=C('<div class="flex items-end makebot-input w-full">'),b_=C('<form class="flex flex-col gap-2 w-full items-end"><div>'),ax=C("<img fetchpriority=high class=m-auto>"),y_=C("<span class=font-semibold>"),x_=C('<span class="text-sm whitespace-pre-wrap text-left">'),v_=C('<div class="flex flex-col gap-1 ">'),w_=C("<div role=checkbox><div>"),jc=C('<div class="m-auto text-center mt-4">'),k_=C("<img fetchpriority=high>"),C_=C('<div role=checkbox aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none makebot-selectable-picture selected"><div>'),sx=e=>{let t,[r,n]=O(e.defaultItems),[o,i]=O([]),[a,s]=O(0);ae(()=>{!ze()&&t&&t.focus({preventScroll:!0})});let l=f=>{c(f)},c=f=>{let x=o().indexOf(f);i(x!==-1?h=>h.filter(w=>w!==f):h=>[...h,f])},u=()=>{let f=o().map(h=>e.defaultItems.find(w=>w.id===h)),x=f.some(h=>h?.value);e.onSubmit({type:"text",value:f.map(h=>h?.value?h.value:pe(h?.title)?h.title:h?.pictureSrc).join(", "),label:x?f.map(h=>pe(h?.title)?h.title:h?.pictureSrc).join(", "):void 0})},d=f=>{n(e.defaultItems.filter(x=>x.title?.toLowerCase().includes((f??"").toLowerCase())||x.description?.toLowerCase().includes((f??"").toLowerCase())))};ve(()=>{a()===e.defaultItems.filter(f=>de(f.pictureSrc)).length&&e.onTransitionEnd()});let p=()=>{s(f=>f+1)};return(()=>{var f=b_(),x=f.firstChild;return f.addEventListener("submit",u),v(f,m(U,{get when(){return e.options?.isSearchable},get children(){var h=h_();return v(h,m(Is,{ref(w){var T=t;typeof T=="function"?T(w):t=w},onInput:d,get placeholder(){return e.options?.searchInputPlaceholder??Hc.searchInputPlaceholder},onClear:()=>n(e.defaultItems)})),h}}),x),v(x,m(we,{get each(){return r()},children:(h,w)=>(()=>{var T=w_(),b=T.firstChild;return Be(T,"click",()=>l(h.id)),v(T,m(U,{get when(){return pe(h.pictureSrc)},get fallback(){return(()=>{var y=jc();return v(y,(()=>{var g=L(()=>!!pe(h.title));return()=>g()?h.title:`Imagem ${w()+1}`})()),y})()},get children(){var y=ax();return y.addEventListener("load",p),$(g=>{var k=h.pictureSrc,S=pe(h.title)?h.title:`Imagem ${w()+1}`,P=`Escolha de imagem ${w()+1}`;return k!==g.e&&G(y,"src",g.e=k),S!==g.t&&G(y,"alt",g.t=S),P!==g.a&&G(y,"elementtiming",g.a=P),g},{e:void 0,t:void 0,a:void 0}),y}}),b),v(b,m(So,{get isChecked(){return o().some(y=>y===h.id)},get class(){return"flex-shrink-0"+(h.title||h.description?" mt-1":void 0)}}),null),v(b,m(U,{get when(){return pe(h.title)||pe(h.description)},get children(){var y=v_();return v(y,m(U,{get when(){return pe(h.title)},get children(){var g=y_();return v(g,()=>h.title),g}}),null),v(y,m(U,{get when(){return pe(h.description)},get children(){var g=x_();return v(g,()=>h.description),g}}),null),y}}),null),$(y=>{var g=o().some(A=>A===h.id),k="flex flex-col focus:outline-none cursor-pointer select-none makebot-selectable-picture"+(o().some(A=>A===h.id)?" selected":"")+(qt(h.pictureSrc)?" has-svg":""),S=h.id,P="flex gap-3 py-2 flex-shrink-0"+(Ue(h.title)&&Ue(h.description)?" justify-center":" px-3");return g!==y.e&&G(T,"aria-checked",y.e=g),k!==y.t&&V(T,y.t=k),S!==y.a&&G(T,"data-itemid",y.a=S),P!==y.o&&V(b,y.o=P),y},{e:void 0,t:void 0,a:void 0,o:void 0}),T})()}),null),v(x,m(we,{get each(){return o().filter(h=>r().every(w=>w.id!==h)).map(h=>e.defaultItems.find(w=>w.id===h)).filter(de)},children:(h,w)=>(()=>{var T=C_(),b=T.firstChild;return Be(T,"click",()=>l(h.id)),v(T,m(U,{get when(){return pe(h.pictureSrc)},get fallback(){return(()=>{var y=jc();return v(y,(()=>{var g=L(()=>!!pe(h.title));return()=>g()?h.title:`Imagem ${w()+1}`})()),y})()},get children(){var y=ax();return $(g=>{var k=h.pictureSrc,S=pe(h.title)?h.title:`Imagem ${w()+1}`,P=`Imagem selecionada ${w()+1}`;return k!==g.e&&G(y,"src",g.e=k),S!==g.t&&G(y,"alt",g.t=S),P!==g.a&&G(y,"elementtiming",g.a=P),g},{e:void 0,t:void 0,a:void 0}),y}}),b),v(b,m(So,{get isChecked(){return o().some(y=>y===h.id)},get class(){return"flex-shrink-0"+(h.title||h.description?" mt-1":void 0)}}),null),v(b,m(U,{get when(){return pe(h.pictureSrc)},get fallback(){return(()=>{var y=jc();return v(y,(()=>{var g=L(()=>!!pe(h.title));return()=>g()?h.title:`Imagem ${w()+1}`})()),y})()},get children(){var y=k_();return $(g=>{var k=h.pictureSrc,S=pe(h.title)?h.title:`Imagem ${w()+1}`,P=`Imagem selecionada ${w()+1}`;return k!==g.e&&G(y,"src",g.e=k),S!==g.t&&G(y,"alt",g.t=S),P!==g.a&&G(y,"elementtiming",g.a=P),g},{e:void 0,t:void 0,a:void 0}),y}}),null),$(y=>{var g=h.id,k="flex gap-3 py-2 flex-shrink-0"+(Ue(h.title)&&Ue(h.description)?" justify-center":" pl-4");return g!==y.e&&G(T,"data-itemid",y.e=g),k!==y.t&&V(b,y.t=k),y},{e:void 0,t:void 0}),T})()}),null),v(f,(()=>{var h=L(()=>o().length>0);return()=>h()&&m(Fe,{disableIcon:!0,get children(){return e.options?.buttonLabel??Hc.buttonLabel}})})(),null),$(()=>V(x,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),f})()};var T_=C('<div class="flex items-end makebot-input w-full">'),S_=C('<div class="flex flex-col gap-2 w-full"><div>'),E_=C("<img fetchpriority=high class=m-auto>"),P_=C("<span class=font-semibold>"),__=C('<button><div><span class="text-sm whitespace-pre-wrap text-left">'),I_=C('<div class="m-auto text-center mt-4">'),lx=e=>{let t,[r,n]=O(e.defaultItems),[o,i]=O(0);ae(()=>{!ze()&&t&&t.focus({preventScroll:!0})});let a=c=>{let u=r()[c];if(u)return e.onSubmit({type:"text",label:pe(u.title)?u.title:u.pictureSrc||u.id,value:pe(u.value)?u.value:u.id})},s=c=>{n(e.defaultItems.filter(u=>u.title?.toLowerCase().includes((c??"").toLowerCase())||u.description?.toLowerCase().includes((c??"").toLowerCase())))};ve(()=>{o()===e.defaultItems.filter(c=>de(c.pictureSrc)).length&&e.onTransitionEnd()});let l=()=>{i(c=>c+1)};return(()=>{var c=S_(),u=c.firstChild;return v(c,m(U,{get when(){return e.options?.isSearchable},get children(){var d=T_();return v(d,m(Is,{ref(p){var f=t;typeof f=="function"?f(p):t=p},onInput:s,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>n(e.defaultItems)})),d}}),u),v(u,m(we,{get each(){return r()},children:(d,p)=>(()=>{var f=__(),x=f.firstChild,h=x.firstChild;return Be(f,"click",()=>a(p())),v(f,m(U,{get when(){return pe(d.pictureSrc)},get fallback(){return(()=>{var w=I_();return v(w,(()=>{var T=L(()=>!!pe(d.title));return()=>T()?d.title:`Imagem ${p()+1}`})()),w})()},get children(){var w=E_();return w.addEventListener("load",l),$(T=>{var b=d.pictureSrc,y=pe(d.title)?d.title:`Imagem ${p()+1}`,g=`Imagem selecionada ${p()+1}`;return b!==T.e&&G(w,"src",T.e=b),y!==T.t&&G(w,"alt",T.t=y),g!==T.a&&G(w,"elementtiming",T.a=g),T},{e:void 0,t:void 0,a:void 0}),w}}),x),v(x,m(U,{get when(){return pe(d.title)},get children(){var w=P_();return v(w,()=>d.title),w}}),h),v(h,()=>d.description),$(w=>{var T=d.id,b="flex flex-col makebot-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(qt(d.pictureSrc)?"has-svg":""),y="flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(d.description?" items-start":"");return T!==w.e&&G(f,"data-itemid",w.e=T),b!==w.t&&V(f,w.t=b),y!==w.a&&V(x,w.a=y),w},{e:void 0,t:void 0,a:void 0}),f})()})),$(()=>V(u,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),c})()};var Ir={buttonType:"Numbers",length:10,labels:{button:Ye},startsAt:0,customIcon:{isEnabled:!1},isOneClickSubmitEnabled:!1};var A_=C('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),R_=C('<span class="text-sm w-full rating-label">'),O_=C('<span class="text-sm w-full text-right pr-2 rating-label">'),$_=C("<div role=checkbox>"),N_=C("<div>"),cx=e=>{let[t,r]=O(e.defaultValue?Number(e.defaultValue):void 0),n=l=>{l.preventDefault();let c=t();Ze(c)||e.onSubmit({type:"text",value:c.toString()})},o=l=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:l.toString()}),r(l)},i=e.block.options?.labels?.button,a=i==="",s=i??Ir.labels.button;return(()=>{var l=A_(),c=l.firstChild,u=c.nextSibling;return l.addEventListener("submit",n),v(l,(()=>{var d=L(()=>!!e.block.options?.labels?.left);return()=>d()&&(()=>{var p=R_();return v(p,()=>e.block.options.labels.left),p})()})(),c),v(c,m(we,{get each(){return Array.from(Array((e.block.options?.length??Ir.length)+((e.block.options?.buttonType??Ir.buttonType)==="Numbers"?-((e.block.options?.startsAt??Ir.startsAt)-1):0)))},children:(d,p)=>m(M_,ce(()=>e.block.options,{get rating(){return t()},get idx(){return p()+((e.block.options?.buttonType??Ir.buttonType)==="Numbers"?e.block.options?.startsAt??Ir.startsAt:1)},onClick:o}))})),v(l,(()=>{var d=L(()=>!!e.block.options?.labels?.right);return()=>d()&&(()=>{var p=O_();return v(p,()=>e.block.options.labels.right),p})()})(),u),v(u,(()=>{var d=L(()=>!!de(t()));return()=>d()&&m(Fe,{disableIcon:!a,children:s})})()),l})()},M_=e=>{let t=r=>{r.preventDefault(),e.onClick(e.idx)};return m(Ie,{get children(){return[m(Z,{get when(){return(e.buttonType??Ir.buttonType)==="Numbers"},get children(){return[m(U,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(Ct,{"on:click":t,get children(){return e.idx}})}}),m(U,{get when(){return!e.isOneClickSubmitEnabled},get children(){var r=$_();return Be(r,"click",t),v(r,()=>e.idx),$(n=>{var o=de(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable"+(de(e.rating)&&e.idx<=e.rating?" selected":"");return o!==n.e&&G(r,"aria-checked",n.e=o),i!==n.t&&V(r,n.t=i),n},{e:void 0,t:void 0}),r}})]}}),m(Z,{get when(){return(e.buttonType??Ir.buttonType)!=="Numbers"},get children(){var r=N_();return Be(r,"click",()=>e.onClick(e.idx)),$(n=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(de(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&pe(e.customIcon?.svg?.trim())?e.customIcon.svg:D_;return o!==n.e&&V(r,n.e=o),i!==n.t&&(r.innerHTML=n.t=i),n},{e:void 0,t:void 0}),r}})]}})},D_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var L_=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),Wc=e=>(()=>{var t=L_();return be(t,e,!0,!0),t})();var B_=C('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),ux=e=>(()=>{var t=B_();return be(t,e,!0,!0),t})();var F_=C("<input type=file id=document-upload multiple class=hidden>"),U_=C('<input type=file id=photos-upload accept="image/avif, image/*, video/*"multiple class=hidden>'),V_=C('<label aria-label="Adicionar anexos"for=document-upload>'),z_=C("<label> Documento"),G_=C("<label> Fotos & v\xEDdeos"),dx=e=>[(()=>{var t=F_();return t.addEventListener("change",r=>{r.currentTarget.files&&(e.onNewFiles(r.currentTarget.files),r.currentTarget.value="")}),t})(),(()=>{var t=U_();return t.addEventListener("change",r=>{r.currentTarget.files&&(e.onNewFiles(r.currentTarget.files),r.currentTarget.value="")}),t})(),(()=>{var t=V_();return v(t,m(Wc,{class:"w-5"})),$(()=>V(t,q("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:hidden",e.class))),t})(),m(Cr.Root,{get children(){return[m(Cr.Trigger,{get class(){return q("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:block hidden",e.class)},"aria-label":"Adicionar anexos",get children(){return m(Wc,{class:"w-5"})}}),m(Cr.Positioner,{get children(){return m(Cr.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[m(Cr.Item,{value:"document",asChild:t=>(()=>{var r=z_(),n=r.firstChild;return be(r,ce(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),v(r,m(xs,{class:"w-4"}),n),r})()}),m(Cr.Item,{value:"photos",asChild:t=>(()=>{var r=G_(),n=r.firstChild;return be(r,ce(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),v(r,m(ux,{class:"w-4"}),n),r})()})]}})}})]}})];var H_=C('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),mx=e=>(()=>{var t=H_();return be(t,e,!0,!0),t})();var j_=C('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),fx=e=>{let[t,r]=De(e,["ref","onInput","inputmode"]),n=ze();return(()=>{var o=j_();o.$$input=a=>t.onInput(a.currentTarget.value);var i=t.ref;return typeof i=="function"?ge(i,o):t.ref=o,o.autofocus=!n,be(o,ce({get inputmode(){return t.inputmode}},r),!1,!1),o})()};Se(["input"]);var Jx=rd(Kx(),1);var Ni={isLong:!1,labels:{button:Ye,placeholder:"Digite sua resposta..."},audioClip:{isEnabled:!1,visibility:"Auto"},attachments:{isEnabled:!1,visibility:"Auto"}};var Xx=`
54
+ (limite de tamanho: 10MB)`,button:"Upload",clear:"Limpar",skip:"Pular",success:{single:"Arquivo enviado",multiple:"{total} arquivos enviados"}}};var El=({newFile:e,existingFiles:t,params:n,context:r,onError:o})=>{let i=n.sizeLimit??un("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(i&&e.size>Number(i)*1024*1024){o({description:(r.makebot.settings.general?.systemMessages?.fileUploadSizeError??Jt.fileUploadSizeError).replace("[[file]]",e.name).replace("[[limit]]",i)});return}if(t.length===0)return e;let a=e.name,s=1;for(;t.some(l=>l.name===a);){let l=e.name.lastIndexOf("."),c=l!==-1?e.name.slice(l):"";a=`${e.name.slice(0,l)}(${s})${c}`,s++}return new File([e],a,{type:e.type})};var wi=async({apiHost:e,files:t,onUploadProgress:n})=>{let r=[],o=[],i=0;for(let{input:a,file:s}of t){n&&n({progress:i/t.length*100,fileIndex:i}),i+=1;let{data:l,error:c}=await Ym({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:a.fileName,sessionId:a.sessionId,fileType:s.type,blockId:a.blockId}});if(c){o.push(c.message);continue}if(l?.presignedUrl){let u=new FormData;if(Object.entries(l.formData).forEach(([f,p])=>{u.append(f,p)}),u.append("file",s),!(await fetch(l.presignedUrl,{method:"POST",body:u})).ok)continue;r.push({url:l.fileUrl,type:s.type})}else continue}return o.length>0?{type:"error",error:o.join(", ")}:{type:"success",urls:r}};var xA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),_r=e=>(()=>{var t=xA();return Ce(t,e,!0,!0),t})();var wA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),Pl=e=>(()=>{var t=wA();return Ce(t,e,!0,!0),t})();var kA=w('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),Il=e=>{let t=SA(e.file);return(()=>{var n=kA(),r=n.firstChild,o=r.nextSibling,i=o.firstChild,a=i.nextSibling;return v(r,m(Pl,{class:"w-6 h-6"})),v(i,()=>e.file.name),v(a,()=>TA(e.file)),$(()=>G(r,q("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),n})()},TA=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},SA=e=>{let t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}};var CA=w('<img class="rounded-md object-cover w-[58px] h-[58px]">'),_A=w('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remover anexo">'),EA=w('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),Al=e=>(()=>{var t=_A(),n=t.firstChild;return v(t,m(Fe,{get children(){return[m(ee,{get when(){return e.file.type.startsWith("image")},get children(){var r=CA();return $(o=>{var i=URL.createObjectURL(e.file),a=e.file.name;return i!==o.e&&K(r,"src",o.e=i),a!==o.t&&K(r,"alt",o.t=a),o},{e:void 0,t:void 0}),r}}),m(ee,{when:!0,get children(){return m(Il,{get file(){return e.file}})}})]}}),n),gt(n,"click",e.onRemoveClick),v(n,m(_r,{class:"w-4"})),v(t,m(U,{get when(){return L(()=>!!ye(e.uploadProgressPercent))()&&e.uploadProgressPercent!==100},get children(){return m(PA,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),PA=e=>{let[t,n]=O(e.progressPercent??0),r;return $e(()=>{e.progressPercent===20&&(r=setInterval(()=>{t()<100&&n(i=>i+(Math.floor(Math.random()*10)+1))},1e3))}),ie(()=>{clearInterval(r)}),(()=>{var o=EA();return v(o,m(Kr.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m(Kr.Circle,{get children(){return[m(Kr.CircleTrack,{}),m(Kr.CircleRange,{})]}})}})),o})()};var IA=w('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full"style="transition:width 150ms cubic-bezier(0.4, 0, 0.2, 1)">'),AA=w('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),RA=w('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),OA=w("<input id=dropzone-file type=file class=hidden>"),NA=w('<div class="flex justify-end">'),$A=w('<div class="flex justify-end"><div class="flex gap-2">'),MA=w('<form class="flex flex-col w-full gap-2"><label for=dropzone-file>'),DA=w('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-500><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),yx=e=>{let[t,n]=O([]),[r,o]=O(!1),[i,a]=O(0),[s,l]=O(!1),c=e.context.makebot.settings.general?.systemMessages?.fileUploadError??Jt.fileUploadError,u=g=>{let x=Array.from(g).map(S=>El({existingFiles:t(),newFile:S,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},context:e.context,onError:({description:P})=>Wt.create({description:P})})).filter(ye);if(x.length!==0){if(!e.block.options?.isMultipleAllowed)return f(x[0]);n([...t(),...x])}},d=async g=>{g.preventDefault(),t().length!==0&&p(t())},f=async g=>{o(!0);let x=await wi({apiHost:e.context.apiHost??kt({ignoreChatApiUrl:!0}),files:[{file:g,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:g.name}}]});if(o(!1),x.type==="success"&&x.urls.length&&x.urls[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??vn.labels.success.single,value:x.urls[0]?bx(x.urls[0].url):"",attachments:[{type:g.type,url:x.urls[0].url,blobUrl:URL.createObjectURL(g)}]});x.type==="error"&&Wt.create({description:x.error})},p=async g=>{o(!0);let x=await wi({apiHost:e.context.apiHost??kt({ignoreChatApiUrl:!0}),files:g.map(S=>({file:S,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:S.name}})),onUploadProgress:a});if(o(!1),a(0),x.type==="error")return Wt.create({description:x.error});e.onSubmit({type:"text",label:x.urls.length>1?(e.block.options?.labels?.success?.multiple??vn.labels.success.multiple).replaceAll("{total}",x.urls.length.toString()):e.block.options?.labels?.success?.single??vn.labels.success.single,value:x.urls.filter(ye).map(({url:S})=>bx(S)).join(", "),attachments:x.urls.map((S,P)=>S?{...S,blobUrl:URL.createObjectURL(t()[P])}:null).filter(ye)})},y=g=>{g.preventDefault(),l(!0)},h=()=>l(!1),k=g=>{g.preventDefault(),g.stopPropagation(),g.dataTransfer?.files&&u(g.dataTransfer.files)},C=()=>n([]),b=()=>e.onSkip(e.block.options?.labels?.skip??vn.labels.skip),T=g=>{n(x=>x.filter((S,P)=>P!==g))};return(()=>{var g=MA(),x=g.firstChild;return g.addEventListener("submit",d),x.addEventListener("drop",k),x.addEventListener("dragleave",h),x.addEventListener("dragover",y),v(x,m(Fe,{get children(){return[m(ee,{get when(){return r()},get children(){return m(U,{get when(){return t().length>1},get fallback(){return m(gl,{})},get children(){var S=IA(),P=S.firstChild;return $(R=>ae(P,"width",`${i()>0?i:10}%`)),S}})}}),m(ee,{get when(){return!r()},get children(){return[(()=>{var S=RA(),P=S.firstChild;return v(S,m(U,{get when(){return t().length},get fallback(){return m(LA,{})},get children(){var R=AA();return gt(R,"click",N=>{N.preventDefault(),N.stopPropagation()}),v(R,m(Re,{get each(){return t()},children:(N,D)=>m(Al,{file:N,onRemoveClick:()=>T(D())})})),R}}),P),$(()=>P.innerHTML=e.block.options?.labels?.placeholder??vn.labels.placeholder),S})(),(()=>{var S=OA();return S.addEventListener("change",P=>{P.currentTarget.files&&(u(P.currentTarget.files),P.currentTarget.value="")}),$(P=>{var R=e.block.options?.allowedFileTypes?.isEnabled?e.block.options?.allowedFileTypes?.types?.join(", "):void 0,N=e.block.options?.isMultipleAllowed??vn.isMultipleAllowed;return R!==P.e&&K(S,"accept",P.e=R),N!==P.t&&(S.multiple=P.t=N),P},{e:void 0,t:void 0}),S})()]}})]}})),v(g,m(U,{get when(){return L(()=>t().length===0)()&&e.block.options?.isRequired===!1},get children(){var S=NA();return v(S,m(yt,{"on:click":b,get children(){return e.block.options?.labels?.skip??vn.labels.skip}})),S}}),null),v(g,m(U,{get when(){return L(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){var S=$A(),P=S.firstChild;return v(P,m(U,{get when(){return t().length},get children(){return m(yt,{variant:"secondary","on:click":C,get children(){return e.block.options?.labels?.clear??vn.labels.clear}})}}),null),v(P,m(Xe,{type:"submit",disableIcon:!0,get children(){return L(()=>(e.block.options?.labels?.button??vn.labels.button)===vn.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),S}}),null),$(()=>G(x,"makebot-upload-input py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8 "+(s()?"dragging-over":""))),g})()},LA=()=>DA(),bx=e=>{let t=e.split("/").pop();if(!t)return e;let n=encodeURIComponent(t);return e.replace(t,n)};var ki=e=>m(br.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,get onOpenChange(){return e.onClose},get children(){return m(ss,{get mount(){return us()()},get children(){return[m(br.Backdrop,{class:"absolute inset-0 bg-[rgba(0,0,0,0.8)] h-screen z-50"}),m(br.Positioner,{class:"absolute inset-0 z-50 flex items-center justify-center px-2",get children(){return[m(br.Content,{class:"focus:outline-none",get children(){return e.children}}),m(br.CloseTrigger,{class:"fixed top-4 right-4 z-50 rounded-md bg-[#202020] p-2 text-white",get children(){return m(_r,{class:"w-6 h-6"})}})]}})]}})}});var BA="Op\xE7\xF5es",vx={buttonLabel:ox,title:"",description:"",footer:"",sectionTitle:BA};function td(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(o){return new this.constructor({...this._def,openapi:o})};let t=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...o){let i=t.apply(this,o);return i._def.extendMetadata={extends:this},delete i._def.openapi,i};let n=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...o){let i=n.apply(this,o);return delete i._def.extendMetadata,delete i._def.openapi,i};let r=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...o){let i=r.apply(this,o);return delete i._def.extendMetadata,delete i._def.openapi,i}}var xx=e=>{typeof e.ZodType.prototype.layout<"u"||(e.ZodType.prototype.layout=function(t){return new this.constructor({...this._def,layout:t})})};xx(ue);td(ue);var kx=ue.object({id:ue.string(),outgoingEdgeId:ue.string().nullable().optional(),requiresValidation:ue.preprocess(e=>e===void 0?!0:e,ue.boolean().optional()).openapi({effectType:"input"})}),Tx=ue.object({variableId:ue.string().optional()}),wx=ue.object({id:ue.string(),blockId:ue.string().optional(),outgoingEdgeId:ue.string().nullable().optional()}),Oa={v5:wx,v6:wx.omit({blockId:!0})},Wz=ue.union([Oa.v5,Oa.v6]);var nd=(n=>(n.OR="OR",n.AND="AND",n))(nd||{}),rd=(y=>(y.EQUAL="Equal to",y.NOT_EQUAL="Not equal",y.CONTAINS="Contains",y.NOT_CONTAINS="Does not contain",y.GREATER="Greater than",y.GREATER_OR_EQUAL="Greater or equal to",y.LESS="Less than",y.LESS_OR_EQUAL="Less or equal to",y.IS_SET="Is set",y.IS_EMPTY="Is empty",y.STARTS_WITH="Starts with",y.ENDS_WITH="Ends with",y.MATCHES_REGEX="Matches regex",y.NOT_MATCH_REGEX="Does not match regex",y))(rd||{});var FA=ue.object({id:ue.string(),variableId:ue.string().optional(),comparisonOperator:ue.nativeEnum(rd).optional(),value:ue.string().optional()}),Sx={WEB:"web",WHATSAPP:"whatsapp"},UA=FA.extend({platform:ue.nativeEnum(Sx).optional()}),od=ue.object({logicalOperator:ue.nativeEnum(nd).optional(),comparisons:ue.array(UA).optional(),platforms:ue.array(ue.nativeEnum(Sx)).optional()});var VA=Tx.merge(ue.object({title:ue.string().optional(),description:ue.string().optional(),footer:ue.string().optional(),buttonLabel:ue.string().optional(),sectionTitle:ue.string().optional(),sections:ue.array(ue.object({id:ue.string(),title:ue.string().optional()})).optional(),dynamicVariableId:ue.string().optional()})),Rl={v5:Oa.v5.extend({content:ue.string().optional(),value:ue.string().optional(),description:ue.string().optional(),sectionId:ue.string().optional(),displayCondition:ue.object({isEnabled:ue.boolean().optional(),condition:od.optional()}).optional()}),v6:Oa.v6.extend({content:ue.string().optional(),value:ue.string().optional(),description:ue.string().optional(),sectionId:ue.string().optional(),displayCondition:ue.object({isEnabled:ue.boolean().optional(),condition:od.optional()}).optional()})},nG=ue.union([Rl.v5,Rl.v6]),Cx=kx.merge(ue.object({type:ue.enum(["list input"]),items:ue.array(Rl.v5),options:VA.optional(),requiresValidation:ue.preprocess(e=>e===void 0?!1:e,ue.boolean().optional())})),_x={v5:Cx.openapi({title:"List v5",ref:"listInputV5"}),v6:Cx.extend({items:ue.array(Rl.v6)}).openapi({title:"List",ref:"listInput"})},rG=ue.union([_x.v5,_x.v6]),Px="default-section",jA=e=>{let t=e.options?.sections?.filter(n=>n.id)??[];return t.length>0?t:[{id:Px,title:e.options?.sectionTitle??"Op\xE7\xF5es"}]},Ix=e=>{let t=jA(e),n=t[0]?.id??Px,r=t.map(i=>({id:i.id,title:i.title,items:[]})),o=new Map(r.map((i,a)=>[i.id,a]));return e.items.forEach(i=>{let a=i.sectionId&&o.has(i.sectionId)?i.sectionId:n,s=o.get(a);s!==void 0&&r[s].items.push(i)}),r.filter(i=>i.items.length>0)};var zA=w('<div class="flex flex-col gap-2 pt-4">'),GA=w('<span class="flex items-center gap-2 justify-center"><svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 6h16M4 12h16M4 18h16">'),HA=w('<div class="w-[min(92vw,360px)] max-h-[min(80vh,560px)] overflow-hidden rounded-2xl bg-host-bubble-bg text-host-bubble-text border-host-bubble border-host-bubble-border shadow-host-bubble"><div class="max-h-[360px] overflow-y-auto px-2 py-2">'),WA=w('<div class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="px-3 pb-2">'),qA=w('<h2 class="px-4 font-semibold">'),ZA=w("<p class=px-4>"),YA=w('<p class="px-4 text-xs opacity-70 leading-relaxed">'),KA=w('<div class="mb-3 last:mb-0">'),XA=w('<p class="px-3 pb-2 text-[11px] font-semibold uppercase tracking-wide opacity-55">'),JA=w('<svg class="h-4 w-4 flex-shrink-0 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd>'),QA=w('<button type=button class="w-full text-left rounded-xl px-3 py-3 flex items-start gap-3 hover:bg-black/5 transition-colors"><span class="mt-0.5 inline-flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full border border-host-bubble-border text-xs opacity-70">\u2022</span><span class="flex min-w-0 flex-1 flex-col"><span class="text-sm font-medium leading-tight">'),eR=w('<span class="mt-1 text-xs opacity-70 leading-relaxed">'),Ax=e=>{let[t,n]=O(!1),[r,o]=O(),i=()=>Ix(e.block),a=s=>{let l=s.value||s.content||"";o(s.id),n(!1),e.onSubmit({type:"text",value:l,label:s.value?s.content:void 0})};return(()=>{var s=WA(),l=s.firstChild,c=l.firstChild,u=c.firstChild;return v(c,m(U,{get when(){return e.block.options?.title||e.block.options?.description||e.block.options?.footer},get children(){var d=zA();return v(d,m(U,{get when(){return e.block.options?.title},children:f=>(()=>{var p=qA();return v(p,f),p})()}),null),v(d,m(U,{get when(){return e.block.options?.description},children:f=>(()=>{var p=ZA();return v(p,f),p})()}),null),v(d,m(U,{get when(){return e.block.options?.footer},children:f=>(()=>{var p=YA();return v(p,f),p})()}),null),d}}),u),v(u,m(yt,{variant:"secondary",size:"sm",get class(){return q("w-full font-normal text-sm border-host-bubble-border border rounded-t-host-bubble rounded-b-host-bubble")},"on:click":()=>n(!0),get children(){var d=GA(),f=d.firstChild;return v(d,()=>e.block.options?.buttonLabel??vx.buttonLabel,null),d}})),v(s,m(ki,{get isOpen(){return t()},onClose:()=>n(!1),get children(){var d=HA(),f=d.firstChild;return v(f,m(Re,{get each(){return i()},children:p=>(()=>{var y=KA();return v(y,m(U,{get when(){return p.title},children:h=>(()=>{var k=XA();return v(k,h),k})()}),null),v(y,m(Re,{get each(){return p.items},children:h=>(()=>{var k=QA(),C=k.firstChild,b=C.nextSibling,T=b.firstChild;return k.$$click=()=>a(h),v(T,()=>h.content||h.value||"Op\xE7\xE3o"),v(b,m(U,{get when(){return h.description},children:g=>(()=>{var x=eR();return v(x,g),x})()}),null),v(k,m(U,{get when(){return r()===h.id},get children(){return JA()}}),null),k})()}),null),y})()})),d}}),null),s})()};Ne(["click"]);var tR=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),Ol=e=>(()=>{var t=tR();return Ce(t,e,!0,!0),t})();var nR=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 15l-6-6-6 6">'),Rx=e=>(()=>{var t=nR();return Ce(t,e,!0,!0),t})();var Ox="decimal",Nx=ft,$x="Digite um n\xFAmero...";var Nl=e=>{if(typeof e=="number")return e;if(!e)return;let t=Number.parseFloat(e.toString().replace(",","."));return isNaN(t)?void 0:t};var rR=w('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]">'),Mx=e=>{let t=ll({locale:navigator.language,formatOptions:oR(e.block.options),min:Nl(e.block.options?.min),max:Nl(e.block.options?.max),step:Nl(e.block.options?.step)}),n,r=()=>t().invalid?(n?.reportValidity(),!1):!0,o=()=>{r()?e.onSubmit({type:"text",value:t().valueAsNumber.toString(),label:t().value.toString()}):t().focus()},i=s=>{s.key==="Enter"&&o()};me(()=>{!st()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",a)}),ie(()=>{window.removeEventListener("message",a)});let a=s=>{let{data:l}=s;l.isFromMakebot&&l.command==="setInputValue"&&t().setValue(Number(l.value))};return(()=>{var s=rR();return s.$$keydown=i,v(s,m(hr.RootProvider,{value:t,class:"flex makebot-input w-full",get children(){return[m(hr.Input,{ref(l){var c=n;typeof c=="function"?c(l):n=l},class:"focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input ml-2",style:{"font-size":"16px",appearance:"auto"},get placeholder(){return e.block.options?.labels?.placeholder??$x}}),m(hr.Control,{class:"flex flex-col rounded-r-md overflow-hidden divide-y h-[42px]",get children(){return[m(hr.IncrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return m(Rx,{class:"size-4"})}}),m(hr.DecrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return m(Ol,{class:"size-4"})}})]}})]}}),null),v(s,m(Xe,{type:"button",class:"h-[42px]","on:click":o,get children(){return e.block.options?.labels?.button??Nx}}),null),s})()},oR=e=>{let t={style:Ox};return e?.style==="currency"&&e.currency?{style:e.style,currency:e.currency}:e?.style==="unit"&&e.unit?{style:e.style,unit:e.unit}:t};Ne(["keydown"]);var $l={provider:"Stripe",labels:{button:"Pagar",success:"Sucesso"},retryMessageContent:"O pagamento falhou. Tente novamente.",currency:"BRL"};var zx=ym(jx(),1);var dR=w('<div class="makebot-input-error-message mt-4 text-center animate-fade-in">'),mR=w('<form id=payment-form class="flex flex-col p-4 makebot-input w-full items-center"><slot name=stripe-payment-form>'),fR="stripe-payment-form",Na,$a=null,Bl=null,Gx=e=>{let[t,n]=O(),[r,o]=O(!1),[i,a]=O(!1);me(async()=>{if(!Na)return;if(pR(Na),!e.options?.publicKey)return n("Missing Stripe public key");if($a=await(0,zx.loadStripe)(e.options?.publicKey),!$a)return;Bl=$a.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(Na).getPropertyValue("--makebot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});let l=Bl.create("payment",{layout:"tabs"});l.on("ready",()=>{o(!0),e.onTransitionEnd()}),l.mount("#payment-element")});let s=async l=>{if(l.preventDefault(),!$a||!Bl)return;a(!0),Zm({sessionId:e.context.sessionId,resultId:e.context.resultId,makebot:e.context.makebot});let{postalCode:c,...u}=e.options?.additionalInformation?.address??{},{error:d,paymentIntent:f}=await $a.confirmPayment({elements:Bl,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:c}}}},redirect:"if_required"});if(ds(),a(!1),d?.type!=="validation_error"){if(d?.type==="card_error")return n(d.message);if(!d&&f.status==="succeeded")return e.onSuccess()}};return(()=>{var l=mR(),c=l.firstChild;l.addEventListener("submit",s);var u=Na;return typeof u=="function"?ke(u,c):Na=c,c._$owner=Mo(),v(l,m(U,{get when(){return r()},get children(){return m(Xe,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[L(()=>e.options?.labels?.button??$l.labels.button)," ",L(()=>e.options?.amountLabel)]}})}}),null),v(l,m(U,{get when(){return t()},get children(){var d=dR();return v(d,t),d}}),null),l})()},pR=e=>{let n=e.getRootNode().host,r=document.createElement("div");r.style.width="100%",r.slot=fR,n.appendChild(r);let o=document.createElement("div");o.id="payment-element",r.appendChild(o)};var Hx=e=>m(Gx,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var sd={labels:{button:ft,placeholder:"Digite seu n\xFAmero de telefone..."},retryMessageContent:"Este n\xFAmero de telefone parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var Er=[{name:"Internacional",flag:"/flags/m/INT.svg",code:"INT",dial_code:""},{name:"Brasil",flag:"/flags/m/BR.svg",code:"BR",dial_code:"+55"},{name:"Arg\xE9lia",flag:"/flags/m/DZ.svg",code:"DZ",dial_code:"+213"},{name:"Andorra",flag:"/flags/m/AD.svg",code:"AD",dial_code:"+376"},{name:"Angola",flag:"/flags/m/AO.svg",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"/flags/m/AI.svg",code:"AI",dial_code:"+1264"},{name:"Ant\xEDgua e Barbuda",flag:"/flags/m/AG.svg",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"/flags/m/AR.svg",code:"AR",dial_code:"+54"},{name:"Arm\xEAnia",flag:"/flags/m/AM.svg",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"/flags/m/AW.svg",code:"AW",dial_code:"+297"},{name:"Austr\xE1lia",flag:"/flags/m/AU.svg",code:"AU",dial_code:"+61"},{name:"\xC1ustria",flag:"/flags/m/AT.svg",code:"AT",dial_code:"+43"},{name:"Azerbaij\xE3o",flag:"/flags/m/AZ.svg",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"/flags/m/BS.svg",code:"BS",dial_code:"+1242"},{name:"Bahrein",flag:"/flags/m/BH.svg",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"/flags/m/BD.svg",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"/flags/m/BB.svg",code:"BB",dial_code:"+1246"},{name:"Bielorr\xFAssia",flag:"/flags/m/BY.svg",code:"BY",dial_code:"+375"},{name:"B\xE9lgica",flag:"/flags/m/BE.svg",code:"BE",dial_code:"+32"},{name:"Belize",flag:"/flags/m/BZ.svg",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"/flags/m/BJ.svg",code:"BJ",dial_code:"+229"},{name:"Bermudas",flag:"/flags/m/BM.svg",code:"BM",dial_code:"+1441"},{name:"But\xE3o",flag:"/flags/m/BT.svg",code:"BT",dial_code:"+975"},{name:"Bol\xEDvia",flag:"/flags/m/BO.svg",code:"BO",dial_code:"+591"},{name:"B\xF3snia e Herzegovina",flag:"/flags/m/BA.svg",code:"BA",dial_code:"+387"},{name:"Botsuana",flag:"/flags/m/BW.svg",code:"BW",dial_code:"+267"},{name:"Brunei",flag:"/flags/m/BN.svg",code:"BN",dial_code:"+673"},{name:"Bulg\xE1ria",flag:"/flags/m/BG.svg",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"/flags/m/BF.svg",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"/flags/m/BI.svg",code:"BI",dial_code:"+257"},{name:"Camboja",flag:"/flags/m/KH.svg",code:"KH",dial_code:"+855"},{name:"Camar\xF5es",flag:"/flags/m/CM.svg",code:"CM",dial_code:"+237"},{name:"Canad\xE1",flag:"/flags/m/CA.svg",code:"CA",dial_code:"+1"},{name:"Ilhas de Cabo Verde",flag:"/flags/m/CV.svg",code:"CV",dial_code:"+238"},{name:"Ilhas Cayman",flag:"/flags/m/KY.svg",code:"KY",dial_code:"+1345"},{name:"Rep\xFAblica Centro-Africana",flag:"/flags/m/CF.svg",code:"CF",dial_code:"+236"},{name:"Chile",flag:"/flags/m/CL.svg",code:"CL",dial_code:"+56"},{name:"China",flag:"/flags/m/CN.svg",code:"CN",dial_code:"+86"},{name:"Col\xF4mbia",flag:"/flags/m/CO.svg",code:"CO",dial_code:"+57"},{name:"Comores",flag:"/flags/m/KM.svg",code:"KM",dial_code:"+269"},{name:"Congo",flag:"/flags/m/CG.svg",code:"CG",dial_code:"+242"},{name:"Ilhas Cook",flag:"/flags/m/CK.svg",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"/flags/m/CR.svg",code:"CR",dial_code:"+506"},{name:"Costa do Marfim",flag:"/flags/m/CI.svg",code:"CI",dial_code:"+225"},{name:"Cro\xE1cia",flag:"/flags/m/HR.svg",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"/flags/m/CU.svg",code:"CU",dial_code:"+53"},{name:"Chipre Norte",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+90392"},{name:"Chipre Sul",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+357"},{name:"Rep\xFAblica Tcheca",flag:"/flags/m/CZ.svg",code:"CZ",dial_code:"+420"},{name:"Dinamarca",flag:"/flags/m/DK.svg",code:"DK",dial_code:"+45"},{name:"Djibuti",flag:"/flags/m/DJ.svg",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"/flags/m/DM.svg",code:"DM",dial_code:"+1809"},{name:"Rep\xFAblica Dominicana",flag:"/flags/m/DO.svg",code:"DO",dial_code:"+1809"},{name:"Equador",flag:"/flags/m/EC.svg",code:"EC",dial_code:"+593"},{name:"Egito",flag:"/flags/m/EG.svg",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"/flags/m/SV.svg",code:"SV",dial_code:"+503"},{name:"Guin\xE9 Equatorial",flag:"/flags/m/GQ.svg",code:"GQ",dial_code:"+240"},{name:"Eritreia",flag:"/flags/m/ER.svg",code:"ER",dial_code:"+291"},{name:"Est\xF4nia",flag:"/flags/m/EE.svg",code:"EE",dial_code:"+372"},{name:"Eti\xF3pia",flag:"/flags/m/ET.svg",code:"ET",dial_code:"+251"},{name:"Ilhas Malvinas",flag:"/flags/m/FK.svg",code:"FK",dial_code:"+500"},{name:"Ilhas Faro\xE9",flag:"/flags/m/FO.svg",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"/flags/m/FJ.svg",code:"FJ",dial_code:"+679"},{name:"Finl\xE2ndia",flag:"/flags/m/FI.svg",code:"FI",dial_code:"+358"},{name:"Fran\xE7a",flag:"/flags/m/FR.svg",code:"FR",dial_code:"+33"},{name:"Guiana Francesa",flag:"/flags/m/GF.svg",code:"GF",dial_code:"+594"},{name:"Polin\xE9sia Francesa",flag:"/flags/m/PF.svg",code:"PF",dial_code:"+689"},{name:"Gab\xE3o",flag:"/flags/m/GA.svg",code:"GA",dial_code:"+241"},{name:"G\xE2mbia",flag:"/flags/m/GM.svg",code:"GM",dial_code:"+220"},{name:"Ge\xF3rgia",flag:"/flags/m/GE.svg",code:"GE",dial_code:"+995"},{name:"Alemanha",flag:"/flags/m/DE.svg",code:"DE",dial_code:"+49"},{name:"Gana",flag:"/flags/m/GH.svg",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"/flags/m/GI.svg",code:"GI",dial_code:"+350"},{name:"Gr\xE9cia",flag:"/flags/m/GR.svg",code:"GR",dial_code:"+30"},{name:"Groenl\xE2ndia",flag:"/flags/m/GL.svg",code:"GL",dial_code:"+299"},{name:"Granada",flag:"/flags/m/GD.svg",code:"GD",dial_code:"+1473"},{name:"Guadalupe",flag:"/flags/m/GP.svg",code:"GP",dial_code:"+590"},{name:"Guam",flag:"/flags/m/GU.svg",code:"GU",dial_code:"+671"},{name:"Guatemala",flag:"/flags/m/GT.svg",code:"GT",dial_code:"+502"},{name:"Guin\xE9",flag:"/flags/m/GN.svg",code:"GN",dial_code:"+224"},{name:"Guin\xE9-Bissau",flag:"/flags/m/GW.svg",code:"GW",dial_code:"+245"},{name:"Guiana",flag:"/flags/m/GY.svg",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"/flags/m/HT.svg",code:"HT",dial_code:"+509"},{name:"Honduras",flag:"/flags/m/HN.svg",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"/flags/m/HK.svg",code:"HK",dial_code:"+852"},{name:"Hungria",flag:"/flags/m/HU.svg",code:"HU",dial_code:"+36"},{name:"Isl\xE2ndia",flag:"/flags/m/IS.svg",code:"IS",dial_code:"+354"},{name:"\xCDndia",flag:"/flags/m/IN.svg",code:"IN",dial_code:"+91"},{name:"Indon\xE9sia",flag:"/flags/m/ID.svg",code:"ID",dial_code:"+62"},{name:"Ir\xE3",flag:"/flags/m/IR.svg",code:"IR",dial_code:"+98"},{name:"Iraque",flag:"/flags/m/IQ.svg",code:"IQ",dial_code:"+964"},{name:"Irlanda",flag:"/flags/m/IE.svg",code:"IE",dial_code:"+353"},{name:"Israel",flag:"/flags/m/IL.svg",code:"IL",dial_code:"+972"},{name:"It\xE1lia",flag:"/flags/m/IT.svg",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"/flags/m/JM.svg",code:"JM",dial_code:"+1876"},{name:"Jap\xE3o",flag:"/flags/m/JP.svg",code:"JP",dial_code:"+81"},{name:"Jord\xE2nia",flag:"/flags/m/JO.svg",code:"JO",dial_code:"+962"},{name:"Cazaquist\xE3o",flag:"/flags/m/KZ.svg",code:"KZ",dial_code:"+7"},{name:"Qu\xEAnia",flag:"/flags/m/KE.svg",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"/flags/m/KI.svg",code:"KI",dial_code:"+686"},{name:"Coreia do Norte",flag:"/flags/m/KP.svg",code:"KP",dial_code:"+850"},{name:"Coreia do Sul",flag:"/flags/m/KR.svg",code:"KR",dial_code:"+82"},{name:"Kuwait",flag:"/flags/m/KW.svg",code:"KW",dial_code:"+965"},{name:"Quirguist\xE3o",flag:"/flags/m/KG.svg",code:"KG",dial_code:"+996"},{name:"Laos",flag:"/flags/m/LA.svg",code:"LA",dial_code:"+856"},{name:"Let\xF4nia",flag:"/flags/m/LV.svg",code:"LV",dial_code:"+371"},{name:"L\xEDbano",flag:"/flags/m/LB.svg",code:"LB",dial_code:"+961"},{name:"Lesoto",flag:"/flags/m/LS.svg",code:"LS",dial_code:"+266"},{name:"Lib\xE9ria",flag:"/flags/m/LR.svg",code:"LR",dial_code:"+231"},{name:"L\xEDbia",flag:"/flags/m/LY.svg",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"/flags/m/LI.svg",code:"LI",dial_code:"+417"},{name:"Litu\xE2nia",flag:"/flags/m/LT.svg",code:"LT",dial_code:"+370"},{name:"Luxemburgo",flag:"/flags/m/LU.svg",code:"LU",dial_code:"+352"},{name:"Macau",flag:"/flags/m/MO.svg",code:"MO",dial_code:"+853"},{name:"Maced\xF4nia",flag:"/flags/m/MK.svg",code:"MK",dial_code:"+389"},{name:"Madag\xE1scar",flag:"/flags/m/MG.svg",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"/flags/m/MW.svg",code:"MW",dial_code:"+265"},{name:"Mal\xE1sia",flag:"/flags/m/MY.svg",code:"MY",dial_code:"+60"},{name:"Maldivas",flag:"/flags/m/MV.svg",code:"MV",dial_code:"+960"},{name:"Mali",flag:"/flags/m/ML.svg",code:"ML",dial_code:"+223"},{name:"Malta",flag:"/flags/m/MT.svg",code:"MT",dial_code:"+356"},{name:"Ilhas Marshall",flag:"/flags/m/MH.svg",code:"MH",dial_code:"+692"},{name:"Martinica",flag:"/flags/m/MQ.svg",code:"MQ",dial_code:"+596"},{name:"Maurit\xE2nia",flag:"/flags/m/MR.svg",code:"MR",dial_code:"+222"},{name:"Mayotte",flag:"/flags/m/YT.svg",code:"YT",dial_code:"+269"},{name:"M\xE9xico",flag:"/flags/m/MX.svg",code:"MX",dial_code:"+52"},{name:"Micron\xE9sia",flag:"/flags/m/FM.svg",code:"FM",dial_code:"+691"},{name:"Mold\xE1via",flag:"/flags/m/MD.svg",code:"MD",dial_code:"+373"},{name:"M\xF4naco",flag:"/flags/m/MC.svg",code:"MC",dial_code:"+377"},{name:"Mong\xF3lia",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+976"},{name:"Montserrat",flag:"/flags/m/MS.svg",code:"MS",dial_code:"+1664"},{name:"Marrocos",flag:"/flags/m/MA.svg",code:"MA",dial_code:"+212"},{name:"Mo\xE7ambique",flag:"/flags/m/MZ.svg",code:"MZ",dial_code:"+258"},{name:"Mianmar",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+95"},{name:"Nam\xEDbia",flag:"/flags/m/NA.svg",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"/flags/m/NR.svg",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+977"},{name:"Holanda",flag:"/flags/m/NL.svg",code:"NL",dial_code:"+31"},{name:"Nova Caled\xF4nia",flag:"/flags/m/NC.svg",code:"NC",dial_code:"+687"},{name:"Nova Zel\xE2ndia",flag:"/flags/m/NZ.svg",code:"NZ",dial_code:"+64"},{name:"Nicar\xE1gua",flag:"/flags/m/NI.svg",code:"NI",dial_code:"+505"},{name:"N\xEDger",flag:"/flags/m/NE.svg",code:"NE",dial_code:"+227"},{name:"Nig\xE9ria",flag:"/flags/m/NG.svg",code:"NG",dial_code:"+234"},{name:"Niue",flag:"/flags/m/NU.svg",code:"NU",dial_code:"+683"},{name:"Ilhas Norfolk",flag:"/flags/m/NF.svg",code:"NF",dial_code:"+672"},{name:"Marianas do Norte",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+670"},{name:"Noruega",flag:"/flags/m/NO.svg",code:"NO",dial_code:"+47"},{name:"Om\xE3",flag:"/flags/m/OM.svg",code:"OM",dial_code:"+968"},{name:"Palau",flag:"/flags/m/PW.svg",code:"PW",dial_code:"+680"},{name:"Panam\xE1",flag:"/flags/m/PA.svg",code:"PA",dial_code:"+507"},{name:"Papua Nova Guin\xE9",flag:"/flags/m/PG.svg",code:"PG",dial_code:"+675"},{name:"Paraguai",flag:"/flags/m/PY.svg",code:"PY",dial_code:"+595"},{name:"Peru",flag:"/flags/m/PE.svg",code:"PE",dial_code:"+51"},{name:"Filipinas",flag:"/flags/m/PH.svg",code:"PH",dial_code:"+63"},{name:"Pol\xF4nia",flag:"/flags/m/PL.svg",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"/flags/m/PT.svg",code:"PT",dial_code:"+351"},{name:"Porto Rico",flag:"/flags/m/PR.svg",code:"PR",dial_code:"+1787"},{name:"Catar",flag:"/flags/m/QA.svg",code:"QA",dial_code:"+974"},{name:"Reuni\xE3o",flag:"/flags/m/RE.svg",code:"RE",dial_code:"+262"},{name:"Rom\xEAnia",flag:"/flags/m/RO.svg",code:"RO",dial_code:"+40"},{name:"R\xFAssia",flag:"/flags/m/RU.svg",code:"RU",dial_code:"+7"},{name:"Ruanda",flag:"/flags/m/RW.svg",code:"RW",dial_code:"+250"},{name:"San Marino",flag:"/flags/m/SM.svg",code:"SM",dial_code:"+378"},{name:"S\xE3o Tom\xE9 e Pr\xEDncipe",flag:"/flags/m/ST.svg",code:"ST",dial_code:"+239"},{name:"Ar\xE1bia Saudita",flag:"/flags/m/SA.svg",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"/flags/m/SN.svg",code:"SN",dial_code:"+221"},{name:"S\xE9rvia",flag:"/flags/m/RS.svg",code:"RS",dial_code:"+381"},{name:"Seicheles",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+248"},{name:"Serra Leoa",flag:"/flags/m/SL.svg",code:"SL",dial_code:"+232"},{name:"Singapura",flag:"/flags/m/SG.svg",code:"SG",dial_code:"+65"},{name:"Rep\xFAblica Eslovaca",flag:"/flags/m/SK.svg",code:"SK",dial_code:"+421"},{name:"Eslov\xEAnia",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+386"},{name:"Ilhas Salom\xE3o",flag:"/flags/m/SB.svg",code:"SB",dial_code:"+677"},{name:"Som\xE1lia",flag:"/flags/m/SO.svg",code:"SO",dial_code:"+252"},{name:"\xC1frica do Sul",flag:"/flags/m/ZA.svg",code:"ZA",dial_code:"+27"},{name:"Espanha",flag:"/flags/m/ES.svg",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"/flags/m/LK.svg",code:"LK",dial_code:"+94"},{name:"Santa Helena",flag:"/flags/m/SH.svg",code:"SH",dial_code:"+290"},{name:"S\xE3o Crist\xF3v\xE3o",flag:"/flags/m/KN.svg",code:"KN",dial_code:"+1869"},{name:"Santa L\xFAcia",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+1758"},{name:"Sud\xE3o",flag:"/flags/m/SD.svg",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"/flags/m/SR.svg",code:"SR",dial_code:"+597"},{name:"Suazil\xE2ndia",flag:"/flags/m/SZ.svg",code:"SZ",dial_code:"+268"},{name:"Su\xE9cia",flag:"/flags/m/SE.svg",code:"SE",dial_code:"+46"},{name:"Su\xED\xE7a",flag:"/flags/m/CH.svg",code:"CH",dial_code:"+41"},{name:"S\xEDria",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+963"},{name:"Taiwan",flag:"/flags/m/TW.svg",code:"TW",dial_code:"+886"},{name:"Tajiquist\xE3o",flag:"/flags/m/TJ.svg",code:"TJ",dial_code:"+992"},{name:"Tail\xE2ndia",flag:"/flags/m/TH.svg",code:"TH",dial_code:"+66"},{name:"Tanz\xE2nia - Rep\xFAblica Unida",flag:"/flags/m/TZ.svg",code:"TZ",dial_code:"+255"},{name:"Togo",flag:"/flags/m/TG.svg",code:"TG",dial_code:"+228"},{name:"Tonga",flag:"/flags/m/TO.svg",code:"TO",dial_code:"+676"},{name:"Trinidad e Tobago",flag:"/flags/m/TT.svg",code:"TT",dial_code:"+1868"},{name:"Tun\xEDsia",flag:"/flags/m/TN.svg",code:"TN",dial_code:"+216"},{name:"Turquia",flag:"/flags/m/TR.svg",code:"TR",dial_code:"+90"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turks & Ilhas Caicos",flag:"/flags/m/TC.svg",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"/flags/m/TV.svg",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"/flags/m/UG.svg",code:"UG",dial_code:"+256"},{name:"Reino Unido",flag:"/flags/m/GB-UKM.svg",code:"GB-UKM",dial_code:"+44"},{name:"Ucr\xE2nia",flag:"/flags/m/UA.svg",code:"UA",dial_code:"+380"},{name:"Emirados \xC1rabes Unidos",flag:"/flags/m/AE.svg",code:"AE",dial_code:"+971"},{name:"Uruguai",flag:"/flags/m/UY.svg",code:"UY",dial_code:"+598"},{name:"Estados Unidos",flag:"/flags/m/US.svg",code:"US",dial_code:"+1"},{name:"Uzbequist\xE3o",flag:"/flags/m/UZ.svg",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"/flags/m/VU.svg",code:"VU",dial_code:"+678"},{name:"Cidade do Vaticano",flag:"/flags/m/VA.svg",code:"VA",dial_code:"+379"},{name:"Venezuela",flag:"/flags/m/VE.svg",code:"VE",dial_code:"+58"},{name:"Vietn\xE3",flag:"/flags/m/VN.svg",code:"VN",dial_code:"+84"},{name:"Ilhas Virgens Brit\xE2nicas",flag:"/flags/m/VG.svg",code:"VG",dial_code:"+1284"},{name:"Ilhas Virgens Americanas",flag:"/flags/m/VI.svg",code:"VI",dial_code:"+1340"},{name:"Wallis e Futuna",flag:"/flags/m/WF.svg",code:"WF",dial_code:"+681"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"Z\xE2mbia",flag:"/flags/m/ZM.svg",code:"ZM",dial_code:"+260"},{name:"Zimb\xE1bue",flag:"/flags/m/ZW.svg",code:"ZW",dial_code:"+263"}];var gR=w('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><div class="relative makebot-country-select flex justify-center items-center"><div class="pl-3 pr-0 flex items-center gap-1"><img alt=Bandeira class="w-8 h-6 rounded-sm"></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),hR=w("<option>"),Wx=e=>{let[t,n]=O(ct(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=O(e.defaultValue??""),i,a=f=>{if(o(f),f?.startsWith("+")&&f.length>2){let p=Er.reduce((y,h)=>!h?.dial_code||y!==null&&!y.dial_code?y:f?.startsWith(h.dial_code)&&h.dial_code.length>(y?.dial_code.length??0)?h:y,null);p&&n(p.code)}},s=()=>i?.value!==""&&i?.reportValidity(),l=()=>{let f=Er.find(p=>p.code===t())?.dial_code;if(s()){let p=i?.value??r();e.onSubmit({type:"text",value:p.startsWith("+")?p:`${f??""}${p}`})}else i?.focus()},c=f=>{f.key==="Enter"&&l()},u=f=>{let p=Er.find(h=>h.code===f.currentTarget.value);if(!p)return;let y=Er.find(h=>h.code===t());(r()===""||y&&r()===y.dial_code)&&o(p.dial_code),n(p.code),i?.focus()};me(()=>{if(!st()&&i&&i.focus({preventScroll:!0}),ct(r())){let f=Er.find(p=>p.code===t());f?.dial_code&&o(f.dial_code)}window.addEventListener("message",d)}),ie(()=>{window.removeEventListener("message",d)});let d=f=>{let{data:p}=f;p.isFromMakebot&&p.command==="setInputValue"&&o(p.value)};return(()=>{var f=gR(),p=f.firstChild,y=p.firstChild,h=y.firstChild,k=h.firstChild,C=h.nextSibling;return f.$$keydown=c,v(h,m(Ol,{class:"w-3"}),null),C.addEventListener("change",u),v(C,m(Re,{each:Er,children:b=>(()=>{var T=hR();return v(T,()=>b.name,null),v(T,(()=>{var g=L(()=>!!(b.dial_code&&String(b.dial_code).trim()!==""));return()=>g()?` (${b.dial_code})`:""})(),null),$(()=>T.selected=b.code===t()),$(()=>T.value=b.code),T})()})),v(p,m(Cr,{type:"tel",ref(b){var T=i;typeof T=="function"?T(b):i=b},get value(){return r()},onInput:a,get placeholder(){return e.labels?.placeholder??sd.labels.placeholder},get autofocus(){return!st()}}),null),v(f,m(Xe,{type:"button",class:"h-[42px]","on:click":l,get children(){return e.labels?.button??sd.labels.button}}),null),$(()=>K(k,"src",Er.find(b=>t()===b.code)?.flag)),f})()};Ne(["keydown"]);var Xn={buttonType:"Numbers",length:10,labels:{button:ft},startsAt:0,customIcon:{isEnabled:!1},isOneClickSubmitEnabled:!1};var bR=w('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),yR=w('<span class="text-sm w-full rating-label">'),vR=w('<span class="text-sm w-full text-right pr-2 rating-label">'),xR=w("<div role=checkbox>"),wR=w("<div>"),qx=e=>{let[t,n]=O(e.defaultValue?Number(e.defaultValue):void 0),r=l=>{l.preventDefault();let c=t();rt(c)||e.onSubmit({type:"text",value:c.toString()})},o=l=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:l.toString()}),n(l)},i=e.block.options?.labels?.button,a=i==="",s=i??Xn.labels.button;return(()=>{var l=bR(),c=l.firstChild,u=c.nextSibling;return l.addEventListener("submit",r),v(l,(()=>{var d=L(()=>!!e.block.options?.labels?.left);return()=>d()&&(()=>{var f=yR();return v(f,()=>e.block.options.labels.left),f})()})(),c),v(c,m(Re,{get each(){return Array.from(Array((e.block.options?.length??Xn.length)+((e.block.options?.buttonType??Xn.buttonType)==="Numbers"?-((e.block.options?.startsAt??Xn.startsAt)-1):0)))},children:(d,f)=>m(kR,ge(()=>e.block.options,{get rating(){return t()},get idx(){return f()+((e.block.options?.buttonType??Xn.buttonType)==="Numbers"?e.block.options?.startsAt??Xn.startsAt:1)},onClick:o}))})),v(l,(()=>{var d=L(()=>!!e.block.options?.labels?.right);return()=>d()&&(()=>{var f=vR();return v(f,()=>e.block.options.labels.right),f})()})(),u),v(u,(()=>{var d=L(()=>!!ye(t()));return()=>d()&&m(Xe,{disableIcon:!a,children:s})})()),l})()},kR=e=>{let t=n=>{n.preventDefault(),e.onClick(e.idx)};return m(Fe,{get children(){return[m(ee,{get when(){return(e.buttonType??Xn.buttonType)==="Numbers"},get children(){return[m(U,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(yt,{"on:click":t,get children(){return e.idx}})}}),m(U,{get when(){return!e.isOneClickSubmitEnabled},get children(){var n=xR();return gt(n,"click",t),v(n,()=>e.idx),$(r=>{var o=ye(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable"+(ye(e.rating)&&e.idx<=e.rating?" selected":"");return o!==r.e&&K(n,"aria-checked",r.e=o),i!==r.t&&G(n,r.t=i),r},{e:void 0,t:void 0}),n}})]}}),m(ee,{get when(){return(e.buttonType??Xn.buttonType)!=="Numbers"},get children(){var n=wR();return gt(n,"click",()=>e.onClick(e.idx)),$(r=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(ye(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&Ue(e.customIcon?.svg?.trim())?e.customIcon.svg:TR;return o!==r.e&&G(n,r.e=o),i!==r.t&&(n.innerHTML=r.t=i),r},{e:void 0,t:void 0}),n}})]}})},TR='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var SR=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),ld=e=>(()=>{var t=SR();return Ce(t,e,!0,!0),t})();var CR=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),Zx=e=>(()=>{var t=CR();return Ce(t,e,!0,!0),t})();var _R=w("<input type=file id=document-upload multiple class=hidden>"),ER=w('<input type=file id=photos-upload accept="image/avif, image/*, video/*"multiple class=hidden>'),PR=w('<label aria-label="Adicionar anexos"for=document-upload>'),IR=w("<label> Documento"),AR=w("<label> Fotos & v\xEDdeos"),Yx=e=>[(()=>{var t=_R();return t.addEventListener("change",n=>{n.currentTarget.files&&(e.onNewFiles(n.currentTarget.files),n.currentTarget.value="")}),t})(),(()=>{var t=ER();return t.addEventListener("change",n=>{n.currentTarget.files&&(e.onNewFiles(n.currentTarget.files),n.currentTarget.value="")}),t})(),(()=>{var t=PR();return v(t,m(ld,{class:"w-5"})),$(()=>G(t,q("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:hidden",e.class))),t})(),m(jn.Root,{get children(){return[m(jn.Trigger,{get class(){return q("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:block hidden",e.class)},"aria-label":"Adicionar anexos",get children(){return m(ld,{class:"w-5"})}}),m(jn.Positioner,{get children(){return m(jn.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[m(jn.Item,{value:"document",asChild:t=>(()=>{var n=IR(),r=n.firstChild;return Ce(n,ge(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),v(n,m(Pl,{class:"w-4"}),r),n})()}),m(jn.Item,{value:"photos",asChild:t=>(()=>{var n=AR(),r=n.firstChild;return Ce(n,ge(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),v(n,m(Zx,{class:"w-4"}),r),n})()})]}})}})]}})];var RR=w('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),Kx=e=>(()=>{var t=RR();return Ce(t,e,!0,!0),t})();var OR=w('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),Xx=e=>{let[t,n]=qe(e,["ref","onInput","inputmode"]),r=st();return(()=>{var o=OR();o.$$input=a=>t.onInput(a.currentTarget.value);var i=t.ref;return typeof i=="function"?ke(i,o):t.ref=o,o.autofocus=!r,Ce(o,ge({get inputmode(){return t.inputmode}},n),!1,!1),o})()};Ne(["input"]);var D0=ym(N0(),1);var La={isLong:!1,labels:{button:ft,placeholder:"Digite sua resposta..."},audioClip:{isEnabled:!1,visibility:"Auto"},attachments:{isEnabled:!1,visibility:"Auto"}};var $0=`
55
55
  const gainFactor = 3;
56
56
 
57
57
  class VolumeProcessor extends AudioWorkletProcessor {
@@ -76,7 +76,7 @@ class VolumeProcessor extends AudioWorkletProcessor {
76
76
 
77
77
  registerProcessor("volume-processor", VolumeProcessor);
78
78
 
79
- `;var uI=C('<div><button class="p-0.5 rounded-full"aria-label="Parar de gravar"></button><div class="relative flex w-full"><canvas class="w-full h-[42px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[42px]"></div><div class="absolute right-gradient w-3 right-0 h-[42px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),Rn=3,On=3,dI=60,mI=10,fI=5,pI=90,Zx=e=>{let[t,r]=O(0),n,o,i,a,s,l,c,u=[],d,p,f=0,x=Je(e.buttonsTheme?.backgroundColor??ha[ls(e.context.makebot.version)?e.context.makebot.version:"6"]).join(", "),h=()=>{if(!i||!n||!p)return;let b=performance.now(),y=b-p;p=b,i.clearRect(0,0,n.width,n.height),i.fillStyle=`rgba(${x}, 0.2)`;for(let g=0;g<(n.width+On)/(Rn+On);g++){let k=g*(Rn+On)-f,S=n.height*(mI/100),P=(n.height-S)/2;i.beginPath(),i.roundRect(k,P,Rn,S,5),i.fill()}i.fillStyle=`rgba(${x}, 1)`;for(let g=0;g<u.length;g++){let k=n.width+(g+1)*(Rn+On)-f,S=n.height*((u[g]??0)/100),P=(n.height-S)/2;i.beginPath(),i.roundRect(k,P,Rn,S,5),i.fill()}f+=dI*(y/1e3),o=requestAnimationFrame(h)},w=async()=>{n&&(c=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(c),i||(i=n.getContext("2d")??void 0),d=setInterval(()=>{r(b=>b+=1)},1e3),a=new AudioContext,s=await gI(a),l=a.createMediaStreamSource(c),l.connect(s),s.connect(a.destination),s.port.onmessage=b=>{((n.width+On)/(Rn+On)+u.length)*(Rn+On)<n.width+f&&u.push(Math.min(Math.max(b.data,fI),pI))},p=performance.now(),o=requestAnimationFrame(h))},T=()=>{i&&n&&i.clearRect(0,0,n.width,n.height),f=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,c?.getTracks().forEach(b=>b.stop()),c=void 0,u=[],clearTimeout(d),r(0),cancelAnimationFrame(o),e.onAbortRecording()};return ve(()=>{e.recordingStatus==="asking"?w():e.recordingStatus==="stopped"&&T()}),re(()=>{T()}),(()=>{var b=uI(),y=b.firstChild,g=y.nextSibling,k=g.firstChild,S=g.nextSibling;Be(y,"click",T),v(y,m(pr,{class:"w-4"}));var P=n;return typeof P=="function"?ge(P,k):n=k,v(S,()=>hI(t())),$(()=>V(b,q("w-full gap-2 items-center transition-opacity px-2 makebot-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),b})()},gI=async e=>{let t=new Blob([Xx],{type:"application/javascript"}),r=URL.createObjectURL(t);return await e.audioWorklet.addModule(r),new AudioWorkletNode(e,"volume-processor")},hI=e=>{let t=Math.floor(e/60),n=(e%60).toString().padStart(2,"0");return`${t}:${n}`};var bI=C('<div class="p-2 flex gap-2 border-input-border overflow-auto"style=border-bottom-width:1px>'),yI=C("<div>"),xI=C("<div><div>"),Qx=e=>{let[t,r]=O(e.defaultValue??""),[n,o]=O([]),[i,a]=O(void 0),[s,l]=O(!1),[c,u]=O("stopped"),d,p,f=[],x=R=>r(R),h=()=>d?.value!==""&&d?.reportValidity(),w=async()=>{if(c()==="started"&&p){p.stop();return}if(h()){let R;if(n().length>0){a(void 0);let M=await Eo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:!0}),files:n().map(z=>({file:z,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:z.name}})),onUploadProgress:a});if(M.type==="error"){$t.create({description:M.error});return}R=M.urls?.map((z,K)=>z?{...z,blobUrl:URL.createObjectURL(n()[K])}:null).filter(de)}e.onSubmit({type:"text",value:d?.value??t(),attachments:R})}else d?.focus()},T=R=>{e.block.options?.isLong||R.key==="Enter"&&w()},b=R=>{e.block.options?.isLong&&R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&w()};ae(()=>{!ze()&&d&&d.focus({preventScroll:!0}),window.addEventListener("message",y)}),re(()=>{window.removeEventListener("message",y)});let y=R=>{let{data:M}=R;M.isFromMakebot&&M.command==="setInputValue"&&r(M.value)},g=R=>{R.preventDefault(),l(!0)},k=()=>l(!1),S=R=>{R.preventDefault(),R.stopPropagation(),R.dataTransfer?.files&&P(R.dataTransfer.files)},P=R=>{let M=Array.from(R).map(z=>ys({existingFiles:n(),newFile:z,params:{sizeLimit:Wt("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")?Number(Wt("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")):void 0},context:e.context,onError:({description:K})=>{$t.create({description:K})}})).filter(de);M.length!==0&&o(z=>[...M,...z])},A=R=>{o(M=>M.filter((z,K)=>K!==R))},N=()=>{u("asking")},D=R=>{let M,z=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";p=new MediaRecorder(R,{mimeType:z}),p.ondataavailable=K=>{K.data.size!==0&&f.push(K.data)},p.onstart=()=>{M=Date.now()},p.onstop=async()=>{if(c()!=="started"||f.length===0)return;let K=Date.now()-M,I=await(0,Jx.fixWebmDuration)(new Blob(f,{type:z}),K),B=new File([I],`rec-${e.block.id}-${Date.now()}.${z==="audio/webm"?"webm":"mp4"}`,{type:z});a(void 0);let j=await Eo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:!0}),files:[{file:B,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:B.name}}],onUploadProgress:a});if(j.type==="error"){$t.create({description:j.error});return}let he=j.urls.filter(de).map(le=>le.url);e.onSubmit({type:"recording",url:he[0],blobUrl:URL.createObjectURL(B)})},p.start(),u("started")},F=()=>{p?.stop(),u("stopped"),p=void 0,f=[]};return(()=>{var R=xI(),M=R.firstChild;return R.addEventListener("dragleave",k),R.addEventListener("dragover",g),R.addEventListener("drop",S),R.$$keydown=T,v(M,m(Zx,{get recordingStatus(){return c()},get buttonsTheme(){return e.context.makebot.theme.chat?.buttons},get context(){return e.context},onRecordingConfirmed:D,onAbortRecording:F}),null),v(M,m(U,{get when(){return c()!=="started"},get children(){return[m(U,{get when(){return n().length},get children(){var z=bI();return v(z,m(we,{get each(){return n()},children:(K,I)=>m(ws,{file:K,get uploadProgressPercent(){return L(()=>!!i())()?L(()=>i()?.fileIndex===I())()?20:I()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>A(I())})})),z}}),(()=>{var z=yI();return v(z,(()=>{var K=L(()=>!!e.block.options?.isLong);return()=>K()?m(fx,{ref(I){var B=d;typeof B=="function"?B(I):d=I},onInput:x,onKeyDown:b,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??Ni.labels.placeholder}}):m(Qr,{ref(I){var B=d;typeof B=="function"?B(I):d=I},onInput:x,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??Ni.labels.placeholder}})})(),null),v(z,m(U,{get when(){return L(()=>!!(e.block.options?.attachments?.isEnabled??Ni.attachments.isEnabled))()&&e.block.options?.attachments?.saveVariableId},get children(){return m(dx,{onNewFiles:P,get class(){return q(e.block.options?.isLong?"ml-2":void 0)}})}}),null),$(()=>V(z,q("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),z})()]}}),null),v(R,m(Ie,{get children(){return[m(Z,{get when(){return L(()=>!t()&&c()!=="started")()&&e.block.options?.audioClip?.isEnabled},get children(){return m(Ct,{class:"h-[42px] flex items-center","on:click":N,"aria-label":"Gravar voz",get children(){return m(mx,{class:"flex w-6 h-6"})}})}}),m(Z,{when:!0,get children(){return m(Fe,{type:"button","on:click":w,get isDisabled(){return!!i()},class:"h-[42px]",get children(){return e.block.options?.labels?.button??Ni.labels.button}})}})]}}),null),$(z=>{var K=q("makebot-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&c()!=="started"?"max-w-full":"max-w-[350px]"),I=q("relative makebot-input flex-col w-full",s()&&"filter brightness-95");return K!==z.e&&V(R,z.e=K),I!==z.t&&V(M,z.t=I),z},{e:void 0,t:void 0}),R})()};Se(["keydown"]);var ev={labels:{button:Ye},format:"HH:mm"};var vI=C('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input makebot-datetime-input "type=time data-testid=time style=font-size:16px>'),tv=e=>{let[t,r]=O(e.defaultValue??""),n,o=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&a()};ae(()=>{!ze()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),re(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=vI(),u=c.firstChild,d=u.firstChild;c.$$keydown=s,d.$$input=f=>{o(f.currentTarget.value)};var p=n;return typeof p=="function"?ge(p,d):n=d,v(c,m(Fe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.options?.labels?.button??ev.labels.button}}),null),$(()=>d.value=t()),c})()};Se(["keydown","input"]);var cu={labels:{button:Ye,placeholder:"Digite um URL..."},retryMessageContent:"Este URL parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var wI=C('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),rv=e=>{let[t,r]=O(e.defaultValue??""),n,o=c=>{r(c)},i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{n&&!n?.value.startsWith("http")&&(n.value=`https://${n.value}`),i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&a()};ae(()=>{!ze()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),re(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=wI(),u=c.firstChild;return c.$$keydown=s,v(u,m(Qr,{ref(d){var p=n;typeof p=="function"?p(d):n=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??cu.labels.placeholder},onInput:o,type:"url",autocomplete:"url"})),v(c,m(Fe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.block.options?.labels?.button??cu.labels.button}}),null),c})()};Se(["keydown"]);var Ws=e=>m(Kr.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,get onOpenChange(){return e.onClose},get children(){return m(oa,{get mount(){return sa()()},get children(){return[m(Kr.Backdrop,{class:"absolute inset-0 bg-[rgba(0,0,0,0.8)] h-screen z-50"}),m(Kr.Positioner,{class:"absolute inset-0 z-50 flex items-center justify-center px-2",get children(){return[m(Kr.Content,{class:"focus:outline-none",get children(){return e.children}}),m(Kr.CloseTrigger,{class:"fixed top-4 right-4 z-50 rounded-md bg-[#202020] p-2 text-white",get children(){return m(pr,{class:"w-6 h-6"})}})]}})]}})}});var kI=C(`<svg viewBox="0 0 156 156"class="size-6 @xs:size-10"data-testid=default-avatar><path fill=#08240E d="M155.542,79.516c0-14.207-1.133-18.566-5.055-19.699c-3.922-1.133-4.271-2.179-5.491-9.675
79
+ `;var XR=w('<div><button class="p-0.5 rounded-full"aria-label="Parar de gravar"></button><div class="relative flex w-full"><canvas class="w-full h-[42px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[42px]"></div><div class="absolute right-gradient w-3 right-0 h-[42px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),xo=3,wo=3,JR=60,QR=10,eO=5,tO=90,M0=e=>{let[t,n]=O(0),r,o,i,a,s,l,c,u=[],d,f,p=0,y=ot(e.buttonsTheme?.backgroundColor??vs[dl(e.context.makebot.version)?e.context.makebot.version:"6"]).join(", "),h=()=>{if(!i||!r||!f)return;let b=performance.now(),T=b-f;f=b,i.clearRect(0,0,r.width,r.height),i.fillStyle=`rgba(${y}, 0.2)`;for(let g=0;g<(r.width+wo)/(xo+wo);g++){let x=g*(xo+wo)-p,S=r.height*(QR/100),P=(r.height-S)/2;i.beginPath(),i.roundRect(x,P,xo,S,5),i.fill()}i.fillStyle=`rgba(${y}, 1)`;for(let g=0;g<u.length;g++){let x=r.width+(g+1)*(xo+wo)-p,S=r.height*((u[g]??0)/100),P=(r.height-S)/2;i.beginPath(),i.roundRect(x,P,xo,S,5),i.fill()}p+=JR*(T/1e3),o=requestAnimationFrame(h)},k=async()=>{r&&(c=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(c),i||(i=r.getContext("2d")??void 0),d=setInterval(()=>{n(b=>b+=1)},1e3),a=new AudioContext,s=await nO(a),l=a.createMediaStreamSource(c),l.connect(s),s.connect(a.destination),s.port.onmessage=b=>{((r.width+wo)/(xo+wo)+u.length)*(xo+wo)<r.width+p&&u.push(Math.min(Math.max(b.data,eO),tO))},f=performance.now(),o=requestAnimationFrame(h))},C=()=>{i&&r&&i.clearRect(0,0,r.width,r.height),p=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,c?.getTracks().forEach(b=>b.stop()),c=void 0,u=[],clearTimeout(d),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return $e(()=>{e.recordingStatus==="asking"?k():e.recordingStatus==="stopped"&&C()}),ie(()=>{C()}),(()=>{var b=XR(),T=b.firstChild,g=T.nextSibling,x=g.firstChild,S=g.nextSibling;gt(T,"click",C),v(T,m(_r,{class:"w-4"}));var P=r;return typeof P=="function"?ke(P,x):r=x,v(S,()=>rO(t())),$(()=>G(b,q("w-full gap-2 items-center transition-opacity px-2 makebot-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),b})()},nO=async e=>{let t=new Blob([$0],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},rO=e=>{let t=Math.floor(e/60),r=(e%60).toString().padStart(2,"0");return`${t}:${r}`};var oO=w('<div class="p-2 flex gap-2 border-input-border overflow-auto"style=border-bottom-width:1px>'),iO=w("<div>"),aO=w("<div><div>"),L0=e=>{let[t,n]=O(e.defaultValue??""),[r,o]=O([]),[i,a]=O(void 0),[s,l]=O(!1),[c,u]=O("stopped"),d,f,p=[],y=A=>n(A),h=()=>d?.value!==""&&d?.reportValidity(),k=async()=>{if(c()==="started"&&f){f.stop();return}if(h()){let A;if(r().length>0){a(void 0);let M=await wi({apiHost:e.context.apiHost??kt({ignoreChatApiUrl:!0}),files:r().map(V=>({file:V,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:V.name}})),onUploadProgress:a});if(M.type==="error"){Wt.create({description:M.error});return}A=M.urls?.map((V,Y)=>V?{...V,blobUrl:URL.createObjectURL(r()[Y])}:null).filter(ye)}e.onSubmit({type:"text",value:d?.value??t(),attachments:A})}else d?.focus()},C=A=>{e.block.options?.isLong||A.key==="Enter"&&k()},b=A=>{e.block.options?.isLong&&A.key==="Enter"&&(A.metaKey||A.ctrlKey)&&k()};me(()=>{!st()&&d&&d.focus({preventScroll:!0}),window.addEventListener("message",T)}),ie(()=>{window.removeEventListener("message",T)});let T=A=>{let{data:M}=A;M.isFromMakebot&&M.command==="setInputValue"&&n(M.value)},g=A=>{A.preventDefault(),l(!0)},x=()=>l(!1),S=A=>{A.preventDefault(),A.stopPropagation(),A.dataTransfer?.files&&P(A.dataTransfer.files)},P=A=>{let M=Array.from(A).map(V=>El({existingFiles:r(),newFile:V,params:{sizeLimit:un("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")?Number(un("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")):void 0},context:e.context,onError:({description:Y})=>{Wt.create({description:Y})}})).filter(ye);M.length!==0&&o(V=>[...M,...V])},R=A=>{o(M=>M.filter((V,Y)=>Y!==A))},N=()=>{u("asking")},D=A=>{let M,V=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";f=new MediaRecorder(A,{mimeType:V}),f.ondataavailable=Y=>{Y.data.size!==0&&p.push(Y.data)},f.onstart=()=>{M=Date.now()},f.onstop=async()=>{if(c()!=="started"||p.length===0)return;let Y=Date.now()-M,I=await(0,D0.fixWebmDuration)(new Blob(p,{type:V}),Y),B=new File([I],`rec-${e.block.id}-${Date.now()}.${V==="audio/webm"?"webm":"mp4"}`,{type:V});a(void 0);let H=await wi({apiHost:e.context.apiHost??kt({ignoreChatApiUrl:!0}),files:[{file:B,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:B.name}}],onUploadProgress:a});if(H.type==="error"){Wt.create({description:H.error});return}let we=H.urls.filter(ye).map(de=>de.url);e.onSubmit({type:"recording",url:we[0],blobUrl:URL.createObjectURL(B)})},f.start(),u("started")},F=()=>{f?.stop(),u("stopped"),f=void 0,p=[]};return(()=>{var A=aO(),M=A.firstChild;return A.addEventListener("dragleave",x),A.addEventListener("dragover",g),A.addEventListener("drop",S),A.$$keydown=C,v(M,m(M0,{get recordingStatus(){return c()},get buttonsTheme(){return e.context.makebot.theme.chat?.buttons},get context(){return e.context},onRecordingConfirmed:D,onAbortRecording:F}),null),v(M,m(U,{get when(){return c()!=="started"},get children(){return[m(U,{get when(){return r().length},get children(){var V=oO();return v(V,m(Re,{get each(){return r()},children:(Y,I)=>m(Al,{file:Y,get uploadProgressPercent(){return L(()=>!!i())()?L(()=>i()?.fileIndex===I())()?20:I()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>R(I())})})),V}}),(()=>{var V=iO();return v(V,(()=>{var Y=L(()=>!!e.block.options?.isLong);return()=>Y()?m(Xx,{ref(I){var B=d;typeof B=="function"?B(I):d=I},onInput:y,onKeyDown:b,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??La.labels.placeholder}}):m(Cr,{ref(I){var B=d;typeof B=="function"?B(I):d=I},onInput:y,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??La.labels.placeholder}})})(),null),v(V,m(U,{get when(){return L(()=>!!(e.block.options?.attachments?.isEnabled??La.attachments.isEnabled))()&&e.block.options?.attachments?.saveVariableId},get children(){return m(Yx,{onNewFiles:P,get class(){return q(e.block.options?.isLong?"ml-2":void 0)}})}}),null),$(()=>G(V,q("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),V})()]}}),null),v(A,m(Fe,{get children(){return[m(ee,{get when(){return L(()=>!t()&&c()!=="started")()&&e.block.options?.audioClip?.isEnabled},get children(){return m(yt,{class:"h-[42px] flex items-center","on:click":N,"aria-label":"Gravar voz",get children(){return m(Kx,{class:"flex w-6 h-6"})}})}}),m(ee,{when:!0,get children(){return m(Xe,{type:"button","on:click":k,get isDisabled(){return!!i()},class:"h-[42px]",get children(){return e.block.options?.labels?.button??La.labels.button}})}})]}}),null),$(V=>{var Y=q("makebot-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&c()!=="started"?"max-w-full":"max-w-[350px]"),I=q("relative makebot-input flex-col w-full",s()&&"filter brightness-95");return Y!==V.e&&G(A,V.e=Y),I!==V.t&&G(M,V.t=I),V},{e:void 0,t:void 0}),A})()};Ne(["keydown"]);var B0={labels:{button:ft},format:"HH:mm"};var sO=w('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input makebot-datetime-input "type=time data-testid=time style=font-size:16px>'),F0=e=>{let[t,n]=O(e.defaultValue??""),r,o=c=>n(c),i=()=>r?.value!==""&&r?.reportValidity(),a=()=>{i()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=c=>{c.key==="Enter"&&a()};me(()=>{!st()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",l)}),ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&n(u.value)};return(()=>{var c=sO(),u=c.firstChild,d=u.firstChild;c.$$keydown=s,d.$$input=p=>{o(p.currentTarget.value)};var f=r;return typeof f=="function"?ke(f,d):r=d,v(c,m(Xe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.options?.labels?.button??B0.labels.button}}),null),$(()=>d.value=t()),c})()};Ne(["keydown","input"]);var Cd={labels:{button:ft,placeholder:"Digite um URL..."},retryMessageContent:"Este URL parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"};var lO=w('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),U0=e=>{let[t,n]=O(e.defaultValue??""),r,o=c=>{n(c)},i=()=>r?.value!==""&&r?.reportValidity(),a=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),i()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},s=c=>{c.key==="Enter"&&a()};me(()=>{!st()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",l)}),ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&n(u.value)};return(()=>{var c=lO(),u=c.firstChild;return c.$$keydown=s,v(u,m(Cr,{ref(d){var f=r;typeof f=="function"?f(d):r=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Cd.labels.placeholder},onInput:o,type:"url",autocomplete:"url"})),v(c,m(Xe,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.block.options?.labels?.button??Cd.labels.button}}),null),c})()};Ne(["keydown"]);var cO=w(`<svg viewBox="0 0 156 156"class="size-6 @xs:size-10"data-testid=default-avatar><path fill=#08240E d="M155.542,79.516c0-14.207-1.133-18.566-5.055-19.699c-3.922-1.133-4.271-2.179-5.491-9.675
80
80
  c-1.22-7.496-5.451-11.321-13.803-14.269c-8.352-2.948-34.635-4.913-53.303-4.913c-18.668,0-43.969,3.193-43.969,3.193
81
81
  C15.919,36.02,10.329,47.963,9.545,54.239c-0.784,6.276-4.881,5.84-6.973,6.537C0.48,61.473,0.306,65.57,0.044,80.039
82
82
  s0.61,19.96,3.399,21.529c2.789,1.569,5.317-0.959,6.363,6.363s0.959,9.065,6.276,14.73c3.234,3.446,8.108,5.145,12.199,5.932
@@ -103,7 +103,7 @@ registerProcessor("volume-processor", VolumeProcessor);
103
103
  c0.308,1.076,0.617,1.883,1.234,2.421c1.079,1.345,3.084,1.345,4.318,0c0.617-0.807,1.079-1.883,1.388-3.228
104
104
  c0.154-1.076,0.308-2.152,0.463-3.228C60.027,79.615,59.718,66.971,58.793,65.088z"></path><path fill=#000000 d="M100.631,65.088c-1.388-2.69-4.472-2.69-5.706,0C94,66.971,93.846,79.615,93.846,82.843c0,1.345,0.154,2.69,0.617,4.035
105
105
  c0.308,1.076,0.617,1.883,1.234,2.421c1.079,1.345,3.084,1.345,4.318,0c0.617-0.807,1.079-1.883,1.388-3.228
106
- c0.154-1.076,0.308-2.152,0.463-3.228C101.865,79.615,101.556,66.971,100.631,65.088z">`),nv=({backgroundColor:e})=>kI();var CI=C("<span class=text-4xl>"),TI=C('<img alt="Avatar do bot"class="flex justify-center items-center relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"elementtiming="Bot avatar">'),SI=C('<figure class="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"><img alt="Avatar do bot"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),qs=e=>m(U,{get when(){return pe(e.src)},keyed:!0,get fallback(){return m(nv,{get backgroundColor(){return L(()=>!!e.isChatContainerLight)()?Ne.gray.dark[2]:Ne.gray.dark[1]}})},get children(){return m(Ie,{get children(){return[m(Z,{get when(){return EI(e.src??"")},get children(){var t=CI();return v(t,()=>e.src),t}}),m(Z,{get when(){return qt(e.src)},get children(){var t=TI();return $(()=>G(t,"src",e.src)),t}}),m(Z,{when:!0,get children(){var t=SI(),r=t.firstChild;return $(()=>G(r,"src",e.src)),t}})]}})}}),EI=e=>/^\p{Emoji}$/u.test(e);var PI=C("<div>"),ov=C('<div class="flex gap-1 overflow-auto max-w-[350px] flex-wrap justify-end @xs:items-center @xs:flex-nowrap">'),_I=C('<span class="px-[15px] py-[7px]">'),II=C('<img alt=Attachment class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),AI=C('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full makebot-guest-bubble flex flex-col"data-testid=guest-bubble>'),RI=C("<img>"),OI=C('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap makebot-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),iv=e=>(()=>{var t=PI();return v(t,m(Ie,{get children(){return[m(Z,{get when(){return e.answer?.type==="text"},get children(){return m($I,{get answer(){return e.answer}})}}),m(Z,{get when(){return e.answer?.type==="recording"},get children(){return m(NI,{get answer(){return e.answer}})}})]}}),null),v(t,m(U,{get when(){return e.theme.chat?.guestAvatar?.isEnabled??Xo},get children(){return m(qs,{get src(){return e.theme.chat?.guestAvatar?.url},get isChatContainerLight(){return oo({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})}}),null),$(()=>V(t,q("flex justify-end items-end animate-fade-in gap-2 guest-container",(e.theme.chat?.hostAvatar?.isEnabled??yr)&&"ml-7 @xs:ml-[50px]"))),t})(),$I=e=>{let[t,r]=O();return(()=>{var n=AI(),o=n.firstChild;return v(n,m(U,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{var i=ov();return v(i,m(we,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var l=RI();return l.$$click=()=>r(a.blobUrl??a.url),$(c=>{var u=a.blobUrl??a.url,d=`Attached image ${s()+1}`,p=q("makebot-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(f=>f.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==c.e&&G(l,"src",c.e=u),d!==c.t&&G(l,"alt",c.t=d),p!==c.a&&V(l,c.a=p),c},{e:void 0,t:void 0,a:void 0}),l})()})),i})(),(()=>{var i=ov();return v(i,m(we,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(vs,{get file(){return{name:a.url.split("/").at(-1)}}})})),i})()]}}),o),v(o,m(U,{get when(){return pe(e.answer.label??e.answer.value)},get children(){var i=_I();return v(i,()=>e.answer.label??e.answer.value),i}})),v(n,m(Ws,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=II();return $(()=>G(i,"src",t())),i}}),null),n})()},NI=e=>(()=>{var t=OI(),r=t.firstChild,n=r.firstChild;return $(()=>G(n,"src",e.answer.blobUrl??e.answer.url)),t})();Se(["click"]);var DI=C('<div class="flex flex-shrink-0 items-center w-6 h-6 @xs:w-10 @xs:h-10">'),LI=C('<div class="flex justify-end animate-fade-in gap-1 @xs:gap-2 makebot-input-container">'),av=e=>{let[t,r]=O(!1),n=async i=>{e.input.type==="cards"||e.input.type==="choice input"?console.log("\u{1F50D} Cards/Buttons block - mantendo vis\xEDvel ap\xF3s submit"):t()&&(console.log("\u{1F50D} Mantendo card vis\xEDvel ap\xF3s submit"),r(!1)),e.onSubmit(i)},o=i=>{e.onSkip(i)};return m(Ie,{get children(){return[m(Z,{get when(){return L(()=>!!(e.input.answer&&e.input.answer.status!=="retry"&&e.input.type!=="cards"))()&&e.input.type!=="choice input"},get children(){return m(iv,{get answer(){return e.input.answer},get theme(){return e.theme}})}}),m(Z,{get when(){return Ze(e.input.answer)||e.input.answer?.status==="retry"||e.input.type==="cards"||e.input.type==="choice input"},get children(){var i=LI(),a=e.ref;return typeof a=="function"?ge(a,i):e.ref=i,v(i,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??yr},get children(){return DI()}}),null),v(i,m(FI,{get context(){return e.context},get block(){return e.input},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return L(()=>e.input.answer?.status==="retry")()?BI(e.input.answer):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:o}),null),$(()=>G(i,"data-blockid",e.input.id)),i}})]}})},BI=e=>{if(e)return e.type==="text"?e.value:e.url},FI=e=>{let t=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),r=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??Ts.labels.success});return m(Ie,{get children(){return[m(Z,{get when(){return e.block.type==="text input"},get children(){return m(Qx,{get block(){return e.block},get defaultValue(){return t()},get context(){return e.context},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="number input"},get children(){return m(Yy,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="email input"},get children(){return m(Vy,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="url input"},get children(){return m(rv,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="phone number input"},get children(){return m(ix,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="date input"},get children(){return m(Uy,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="time input"},get children(){return m(tv,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return UI(e.block)},children:n=>{let o=n(),i=o.options;return m(Ie,{get children(){return[m(Z,{get when(){return!i?.isMultipleChoice},get children(){return m(Ay,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},options:i,get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return i?.isMultipleChoice},get children(){return m(Ny,{get defaultItems(){return o.items},options:i,get onSubmit(){return e.onSubmit}})}})]}})}}),m(Z,{get when(){return VI(e.block)},keyed:!0,children:n=>m(Ie,{get children(){return[m(Z,{get when(){return!n.options?.isMultipleChoice},get children(){return m(lx,{get defaultItems(){return n.items},get options(){return n.options},get onSubmit(){return e.onSubmit},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return n.options?.isMultipleChoice},get children(){return m(sx,{get defaultItems(){return n.items},get options(){return n.options},get onSubmit(){return e.onSubmit},get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(Z,{get when(){return e.block.type==="rating input"},get children(){return m(cx,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(Z,{get when(){return e.block.type==="file input"},get children(){return m(Gy,{get context(){return e.context},get block(){return e.block},get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}}),m(Z,{get when(){return e.block.type==="payment input"},get children(){return m(ox,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:r,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.block.type==="cards"},get children(){return m(By,{get block(){return e.block},get onSubmit(){return e.onSubmit},get onTransitionEnd(){return e.onTransitionEnd},get context(){return{sessionId:e.context.sessionId,apiHost:e.context.apiHost}},onAction:n=>{console.log("\u{1F50D} CardsCaroussel onAction:",n),console.log("\u{1F50D} A\xE7\xE3o executada:",n)}})}})]}})},UI=e=>e?.type==="choice input"?e:void 0,VI=e=>e?.type==="picture choice input"?e:void 0;var zI=C('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),Ke=()=>zI();var sv={isAutoplayEnabled:!0};var GI=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),HI=400,jI=100,uu,lv=e=>{let t=!1,r,n,[o,i]=O(!!e.onTransitionEnd);return ae(()=>{uu=setTimeout(()=>{t||(t=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(r),HI))},jI)}),re(()=>{uu&&clearTimeout(uu)}),(()=>{var a=GI(),s=a.firstChild,l=s.firstChild,c=l.firstChild,u=c.nextSibling,d=r;typeof d=="function"?ge(d,a):r=a,v(c,(()=>{var f=L(()=>!!o());return()=>f()&&m(Ke,{})})());var p=n;return typeof p=="function"?ge(p,u):n=u,$(f=>{var x=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=o()?"64px":"100%",w=o()?"32px":"100%",T=e.content?.url,b=e.onTransitionEnd?e.content?.isAutoplayEnabled??sv.isAutoplayEnabled:!1,y=q("z-10 text-fade-in",o()?"opacity-0 h-8 @xs:h-9":"opacity-100 m-2 h-[revert]");return x!==f.e&&V(a,f.e=x),h!==f.t&&ne(c,"width",f.t=h),w!==f.a&&ne(c,"height",f.a=w),T!==f.o&&G(u,"src",f.o=T),b!==f.i&&(u.autoplay=f.i=b),y!==f.n&&V(u,f.n=y),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),a})()};var WI=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto max-h-[calc(var(--bot-container-height)-100px)]">'),du,qI=400,cv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o;return ae(()=>{Ii({args:{...e.content.initFunction.args,makebotElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&Ii({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),du=setTimeout(()=>{n(!1),setTimeout(()=>e.onTransitionEnd?.(t),qI)},2e3)}),re(()=>{du&&clearTimeout(du)}),(()=>{var i=WI(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;typeof d=="function"?ge(d,i):t=i,v(l,(()=>{var f=L(()=>!!r());return()=>f()&&m(Ke,{})})());var p=o;return typeof p=="function"?ge(p,u):o=u,$(f=>{var x=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",w=r()?"32px":"100%",T=q("p-2 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100");return x!==f.e&&V(i,f.e=x),h!==f.t&&ne(l,"width",f.t=h),w!==f.a&&ne(l,"height",f.a=w),T!==f.o&&V(c,f.o=T),f},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var uv={height:400};var YI=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full">'),mu,KI=400,dv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&pe(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",o))};return ae(()=>{mu=setTimeout(()=>{n(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t)},KI)},2e3)}),re(()=>{mu&&clearTimeout(mu),window.removeEventListener("message",o)}),(()=>{var i=YI(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;return typeof d=="function"?ge(d,i):t=i,v(l,(()=>{var p=L(()=>!!r());return()=>p()&&m(Ke,{})})()),$(p=>{var f=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),x=r()?"64px":"100%",h=r()?"32px":"100%",w=q("p-4 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--embed-bubble-height)]"),T=`${e.content?.height??uv.height}px`,b=e.content?.url;return f!==p.e&&V(i,p.e=f),x!==p.t&&ne(l,"width",p.t=x),h!==p.a&&ne(l,"height",p.a=h),w!==p.o&&V(c,p.o=w),T!==p.i&&ne(c,"--embed-bubble-height",p.i=T),b!==p.n&&G(u,"src",p.n=b),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var fu={clickLink:{alt:"Minha imagem"}};var XI=C('<img elementtiming="Bubble image"fetchpriority=high>'),ZI=C('<img class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),JI=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),QI=C("<a target=_blank rel=noreferrer>"),eA=C("<figure>"),tA=400,rA=5e3,Ys,mv=e=>{let t,r,[n,o]=O(!1),[i,a]=O(!!e.onTransitionEnd),s=()=>{i()&&(a(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},tA))};ae(()=>{r&&(Ys=setTimeout(s,rA),r.onload=()=>{clearTimeout(Ys),s()})}),re(()=>{Ys&&clearTimeout(Ys)});let l=()=>{o(!0)},c=()=>{o(!1)},u=(()=>{var d=XI(),p=r;return typeof p=="function"?ge(p,d):r=d,$(f=>{var x=e.content?.url,h=e.content?.clickLink?.alt??fu.clickLink.alt,w=q(i()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-96":void 0),T=e.content?.url?.startsWith("data:image/svg")?"100%":void 0,b=e.content?.url?.startsWith("data:image/svg")?"120px":"512px",y=i()?"32px":"auto";return x!==f.e&&G(d,"src",f.e=x),h!==f.t&&G(d,"alt",f.t=h),w!==f.a&&V(d,f.a=w),T!==f.o&&ne(d,"width",f.o=T),b!==f.i&&ne(d,"max-height",f.i=b),y!==f.n&&ne(d,"height",f.n=y),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),d})();return(()=>{var d=JI(),p=d.firstChild,f=p.firstChild,x=f.firstChild,h=t;return typeof h=="function"?ge(h,d):t=d,v(x,(()=>{var w=L(()=>!!i());return()=>w()?m(Ke,{}):null})()),v(f,(()=>{var w=L(()=>!!e.content?.clickLink);return()=>w()?(()=>{var T=QI();return v(T,u),$(b=>{var y=e.content.clickLink.url,g=q("z-10",i()?"h-8":"p-4");return y!==b.e&&G(T,"href",b.e=y),g!==b.t&&V(T,b.t=g),b},{e:void 0,t:void 0}),T})():(()=>{var T=eA();return Be(T,"click",e.content?.url?.startsWith("data:image/svg")?void 0:l),v(T,u),$(()=>V(T,q("z-10 cursor-pointer",i()?"h-8 @xs:h-9":"p-4"))),T})()})(),null),v(d,m(Ws,{get isOpen(){return n()},onClose:c,get children(){var w=ZI();return $(T=>{var b=e.content?.url,y=e.content?.clickLink?.alt??fu.clickLink.alt;return b!==T.e&&G(w,"src",T.e=b),y!==T.t&&G(w,"alt",T.t=y),T},{e:void 0,t:void 0}),w}}),null),$(w=>{var T=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=i()?"64px":"100%",y=i()?"32px":"100%";return T!==w.e&&V(d,w.e=T),b!==w.t&&ne(x,"width",w.t=b),y!==w.a&&ne(x,"height",w.a=y),w},{e:void 0,t:void 0,a:void 0}),d})()};var nA=C(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
106
+ c0.154-1.076,0.308-2.152,0.463-3.228C101.865,79.615,101.556,66.971,100.631,65.088z">`),V0=({backgroundColor:e})=>cO();var uO=w("<span class=text-4xl>"),dO=w('<img alt="Avatar do bot"class="flex justify-center items-center relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"elementtiming="Bot avatar">'),mO=w('<figure class="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"><img alt="Avatar do bot"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),tc=e=>m(U,{get when(){return Ue(e.src)},keyed:!0,get fallback(){return m(V0,{get backgroundColor(){return L(()=>!!e.isChatContainerLight)()?Ge.gray.dark[2]:Ge.gray.dark[1]}})},get children(){return m(Fe,{get children(){return[m(ee,{get when(){return fO(e.src??"")},get children(){var t=uO();return v(t,()=>e.src),t}}),m(ee,{get when(){return Rr(e.src)},get children(){var t=dO();return $(()=>K(t,"src",e.src)),t}}),m(ee,{when:!0,get children(){var t=mO(),n=t.firstChild;return $(()=>K(n,"src",e.src)),t}})]}})}}),fO=e=>/^\p{Emoji}$/u.test(e);var pO=w("<div>"),j0=w('<div class="flex gap-1 overflow-auto max-w-[350px] flex-wrap justify-end @xs:items-center @xs:flex-nowrap">'),gO=w('<span class="px-[15px] py-[7px]">'),hO=w('<img alt=Attachment class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),bO=w('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full makebot-guest-bubble flex flex-col"data-testid=guest-bubble>'),yO=w("<img>"),vO=w('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap makebot-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),z0=e=>(()=>{var t=pO();return v(t,m(Fe,{get children(){return[m(ee,{get when(){return e.answer?.type==="text"},get children(){return m(xO,{get answer(){return e.answer}})}}),m(ee,{get when(){return e.answer?.type==="recording"},get children(){return m(wO,{get answer(){return e.answer}})}})]}}),null),v(t,m(U,{get when(){return e.theme.chat?.guestAvatar?.isEnabled??Wi},get children(){return m(tc,{get src(){return e.theme.chat?.guestAvatar?.url},get isChatContainerLight(){return qo({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})}}),null),$(()=>G(t,q("flex justify-end items-end animate-fade-in gap-2 guest-container",(e.theme.chat?.hostAvatar?.isEnabled??Ln)&&"ml-7 @xs:ml-[50px]"))),t})(),xO=e=>{let[t,n]=O();return(()=>{var r=bO(),o=r.firstChild;return v(r,m(U,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{var i=j0();return v(i,m(Re,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var l=yO();return l.$$click=()=>n(a.blobUrl??a.url),$(c=>{var u=a.blobUrl??a.url,d=`Attached image ${s()+1}`,f=q("makebot-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==c.e&&K(l,"src",c.e=u),d!==c.t&&K(l,"alt",c.t=d),f!==c.a&&G(l,c.a=f),c},{e:void 0,t:void 0,a:void 0}),l})()})),i})(),(()=>{var i=j0();return v(i,m(Re,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(Il,{get file(){return{name:a.url.split("/").at(-1)}}})})),i})()]}}),o),v(o,m(U,{get when(){return Ue(e.answer.label??e.answer.value)},get children(){var i=gO();return v(i,()=>e.answer.label??e.answer.value),i}})),v(r,m(ki,{get isOpen(){return t()!==void 0},onClose:()=>n(void 0),get children(){var i=hO();return $(()=>K(i,"src",t())),i}}),null),r})()},wO=e=>(()=>{var t=vO(),n=t.firstChild,r=n.firstChild;return $(()=>K(r,"src",e.answer.blobUrl??e.answer.url)),t})();Ne(["click"]);var kO=w('<div class="flex flex-shrink-0 items-center w-6 h-6 @xs:w-10 @xs:h-10">'),TO=w('<div class="flex justify-end animate-fade-in gap-1 @xs:gap-2 makebot-input-container">'),G0=e=>{let[t,n]=O(!1),r=async i=>{e.input.type==="cards"||e.input.type==="choice input"||e.input.type==="list input"?console.log("\u{1F50D} Cards/Buttons block - mantendo vis\xEDvel ap\xF3s submit"):t()&&(console.log("\u{1F50D} Mantendo card vis\xEDvel ap\xF3s submit"),n(!1)),e.onSubmit(i)},o=i=>{e.onSkip(i)};return m(Fe,{get children(){return[m(ee,{get when(){return L(()=>!!(e.input.answer&&e.input.answer.status!=="retry"&&e.input.type!=="cards"&&e.input.type!=="choice input"))()&&e.input.type!=="list input"},get children(){return m(z0,{get answer(){return e.input.answer},get theme(){return e.theme}})}}),m(ee,{get when(){return rt(e.input.answer)||e.input.answer?.status==="retry"||e.input.type==="cards"||e.input.type==="choice input"||e.input.type==="list input"},get children(){var i=TO(),a=e.ref;return typeof a=="function"?ke(a,i):e.ref=i,v(i,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Ln},get children(){return kO()}}),null),v(i,m(CO,{get context(){return e.context},get block(){return e.input},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return L(()=>e.input.answer?.status==="retry")()?SO(e.input.answer):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:r,onSkip:o}),null),$(()=>K(i,"data-blockid",e.input.id)),i}})]}})},SO=e=>{if(e)return e.type==="text"?e.value:e.url},CO=e=>{let t=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),n=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??$l.labels.success});return m(Fe,{get children(){return[m(ee,{get when(){return e.block.type==="text input"},get children(){return m(L0,{get block(){return e.block},get defaultValue(){return t()},get context(){return e.context},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="number input"},get children(){return m(Mx,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="email input"},get children(){return m(hx,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="url input"},get children(){return m(U0,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="phone number input"},get children(){return m(Wx,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="date input"},get children(){return m(gx,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="time input"},get children(){return m(F0,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return _O(e.block)},children:r=>{let o=r(),i=o.options;return m(Fe,{get children(){return[m(ee,{get when(){return!i?.isMultipleChoice},get children(){return m(ix,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},options:i,get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return i?.isMultipleChoice},get children(){return m(cx,{get defaultItems(){return o.items},options:i,get onSubmit(){return e.onSubmit}})}})]}})}}),m(ee,{get when(){return EO(e.block)},children:r=>m(Ax,{get block(){return r()},get onSubmit(){return e.onSubmit}})}),m(ee,{get when(){return e.block.type==="rating input"},get children(){return m(qx,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),m(ee,{get when(){return e.block.type==="file input"},get children(){return m(yx,{get context(){return e.context},get block(){return e.block},get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}}),m(ee,{get when(){return e.block.type==="payment input"},get children(){return m(Hx,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:n,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(ee,{get when(){return e.block.type==="cards"},get children(){return m(fx,{get block(){return e.block},get onSubmit(){return e.onSubmit},get onTransitionEnd(){return e.onTransitionEnd},get context(){return{sessionId:e.context.sessionId,apiHost:e.context.apiHost}},onAction:r=>{console.log("\u{1F50D} CardsCaroussel onAction:",r),console.log("\u{1F50D} A\xE7\xE3o executada:",r)}})}})]}})},_O=e=>e?.type==="choice input"?e:void 0,EO=e=>e?.type==="list input"?e:void 0;var PO=w('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),tt=()=>PO();var H0={isAutoplayEnabled:!0};var IO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),AO=400,RO=100,_d,W0=e=>{let t=!1,n,r,[o,i]=O(!!e.onTransitionEnd);return me(()=>{_d=setTimeout(()=>{t||(t=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(n),AO))},RO)}),ie(()=>{_d&&clearTimeout(_d)}),(()=>{var a=IO(),s=a.firstChild,l=s.firstChild,c=l.firstChild,u=c.nextSibling,d=n;typeof d=="function"?ke(d,a):n=a,v(c,(()=>{var p=L(()=>!!o());return()=>p()&&m(tt,{})})());var f=r;return typeof f=="function"?ke(f,u):r=u,$(p=>{var y=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=o()?"64px":"100%",k=o()?"32px":"100%",C=e.content?.url,b=e.onTransitionEnd?e.content?.isAutoplayEnabled??H0.isAutoplayEnabled:!1,T=q("z-10 text-fade-in",o()?"opacity-0 h-8 @xs:h-9":"opacity-100 m-2 h-[revert]");return y!==p.e&&G(a,p.e=y),h!==p.t&&ae(c,"width",p.t=h),k!==p.a&&ae(c,"height",p.a=k),C!==p.o&&K(u,"src",p.o=C),b!==p.i&&(u.autoplay=p.i=b),T!==p.n&&G(u,p.n=T),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),a})()};var OO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto max-h-[calc(var(--bot-container-height)-100px)]">'),Ed,NO=400,q0=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o;return me(()=>{Ra({args:{...e.content.initFunction.args,makebotElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&Ra({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),Ed=setTimeout(()=>{r(!1),setTimeout(()=>e.onTransitionEnd?.(t),NO)},2e3)}),ie(()=>{Ed&&clearTimeout(Ed)}),(()=>{var i=OO(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;typeof d=="function"?ke(d,i):t=i,v(l,(()=>{var p=L(()=>!!n());return()=>p()&&m(tt,{})})());var f=o;return typeof f=="function"?ke(f,u):o=u,$(p=>{var y=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=n()?"64px":"100%",k=n()?"32px":"100%",C=q("p-2 z-20 text-fade-in w-full",n()?"opacity-0 h-8 @xs:h-9":"opacity-100");return y!==p.e&&G(i,p.e=y),h!==p.t&&ae(l,"width",p.t=h),k!==p.a&&ae(l,"height",p.a=k),C!==p.o&&G(c,p.o=C),p},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Z0={height:400};var $O=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full">'),Pd,MO=400,Y0=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Ue(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",o))};return me(()=>{Pd=setTimeout(()=>{r(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t)},MO)},2e3)}),ie(()=>{Pd&&clearTimeout(Pd),window.removeEventListener("message",o)}),(()=>{var i=$O(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;return typeof d=="function"?ke(d,i):t=i,v(l,(()=>{var f=L(()=>!!n());return()=>f()&&m(tt,{})})()),$(f=>{var p=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),y=n()?"64px":"100%",h=n()?"32px":"100%",k=q("p-4 z-20 text-fade-in w-full",n()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--embed-bubble-height)]"),C=`${e.content?.height??Z0.height}px`,b=e.content?.url;return p!==f.e&&G(i,f.e=p),y!==f.t&&ae(l,"width",f.t=y),h!==f.a&&ae(l,"height",f.a=h),k!==f.o&&G(c,f.o=k),C!==f.i&&ae(c,"--embed-bubble-height",f.i=C),b!==f.n&&K(u,"src",f.n=b),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var Id={clickLink:{alt:"Minha imagem"}};var DO=w('<img elementtiming="Bubble image"fetchpriority=high>'),LO=w('<img class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),BO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),FO=w("<a target=_blank rel=noreferrer>"),UO=w("<figure>"),VO=400,jO=5e3,nc,K0=e=>{let t,n,[r,o]=O(!1),[i,a]=O(!!e.onTransitionEnd),s=()=>{i()&&(a(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},VO))};me(()=>{n&&(nc=setTimeout(s,jO),n.onload=()=>{clearTimeout(nc),s()})}),ie(()=>{nc&&clearTimeout(nc)});let l=()=>{o(!0)},c=()=>{o(!1)},u=(()=>{var d=DO(),f=n;return typeof f=="function"?ke(f,d):n=d,$(p=>{var y=e.content?.url,h=e.content?.clickLink?.alt??Id.clickLink.alt,k=q(i()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-96":void 0),C=e.content?.url?.startsWith("data:image/svg")?"100%":void 0,b=e.content?.url?.startsWith("data:image/svg")?"120px":"512px",T=i()?"32px":"auto";return y!==p.e&&K(d,"src",p.e=y),h!==p.t&&K(d,"alt",p.t=h),k!==p.a&&G(d,p.a=k),C!==p.o&&ae(d,"width",p.o=C),b!==p.i&&ae(d,"max-height",p.i=b),T!==p.n&&ae(d,"height",p.n=T),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),d})();return(()=>{var d=BO(),f=d.firstChild,p=f.firstChild,y=p.firstChild,h=t;return typeof h=="function"?ke(h,d):t=d,v(y,(()=>{var k=L(()=>!!i());return()=>k()?m(tt,{}):null})()),v(p,(()=>{var k=L(()=>!!e.content?.clickLink);return()=>k()?(()=>{var C=FO();return v(C,u),$(b=>{var T=e.content.clickLink.url,g=q("z-10",i()?"h-8":"p-4");return T!==b.e&&K(C,"href",b.e=T),g!==b.t&&G(C,b.t=g),b},{e:void 0,t:void 0}),C})():(()=>{var C=UO();return gt(C,"click",e.content?.url?.startsWith("data:image/svg")?void 0:l),v(C,u),$(()=>G(C,q("z-10 cursor-pointer",i()?"h-8 @xs:h-9":"p-4"))),C})()})(),null),v(d,m(ki,{get isOpen(){return r()},onClose:c,get children(){var k=LO();return $(C=>{var b=e.content?.url,T=e.content?.clickLink?.alt??Id.clickLink.alt;return b!==C.e&&K(k,"src",C.e=b),T!==C.t&&K(k,"alt",C.t=T),C},{e:void 0,t:void 0}),k}}),null),$(k=>{var C=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=i()?"64px":"100%",T=i()?"32px":"100%";return C!==k.e&&G(d,k.e=C),b!==k.t&&ae(y,"width",k.t=b),T!==k.a&&ae(y,"height",k.a=T),k},{e:void 0,t:void 0,a:void 0}),d})()};var zO=w(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
107
107
  .contact-error-card {
108
108
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
109
109
  border-radius: 8px;
@@ -273,8 +273,8 @@ registerProcessor("volume-processor", VolumeProcessor);
273
273
  .contact-action-error {
274
274
  background: rgba(239, 68, 68, 0.8) !important;
275
275
  }
276
- `),oA=C("<div class=contact-error-card><div class=contact-error-icon>\u26A0\uFE0F</div><div class=contact-error-content><h3 class=contact-error-title>Aten\xE7\xE3o!</h3><p class=contact-error-message>Dados do contato n\xE3o definidos. Campos obrigat\xF3rios: "),iA=C('<div class=contact-card><div class=contact-header><div class=contact-icon aria-label="\xCDcone de contato">\u{1F464}</div><h3 class=contact-title>Cart\xE3o de Contato</h3></div><div class=contact-info>'),aA=C("<div class=contact-variable-warning><span class=contact-warning-icon>\u26A0\uFE0F</span><span class=contact-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),sA=C("<div class=contact-name><span class=contact-label>Nome:</span><span class=contact-value>"),lA=C("<div class=contact-company><span class=contact-label>Empresa:</span><span class=contact-value>"),cA=C("<div class=contact-job-title><span class=contact-label>Cargo:</span><span class=contact-value>"),uA=C("<div class=contact-phone><span class=contact-label>Telefone:</span><span class=contact-value>"),dA=C("<div class=contact-mobile><span class=contact-label>Celular:</span><span class=contact-value>"),mA=C("<div class=contact-email><span class=contact-label>Email:</span><span class=contact-value>"),fA=C("<div class=contact-website><span class=contact-label>Website:</span><span class=contact-value>"),pA=C("<div class=contact-address><span class=contact-label>Endere\xE7o:</span><span class=contact-value>"),gA=C("<div class=contact-notes><span class=contact-label>Notas:</span><span class=contact-value>"),hA=C("<div class=contact-actions><button>"),fv=C("<button>"),pu,bA=400,$n=e=>e?/{{[^}]+}}/.test(e):!1,pv=e=>{if(!e)return"";if($n(e))return e;let t=e.replace(/\D/g,"");return t.length===11?`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`:t.length===10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:e},yA=e=>e?$n(e)?e:e.toLowerCase():"",xA=async e=>{try{await navigator.clipboard.writeText(e)}catch{let r=document.createElement("textarea");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r)}},vA=e=>{let t=["BEGIN:VCARD","VERSION:3.0"];if(e?.firstName||e?.lastName){let r=`${e.firstName||""} ${e.lastName||""}`.trim();r&&t.push(`FN:${r}`)}if(e?.firstName||e?.lastName){let r=`${e.lastName||""};${e.firstName||""};;;`;t.push(`N:${r}`)}if(e?.company&&t.push(`ORG:${e.company}`),e?.jobTitle&&t.push(`TITLE:${e.jobTitle}`),e?.phone&&t.push(`TEL;TYPE=WORK:${e.phone.replace(/\D/g,"")}`),e?.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile.replace(/\D/g,"")}`),e?.email&&t.push(`EMAIL:${e.email}`),e?.website&&t.push(`URL:${e.website}`),e?.address||e?.city||e?.state||e?.zipCode||e?.country){let r=[e?.address||"",e?.city||"",e?.state||"",e?.zipCode||"",e?.country||""].filter(Boolean).join(";");r&&t.push(`ADR;TYPE=WORK:;;${r}`)}return e?.notes&&t.push(`NOTE:${e.notes}`),t.push("END:VCARD"),t.join(`\r
277
- `)},wA=e=>{let t=[];return!e?.firstName&&!e?.lastName&&t.push("nome"),!e?.phone&&!e?.mobile&&!e?.email&&t.push("contato (telefone ou email)"),{isValid:t.length===0,missingFields:t}},gv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),[o,i]=O({type:null,success:!1}),a=async(u,d)=>{try{await xA(u),i({type:d,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:d,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};ae(()=>{pu=setTimeout(()=>{n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},bA)},2e3)}),re(()=>{pu&&clearTimeout(pu)});let s=wA(e.content),l=$n(e.content?.firstName||"")||$n(e.content?.lastName||"")||$n(e.content?.phone||"")||$n(e.content?.mobile||"")||$n(e.content?.email||""),c=vA(e.content);return(()=>{var u=nA(),d=u.firstChild,p=d.firstChild,f=p.firstChild,x=f.nextSibling,h=t;return typeof h=="function"?ge(h,u):t=u,v(f,(()=>{var w=L(()=>!!r());return()=>w()&&m(Ke,{})})()),v(x,(()=>{var w=L(()=>!s.isValid);return()=>w()?(()=>{var T=oA(),b=T.firstChild,y=b.nextSibling,g=y.firstChild,k=g.nextSibling,S=k.firstChild;return v(k,()=>s.missingFields.join(", "),null),T})():(()=>{var T=iA(),b=T.firstChild,y=b.nextSibling;return v(T,l&&aA(),y),v(y,(()=>{var g=L(()=>!!(e.content?.firstName||e.content?.lastName));return()=>g()&&(()=>{var k=sA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>`${e.content?.firstName||""} ${e.content?.lastName||""}`.trim()),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.company);return()=>g()&&(()=>{var k=lA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>e.content.company),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.jobTitle);return()=>g()&&(()=>{var k=cA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>e.content.jobTitle),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.phone);return()=>g()&&(()=>{var k=uA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>pv(e.content.phone)),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.mobile);return()=>g()&&(()=>{var k=dA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>pv(e.content.mobile)),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.email);return()=>g()&&(()=>{var k=mA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>yA(e.content.email)),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.website);return()=>g()&&(()=>{var k=fA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>e.content.website),k})()})(),null),v(y,(()=>{var g=L(()=>!!(e.content?.address||e.content?.city||e.content?.state));return()=>g()&&(()=>{var k=pA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>[e.content?.address,e.content?.city,e.content?.state,e.content?.zipCode,e.content?.country].filter(Boolean).join(", ")),k})()})(),null),v(y,(()=>{var g=L(()=>!!e.content?.notes);return()=>g()&&(()=>{var k=gA(),S=k.firstChild,P=S.nextSibling;return v(P,()=>e.content.notes),k})()})(),null),v(T,(()=>{var g=L(()=>e.content?.showCopyButtons!==!1);return()=>g()&&(()=>{var k=hA(),S=k.firstChild;return v(k,(()=>{var P=L(()=>!!e.content?.phone);return()=>P()&&(()=>{var A=fv();return A.$$click=()=>e.content?.phone!=null&&a(e.content.phone,"phone"),v(A,()=>o().type==="phone"&&o().success?"\u2713 Copiado!":"\u{1F4DE} Copiar Telefone"),$(()=>V(A,q("contact-action-btn",o().type==="phone"&&o().success&&"contact-action-success",o().type==="phone"&&!o().success&&"contact-action-error"))),A})()})(),S),v(k,(()=>{var P=L(()=>!!e.content?.email);return()=>P()&&(()=>{var A=fv();return A.$$click=()=>e.content?.email!=null&&a(e.content.email,"email"),v(A,()=>o().type==="email"&&o().success?"\u2713 Copiado!":"\u{1F4E7} Copiar Email"),$(()=>V(A,q("contact-action-btn",o().type==="email"&&o().success&&"contact-action-success",o().type==="email"&&!o().success&&"contact-action-error"))),A})()})(),S),S.$$click=()=>a(c,"vcard"),v(S,()=>o().type==="vcard"&&o().success?"\u2713 Copiado!":"\u{1F4C7} Salvar Contato"),$(()=>V(S,q("contact-action-btn",o().type==="vcard"&&o().success&&"contact-action-success",o().type==="vcard"&&!o().success&&"contact-action-error"))),k})()})(),null),T})()})()),$(w=>{var T=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=r()?"64px":"100%",y=r()?"32px":"100%",g=q("p-4 z-20 text-fade-in",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4");return T!==w.e&&V(u,w.e=T),b!==w.t&&ne(f,"width",w.t=b),y!==w.a&&ne(f,"height",w.a=y),g!==w.o&&V(x,w.o=g),w},{e:void 0,t:void 0,a:void 0,o:void 0}),u})()};Se(["click"]);var kA=C(`<div><style>
276
+ `),GO=w("<div class=contact-error-card><div class=contact-error-icon>\u26A0\uFE0F</div><div class=contact-error-content><h3 class=contact-error-title>Aten\xE7\xE3o!</h3><p class=contact-error-message>Dados do contato n\xE3o definidos. Campos obrigat\xF3rios: "),HO=w('<div class=contact-card><div class=contact-header><div class=contact-icon aria-label="\xCDcone de contato">\u{1F464}</div><h3 class=contact-title>Cart\xE3o de Contato</h3></div><div class=contact-info>'),WO=w("<div class=contact-variable-warning><span class=contact-warning-icon>\u26A0\uFE0F</span><span class=contact-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),qO=w("<div class=contact-name><span class=contact-label>Nome:</span><span class=contact-value>"),ZO=w("<div class=contact-company><span class=contact-label>Empresa:</span><span class=contact-value>"),YO=w("<div class=contact-job-title><span class=contact-label>Cargo:</span><span class=contact-value>"),KO=w("<div class=contact-phone><span class=contact-label>Telefone:</span><span class=contact-value>"),XO=w("<div class=contact-mobile><span class=contact-label>Celular:</span><span class=contact-value>"),JO=w("<div class=contact-email><span class=contact-label>Email:</span><span class=contact-value>"),QO=w("<div class=contact-website><span class=contact-label>Website:</span><span class=contact-value>"),e3=w("<div class=contact-address><span class=contact-label>Endere\xE7o:</span><span class=contact-value>"),t3=w("<div class=contact-notes><span class=contact-label>Notas:</span><span class=contact-value>"),n3=w("<div class=contact-actions><button>"),X0=w("<button>"),Ad,r3=400,ko=e=>e?/{{[^}]+}}/.test(e):!1,J0=e=>{if(!e)return"";if(ko(e))return e;let t=e.replace(/\D/g,"");return t.length===11?`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`:t.length===10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:e},o3=e=>e?ko(e)?e:e.toLowerCase():"",i3=async e=>{try{await navigator.clipboard.writeText(e)}catch{let n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}},a3=e=>{let t=["BEGIN:VCARD","VERSION:3.0"];if(e?.firstName||e?.lastName){let n=`${e.firstName||""} ${e.lastName||""}`.trim();n&&t.push(`FN:${n}`)}if(e?.firstName||e?.lastName){let n=`${e.lastName||""};${e.firstName||""};;;`;t.push(`N:${n}`)}if(e?.company&&t.push(`ORG:${e.company}`),e?.jobTitle&&t.push(`TITLE:${e.jobTitle}`),e?.phone&&t.push(`TEL;TYPE=WORK:${e.phone.replace(/\D/g,"")}`),e?.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile.replace(/\D/g,"")}`),e?.email&&t.push(`EMAIL:${e.email}`),e?.website&&t.push(`URL:${e.website}`),e?.address||e?.city||e?.state||e?.zipCode||e?.country){let n=[e?.address||"",e?.city||"",e?.state||"",e?.zipCode||"",e?.country||""].filter(Boolean).join(";");n&&t.push(`ADR;TYPE=WORK:;;${n}`)}return e?.notes&&t.push(`NOTE:${e.notes}`),t.push("END:VCARD"),t.join(`\r
277
+ `)},s3=e=>{let t=[];return!e?.firstName&&!e?.lastName&&t.push("nome"),!e?.phone&&!e?.mobile&&!e?.email&&t.push("contato (telefone ou email)"),{isValid:t.length===0,missingFields:t}},Q0=e=>{let t,[n,r]=O(!!e.onTransitionEnd),[o,i]=O({type:null,success:!1}),a=async(u,d)=>{try{await i3(u),i({type:d,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:d,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};me(()=>{Ad=setTimeout(()=>{r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},r3)},2e3)}),ie(()=>{Ad&&clearTimeout(Ad)});let s=s3(e.content),l=ko(e.content?.firstName||"")||ko(e.content?.lastName||"")||ko(e.content?.phone||"")||ko(e.content?.mobile||"")||ko(e.content?.email||""),c=a3(e.content);return(()=>{var u=zO(),d=u.firstChild,f=d.firstChild,p=f.firstChild,y=p.nextSibling,h=t;return typeof h=="function"?ke(h,u):t=u,v(p,(()=>{var k=L(()=>!!n());return()=>k()&&m(tt,{})})()),v(y,(()=>{var k=L(()=>!s.isValid);return()=>k()?(()=>{var C=GO(),b=C.firstChild,T=b.nextSibling,g=T.firstChild,x=g.nextSibling,S=x.firstChild;return v(x,()=>s.missingFields.join(", "),null),C})():(()=>{var C=HO(),b=C.firstChild,T=b.nextSibling;return v(C,l&&WO(),T),v(T,(()=>{var g=L(()=>!!(e.content?.firstName||e.content?.lastName));return()=>g()&&(()=>{var x=qO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>`${e.content?.firstName||""} ${e.content?.lastName||""}`.trim()),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.company);return()=>g()&&(()=>{var x=ZO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>e.content.company),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.jobTitle);return()=>g()&&(()=>{var x=YO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>e.content.jobTitle),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.phone);return()=>g()&&(()=>{var x=KO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>J0(e.content.phone)),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.mobile);return()=>g()&&(()=>{var x=XO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>J0(e.content.mobile)),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.email);return()=>g()&&(()=>{var x=JO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>o3(e.content.email)),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.website);return()=>g()&&(()=>{var x=QO(),S=x.firstChild,P=S.nextSibling;return v(P,()=>e.content.website),x})()})(),null),v(T,(()=>{var g=L(()=>!!(e.content?.address||e.content?.city||e.content?.state));return()=>g()&&(()=>{var x=e3(),S=x.firstChild,P=S.nextSibling;return v(P,()=>[e.content?.address,e.content?.city,e.content?.state,e.content?.zipCode,e.content?.country].filter(Boolean).join(", ")),x})()})(),null),v(T,(()=>{var g=L(()=>!!e.content?.notes);return()=>g()&&(()=>{var x=t3(),S=x.firstChild,P=S.nextSibling;return v(P,()=>e.content.notes),x})()})(),null),v(C,(()=>{var g=L(()=>e.content?.showCopyButtons!==!1);return()=>g()&&(()=>{var x=n3(),S=x.firstChild;return v(x,(()=>{var P=L(()=>!!e.content?.phone);return()=>P()&&(()=>{var R=X0();return R.$$click=()=>e.content?.phone!=null&&a(e.content.phone,"phone"),v(R,()=>o().type==="phone"&&o().success?"\u2713 Copiado!":"\u{1F4DE} Copiar Telefone"),$(()=>G(R,q("contact-action-btn",o().type==="phone"&&o().success&&"contact-action-success",o().type==="phone"&&!o().success&&"contact-action-error"))),R})()})(),S),v(x,(()=>{var P=L(()=>!!e.content?.email);return()=>P()&&(()=>{var R=X0();return R.$$click=()=>e.content?.email!=null&&a(e.content.email,"email"),v(R,()=>o().type==="email"&&o().success?"\u2713 Copiado!":"\u{1F4E7} Copiar Email"),$(()=>G(R,q("contact-action-btn",o().type==="email"&&o().success&&"contact-action-success",o().type==="email"&&!o().success&&"contact-action-error"))),R})()})(),S),S.$$click=()=>a(c,"vcard"),v(S,()=>o().type==="vcard"&&o().success?"\u2713 Copiado!":"\u{1F4C7} Salvar Contato"),$(()=>G(S,q("contact-action-btn",o().type==="vcard"&&o().success&&"contact-action-success",o().type==="vcard"&&!o().success&&"contact-action-error"))),x})()})(),null),C})()})()),$(k=>{var C=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=n()?"64px":"100%",T=n()?"32px":"100%",g=q("p-4 z-20 text-fade-in",n()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4");return C!==k.e&&G(u,k.e=C),b!==k.t&&ae(p,"width",k.t=b),T!==k.a&&ae(p,"height",k.a=T),g!==k.o&&G(y,k.o=g),k},{e:void 0,t:void 0,a:void 0,o:void 0}),u})()};Ne(["click"]);var l3=w(`<div><style>
278
278
  .location-variable-warning {
279
279
  display: flex;
280
280
  align-items: center;
@@ -327,7 +327,7 @@ registerProcessor("volume-processor", VolumeProcessor);
327
327
  opacity: 0.9;
328
328
  margin: 0;
329
329
  }
330
- </style><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div>`),CA=C('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Carregando localiza\xE7\xE3o...'),TA=C("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Erro ao carregar localiza\xE7\xE3o: "),SA=C("<div class=location-variable-warning><span class=location-warning-icon>\u26A0\uFE0F</span><span class=location-warning-text>Localiza\xE7\xE3o ser\xE1 processada em tempo de execu\xE7\xE3o com vari\xE1veis"),EA=C("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Nenhuma localiza\xE7\xE3o foi definida."),PA=C("<div class=location-map-container>"),hv=C("<iframe width=100% allowfullscreen loading=lazy referrerpolicy=no-referrer-when-downgrade style=border:0;border-radius:8px>",!0,!1,!1),_A=C('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Processando localiza\xE7\xE3o...'),IA=C("<div class=p-2>"),AA=C("<strong>"),RA=C("<br>"),OA=C('<span class="text-gray-500 font-light text-sm">'),gu,$A=400,NA=e=>/\{\{.*?\}\}/.test(e),MA=e=>{let t=[];return e?.query||t.push("endere\xE7o"),{isValid:t.length===0,missingFields:t}},bv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),[o,i]=O(""),[a,s]=O(!1),[l,c]=O(""),[u,d]=O(""),[p,f]=O(""),x=MA(e.content),h=()=>{let g=e.content?.query||"";return NA(g)},w=(g,k)=>g.replace(/\{\{([^}]+)\}\}/g,(S,P)=>k[P]||S),T=(g,k,S,P)=>{let A=S||e.content?.zoom||"15",N=P||e.content?.mapType||"roadmap";return`https://www.google.com/maps/embed/v1/place?key=${process.env.NEXT_PUBLIC_GOOGLE_PLACES_API_KEY}&q=${g},${k}&zoom=${A}&maptype=${N}`},b=async g=>{try{s(!0),c("");let k=await fetch(`/api/getCoordinates?query=${encodeURIComponent(g)}`);if(k.status===404){console.log(`\u{1F4CD} Endere\xE7o n\xE3o encontrado: "${g}"`),c("Endere\xE7o n\xE3o encontrado. Verifique se o endere\xE7o est\xE1 correto.");return}if(!k.ok){console.error(`\u274C Erro na API (${k.status}): ${k.statusText}`),c(`Erro na API: ${k.status}`);return}let S=await k.json();if(S.error){console.log(`\u26A0\uFE0F Erro retornado pela API: ${S.error}`),c(S.error);return}if(!S.latitude||!S.longitude){console.log(`\u{1F4CD} Local n\xE3o encontrado: "${g}"`),c("Local n\xE3o encontrado");return}let P=T(S.latitude,S.longitude,e.content?.zoom,e.content?.mapType);i(P),d(S.name||""),f(S.formatted_address||""),console.log(`\u2705 Localiza\xE7\xE3o encontrada: "${S.name||g}"`)}catch(k){console.error("\u274C Erro inesperado ao buscar localiza\xE7\xE3o:",k),c(k instanceof Error?k.message:"Erro desconhecido")}finally{s(!1)}},y=()=>{e.content?.query&&e.content.query.trim()!==""&&b(e.content.query)};return ae(()=>{gu=setTimeout(()=>{n(!1),y(),setTimeout(()=>{e.onTransitionEnd?.(t)},$A)},2e3)}),re(()=>{gu&&clearTimeout(gu)}),ve(()=>{e.content?.query&&e.content.query.trim()!==""&&!e.content?.url&&y()}),(()=>{var g=kA(),k=g.firstChild,S=k.nextSibling,P=S.firstChild,A=P.firstChild,N=A.nextSibling,D=t;return typeof D=="function"?ge(D,g):t=g,v(A,(()=>{var F=L(()=>!!r());return()=>F()&&m(Ke,{})})()),v(N,(()=>{var F=L(()=>!!a());return()=>F()&&CA()})(),null),v(N,(()=>{var F=L(()=>!!l());return()=>F()&&(()=>{var R=TA(),M=R.firstChild,z=M.nextSibling,K=z.firstChild,I=K.nextSibling,B=I.firstChild;return v(I,l,null),R})()})(),null),v(N,(()=>{var F=L(()=>!!h());return()=>F()&&SA()})(),null),v(N,(()=>{var F=L(()=>!x.isValid&&!a()&&!l());return()=>F()&&EA()})(),null),v(N,()=>!a()&&!l()&&(e.content?.url||h()||e.content?.query&&e.content.query.trim()!=="")?(()=>{var R=PA();return v(R,(()=>{var M=L(()=>!!(e.content?.url&&!o()));return()=>M()&&(()=>{var z=hv();return $(K=>{var I=e.content.url,B=e.content?.height||300;return I!==K.e&&G(z,"src",K.e=I),B!==K.t&&G(z,"height",K.t=B),K},{e:void 0,t:void 0}),z})()})(),null),v(R,(()=>{var M=L(()=>!!o());return()=>M()&&(()=>{var z=hv();return $(K=>{var I=o(),B=e.content?.height||300;return I!==K.e&&G(z,"src",K.e=I),B!==K.t&&G(z,"height",K.t=B),K},{e:void 0,t:void 0}),z})()})(),null),v(R,(()=>{var M=L(()=>!!(!e.content?.url&&!o()&&e.content?.query&&!h()));return()=>M()&&_A()})(),null),v(R,(()=>{var M=L(()=>!!(u()||p()));return()=>M()&&(()=>{var z=IA();return v(z,(()=>{var K=L(()=>!!u());return()=>K()&&(()=>{var I=AA();return v(I,u),I})()})(),null),v(z,(()=>{var K=L(()=>!!(u()&&p()));return()=>K()&&RA()})(),null),v(z,(()=>{var K=L(()=>!!p());return()=>K()&&(()=>{var I=OA();return v(I,p),I})()})(),null),z})()})(),null),R})():null,null),$(F=>{var R=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),M=r()?"64px":"100%",z=r()?"32px":"100%",K=q("p-4 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--location-bubble-height)]");return R!==F.e&&V(g,F.e=R),M!==F.t&&ne(A,"width",F.t=M),z!==F.a&&ne(A,"height",F.a=z),K!==F.o&&V(N,F.o=K),F},{e:void 0,t:void 0,a:void 0,o:void 0}),g})()};var DA=C('<img alt="C\xF3digo QR do PIX"style="border-radius:8px;border:1px solid #e5e7eb">'),LA=C(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
330
+ </style><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div>`),c3=w('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Carregando localiza\xE7\xE3o...'),u3=w("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Erro ao carregar localiza\xE7\xE3o: "),d3=w("<div class=location-variable-warning><span class=location-warning-icon>\u26A0\uFE0F</span><span class=location-warning-text>Localiza\xE7\xE3o ser\xE1 processada em tempo de execu\xE7\xE3o com vari\xE1veis"),m3=w("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Nenhuma localiza\xE7\xE3o foi definida."),f3=w("<div class=location-map-container>"),ew=w("<iframe width=100% allowfullscreen loading=lazy referrerpolicy=no-referrer-when-downgrade style=border:0;border-radius:8px>",!0,!1,!1),p3=w('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Processando localiza\xE7\xE3o...'),g3=w("<div class=p-2>"),h3=w("<strong>"),b3=w("<br>"),y3=w('<span class="text-gray-500 font-light text-sm">'),Rd,v3=400,x3=e=>/\{\{.*?\}\}/.test(e),w3=e=>{let t=[];return e?.query||t.push("endere\xE7o"),{isValid:t.length===0,missingFields:t}},tw=e=>{let t,[n,r]=O(!!e.onTransitionEnd),[o,i]=O(""),[a,s]=O(!1),[l,c]=O(""),[u,d]=O(""),[f,p]=O(""),y=w3(e.content),h=()=>{let g=e.content?.query||"";return x3(g)},k=(g,x)=>g.replace(/\{\{([^}]+)\}\}/g,(S,P)=>x[P]||S),C=(g,x,S,P)=>{let R=S||e.content?.zoom||"15",N=P||e.content?.mapType||"roadmap";return`https://www.google.com/maps/embed/v1/place?key=${process.env.NEXT_PUBLIC_GOOGLE_PLACES_API_KEY}&q=${g},${x}&zoom=${R}&maptype=${N}`},b=async g=>{try{s(!0),c("");let x=await fetch(`/api/getCoordinates?query=${encodeURIComponent(g)}`);if(x.status===404){console.log(`\u{1F4CD} Endere\xE7o n\xE3o encontrado: "${g}"`),c("Endere\xE7o n\xE3o encontrado. Verifique se o endere\xE7o est\xE1 correto.");return}if(!x.ok){console.error(`\u274C Erro na API (${x.status}): ${x.statusText}`),c(`Erro na API: ${x.status}`);return}let S=await x.json();if(S.error){console.log(`\u26A0\uFE0F Erro retornado pela API: ${S.error}`),c(S.error);return}if(!S.latitude||!S.longitude){console.log(`\u{1F4CD} Local n\xE3o encontrado: "${g}"`),c("Local n\xE3o encontrado");return}let P=C(S.latitude,S.longitude,e.content?.zoom,e.content?.mapType);i(P),d(S.name||""),p(S.formatted_address||""),console.log(`\u2705 Localiza\xE7\xE3o encontrada: "${S.name||g}"`)}catch(x){console.error("\u274C Erro inesperado ao buscar localiza\xE7\xE3o:",x),c(x instanceof Error?x.message:"Erro desconhecido")}finally{s(!1)}},T=()=>{e.content?.query&&e.content.query.trim()!==""&&b(e.content.query)};return me(()=>{Rd=setTimeout(()=>{r(!1),T(),setTimeout(()=>{e.onTransitionEnd?.(t)},v3)},2e3)}),ie(()=>{Rd&&clearTimeout(Rd)}),$e(()=>{e.content?.query&&e.content.query.trim()!==""&&!e.content?.url&&T()}),(()=>{var g=l3(),x=g.firstChild,S=x.nextSibling,P=S.firstChild,R=P.firstChild,N=R.nextSibling,D=t;return typeof D=="function"?ke(D,g):t=g,v(R,(()=>{var F=L(()=>!!n());return()=>F()&&m(tt,{})})()),v(N,(()=>{var F=L(()=>!!a());return()=>F()&&c3()})(),null),v(N,(()=>{var F=L(()=>!!l());return()=>F()&&(()=>{var A=u3(),M=A.firstChild,V=M.nextSibling,Y=V.firstChild,I=Y.nextSibling,B=I.firstChild;return v(I,l,null),A})()})(),null),v(N,(()=>{var F=L(()=>!!h());return()=>F()&&d3()})(),null),v(N,(()=>{var F=L(()=>!y.isValid&&!a()&&!l());return()=>F()&&m3()})(),null),v(N,()=>!a()&&!l()&&(e.content?.url||h()||e.content?.query&&e.content.query.trim()!=="")?(()=>{var A=f3();return v(A,(()=>{var M=L(()=>!!(e.content?.url&&!o()));return()=>M()&&(()=>{var V=ew();return $(Y=>{var I=e.content.url,B=e.content?.height||300;return I!==Y.e&&K(V,"src",Y.e=I),B!==Y.t&&K(V,"height",Y.t=B),Y},{e:void 0,t:void 0}),V})()})(),null),v(A,(()=>{var M=L(()=>!!o());return()=>M()&&(()=>{var V=ew();return $(Y=>{var I=o(),B=e.content?.height||300;return I!==Y.e&&K(V,"src",Y.e=I),B!==Y.t&&K(V,"height",Y.t=B),Y},{e:void 0,t:void 0}),V})()})(),null),v(A,(()=>{var M=L(()=>!!(!e.content?.url&&!o()&&e.content?.query&&!h()));return()=>M()&&p3()})(),null),v(A,(()=>{var M=L(()=>!!(u()||f()));return()=>M()&&(()=>{var V=g3();return v(V,(()=>{var Y=L(()=>!!u());return()=>Y()&&(()=>{var I=h3();return v(I,u),I})()})(),null),v(V,(()=>{var Y=L(()=>!!(u()&&f()));return()=>Y()&&b3()})(),null),v(V,(()=>{var Y=L(()=>!!f());return()=>Y()&&(()=>{var I=y3();return v(I,f),I})()})(),null),V})()})(),null),A})():null,null),$(F=>{var A=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),M=n()?"64px":"100%",V=n()?"32px":"100%",Y=q("p-4 z-20 text-fade-in w-full",n()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--location-bubble-height)]");return A!==F.e&&G(g,F.e=A),M!==F.t&&ae(R,"width",F.t=M),V!==F.a&&ae(R,"height",F.a=V),Y!==F.o&&G(N,F.o=Y),F},{e:void 0,t:void 0,a:void 0,o:void 0}),g})()};var k3=w('<img alt="C\xF3digo QR do PIX"style="border-radius:8px;border:1px solid #e5e7eb">'),T3=w(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
331
331
  .pix-payment-card {
332
332
  background: linear-gradient(135deg, #30a46c 0%, #2d8f5f 100%);
333
333
  border-radius: 8px;
@@ -552,7 +552,7 @@ registerProcessor("volume-processor", VolumeProcessor);
552
552
  from { transform: rotate(0deg); }
553
553
  to { transform: rotate(360deg); }
554
554
  }
555
- `),BA=C("<div class=pix-error-card><div class=pix-error-icon>\u26A0\uFE0F</div><div class=pix-error-content><h3 class=pix-error-title>Aten\xE7\xE3o!</h3><p class=pix-error-message>Dados do PIX n\xE3o definidos."),FA=C('<div class=pix-payment-card><div class=pix-header><div class=pix-icon aria-label="\xCDcone de pagamento">\u{1F4B3}</div><h3 class=pix-title>Pagamento PIX</h3></div><div class=pix-details></div><div class=pix-actions><button aria-label="Copiar c\xF3digo PIX">Copiar C\xF3digo PIX'),UA=C("<div class=pix-variable-warning><span class=pix-warning-icon>\u26A0\uFE0F</span><span class=pix-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),VA=C("<div class=pix-qr-container>"),zA=C("<div class=pix-amount><span class=pix-label>Valor:</span><span class=pix-value>R$ "),GA=C("<div class=pix-beneficiary><span class=pix-label>Benefici\xE1rio:</span><span class=pix-value>"),HA=C("<div class=pix-city><span class=pix-label>Cidade:</span><span class=pix-value>"),jA=C("<div class=pix-note><small>Nota: Cidade truncada no c\xF3digo PIX para atender ao padr\xE3o banc\xE1rio"),WA=C("<div class=pix-key-info><div class=pix-key-type><span class=pix-label>Tipo:</span><span class=pix-value></span></div><div class=pix-key-value><span class=pix-label>Chave:</span><span class=pix-value>"),qA=C('<button aria-label="Copiar chave PIX">Copiar Chave PIX'),YA=C("<div class=pix-loading-card><div class=pix-loading-icon>\u23F3</div><div class=pix-loading-content><h3 class=pix-loading-title>Gerando PIX...</h3><p class=pix-loading-message>Aguarde enquanto processamos os dados do pagamento"),KA=e=>{let t=`https://api.qrserver.com/v1/create-qr-code/?size=${e.size||200}x${e.size||200}&data=${encodeURIComponent(e.value)}&format=png&margin=10`;return(()=>{var r=DA();return r.addEventListener("error",n=>{let o=n.target;o.style.display="none";let i=document.createElement("div");i.innerHTML="QR Code n\xE3o dispon\xEDvel",i.style.cssText=`
555
+ `),S3=w("<div class=pix-error-card><div class=pix-error-icon>\u26A0\uFE0F</div><div class=pix-error-content><h3 class=pix-error-title>Aten\xE7\xE3o!</h3><p class=pix-error-message>Dados do PIX n\xE3o definidos."),C3=w('<div class=pix-payment-card><div class=pix-header><div class=pix-icon aria-label="\xCDcone de pagamento">\u{1F4B3}</div><h3 class=pix-title>Pagamento PIX</h3></div><div class=pix-details></div><div class=pix-actions><button aria-label="Copiar c\xF3digo PIX">Copiar C\xF3digo PIX'),_3=w("<div class=pix-variable-warning><span class=pix-warning-icon>\u26A0\uFE0F</span><span class=pix-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),E3=w("<div class=pix-qr-container>"),P3=w("<div class=pix-amount><span class=pix-label>Valor:</span><span class=pix-value>R$ "),I3=w("<div class=pix-beneficiary><span class=pix-label>Benefici\xE1rio:</span><span class=pix-value>"),A3=w("<div class=pix-city><span class=pix-label>Cidade:</span><span class=pix-value>"),R3=w("<div class=pix-note><small>Nota: Cidade truncada no c\xF3digo PIX para atender ao padr\xE3o banc\xE1rio"),O3=w("<div class=pix-key-info><div class=pix-key-type><span class=pix-label>Tipo:</span><span class=pix-value></span></div><div class=pix-key-value><span class=pix-label>Chave:</span><span class=pix-value>"),N3=w('<button aria-label="Copiar chave PIX">Copiar Chave PIX'),$3=w("<div class=pix-loading-card><div class=pix-loading-icon>\u23F3</div><div class=pix-loading-content><h3 class=pix-loading-title>Gerando PIX...</h3><p class=pix-loading-message>Aguarde enquanto processamos os dados do pagamento"),M3=e=>{let t=`https://api.qrserver.com/v1/create-qr-code/?size=${e.size||200}x${e.size||200}&data=${encodeURIComponent(e.value)}&format=png&margin=10`;return(()=>{var n=k3();return n.addEventListener("error",r=>{let o=r.target;o.style.display="none";let i=document.createElement("div");i.innerHTML="QR Code n\xE3o dispon\xEDvel",i.style.cssText=`
556
556
  width: ${e.size||200}px;
557
557
  height: ${e.size||200}px;
558
558
  background: #f3f4f6;
@@ -563,53 +563,53 @@ registerProcessor("volume-processor", VolumeProcessor);
563
563
  justify-content: center;
564
564
  color: #6b7280;
565
565
  font-size: 14px;
566
- `,o.parentNode?.appendChild(i)}),G(r,"src",t),$(n=>{var o=e.size||200,i=e.size||200;return o!==n.e&&G(r,"width",n.e=o),i!==n.t&&G(r,"height",n.t=i),n},{e:void 0,t:void 0}),r})()},hu,XA=400,ZA=e=>e?Number.parseFloat(e.replace(/[^\d,]/g,"").replace(",",".")).toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}):"0,00",JA=e=>({cpf:"CPF",cnpj:"CNPJ",telefone:"Telefone",email:"E-mail",aleatoria:"Chave Aleat\xF3ria"})[e]||e,QA=(e,t)=>{if(!e)return"";if(Ks(e))return e;switch(t){case"cpf":return e.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4");case"cnpj":return e.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5");case"telefone":return e.replace(/(\+55)(\d{2})(\d{5})(\d{4})/,"$1 ($2) $3-$4");default:return e}},eR=async e=>{try{await navigator.clipboard.writeText(e)}catch(t){console.error("Erro ao copiar:",t)}},Ks=e=>e?/{{[^}]+}}/.test(e):!1,tR=e=>{let t=[];return e?.pixCode||t.push("c\xF3digo PIX"),e?.valor||t.push("valor"),e?.nome||t.push("nome do benefici\xE1rio"),e?.chave||t.push("chave PIX"),e?.tipoChave||t.push("tipo de chave"),{isValid:t.length===0,missingFields:t}},yv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),[o,i]=O({type:null,success:!1}),a=async(c,u)=>{try{await eR(c),i({type:u,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:u,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};ae(()=>{hu=setTimeout(()=>{n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},XA)},2e3)}),re(()=>{hu&&clearTimeout(hu)});let s=tR(e.content),l=Ks(e.content?.chave||"")||Ks(e.content?.nome||"")||Ks(e.content?.valor||"");return(()=>{var c=LA(),u=c.firstChild,d=u.firstChild,p=d.firstChild,f=p.nextSibling,x=t;return typeof x=="function"?ge(x,c):t=c,v(p,(()=>{var h=L(()=>!!r());return()=>h()&&m(Ke,{})})()),v(f,(()=>{var h=L(()=>!s.isValid);return()=>h()?BA():L(()=>!!e.content?.pixCode)()?(()=>{var w=FA(),T=w.firstChild,b=T.nextSibling,y=b.nextSibling,g=y.firstChild,k=g.firstChild;return v(w,l&&UA(),b),v(w,(()=>{var S=L(()=>e.content.showQrCode!==!1);return()=>S()&&(()=>{var P=VA();return v(P,m(KA,{get value(){return e.content.pixCode},size:200,level:"M",includeMargin:!0,"aria-label":"C\xF3digo QR do PIX"})),P})()})(),b),v(b,(()=>{var S=L(()=>!!e.content.valor);return()=>S()&&(()=>{var P=zA(),A=P.firstChild,N=A.nextSibling,D=N.firstChild;return v(N,()=>ZA(e.content.valor),null),P})()})(),null),v(b,(()=>{var S=L(()=>!!e.content.nome);return()=>S()&&(()=>{var P=GA(),A=P.firstChild,N=A.nextSibling;return v(N,()=>e.content.nome),P})()})(),null),v(b,(()=>{var S=L(()=>!!e.content.cidade);return()=>S()&&(()=>{var P=HA(),A=P.firstChild,N=A.nextSibling;return v(N,()=>e.content.cidade),v(P,(()=>{var D=L(()=>e.content.cidade.length>15);return()=>D()&&jA()})(),null),P})()})(),null),v(b,(()=>{var S=L(()=>!!(e.content.chave&&e.content.tipoChave));return()=>S()&&(()=>{var P=WA(),A=P.firstChild,N=A.firstChild,D=N.nextSibling,F=A.nextSibling,R=F.firstChild,M=R.nextSibling;return v(D,()=>JA(e.content.tipoChave)),v(M,()=>QA(e.content.chave,e.content.tipoChave)),P})()})(),null),g.$$click=()=>e.content?.pixCode!=null&&a(e.content.pixCode,"code"),v(g,()=>o().type==="code"&&o().success?"\u2705":"\u{1F4CB}",k),v(y,(()=>{var S=L(()=>!!(e.content.chave&&e.content.showCopyKeyButton!==!1));return()=>S()&&(()=>{var P=qA(),A=P.firstChild;return P.$$click=()=>e.content?.chave!=null&&a(e.content.chave,"key"),v(P,()=>o().type==="key"&&o().success?"\u2705":"\u{1F511}",A),$(()=>V(P,q("pix-action-btn",o().type==="key"&&o().success&&"pix-action-success",o().type==="key"&&!o().success&&"pix-action-error"))),P})()})(),null),$(()=>V(g,q("pix-action-btn",o().type==="code"&&o().success&&"pix-action-success",o().type==="code"&&!o().success&&"pix-action-error"))),w})():YA()})()),$(h=>{var w=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),T=r()?"64px":"100%",b=r()?"32px":"100%",y=q("p-4 z-20 text-fade-in",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--pix-bubble-height)]");return w!==h.e&&V(c,h.e=w),T!==h.t&&ne(p,"width",h.t=T),b!==h.a&&ne(p,"height",h.a=b),y!==h.o&&V(f,h.o=y),h},{e:void 0,t:void 0,a:void 0,o:void 0}),c})()};Se(["click"]);var xv=({bubbleContent:e,typingSettings:t})=>{let r=e.match(/(\w+)/g)?.length??0;r===0&&(r=e.length);let{enabled:n,speed:o,maxDelay:i}={enabled:t?.enabled??at.typingEmulation.enabled,speed:t?.speed??at.typingEmulation.speed,maxDelay:t?.maxDelay??at.typingEmulation.maxDelay},s=n?r/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var bu=e=>e.map(t=>t.text??bu(t.children)).join("");var rR=C("<br>"),nR=C("<span>"),oR=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},vv=e=>(()=>{var t=nR();return v(t,()=>e.text,null),v(t,m(U,{get when(){return L(()=>!!e.isUniqueChild)()&&Ue(e.text)},get children(){return rR()}}),null),$(()=>V(t,oR(e.bold,e.italic,e.underline))),t})();var iR=C('<a target=_blank rel="noopener noreferrer">'),aR=C("<ol>"),sR=C("<ul>"),lR=C("<li>"),cR=C("<span>"),uR=C("<div>"),Nn=e=>m(Ie,{get children(){return[m(Z,{get when(){return de(e.element.text)},get children(){return m(vv,ce(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),m(Z,{when:!0,get children(){return m(Ie,{get children(){return[m(Z,{get when(){return e.element.type==="a"},get children(){var t=iR();return v(t,m(we,{get each(){return e.element.children},children:r=>m(Nn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),$(()=>G(t,"href",e.element.url)),t}}),m(Z,{get when(){return e.element.type==="ol"},get children(){var t=aR();return v(t,m(we,{get each(){return e.element.children},children:r=>m(Nn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{get when(){return e.element.type==="ul"},get children(){var t=sR();return v(t,m(we,{get each(){return e.element.children},children:r=>m(Nn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{get when(){return e.element.type==="li"},get children(){var t=lR();return v(t,m(we,{get each(){return e.element.children},children:r=>m(Nn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(Z,{when:!0,get children(){return m(dR,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return m(we,{get each(){return e.element.children},children:t=>m(Nn,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),dR=e=>m(Ie,{get children(){return[m(Z,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=cR();return v(t,()=>e.children),$(()=>G(t,"data-element-type",e.element.type)),t}}),m(Z,{when:!0,get children(){var t=uR();return v(t,()=>e.children),$(()=>G(t,"data-element-type",e.element.type)),t}})]}});var mR=C('<div><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),fR=400,yu,wv=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=()=>{r()&&(n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},fR))};return ae(()=>{if(!r)return;let i=e.content?.richText?bu(e.content.richText):"",a=e.typingEmulation?.enabled===!1||e.isTypingSkipped?0:xv({bubbleContent:i,typingSettings:e.typingEmulation});yu=setTimeout(o,a)}),re(()=>{yu&&clearTimeout(yu)}),(()=>{var i=mR(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=t;return typeof u=="function"?ge(u,i):t=i,v(l,(()=>{var d=L(()=>!!r());return()=>d()&&m(Ke,{})})()),v(c,m(we,{get each(){return e.content?.richText},children:d=>m(Nn,{element:d})})),$(d=>{var p=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),f=r()?"64px":"100%",x=r()?"32px":"100%",h=q("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0 h-4 @xs:h-5":"opacity-100 h-full");return p!==d.e&&V(i,d.e=p),f!==d.t&&ne(l,"width",d.t=f),x!==d.a&&ne(l,"height",d.a=x),h!==d.o&&V(c,d.o=h),d},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var xu=["youtube","vimeo","tiktok","gumlet"],Rr={height:400,aspectRatio:"16/9",maxWidth:"100%",areControlsDisplayed:!0,isAutoplayEnabled:!0};var pR="https://www.youtube.com/embed";var gR="https://player.vimeo.com/video";var hR="https://www.tiktok.com/embed/v2";var bR="https://play.gumlet.io/embed";var kv={vimeo:gR,youtube:pR,tiktok:hR,gumlet:bR};var Cv=e=>e?.isAutoplayEnabled??Rr.isAutoplayEnabled?e?.type==="youtube"||e?.type==="vimeo"?"autoplay=1":e?.type==="gumlet"?"autoplay=true":"":"";var xR=C("<video>"),vR=C('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),wR=C('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),kR=400,vu,Tv=e=>{let t,[r,n]=O(!!e.onTransitionEnd);return ae(()=>{let o=e.content?.type&&xu.includes(e.content?.type)?2e3:100;vu=setTimeout(()=>{r()&&(n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},kR))},o)}),re(()=>{vu&&clearTimeout(vu)}),(()=>{var o=wR(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=t;return typeof l=="function"?ge(l,o):t=o,v(s,(()=>{var c=L(()=>!!r());return()=>c()&&m(Ke,{})})()),v(a,m(Ie,{get children(){return[m(Z,{get when(){return L(()=>!!e.content?.type)()&&e.content.type==="url"},get children(){var c=xR();return $(u=>{var d=e.onTransitionEnd?e.content?.isAutoplayEnabled??Rr.isAutoplayEnabled:!1,p=e.content?.url,f=e.content?.areControlsDisplayed??Rr.areControlsDisplayed,x=q("p-4 focus:outline-none w-full z-10 text-fade-in rounded-md",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 h-auto"),h=e.content?.aspectRatio,w=e.content?.maxWidth??Rr.maxWidth;return d!==u.e&&(c.autoplay=u.e=d),p!==u.t&&G(c,"src",u.t=p),f!==u.a&&(c.controls=u.a=f),x!==u.o&&V(c,u.o=x),h!==u.i&&ne(c,"aspect-ratio",u.i=h),w!==u.n&&ne(c,"max-width",u.n=w),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),c}}),m(Z,{get when(){return L(()=>!!e.content?.type)()&&xu.includes(e.content.type)},get children(){var c=vR(),u=c.firstChild;return $(d=>{var p=q("p-4 z-10 text-fade-in w-full aspect-[var(--aspect-ratio)]",r()?"opacity-0 h-8 @xs:h-9":"opacity-100",!e.content?.aspectRatio&&"h-[var(--height)]"),f=e.content?.aspectRatio,x=`${e.content?.height??Rr.height}px`,h=e.content?.maxWidth??Rr.maxWidth,w=`${kv[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??`?${Cv(e.content)}`}`;return p!==d.e&&V(c,d.e=p),f!==d.t&&ne(c,"--aspect-ratio",d.t=f),x!==d.a&&ne(c,"--height",d.a=x),h!==d.o&&ne(c,"max-width",d.o=h),w!==d.i&&G(u,"src",d.i=w),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c}})]}}),null),$(c=>{var u=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),d=r()?"64px":"100%",p=r()?"32px":"100%",f=e.content?.maxWidth??Rr.maxWidth;return u!==c.e&&V(o,c.e=u),d!==c.t&&ne(s,"width",c.t=d),p!==c.a&&ne(s,"height",c.a=p),f!==c.o&&ne(s,"max-width",c.o=f),c},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var Sv=e=>(console.log("\u{1F50D} HostBubble - message type:",e.message.type),console.log("\u{1F50D} HostBubble - message content:",e.message.content),m(Ie,{get children(){return[m(Z,{get when(){return e.message.type==="text"},get children(){return m(wv,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="image"},get children(){return m(mv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="video"},get children(){return m(Tv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(Z,{get when(){return e.message.type==="embed"},get children(){return m(dv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="custom-embed"},get children(){return m(cv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="location"},get children(){return m(bv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="pix"},get children(){return m(yv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="contact"},get children(){return m(gv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(Z,{get when(){return e.message.type==="audio"},get children(){return m(lv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}}));var{entries:Mv,setPrototypeOf:Ev,isFrozen:TR,getPrototypeOf:SR,getOwnPropertyDescriptor:ER}=Object,{freeze:St,seal:Ht,create:Dv}=Object,{apply:Eu,construct:Pu}=typeof Reflect<"u"&&Reflect;St||(St=function(t){return t});Ht||(Ht=function(t){return t});Eu||(Eu=function(t,r,n){return t.apply(r,n)});Pu||(Pu=function(t,r){return new t(...r)});var Xs=Et(Array.prototype.forEach),PR=Et(Array.prototype.lastIndexOf),Pv=Et(Array.prototype.pop),Mi=Et(Array.prototype.push),_R=Et(Array.prototype.splice),Js=Et(String.prototype.toLowerCase),wu=Et(String.prototype.toString),_v=Et(String.prototype.match),Di=Et(String.prototype.replace),IR=Et(String.prototype.indexOf),AR=Et(String.prototype.trim),nr=Et(Object.prototype.hasOwnProperty),Tt=Et(RegExp.prototype.test),Li=RR(TypeError);function Et(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 Eu(e,t,n)}}function RR(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Pu(e,r)}}function xe(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Js;Ev&&Ev(e,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){let i=r(o);i!==o&&(TR(t)||(t[n]=i),o=i)}e[o]=!0}return e}function OR(e){for(let t=0;t<e.length;t++)nr(e,t)||(e[t]=null);return e}function Mn(e){let t=Dv(null);for(let[r,n]of Mv(e))nr(e,r)&&(Array.isArray(n)?t[r]=OR(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Mn(n):t[r]=n);return t}function Bi(e,t){for(;e!==null;){let n=ER(e,t);if(n){if(n.get)return Et(n.get);if(typeof n.value=="function")return Et(n.value)}e=SR(e)}function r(){return null}return r}var Iv=St(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ku=St(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cu=St(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$R=St(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Tu=St(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),NR=St(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Av=St(["#text"]),Rv=St(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Su=St(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ov=St(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zs=St(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MR=Ht(/\{\{[\w\W]*|[\w\W]*\}\}/gm),DR=Ht(/<%[\w\W]*|[\w\W]*%>/gm),LR=Ht(/\$\{[\w\W]*/gm),BR=Ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),FR=Ht(/^aria-[\-\w]+$/),Lv=Ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),UR=Ht(/^(?:\w+script|data):/i),VR=Ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bv=Ht(/^html$/i),zR=Ht(/^[a-z][.\w]*(-[.\w]+)+$/i),$v=Object.freeze({__proto__:null,ARIA_ATTR:FR,ATTR_WHITESPACE:VR,CUSTOM_ELEMENT:zR,DATA_ATTR:BR,DOCTYPE_NAME:Bv,ERB_EXPR:DR,IS_ALLOWED_URI:Lv,IS_SCRIPT_OR_DATA:UR,MUSTACHE_EXPR:MR,TMPLIT_EXPR:LR}),Fi={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},GR=function(){return typeof window>"u"?null:window},HR=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));let i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Nv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Fv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GR(),t=ue=>Fv(ue);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Fi.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e,n=r,o=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=e,x=l.prototype,h=Bi(x,"cloneNode"),w=Bi(x,"remove"),T=Bi(x,"nextSibling"),b=Bi(x,"childNodes"),y=Bi(x,"parentNode");if(typeof a=="function"){let ue=r.createElement("template");ue.content&&ue.content.ownerDocument&&(r=ue.content.ownerDocument)}let g,k="",{implementation:S,createNodeIterator:P,createDocumentFragment:A,getElementsByTagName:N}=r,{importNode:D}=n,F=Nv();t.isSupported=typeof Mv=="function"&&typeof y=="function"&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:R,ERB_EXPR:M,TMPLIT_EXPR:z,DATA_ATTR:K,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:j,CUSTOM_ELEMENT:he}=$v,{IS_ALLOWED_URI:le}=$v,Q=null,Ge=xe({},[...Iv,...ku,...Cu,...Tu,...Av]),_e=null,jt=xe({},[...Rv,...Su,...Ov,...Zs]),Me=Object.seal(Dv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),gr=null,Nr=null,Nu=!0,tl=!0,Mu=!1,Du=!0,Bn=!1,rl=!0,tn=!1,nl=!1,ol=!1,Fn=!1,zi=!1,Gi=!1,Lu=!0,Bu=!1,C0="user-content-",il=!0,Mo=!1,Un={},Vn=null,Fu=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Uu=null,Vu=xe({},["audio","video","img","source","image","track"]),al=null,zu=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hi="http://www.w3.org/1998/Math/MathML",ji="http://www.w3.org/2000/svg",hr="http://www.w3.org/1999/xhtml",zn=hr,sl=!1,ll=null,T0=xe({},[Hi,ji,hr],wu),Wi=xe({},["mi","mo","mn","ms","mtext"]),qi=xe({},["annotation-xml"]),S0=xe({},["title","style","font","a","script"]),Do=null,E0=["application/xhtml+xml","text/html"],P0="text/html",tt=null,Gn=null,_0=r.createElement("form"),Gu=function(_){return _ instanceof RegExp||_ instanceof Function},cl=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gn&&Gn===_)){if((!_||typeof _!="object")&&(_={}),_=Mn(_),Do=E0.indexOf(_.PARSER_MEDIA_TYPE)===-1?P0:_.PARSER_MEDIA_TYPE,tt=Do==="application/xhtml+xml"?wu:Js,Q=nr(_,"ALLOWED_TAGS")?xe({},_.ALLOWED_TAGS,tt):Ge,_e=nr(_,"ALLOWED_ATTR")?xe({},_.ALLOWED_ATTR,tt):jt,ll=nr(_,"ALLOWED_NAMESPACES")?xe({},_.ALLOWED_NAMESPACES,wu):T0,al=nr(_,"ADD_URI_SAFE_ATTR")?xe(Mn(zu),_.ADD_URI_SAFE_ATTR,tt):zu,Uu=nr(_,"ADD_DATA_URI_TAGS")?xe(Mn(Vu),_.ADD_DATA_URI_TAGS,tt):Vu,Vn=nr(_,"FORBID_CONTENTS")?xe({},_.FORBID_CONTENTS,tt):Fu,gr=nr(_,"FORBID_TAGS")?xe({},_.FORBID_TAGS,tt):{},Nr=nr(_,"FORBID_ATTR")?xe({},_.FORBID_ATTR,tt):{},Un=nr(_,"USE_PROFILES")?_.USE_PROFILES:!1,Nu=_.ALLOW_ARIA_ATTR!==!1,tl=_.ALLOW_DATA_ATTR!==!1,Mu=_.ALLOW_UNKNOWN_PROTOCOLS||!1,Du=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bn=_.SAFE_FOR_TEMPLATES||!1,rl=_.SAFE_FOR_XML!==!1,tn=_.WHOLE_DOCUMENT||!1,Fn=_.RETURN_DOM||!1,zi=_.RETURN_DOM_FRAGMENT||!1,Gi=_.RETURN_TRUSTED_TYPE||!1,ol=_.FORCE_BODY||!1,Lu=_.SANITIZE_DOM!==!1,Bu=_.SANITIZE_NAMED_PROPS||!1,il=_.KEEP_CONTENT!==!1,Mo=_.IN_PLACE||!1,le=_.ALLOWED_URI_REGEXP||Lv,zn=_.NAMESPACE||hr,Wi=_.MATHML_TEXT_INTEGRATION_POINTS||Wi,qi=_.HTML_INTEGRATION_POINTS||qi,Me=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Gu(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Gu(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Me.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Me.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Bn&&(tl=!1),zi&&(Fn=!0),Un&&(Q=xe({},Av),_e=[],Un.html===!0&&(xe(Q,Iv),xe(_e,Rv)),Un.svg===!0&&(xe(Q,ku),xe(_e,Su),xe(_e,Zs)),Un.svgFilters===!0&&(xe(Q,Cu),xe(_e,Su),xe(_e,Zs)),Un.mathMl===!0&&(xe(Q,Tu),xe(_e,Ov),xe(_e,Zs))),_.ADD_TAGS&&(Q===Ge&&(Q=Mn(Q)),xe(Q,_.ADD_TAGS,tt)),_.ADD_ATTR&&(_e===jt&&(_e=Mn(_e)),xe(_e,_.ADD_ATTR,tt)),_.ADD_URI_SAFE_ATTR&&xe(al,_.ADD_URI_SAFE_ATTR,tt),_.FORBID_CONTENTS&&(Vn===Fu&&(Vn=Mn(Vn)),xe(Vn,_.FORBID_CONTENTS,tt)),il&&(Q["#text"]=!0),tn&&xe(Q,["html","head","body"]),Q.table&&(xe(Q,["tbody"]),delete gr.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=_.TRUSTED_TYPES_POLICY,k=g.createHTML("")}else g===void 0&&(g=HR(f,o)),g!==null&&typeof k=="string"&&(k=g.createHTML(""));St&&St(_),Gn=_}},Hu=xe({},[...ku,...Cu,...$R]),ju=xe({},[...Tu,...NR]),I0=function(_){let W=y(_);(!W||!W.tagName)&&(W={namespaceURI:zn,tagName:"template"});let se=Js(_.tagName),Le=Js(W.tagName);return ll[_.namespaceURI]?_.namespaceURI===ji?W.namespaceURI===hr?se==="svg":W.namespaceURI===Hi?se==="svg"&&(Le==="annotation-xml"||Wi[Le]):!!Hu[se]:_.namespaceURI===Hi?W.namespaceURI===hr?se==="math":W.namespaceURI===ji?se==="math"&&qi[Le]:!!ju[se]:_.namespaceURI===hr?W.namespaceURI===ji&&!qi[Le]||W.namespaceURI===Hi&&!Wi[Le]?!1:!ju[se]&&(S0[se]||!Hu[se]):!!(Do==="application/xhtml+xml"&&ll[_.namespaceURI]):!1},or=function(_){Mi(t.removed,{element:_});try{y(_).removeChild(_)}catch{w(_)}},Yi=function(_,W){try{Mi(t.removed,{attribute:W.getAttributeNode(_),from:W})}catch{Mi(t.removed,{attribute:null,from:W})}if(W.removeAttribute(_),_==="is")if(Fn||zi)try{or(W)}catch{}else try{W.setAttribute(_,"")}catch{}},Wu=function(_){let W=null,se=null;if(ol)_="<remove></remove>"+_;else{let it=_v(_,/^[\r\n\t ]+/);se=it&&it[0]}Do==="application/xhtml+xml"&&zn===hr&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");let Le=g?g.createHTML(_):_;if(zn===hr)try{W=new p().parseFromString(Le,Do)}catch{}if(!W||!W.documentElement){W=S.createDocument(zn,"template",null);try{W.documentElement.innerHTML=sl?k:Le}catch{}}let ct=W.body||W.documentElement;return _&&se&&ct.insertBefore(r.createTextNode(se),ct.childNodes[0]||null),zn===hr?N.call(W,tn?"html":"body")[0]:tn?W.documentElement:ct},qu=function(_){return P.call(_.ownerDocument||_,_,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ul=function(_){return _ instanceof d&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof u)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Yu=function(_){return typeof s=="function"&&_ instanceof s};function br(ue,_,W){Xs(ue,se=>{se.call(t,_,W,Gn)})}let Ku=function(_){let W=null;if(br(F.beforeSanitizeElements,_,null),ul(_))return or(_),!0;let se=tt(_.nodeName);if(br(F.uponSanitizeElement,_,{tagName:se,allowedTags:Q}),_.hasChildNodes()&&!Yu(_.firstElementChild)&&Tt(/<[/\w]/g,_.innerHTML)&&Tt(/<[/\w]/g,_.textContent)||_.nodeType===Fi.progressingInstruction||rl&&_.nodeType===Fi.comment&&Tt(/<[/\w]/g,_.data))return or(_),!0;if(!Q[se]||gr[se]){if(!gr[se]&&Zu(se)&&(Me.tagNameCheck instanceof RegExp&&Tt(Me.tagNameCheck,se)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(se)))return!1;if(il&&!Vn[se]){let Le=y(_)||_.parentNode,ct=b(_)||_.childNodes;if(ct&&Le){let it=ct.length;for(let Pt=it-1;Pt>=0;--Pt){let ir=h(ct[Pt],!0);ir.__removalCount=(_.__removalCount||0)+1,Le.insertBefore(ir,T(_))}}}return or(_),!0}return _ instanceof l&&!I0(_)||(se==="noscript"||se==="noembed"||se==="noframes")&&Tt(/<\/no(script|embed|frames)/i,_.innerHTML)?(or(_),!0):(Bn&&_.nodeType===Fi.text&&(W=_.textContent,Xs([R,M,z],Le=>{W=Di(W,Le," ")}),_.textContent!==W&&(Mi(t.removed,{element:_.cloneNode()}),_.textContent=W)),br(F.afterSanitizeElements,_,null),!1)},Xu=function(_,W,se){if(Lu&&(W==="id"||W==="name")&&(se in r||se in _0))return!1;if(!(tl&&!Nr[W]&&Tt(K,W))){if(!(Nu&&Tt(I,W))){if(!_e[W]||Nr[W]){if(!(Zu(_)&&(Me.tagNameCheck instanceof RegExp&&Tt(Me.tagNameCheck,_)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(_))&&(Me.attributeNameCheck instanceof RegExp&&Tt(Me.attributeNameCheck,W)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(W))||W==="is"&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&Tt(Me.tagNameCheck,se)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(se))))return!1}else if(!al[W]){if(!Tt(le,Di(se,j,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&_!=="script"&&IR(se,"data:")===0&&Uu[_])){if(!(Mu&&!Tt(B,Di(se,j,"")))){if(se)return!1}}}}}}return!0},Zu=function(_){return _!=="annotation-xml"&&_v(_,he)},Ju=function(_){br(F.beforeSanitizeAttributes,_,null);let{attributes:W}=_;if(!W||ul(_))return;let se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0},Le=W.length;for(;Le--;){let ct=W[Le],{name:it,namespaceURI:Pt,value:ir}=ct,Lo=tt(it),ht=it==="value"?ir:AR(ir);if(se.attrName=Lo,se.attrValue=ht,se.keepAttr=!0,se.forceKeepAttr=void 0,br(F.uponSanitizeAttribute,_,se),ht=se.attrValue,Bu&&(Lo==="id"||Lo==="name")&&(Yi(it,_),ht=C0+ht),rl&&Tt(/((--!?|])>)|<\/(style|title)/i,ht)){Yi(it,_);continue}if(se.forceKeepAttr||(Yi(it,_),!se.keepAttr))continue;if(!Du&&Tt(/\/>/i,ht)){Yi(it,_);continue}Bn&&Xs([R,M,z],ed=>{ht=Di(ht,ed," ")});let Qu=tt(_.nodeName);if(Xu(Qu,Lo,ht)){if(g&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Pt)switch(f.getAttributeType(Qu,Lo)){case"TrustedHTML":{ht=g.createHTML(ht);break}case"TrustedScriptURL":{ht=g.createScriptURL(ht);break}}try{Pt?_.setAttributeNS(Pt,it,ht):_.setAttribute(it,ht),ul(_)?or(_):Pv(t.removed)}catch{}}}br(F.afterSanitizeAttributes,_,null)},A0=function ue(_){let W=null,se=qu(_);for(br(F.beforeSanitizeShadowDOM,_,null);W=se.nextNode();)br(F.uponSanitizeShadowNode,W,null),Ku(W),Ju(W),W.content instanceof i&&ue(W.content);br(F.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(ue){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,se=null,Le=null,ct=null;if(sl=!ue,sl&&(ue="<!-->"),typeof ue!="string"&&!Yu(ue))if(typeof ue.toString=="function"){if(ue=ue.toString(),typeof ue!="string")throw Li("dirty is not a string, aborting")}else throw Li("toString is not a function");if(!t.isSupported)return ue;if(nl||cl(_),t.removed=[],typeof ue=="string"&&(Mo=!1),Mo){if(ue.nodeName){let ir=tt(ue.nodeName);if(!Q[ir]||gr[ir])throw Li("root node is forbidden and cannot be sanitized in-place")}}else if(ue instanceof s)W=Wu("<!---->"),se=W.ownerDocument.importNode(ue,!0),se.nodeType===Fi.element&&se.nodeName==="BODY"||se.nodeName==="HTML"?W=se:W.appendChild(se);else{if(!Fn&&!Bn&&!tn&&ue.indexOf("<")===-1)return g&&Gi?g.createHTML(ue):ue;if(W=Wu(ue),!W)return Fn?null:Gi?k:""}W&&ol&&or(W.firstChild);let it=qu(Mo?ue:W);for(;Le=it.nextNode();)Ku(Le),Ju(Le),Le.content instanceof i&&A0(Le.content);if(Mo)return ue;if(Fn){if(zi)for(ct=A.call(W.ownerDocument);W.firstChild;)ct.appendChild(W.firstChild);else ct=W;return(_e.shadowroot||_e.shadowrootmode)&&(ct=D.call(n,ct,!0)),ct}let Pt=tn?W.outerHTML:W.innerHTML;return tn&&Q["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&Tt(Bv,W.ownerDocument.doctype.name)&&(Pt="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
567
- `+Pt),Bn&&Xs([R,M,z],ir=>{Pt=Di(Pt,ir," ")}),g&&Gi?g.createHTML(Pt):Pt},t.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cl(ue),nl=!0},t.clearConfig=function(){Gn=null,nl=!1},t.isValidAttribute=function(ue,_,W){Gn||cl({});let se=tt(ue),Le=tt(_);return Xu(se,Le,W)},t.addHook=function(ue,_){typeof _=="function"&&Mi(F[ue],_)},t.removeHook=function(ue,_){if(_!==void 0){let W=PR(F[ue],_);return W===-1?void 0:_R(F[ue],W,1)[0]}return Pv(F[ue])},t.removeHooks=function(ue){F[ue]=[]},t.removeAllHooks=function(){F=Nv()},t}var _u=Fv();function Ru(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ln=Ru();function Hv(e){Ln=e}var jv=/[&<>"']/,jR=new RegExp(jv.source,"g"),Wv=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,WR=new RegExp(Wv.source,"g"),qR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Uv=e=>qR[e];function Nt(e,t){if(t){if(jv.test(e))return e.replace(jR,Uv)}else if(Wv.test(e))return e.replace(WR,Uv);return e}var YR=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function KR(e){return e.replace(YR,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var XR=/(^|[^\[])\^/g;function Re(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(n,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(XR,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}function Vv(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var Qs={exec:()=>null};function zv(e,t){let r=e.replace(/\|/g,(i,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function Iu(e,t,r){let n=e.length;if(n===0)return"";let o=0;for(;o<n;){let i=e.charAt(n-o-1);if(i===t&&!r)o++;else if(i!==t&&r)o++;else break}return e.slice(0,n-o)}function ZR(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}function Gv(e,t,r,n){let o=t.href,i=t.title?Nt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;let s={type:"link",raw:r,href:o,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,s}return{type:"image",raw:r,href:o,title:i,text:Nt(a)}}function JR(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
568
- `).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[a]=i;return a.length>=n.length?o.slice(n.length):o}).join(`
569
- `)}var Ao=class{options;rules;lexer;constructor(t){this.options=t||Ln}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Iu(n,`
570
- `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],o=JR(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){let o=Iu(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;let i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let a=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),s="",l="",c=!1;for(;t;){let u=!1;if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;s=r[0],t=t.substring(s.length);let d=r[2].split(`
571
- `,1)[0].replace(/^\t+/,T=>" ".repeat(3*T.length)),p=t.split(`
572
- `,1)[0],f=0;this.options.pedantic?(f=2,l=d.trimStart()):(f=r[2].search(/[^ ]/),f=f>4?1:f,l=d.slice(f),f+=r[1].length);let x=!1;if(!d&&/^ *$/.test(p)&&(s+=p+`
573
- `,t=t.substring(p.length+1),u=!0),!u){let T=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,f-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),y=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:\`\`\`|~~~)`),g=new RegExp(`^ {0,${Math.min(3,f-1)}}#`);for(;t;){let k=t.split(`
574
- `,1)[0];if(p=k,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),y.test(p)||g.test(p)||T.test(p)||b.test(t))break;if(p.search(/[^ ]/)>=f||!p.trim())l+=`
575
- `+p.slice(f);else{if(x||d.search(/[^ ]/)>=4||y.test(d)||g.test(d)||b.test(d))break;l+=`
576
- `+p}!x&&!p.trim()&&(x=!0),s+=k+`
577
- `,t=t.substring(k.length+1),d=p.slice(f)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(s)&&(c=!0));let h=null,w;this.options.gfm&&(h=/^\[[ xX]\] /.exec(l),h&&(w=h[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!h,checked:w,loose:!1,text:l,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){let d=i.items[u].tokens.filter(f=>f.type==="space"),p=d.length>0&&d.some(f=>/\n.*\n/.test(f.raw));i.loose=p}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(/\s+/g," "),o=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){let r=this.rules.block.table.exec(t);if(r){if(!/[:|]/.test(r[2]))return;let n={type:"table",raw:r[0],header:zv(r[1]).map(o=>({text:o,tokens:[]})),align:r[2].replace(/^\||\| *$/g,"").split("|"),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
578
- `):[]};if(n.header.length===n.align.length){let o=n.align.length,i,a,s,l;for(i=0;i<o;i++){let c=n.align[i];c&&(/^ *-+: *$/.test(c)?n.align[i]="right":/^ *:-+: *$/.test(c)?n.align[i]="center":/^ *:-+ *$/.test(c)?n.align[i]="left":n.align[i]=null)}for(o=n.rows.length,i=0;i<o;i++)n.rows[i]=zv(n.rows[i],n.header.length).map(c=>({text:c,tokens:[]}));for(o=n.header.length,a=0;a<o;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(o=n.rows.length,a=0;a<o;a++)for(l=n.rows[a],s=0;s<l.length;s++)l[s].tokens=this.lexer.inline(l[s].text);return n}}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
579
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:Nt(r[1])}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let a=Iu(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=ZR(r[2],"()");if(a>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),Gv(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Gv(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...o[0]].length-1,s,l,c=a,u=0,d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+o[0].length-1);(o=d.exec(r))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(l=[...s].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&a%3&&!((a+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);let p=[...t].slice(0,a+o.index+l+1).join("");if(Math.min(a,l)%2){let x=p.slice(1,-1);return{type:"em",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}let f=p.slice(2,-2);return{type:"strong",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," "),o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=Nt(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,o;return r[2]==="@"?(n=Nt(r[1]),o="mailto:"+n):(n=Nt(r[1]),o=n),{type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,o;if(r[2]==="@")n=Nt(r[0]),o="mailto:"+n;else{let i;do i=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(i!==r[0]);n=Nt(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=Nt(r[0]),{type:"text",raw:r[0],text:n}}}},me={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Qs,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;me.def=Re(me.def).replace("label",me._label).replace("title",me._title).getRegex();me.bullet=/(?:[*+-]|\d{1,9}[.)])/;me.listItemStart=Re(/^( *)(bull) */).replace("bull",me.bullet).getRegex();me.list=Re(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex();me._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";me._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;me.html=Re(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();me.lheading=Re(me.lheading).replace(/bull/g,me.bullet).getRegex();me.paragraph=Re(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.blockquote=Re(me.blockquote).replace("paragraph",me.paragraph).getRegex();me.normal={...me};me.gfm={...me.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};me.gfm.table=Re(me.gfm.table).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.gfm.paragraph=Re(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",me.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.pedantic={...me.normal,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
580
- ]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var J={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Qs,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Qs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};J._punctuation="\\p{P}$+<=>`^|~";J.punctuation=Re(J.punctuation,"u").replace(/punctuation/g,J._punctuation).getRegex();J.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;J.anyPunctuation=/\\[punct]/g;J._escapes=/\\([punct])/g;J._comment=Re(me._comment).replace("(?:-->|$)","-->").getRegex();J.emStrong.lDelim=Re(J.emStrong.lDelim,"u").replace(/punct/g,J._punctuation).getRegex();J.emStrong.rDelimAst=Re(J.emStrong.rDelimAst,"gu").replace(/punct/g,J._punctuation).getRegex();J.emStrong.rDelimUnd=Re(J.emStrong.rDelimUnd,"gu").replace(/punct/g,J._punctuation).getRegex();J.anyPunctuation=Re(J.anyPunctuation,"gu").replace(/punct/g,J._punctuation).getRegex();J._escapes=Re(J._escapes,"gu").replace(/punct/g,J._punctuation).getRegex();J._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;J._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;J.autolink=Re(J.autolink).replace("scheme",J._scheme).replace("email",J._email).getRegex();J._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;J.tag=Re(J.tag).replace("comment",J._comment).replace("attribute",J._attribute).getRegex();J._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;J._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;J._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;J.link=Re(J.link).replace("label",J._label).replace("href",J._href).replace("title",J._title).getRegex();J.reflink=Re(J.reflink).replace("label",J._label).replace("ref",me._label).getRegex();J.nolink=Re(J.nolink).replace("ref",me._label).getRegex();J.reflinkSearch=Re(J.reflinkSearch,"g").replace("reflink",J.reflink).replace("nolink",J.nolink).getRegex();J.normal={...J};J.pedantic={...J.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",J._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",J._label).getRegex()};J.gfm={...J.normal,escape:Re(J.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};J.gfm.url=Re(J.gfm.url,"i").replace("email",J.gfm._extended_email).getRegex();J.breaks={...J.gfm,br:Re(J.br).replace("{2,}","*").getRegex(),text:Re(J.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var Or=class e{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ln,this.options.tokenizer=this.options.tokenizer||new Ao,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={block:me.normal,inline:J.normal};this.options.pedantic?(r.block=me.pedantic,r.inline=J.pedantic):this.options.gfm&&(r.block=me.gfm,this.options.breaks?r.inline=J.breaks:r.inline=J.gfm),this.tokenizer.rules=r}static get rules(){return{block:me,inline:J}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
581
- `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,c)=>l+" ".repeat(c.length));let n,o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(n=s.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
582
- `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
583
- `+n.raw,o.text+=`
584
- `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
585
- `+n.raw,o.text+=`
586
- `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){o=r[r.length-1],a&&o.type==="paragraph"?(o.raw+=`
587
- `+n.raw,o.text+=`
588
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),a=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=`
589
- `+n.raw,o.text+=`
590
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,a=t,s,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,a,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(f=>{p=f.call({lexer:this},d),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}},Ro=class{options;constructor(t){this.options=t||Ln}code(t,r,n){let o=(r||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
591
- `,o?'<pre><code class="language-'+Nt(o)+'">'+(n?t:Nt(t,!0))+`</code></pre>
592
- `:"<pre><code>"+(n?t:Nt(t,!0))+`</code></pre>
566
+ `,o.parentNode?.appendChild(i)}),K(n,"src",t),$(r=>{var o=e.size||200,i=e.size||200;return o!==r.e&&K(n,"width",r.e=o),i!==r.t&&K(n,"height",r.t=i),r},{e:void 0,t:void 0}),n})()},Od,D3=400,L3=e=>e?Number.parseFloat(e.replace(/[^\d,]/g,"").replace(",",".")).toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}):"0,00",B3=e=>({cpf:"CPF",cnpj:"CNPJ",telefone:"Telefone",email:"E-mail",aleatoria:"Chave Aleat\xF3ria"})[e]||e,F3=(e,t)=>{if(!e)return"";if(rc(e))return e;switch(t){case"cpf":return e.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4");case"cnpj":return e.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5");case"telefone":return e.replace(/(\+55)(\d{2})(\d{5})(\d{4})/,"$1 ($2) $3-$4");default:return e}},U3=async e=>{try{await navigator.clipboard.writeText(e)}catch(t){console.error("Erro ao copiar:",t)}},rc=e=>e?/{{[^}]+}}/.test(e):!1,V3=e=>{let t=[];return e?.pixCode||t.push("c\xF3digo PIX"),e?.valor||t.push("valor"),e?.nome||t.push("nome do benefici\xE1rio"),e?.chave||t.push("chave PIX"),e?.tipoChave||t.push("tipo de chave"),{isValid:t.length===0,missingFields:t}},nw=e=>{let t,[n,r]=O(!!e.onTransitionEnd),[o,i]=O({type:null,success:!1}),a=async(c,u)=>{try{await U3(c),i({type:u,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:u,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};me(()=>{Od=setTimeout(()=>{r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},D3)},2e3)}),ie(()=>{Od&&clearTimeout(Od)});let s=V3(e.content),l=rc(e.content?.chave||"")||rc(e.content?.nome||"")||rc(e.content?.valor||"");return(()=>{var c=T3(),u=c.firstChild,d=u.firstChild,f=d.firstChild,p=f.nextSibling,y=t;return typeof y=="function"?ke(y,c):t=c,v(f,(()=>{var h=L(()=>!!n());return()=>h()&&m(tt,{})})()),v(p,(()=>{var h=L(()=>!s.isValid);return()=>h()?S3():L(()=>!!e.content?.pixCode)()?(()=>{var k=C3(),C=k.firstChild,b=C.nextSibling,T=b.nextSibling,g=T.firstChild,x=g.firstChild;return v(k,l&&_3(),b),v(k,(()=>{var S=L(()=>e.content.showQrCode!==!1);return()=>S()&&(()=>{var P=E3();return v(P,m(M3,{get value(){return e.content.pixCode},size:200,level:"M",includeMargin:!0,"aria-label":"C\xF3digo QR do PIX"})),P})()})(),b),v(b,(()=>{var S=L(()=>!!e.content.valor);return()=>S()&&(()=>{var P=P3(),R=P.firstChild,N=R.nextSibling,D=N.firstChild;return v(N,()=>L3(e.content.valor),null),P})()})(),null),v(b,(()=>{var S=L(()=>!!e.content.nome);return()=>S()&&(()=>{var P=I3(),R=P.firstChild,N=R.nextSibling;return v(N,()=>e.content.nome),P})()})(),null),v(b,(()=>{var S=L(()=>!!e.content.cidade);return()=>S()&&(()=>{var P=A3(),R=P.firstChild,N=R.nextSibling;return v(N,()=>e.content.cidade),v(P,(()=>{var D=L(()=>e.content.cidade.length>15);return()=>D()&&R3()})(),null),P})()})(),null),v(b,(()=>{var S=L(()=>!!(e.content.chave&&e.content.tipoChave));return()=>S()&&(()=>{var P=O3(),R=P.firstChild,N=R.firstChild,D=N.nextSibling,F=R.nextSibling,A=F.firstChild,M=A.nextSibling;return v(D,()=>B3(e.content.tipoChave)),v(M,()=>F3(e.content.chave,e.content.tipoChave)),P})()})(),null),g.$$click=()=>e.content?.pixCode!=null&&a(e.content.pixCode,"code"),v(g,()=>o().type==="code"&&o().success?"\u2705":"\u{1F4CB}",x),v(T,(()=>{var S=L(()=>!!(e.content.chave&&e.content.showCopyKeyButton!==!1));return()=>S()&&(()=>{var P=N3(),R=P.firstChild;return P.$$click=()=>e.content?.chave!=null&&a(e.content.chave,"key"),v(P,()=>o().type==="key"&&o().success?"\u2705":"\u{1F511}",R),$(()=>G(P,q("pix-action-btn",o().type==="key"&&o().success&&"pix-action-success",o().type==="key"&&!o().success&&"pix-action-error"))),P})()})(),null),$(()=>G(g,q("pix-action-btn",o().type==="code"&&o().success&&"pix-action-success",o().type==="code"&&!o().success&&"pix-action-error"))),k})():$3()})()),$(h=>{var k=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),C=n()?"64px":"100%",b=n()?"32px":"100%",T=q("p-4 z-20 text-fade-in",n()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--pix-bubble-height)]");return k!==h.e&&G(c,h.e=k),C!==h.t&&ae(f,"width",h.t=C),b!==h.a&&ae(f,"height",h.a=b),T!==h.o&&G(p,h.o=T),h},{e:void 0,t:void 0,a:void 0,o:void 0}),c})()};Ne(["click"]);var rw=({bubbleContent:e,typingSettings:t})=>{let n=e.match(/(\w+)/g)?.length??0;n===0&&(n=e.length);let{enabled:r,speed:o,maxDelay:i}={enabled:t?.enabled??ht.typingEmulation.enabled,speed:t?.speed??ht.typingEmulation.speed,maxDelay:t?.maxDelay??ht.typingEmulation.maxDelay},s=r?n/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var Nd=e=>e.map(t=>t.text??Nd(t.children)).join("");var j3=w("<br>"),z3=w("<span>"),G3=(e,t,n)=>{let r="";return e&&(r+="slate-bold"),t&&(r+=" slate-italic"),n&&(r+=" slate-underline"),r},ow=e=>(()=>{var t=z3();return v(t,()=>e.text,null),v(t,m(U,{get when(){return L(()=>!!e.isUniqueChild)()&&ct(e.text)},get children(){return j3()}}),null),$(()=>G(t,G3(e.bold,e.italic,e.underline))),t})();var H3=w('<a target=_blank rel="noopener noreferrer">'),W3=w("<ol>"),q3=w("<ul>"),Z3=w("<li>"),Y3=w("<span>"),K3=w("<div>"),To=e=>m(Fe,{get children(){return[m(ee,{get when(){return ye(e.element.text)},get children(){return m(ow,ge(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),m(ee,{when:!0,get children(){return m(Fe,{get children(){return[m(ee,{get when(){return e.element.type==="a"},get children(){var t=H3();return v(t,m(Re,{get each(){return e.element.children},children:n=>m(To,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),$(()=>K(t,"href",e.element.url)),t}}),m(ee,{get when(){return e.element.type==="ol"},get children(){var t=W3();return v(t,m(Re,{get each(){return e.element.children},children:n=>m(To,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(ee,{get when(){return e.element.type==="ul"},get children(){var t=q3();return v(t,m(Re,{get each(){return e.element.children},children:n=>m(To,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(ee,{get when(){return e.element.type==="li"},get children(){var t=Z3();return v(t,m(Re,{get each(){return e.element.children},children:n=>m(To,{element:n,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(ee,{when:!0,get children(){return m(X3,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return m(Re,{get each(){return e.element.children},children:t=>m(To,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),X3=e=>m(Fe,{get children(){return[m(ee,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=Y3();return v(t,()=>e.children),$(()=>K(t,"data-element-type",e.element.type)),t}}),m(ee,{when:!0,get children(){var t=K3();return v(t,()=>e.children),$(()=>K(t,"data-element-type",e.element.type)),t}})]}});var J3=w('<div><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),Q3=400,$d,iw=e=>{let t,[n,r]=O(!!e.onTransitionEnd),o=()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},Q3))};return me(()=>{if(!n)return;let i=e.content?.richText?Nd(e.content.richText):"",a=e.typingEmulation?.enabled===!1||e.isTypingSkipped?0:rw({bubbleContent:i,typingSettings:e.typingEmulation});$d=setTimeout(o,a)}),ie(()=>{$d&&clearTimeout($d)}),(()=>{var i=J3(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=t;return typeof u=="function"?ke(u,i):t=i,v(l,(()=>{var d=L(()=>!!n());return()=>d()&&m(tt,{})})()),v(c,m(Re,{get each(){return e.content?.richText},children:d=>m(To,{element:d})})),$(d=>{var f=q("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=n()?"64px":"100%",y=n()?"32px":"100%",h=q("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",n()?"opacity-0 h-4 @xs:h-5":"opacity-100 h-full");return f!==d.e&&G(i,d.e=f),p!==d.t&&ae(l,"width",d.t=p),y!==d.a&&ae(l,"height",d.a=y),h!==d.o&&G(c,d.o=h),d},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Md=["youtube","vimeo","tiktok","gumlet"],Qn={height:400,aspectRatio:"16/9",maxWidth:"100%",areControlsDisplayed:!0,isAutoplayEnabled:!0};var e4="https://www.youtube.com/embed";var t4="https://player.vimeo.com/video";var n4="https://www.tiktok.com/embed/v2";var r4="https://play.gumlet.io/embed";var aw={vimeo:t4,youtube:e4,tiktok:n4,gumlet:r4};var sw=e=>e?.isAutoplayEnabled??Qn.isAutoplayEnabled?e?.type==="youtube"||e?.type==="vimeo"?"autoplay=1":e?.type==="gumlet"?"autoplay=true":"":"";var i4=w("<video>"),a4=w('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),s4=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),l4=400,Dd,lw=e=>{let t,[n,r]=O(!!e.onTransitionEnd);return me(()=>{let o=e.content?.type&&Md.includes(e.content?.type)?2e3:100;Dd=setTimeout(()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},l4))},o)}),ie(()=>{Dd&&clearTimeout(Dd)}),(()=>{var o=s4(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=t;return typeof l=="function"?ke(l,o):t=o,v(s,(()=>{var c=L(()=>!!n());return()=>c()&&m(tt,{})})()),v(a,m(Fe,{get children(){return[m(ee,{get when(){return L(()=>!!e.content?.type)()&&e.content.type==="url"},get children(){var c=i4();return $(u=>{var d=e.onTransitionEnd?e.content?.isAutoplayEnabled??Qn.isAutoplayEnabled:!1,f=e.content?.url,p=e.content?.areControlsDisplayed??Qn.areControlsDisplayed,y=q("p-4 focus:outline-none w-full z-10 text-fade-in rounded-md",n()?"opacity-0 h-8 @xs:h-9":"opacity-100 h-auto"),h=e.content?.aspectRatio,k=e.content?.maxWidth??Qn.maxWidth;return d!==u.e&&(c.autoplay=u.e=d),f!==u.t&&K(c,"src",u.t=f),p!==u.a&&(c.controls=u.a=p),y!==u.o&&G(c,u.o=y),h!==u.i&&ae(c,"aspect-ratio",u.i=h),k!==u.n&&ae(c,"max-width",u.n=k),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),c}}),m(ee,{get when(){return L(()=>!!e.content?.type)()&&Md.includes(e.content.type)},get children(){var c=a4(),u=c.firstChild;return $(d=>{var f=q("p-4 z-10 text-fade-in w-full aspect-[var(--aspect-ratio)]",n()?"opacity-0 h-8 @xs:h-9":"opacity-100",!e.content?.aspectRatio&&"h-[var(--height)]"),p=e.content?.aspectRatio,y=`${e.content?.height??Qn.height}px`,h=e.content?.maxWidth??Qn.maxWidth,k=`${aw[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??`?${sw(e.content)}`}`;return f!==d.e&&G(c,d.e=f),p!==d.t&&ae(c,"--aspect-ratio",d.t=p),y!==d.a&&ae(c,"--height",d.a=y),h!==d.o&&ae(c,"max-width",d.o=h),k!==d.i&&K(u,"src",d.i=k),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c}})]}}),null),$(c=>{var u=q("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),d=n()?"64px":"100%",f=n()?"32px":"100%",p=e.content?.maxWidth??Qn.maxWidth;return u!==c.e&&G(o,c.e=u),d!==c.t&&ae(s,"width",c.t=d),f!==c.a&&ae(s,"height",c.a=f),p!==c.o&&ae(s,"max-width",c.o=p),c},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var cw=e=>(console.log("\u{1F50D} HostBubble - message type:",e.message.type),console.log("\u{1F50D} HostBubble - message content:",e.message.content),m(Fe,{get children(){return[m(ee,{get when(){return e.message.type==="text"},get children(){return m(iw,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(ee,{get when(){return e.message.type==="image"},get children(){return m(K0,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(ee,{get when(){return e.message.type==="video"},get children(){return m(lw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(ee,{get when(){return e.message.type==="embed"},get children(){return m(Y0,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(ee,{get when(){return e.message.type==="custom-embed"},get children(){return m(q0,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(ee,{get when(){return e.message.type==="location"},get children(){return m(tw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(ee,{get when(){return e.message.type==="pix"},get children(){return m(nw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(ee,{get when(){return e.message.type==="contact"},get children(){return m(Q0,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(ee,{get when(){return e.message.type==="audio"},get children(){return m(W0,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}}));var{entries:vw,setPrototypeOf:uw,isFrozen:u4,getPrototypeOf:d4,getOwnPropertyDescriptor:m4}=Object,{freeze:Lt,seal:ln,create:xw}=Object,{apply:jd,construct:zd}=typeof Reflect<"u"&&Reflect;Lt||(Lt=function(t){return t});ln||(ln=function(t){return t});jd||(jd=function(t,n,r){return t.apply(n,r)});zd||(zd=function(t,n){return new t(...n)});var oc=Bt(Array.prototype.forEach),f4=Bt(Array.prototype.lastIndexOf),dw=Bt(Array.prototype.pop),Ba=Bt(Array.prototype.push),p4=Bt(Array.prototype.splice),ac=Bt(String.prototype.toLowerCase),Ld=Bt(String.prototype.toString),mw=Bt(String.prototype.match),Fa=Bt(String.prototype.replace),g4=Bt(String.prototype.indexOf),h4=Bt(String.prototype.trim),wn=Bt(Object.prototype.hasOwnProperty),Dt=Bt(RegExp.prototype.test),Ua=b4(TypeError);function Bt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return jd(e,t,r)}}function b4(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return zd(e,n)}}function Ee(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ac;uw&&uw(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let i=n(o);i!==o&&(u4(t)||(t[r]=i),o=i)}e[o]=!0}return e}function y4(e){for(let t=0;t<e.length;t++)wn(e,t)||(e[t]=null);return e}function So(e){let t=xw(null);for(let[n,r]of vw(e))wn(e,n)&&(Array.isArray(r)?t[n]=y4(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=So(r):t[n]=r);return t}function Va(e,t){for(;e!==null;){let r=m4(e,t);if(r){if(r.get)return Bt(r.get);if(typeof r.value=="function")return Bt(r.value)}e=d4(e)}function n(){return null}return n}var fw=Lt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Bd=Lt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fd=Lt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),v4=Lt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ud=Lt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),x4=Lt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pw=Lt(["#text"]),gw=Lt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Vd=Lt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hw=Lt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ic=Lt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),w4=ln(/\{\{[\w\W]*|[\w\W]*\}\}/gm),k4=ln(/<%[\w\W]*|[\w\W]*%>/gm),T4=ln(/\$\{[\w\W]*/gm),S4=ln(/^data-[\-\w.\u00B7-\uFFFF]+$/),C4=ln(/^aria-[\-\w]+$/),ww=ln(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_4=ln(/^(?:\w+script|data):/i),E4=ln(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kw=ln(/^html$/i),P4=ln(/^[a-z][.\w]*(-[.\w]+)+$/i),bw=Object.freeze({__proto__:null,ARIA_ATTR:C4,ATTR_WHITESPACE:E4,CUSTOM_ELEMENT:P4,DATA_ATTR:S4,DOCTYPE_NAME:kw,ERB_EXPR:k4,IS_ALLOWED_URI:ww,IS_SCRIPT_OR_DATA:_4,MUSTACHE_EXPR:w4,TMPLIT_EXPR:T4}),ja={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},I4=function(){return typeof window>"u"?null:window},A4=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));let i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},yw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Tw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I4(),t=pe=>Tw(pe);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==ja.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,y=l.prototype,h=Va(y,"cloneNode"),k=Va(y,"remove"),C=Va(y,"nextSibling"),b=Va(y,"childNodes"),T=Va(y,"parentNode");if(typeof a=="function"){let pe=n.createElement("template");pe.content&&pe.content.ownerDocument&&(n=pe.content.ownerDocument)}let g,x="",{implementation:S,createNodeIterator:P,createDocumentFragment:R,getElementsByTagName:N}=n,{importNode:D}=r,F=yw();t.isSupported=typeof vw=="function"&&typeof T=="function"&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:A,ERB_EXPR:M,TMPLIT_EXPR:V,DATA_ATTR:Y,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:H,CUSTOM_ELEMENT:we}=bw,{IS_ALLOWED_URI:de}=bw,te=null,Ye=Ee({},[...fw,...Bd,...Fd,...Ud,...pw]),Le=null,cn=Ee({},[...gw,...Vd,...hw,...ic]),He=Object.seal(xw(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$n=null,nr=null,Kd=!0,cc=!0,Xd=!1,Jd=!0,Eo=!1,uc=!0,Pr=!1,dc=!1,mc=!1,Po=!1,Ha=!1,Wa=!1,Qd=!0,em=!1,s1="user-content-",fc=!0,Ri=!1,Io={},Ao=null,tm=Ee({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),nm=null,rm=Ee({},["audio","video","img","source","image","track"]),pc=null,om=Ee({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qa="http://www.w3.org/1998/Math/MathML",Za="http://www.w3.org/2000/svg",Mn="http://www.w3.org/1999/xhtml",Ro=Mn,gc=!1,hc=null,l1=Ee({},[qa,Za,Mn],Ld),Ya=Ee({},["mi","mo","mn","ms","mtext"]),Ka=Ee({},["annotation-xml"]),c1=Ee({},["title","style","font","a","script"]),Oi=null,u1=["application/xhtml+xml","text/html"],d1="text/html",lt=null,Oo=null,m1=n.createElement("form"),im=function(E){return E instanceof RegExp||E instanceof Function},bc=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Oo&&Oo===E)){if((!E||typeof E!="object")&&(E={}),E=So(E),Oi=u1.indexOf(E.PARSER_MEDIA_TYPE)===-1?d1:E.PARSER_MEDIA_TYPE,lt=Oi==="application/xhtml+xml"?Ld:ac,te=wn(E,"ALLOWED_TAGS")?Ee({},E.ALLOWED_TAGS,lt):Ye,Le=wn(E,"ALLOWED_ATTR")?Ee({},E.ALLOWED_ATTR,lt):cn,hc=wn(E,"ALLOWED_NAMESPACES")?Ee({},E.ALLOWED_NAMESPACES,Ld):l1,pc=wn(E,"ADD_URI_SAFE_ATTR")?Ee(So(om),E.ADD_URI_SAFE_ATTR,lt):om,nm=wn(E,"ADD_DATA_URI_TAGS")?Ee(So(rm),E.ADD_DATA_URI_TAGS,lt):rm,Ao=wn(E,"FORBID_CONTENTS")?Ee({},E.FORBID_CONTENTS,lt):tm,$n=wn(E,"FORBID_TAGS")?Ee({},E.FORBID_TAGS,lt):{},nr=wn(E,"FORBID_ATTR")?Ee({},E.FORBID_ATTR,lt):{},Io=wn(E,"USE_PROFILES")?E.USE_PROFILES:!1,Kd=E.ALLOW_ARIA_ATTR!==!1,cc=E.ALLOW_DATA_ATTR!==!1,Xd=E.ALLOW_UNKNOWN_PROTOCOLS||!1,Jd=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Eo=E.SAFE_FOR_TEMPLATES||!1,uc=E.SAFE_FOR_XML!==!1,Pr=E.WHOLE_DOCUMENT||!1,Po=E.RETURN_DOM||!1,Ha=E.RETURN_DOM_FRAGMENT||!1,Wa=E.RETURN_TRUSTED_TYPE||!1,mc=E.FORCE_BODY||!1,Qd=E.SANITIZE_DOM!==!1,em=E.SANITIZE_NAMED_PROPS||!1,fc=E.KEEP_CONTENT!==!1,Ri=E.IN_PLACE||!1,de=E.ALLOWED_URI_REGEXP||ww,Ro=E.NAMESPACE||Mn,Ya=E.MATHML_TEXT_INTEGRATION_POINTS||Ya,Ka=E.HTML_INTEGRATION_POINTS||Ka,He=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&im(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(He.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&im(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(He.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(He.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Eo&&(cc=!1),Ha&&(Po=!0),Io&&(te=Ee({},pw),Le=[],Io.html===!0&&(Ee(te,fw),Ee(Le,gw)),Io.svg===!0&&(Ee(te,Bd),Ee(Le,Vd),Ee(Le,ic)),Io.svgFilters===!0&&(Ee(te,Fd),Ee(Le,Vd),Ee(Le,ic)),Io.mathMl===!0&&(Ee(te,Ud),Ee(Le,hw),Ee(Le,ic))),E.ADD_TAGS&&(te===Ye&&(te=So(te)),Ee(te,E.ADD_TAGS,lt)),E.ADD_ATTR&&(Le===cn&&(Le=So(Le)),Ee(Le,E.ADD_ATTR,lt)),E.ADD_URI_SAFE_ATTR&&Ee(pc,E.ADD_URI_SAFE_ATTR,lt),E.FORBID_CONTENTS&&(Ao===tm&&(Ao=So(Ao)),Ee(Ao,E.FORBID_CONTENTS,lt)),fc&&(te["#text"]=!0),Pr&&Ee(te,["html","head","body"]),te.table&&(Ee(te,["tbody"]),delete $n.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ua('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ua('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=E.TRUSTED_TYPES_POLICY,x=g.createHTML("")}else g===void 0&&(g=A4(p,o)),g!==null&&typeof x=="string"&&(x=g.createHTML(""));Lt&&Lt(E),Oo=E}},am=Ee({},[...Bd,...Fd,...v4]),sm=Ee({},[...Ud,...x4]),f1=function(E){let W=T(E);(!W||!W.tagName)&&(W={namespaceURI:Ro,tagName:"template"});let ce=ac(E.tagName),We=ac(W.tagName);return hc[E.namespaceURI]?E.namespaceURI===Za?W.namespaceURI===Mn?ce==="svg":W.namespaceURI===qa?ce==="svg"&&(We==="annotation-xml"||Ya[We]):!!am[ce]:E.namespaceURI===qa?W.namespaceURI===Mn?ce==="math":W.namespaceURI===Za?ce==="math"&&Ka[We]:!!sm[ce]:E.namespaceURI===Mn?W.namespaceURI===Za&&!Ka[We]||W.namespaceURI===qa&&!Ya[We]?!1:!sm[ce]&&(c1[ce]||!am[ce]):!!(Oi==="application/xhtml+xml"&&hc[E.namespaceURI]):!1},kn=function(E){Ba(t.removed,{element:E});try{T(E).removeChild(E)}catch{k(E)}},Xa=function(E,W){try{Ba(t.removed,{attribute:W.getAttributeNode(E),from:W})}catch{Ba(t.removed,{attribute:null,from:W})}if(W.removeAttribute(E),E==="is")if(Po||Ha)try{kn(W)}catch{}else try{W.setAttribute(E,"")}catch{}},lm=function(E){let W=null,ce=null;if(mc)E="<remove></remove>"+E;else{let pt=mw(E,/^[\r\n\t ]+/);ce=pt&&pt[0]}Oi==="application/xhtml+xml"&&Ro===Mn&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let We=g?g.createHTML(E):E;if(Ro===Mn)try{W=new f().parseFromString(We,Oi)}catch{}if(!W||!W.documentElement){W=S.createDocument(Ro,"template",null);try{W.documentElement.innerHTML=gc?x:We}catch{}}let xt=W.body||W.documentElement;return E&&ce&&xt.insertBefore(n.createTextNode(ce),xt.childNodes[0]||null),Ro===Mn?N.call(W,Pr?"html":"body")[0]:Pr?W.documentElement:xt},cm=function(E){return P.call(E.ownerDocument||E,E,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},yc=function(E){return E instanceof d&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof u)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},um=function(E){return typeof s=="function"&&E instanceof s};function Dn(pe,E,W){oc(pe,ce=>{ce.call(t,E,W,Oo)})}let dm=function(E){let W=null;if(Dn(F.beforeSanitizeElements,E,null),yc(E))return kn(E),!0;let ce=lt(E.nodeName);if(Dn(F.uponSanitizeElement,E,{tagName:ce,allowedTags:te}),E.hasChildNodes()&&!um(E.firstElementChild)&&Dt(/<[/\w]/g,E.innerHTML)&&Dt(/<[/\w]/g,E.textContent)||E.nodeType===ja.progressingInstruction||uc&&E.nodeType===ja.comment&&Dt(/<[/\w]/g,E.data))return kn(E),!0;if(!te[ce]||$n[ce]){if(!$n[ce]&&fm(ce)&&(He.tagNameCheck instanceof RegExp&&Dt(He.tagNameCheck,ce)||He.tagNameCheck instanceof Function&&He.tagNameCheck(ce)))return!1;if(fc&&!Ao[ce]){let We=T(E)||E.parentNode,xt=b(E)||E.childNodes;if(xt&&We){let pt=xt.length;for(let Ft=pt-1;Ft>=0;--Ft){let Tn=h(xt[Ft],!0);Tn.__removalCount=(E.__removalCount||0)+1,We.insertBefore(Tn,C(E))}}}return kn(E),!0}return E instanceof l&&!f1(E)||(ce==="noscript"||ce==="noembed"||ce==="noframes")&&Dt(/<\/no(script|embed|frames)/i,E.innerHTML)?(kn(E),!0):(Eo&&E.nodeType===ja.text&&(W=E.textContent,oc([A,M,V],We=>{W=Fa(W,We," ")}),E.textContent!==W&&(Ba(t.removed,{element:E.cloneNode()}),E.textContent=W)),Dn(F.afterSanitizeElements,E,null),!1)},mm=function(E,W,ce){if(Qd&&(W==="id"||W==="name")&&(ce in n||ce in m1))return!1;if(!(cc&&!nr[W]&&Dt(Y,W))){if(!(Kd&&Dt(I,W))){if(!Le[W]||nr[W]){if(!(fm(E)&&(He.tagNameCheck instanceof RegExp&&Dt(He.tagNameCheck,E)||He.tagNameCheck instanceof Function&&He.tagNameCheck(E))&&(He.attributeNameCheck instanceof RegExp&&Dt(He.attributeNameCheck,W)||He.attributeNameCheck instanceof Function&&He.attributeNameCheck(W))||W==="is"&&He.allowCustomizedBuiltInElements&&(He.tagNameCheck instanceof RegExp&&Dt(He.tagNameCheck,ce)||He.tagNameCheck instanceof Function&&He.tagNameCheck(ce))))return!1}else if(!pc[W]){if(!Dt(de,Fa(ce,H,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&E!=="script"&&g4(ce,"data:")===0&&nm[E])){if(!(Xd&&!Dt(B,Fa(ce,H,"")))){if(ce)return!1}}}}}}return!0},fm=function(E){return E!=="annotation-xml"&&mw(E,we)},pm=function(E){Dn(F.beforeSanitizeAttributes,E,null);let{attributes:W}=E;if(!W||yc(E))return;let ce={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0},We=W.length;for(;We--;){let xt=W[We],{name:pt,namespaceURI:Ft,value:Tn}=xt,Ni=lt(pt),Pt=pt==="value"?Tn:h4(Tn);if(ce.attrName=Ni,ce.attrValue=Pt,ce.keepAttr=!0,ce.forceKeepAttr=void 0,Dn(F.uponSanitizeAttribute,E,ce),Pt=ce.attrValue,em&&(Ni==="id"||Ni==="name")&&(Xa(pt,E),Pt=s1+Pt),uc&&Dt(/((--!?|])>)|<\/(style|title)/i,Pt)){Xa(pt,E);continue}if(ce.forceKeepAttr||(Xa(pt,E),!ce.keepAttr))continue;if(!Jd&&Dt(/\/>/i,Pt)){Xa(pt,E);continue}Eo&&oc([A,M,V],hm=>{Pt=Fa(Pt,hm," ")});let gm=lt(E.nodeName);if(mm(gm,Ni,Pt)){if(g&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Ft)switch(p.getAttributeType(gm,Ni)){case"TrustedHTML":{Pt=g.createHTML(Pt);break}case"TrustedScriptURL":{Pt=g.createScriptURL(Pt);break}}try{Ft?E.setAttributeNS(Ft,pt,Pt):E.setAttribute(pt,Pt),yc(E)?kn(E):dw(t.removed)}catch{}}}Dn(F.afterSanitizeAttributes,E,null)},p1=function pe(E){let W=null,ce=cm(E);for(Dn(F.beforeSanitizeShadowDOM,E,null);W=ce.nextNode();)Dn(F.uponSanitizeShadowNode,W,null),dm(W),pm(W),W.content instanceof i&&pe(W.content);Dn(F.afterSanitizeShadowDOM,E,null)};return t.sanitize=function(pe){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,ce=null,We=null,xt=null;if(gc=!pe,gc&&(pe="<!-->"),typeof pe!="string"&&!um(pe))if(typeof pe.toString=="function"){if(pe=pe.toString(),typeof pe!="string")throw Ua("dirty is not a string, aborting")}else throw Ua("toString is not a function");if(!t.isSupported)return pe;if(dc||bc(E),t.removed=[],typeof pe=="string"&&(Ri=!1),Ri){if(pe.nodeName){let Tn=lt(pe.nodeName);if(!te[Tn]||$n[Tn])throw Ua("root node is forbidden and cannot be sanitized in-place")}}else if(pe instanceof s)W=lm("<!---->"),ce=W.ownerDocument.importNode(pe,!0),ce.nodeType===ja.element&&ce.nodeName==="BODY"||ce.nodeName==="HTML"?W=ce:W.appendChild(ce);else{if(!Po&&!Eo&&!Pr&&pe.indexOf("<")===-1)return g&&Wa?g.createHTML(pe):pe;if(W=lm(pe),!W)return Po?null:Wa?x:""}W&&mc&&kn(W.firstChild);let pt=cm(Ri?pe:W);for(;We=pt.nextNode();)dm(We),pm(We),We.content instanceof i&&p1(We.content);if(Ri)return pe;if(Po){if(Ha)for(xt=R.call(W.ownerDocument);W.firstChild;)xt.appendChild(W.firstChild);else xt=W;return(Le.shadowroot||Le.shadowrootmode)&&(xt=D.call(r,xt,!0)),xt}let Ft=Pr?W.outerHTML:W.innerHTML;return Pr&&te["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&Dt(kw,W.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
567
+ `+Ft),Eo&&oc([A,M,V],Tn=>{Ft=Fa(Ft,Tn," ")}),g&&Wa?g.createHTML(Ft):Ft},t.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bc(pe),dc=!0},t.clearConfig=function(){Oo=null,dc=!1},t.isValidAttribute=function(pe,E,W){Oo||bc({});let ce=lt(pe),We=lt(E);return mm(ce,We,W)},t.addHook=function(pe,E){typeof E=="function"&&Ba(F[pe],E)},t.removeHook=function(pe,E){if(E!==void 0){let W=f4(F[pe],E);return W===-1?void 0:p4(F[pe],W,1)[0]}return dw(F[pe])},t.removeHooks=function(pe){F[pe]=[]},t.removeAllHooks=function(){F=yw()},t}var Gd=Tw();function qd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _o=qd();function Pw(e){_o=e}var Iw=/[&<>"']/,R4=new RegExp(Iw.source,"g"),Aw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,O4=new RegExp(Aw.source,"g"),N4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sw=e=>N4[e];function Yt(e,t){if(t){if(Iw.test(e))return e.replace(R4,Sw)}else if(Aw.test(e))return e.replace(O4,Sw);return e}var $4=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M4(e){return e.replace($4,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var D4=/(^|[^\[])\^/g;function Ve(e,t){e=typeof e=="string"?e:e.source,t=t||"";let n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(D4,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function Cw(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var sc={exec:()=>null};function _w(e,t){let n=e.replace(/\|/g,(i,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Hd(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function L4(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function Ew(e,t,n,r){let o=t.href,i=t.title?Yt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;let s={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:o,title:i,text:Yt(a)}}function B4(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
568
+ `).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
569
+ `)}var _i=class{options;rules;lexer;constructor(t){this.options=t||_o}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Hd(r,`
570
+ `)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let r=n[0],o=B4(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){let o=Hd(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let r=n[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;let i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim(),o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");let a=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),s="",l="",c=!1;for(;t;){let u=!1;if(!(n=a.exec(t))||this.rules.block.hr.test(t))break;s=n[0],t=t.substring(s.length);let d=n[2].split(`
571
+ `,1)[0].replace(/^\t+/,C=>" ".repeat(3*C.length)),f=t.split(`
572
+ `,1)[0],p=0;this.options.pedantic?(p=2,l=d.trimStart()):(p=n[2].search(/[^ ]/),p=p>4?1:p,l=d.slice(p),p+=n[1].length);let y=!1;if(!d&&/^ *$/.test(f)&&(s+=f+`
573
+ `,t=t.substring(f.length+1),u=!0),!u){let C=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),T=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),g=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){let x=t.split(`
574
+ `,1)[0];if(f=x,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),T.test(f)||g.test(f)||C.test(f)||b.test(t))break;if(f.search(/[^ ]/)>=p||!f.trim())l+=`
575
+ `+f.slice(p);else{if(y||d.search(/[^ ]/)>=4||T.test(d)||g.test(d)||b.test(d))break;l+=`
576
+ `+f}!y&&!f.trim()&&(y=!0),s+=x+`
577
+ `,t=t.substring(x.length+1),d=f.slice(p)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(s)&&(c=!0));let h=null,k;this.options.gfm&&(h=/^\[[ xX]\] /.exec(l),h&&(k=h[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!h,checked:k,loose:!1,text:l,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){let d=i.items[u].tokens.filter(p=>p.type==="space"),f=d.length>0&&d.some(p=>/\n.*\n/.test(p.raw));i.loose=f}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);if(n){let r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){let n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;let r={type:"table",raw:n[0],header:_w(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
578
+ `):[]};if(r.header.length===r.align.length){let o=r.align.length,i,a,s,l;for(i=0;i<o;i++){let c=r.align[i];c&&(/^ *-+: *$/.test(c)?r.align[i]="right":/^ *:-+: *$/.test(c)?r.align[i]="center":/^ *:-+ *$/.test(c)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=_w(r.rows[i],r.header.length).map(c=>({text:c,tokens:[]}));for(o=r.header.length,a=0;a<o;a++)r.header[a].tokens=this.lexer.inline(r.header[a].text);for(o=r.rows.length,a=0;a<o;a++)for(l=r.rows[a],s=0;s<l.length;s++)l[s].tokens=this.lexer.inline(l[s].text);return r}}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let r=n[1].charAt(n[1].length-1)===`
579
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:Yt(n[1])}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let a=Hd(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=L4(n[2],"()");if(a>-1){let l=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),Ew(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Ew(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let a=[...o[0]].length-1,s,l,c=a,u=0,d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+o[0].length-1);(o=d.exec(n))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(l=[...s].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&a%3&&!((a+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);let f=[...t].slice(0,a+o.index+l+1).join("");if(Math.min(a,l)%2){let y=f.slice(1,-1);return{type:"em",raw:f,text:y,tokens:this.lexer.inlineTokens(y)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," "),o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=Yt(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){let n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=Yt(n[1]),o="mailto:"+r):(r=Yt(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=Yt(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=Yt(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=Yt(n[0]),{type:"text",raw:n[0],text:r}}}},he={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:sc,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;he.def=Ve(he.def).replace("label",he._label).replace("title",he._title).getRegex();he.bullet=/(?:[*+-]|\d{1,9}[.)])/;he.listItemStart=Ve(/^( *)(bull) */).replace("bull",he.bullet).getRegex();he.list=Ve(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex();he._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";he._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;he.html=Ve(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();he.lheading=Ve(he.lheading).replace(/bull/g,he.bullet).getRegex();he.paragraph=Ve(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.blockquote=Ve(he.blockquote).replace("paragraph",he.paragraph).getRegex();he.normal={...he};he.gfm={...he.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};he.gfm.table=Ve(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.gfm.paragraph=Ve(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",he.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.pedantic={...he.normal,html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ve(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
580
+ ]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sc,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};Q._punctuation="\\p{P}$+<=>`^|~";Q.punctuation=Ve(Q.punctuation,"u").replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;Q.anyPunctuation=/\\[punct]/g;Q._escapes=/\\([punct])/g;Q._comment=Ve(he._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=Ve(Q.emStrong.lDelim,"u").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=Ve(Q.emStrong.rDelimAst,"gu").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=Ve(Q.emStrong.rDelimUnd,"gu").replace(/punct/g,Q._punctuation).getRegex();Q.anyPunctuation=Ve(Q.anyPunctuation,"gu").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=Ve(Q._escapes,"gu").replace(/punct/g,Q._punctuation).getRegex();Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=Ve(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=Ve(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=Ve(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=Ve(Q.reflink).replace("label",Q._label).replace("ref",he._label).getRegex();Q.nolink=Ve(Q.nolink).replace("ref",he._label).getRegex();Q.reflinkSearch=Ve(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:Ve(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Q.gfm.url=Ve(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex();Q.breaks={...Q.gfm,br:Ve(Q.br).replace("{2,}","*").getRegex(),text:Ve(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var er=class e{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||_o,this.options.tokenizer=this.options.tokenizer||new _i,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:he.normal,inline:Q.normal};this.options.pedantic?(n.block=he.pedantic,n.inline=Q.pedantic):this.options.gfm&&(n.block=he.gfm,this.options.breaks?n.inline=Q.breaks:n.inline=Q.gfm),this.tokenizer.rules=n}static get rules(){return{block:he,inline:Q}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
581
+ `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,c)=>l+" ".repeat(c.length));let r,o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
582
+ `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
583
+ `+r.raw,o.text+=`
584
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
585
+ `+r.raw,o.text+=`
586
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],a&&o.type==="paragraph"?(o.raw+=`
587
+ `+r.raw,o.text+=`
588
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),a=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
589
+ `+r.raw,o.text+=`
590
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,a=t,s,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,a,c)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},Ei=class{options;constructor(t){this.options=t||_o}code(t,n,r){let o=(n||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
591
+ `,o?'<pre><code class="language-'+Yt(o)+'">'+(r?t:Yt(t,!0))+`</code></pre>
592
+ `:"<pre><code>"+(r?t:Yt(t,!0))+`</code></pre>
593
593
  `}blockquote(t){return`<blockquote>
594
594
  ${t}</blockquote>
595
- `}html(t,r){return t}heading(t,r,n){return`<h${r}>${t}</h${r}>
595
+ `}html(t,n){return t}heading(t,n,r){return`<h${n}>${t}</h${n}>
596
596
  `}hr(){return`<hr>
597
- `}list(t,r,n){let o=r?"ol":"ul",i=r&&n!==1?' start="'+n+'"':"";return"<"+o+i+`>
597
+ `}list(t,n,r){let o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
598
598
  `+t+"</"+o+`>
599
- `}listitem(t,r,n){return`<li>${t}</li>
599
+ `}listitem(t,n,r){return`<li>${t}</li>
600
600
  `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
601
- `}table(t,r){return r&&(r=`<tbody>${r}</tbody>`),`<table>
601
+ `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
602
602
  <thead>
603
603
  `+t+`</thead>
604
- `+r+`</table>
604
+ `+n+`</table>
605
605
  `}tablerow(t){return`<tr>
606
606
  ${t}</tr>
607
- `}tablecell(t,r){let n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+`</${n}>
608
- `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,r,n){let o=Vv(t);if(o===null)return n;t=o;let i='<a href="'+t+'"';return r&&(i+=' title="'+r+'"'),i+=">"+n+"</a>",i}image(t,r,n){let o=Vv(t);if(o===null)return n;t=o;let i=`<img src="${t}" alt="${n}"`;return r&&(i+=` title="${r}"`),i+=">",i}text(t){return t}},Ui=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}},$r=class e{options;renderer;textRenderer;constructor(t){this.options=t||Ln,this.options.renderer=this.options.renderer||new Ro,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ui}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(t,r=!0){let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=s||"";continue}}switch(i.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{let a=i;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,KR(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{let a=i;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{let a=i,s="",l="";for(let u=0;u<a.header.length;u++)l+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:!0,align:a.align[u]});s+=this.renderer.tablerow(l);let c="";for(let u=0;u<a.rows.length;u++){let d=a.rows[u];l="";for(let p=0;p<d.length;p++)l+=this.renderer.tablecell(this.parseInline(d[p].tokens),{header:!1,align:a.align[p]});c+=this.renderer.tablerow(l)}n+=this.renderer.table(s,c);continue}case"blockquote":{let a=i,s=this.parse(a.tokens);n+=this.renderer.blockquote(s);continue}case"list":{let a=i,s=a.ordered,l=a.start,c=a.loose,u="";for(let d=0;d<a.items.length;d++){let p=a.items[d],f=p.checked,x=p.task,h="";if(p.task){let w=this.renderer.checkbox(!!f);c?p.tokens.length>0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=w+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=w+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:w+" "}):h+=w+" "}h+=this.parse(p.tokens,c),u+=this.renderer.listitem(h,x,!!f)}n+=this.renderer.list(u,s,l);continue}case"html":{let a=i;n+=this.renderer.html(a.text,a.block);continue}case"paragraph":{let a=i;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=i,s=a.tokens?this.parseInline(a.tokens):a.text;for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],s+=`
609
- `+(a.tokens?this.parseInline(a.tokens):a.text);n+=r?this.renderer.paragraph(s):s;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}switch(i.type){case"escape":{let a=i;n+=r.text(a.text);break}case"html":{let a=i;n+=r.html(a.text);break}case"link":{let a=i;n+=r.link(a.href,a.title,this.parseInline(a.tokens,r));break}case"image":{let a=i;n+=r.image(a.href,a.title,a.text);break}case"strong":{let a=i;n+=r.strong(this.parseInline(a.tokens,r));break}case"em":{let a=i;n+=r.em(this.parseInline(a.tokens,r));break}case"codespan":{let a=i;n+=r.codespan(a.text);break}case"br":{n+=r.br();break}case"del":{let a=i;n+=r.del(this.parseInline(a.tokens,r));break}case"text":{let a=i;n+=r.text(a.text);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},Io=class{options;constructor(t){this.options=t||Ln}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},Au=class{defaults=Ru();options=this.setOptions;parse=this.#s(Or.lex,$r.parse);parseInline=this.#s(Or.lexInline,$r.parseInline);Parser=$r;parser=$r.parse;Renderer=Ro;TextRenderer=Ui;Lexer=Or;lexer=Or.lex;Tokenizer=Ao;Hooks=Io;constructor(...t){this.use(...t)}walkTokens(t,r){let n=[];for(let o of t)switch(n=n.concat(r.call(this,o)),o.type){case"table":{let i=o;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,r));for(let a of i.rows)for(let s of a)n=n.concat(this.walkTokens(s.tokens,r));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,r));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{n=n.concat(this.walkTokens(i[a],r))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=r.renderers[i.name];a?r.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:r.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[i.level];a?a.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens)}),o.extensions=r),n.renderer){let i=this.defaults.renderer||new Ro(this.defaults);for(let a in n.renderer){let s=n.renderer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Ao(this.defaults);for(let a in n.tokenizer){let s=n.tokenizer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Io;for(let a in n.hooks){let s=n.hooks[a],l=a,c=i[l];Io.passThroughHooks.has(a)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(p=>c.call(i,p));let d=s.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;o.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}#s(t,r){return(n,o)=>{let i={...o},a={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);let s=this.#r(!!a.silent,!!a.async);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(l=>t(l,a)).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>r(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let l=t(n,a);a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=r(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return s(l)}}}#r(t,r){return n=>{if(n.message+=`
610
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Nt(n.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(n);throw n}}},Dn=new Au;function Pe(e,t){return Dn.parse(e,t)}Pe.options=Pe.setOptions=function(e){return Dn.setOptions(e),Pe.defaults=Dn.defaults,Hv(Pe.defaults),Pe};Pe.getDefaults=Ru;Pe.defaults=Ln;Pe.use=function(...e){return Dn.use(...e),Pe.defaults=Dn.defaults,Hv(Pe.defaults),Pe};Pe.walkTokens=function(e,t){return Dn.walkTokens(e,t)};Pe.parseInline=Dn.parseInline;Pe.Parser=$r;Pe.parser=$r.parse;Pe.Renderer=Ro;Pe.TextRenderer=Ui;Pe.Lexer=Or;Pe.lexer=Or.lex;Pe.Tokenizer=Ao;Pe.Hooks=Io;Pe.parse=Pe;var AK=Pe.options,RK=Pe.setOptions,OK=Pe.use,$K=Pe.walkTokens,NK=Pe.parseInline;var MK=$r.parse,DK=Or.lex;var QR=C('<div class="flex flex-col animate-fade-in makebot-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:100%;height:100%></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),e3=C("<span>"),qv=e=>{Pe.use({renderer:{link:(r,n,o)=>`<a href="${r}" target="_blank" rel="noopener noreferrer">${o}</a>`}});let t=ee(()=>Array.isArray(e.content)?e.content:e.content.split("```").flatMap((r,n)=>n%2===0?r.split(`
607
+ `}tablecell(t,n){let r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
608
+ `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){let o=Cw(t);if(o===null)return r;t=o;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){let o=Cw(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return t}},za=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}},tr=class e{options;renderer;textRenderer;constructor(t){this.options=t||_o,this.options.renderer=this.options.renderer||new Ei,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new za}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=s||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{let a=i;r+=this.renderer.heading(this.parseInline(a.tokens),a.depth,M4(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{let a=i;r+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{let a=i,s="",l="";for(let u=0;u<a.header.length;u++)l+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:!0,align:a.align[u]});s+=this.renderer.tablerow(l);let c="";for(let u=0;u<a.rows.length;u++){let d=a.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:a.align[f]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(s,c);continue}case"blockquote":{let a=i,s=this.parse(a.tokens);r+=this.renderer.blockquote(s);continue}case"list":{let a=i,s=a.ordered,l=a.start,c=a.loose,u="";for(let d=0;d<a.items.length;d++){let f=a.items[d],p=f.checked,y=f.task,h="";if(f.task){let k=this.renderer.checkbox(!!p);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=k+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=k+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:k+" "}):h+=k+" "}h+=this.parse(f.tokens,c),u+=this.renderer.listitem(h,y,!!p)}r+=this.renderer.list(u,s,l);continue}case"html":{let a=i;r+=this.renderer.html(a.text,a.block);continue}case"paragraph":{let a=i;r+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=i,s=a.tokens?this.parseInline(a.tokens):a.text;for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],s+=`
609
+ `+(a.tokens?this.parseInline(a.tokens):a.text);r+=n?this.renderer.paragraph(s):s;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=a||"";continue}}switch(i.type){case"escape":{let a=i;r+=n.text(a.text);break}case"html":{let a=i;r+=n.html(a.text);break}case"link":{let a=i;r+=n.link(a.href,a.title,this.parseInline(a.tokens,n));break}case"image":{let a=i;r+=n.image(a.href,a.title,a.text);break}case"strong":{let a=i;r+=n.strong(this.parseInline(a.tokens,n));break}case"em":{let a=i;r+=n.em(this.parseInline(a.tokens,n));break}case"codespan":{let a=i;r+=n.codespan(a.text);break}case"br":{r+=n.br();break}case"del":{let a=i;r+=n.del(this.parseInline(a.tokens,n));break}case"text":{let a=i;r+=n.text(a.text);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Ci=class{options;constructor(t){this.options=t||_o}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},Wd=class{defaults=qd();options=this.setOptions;parse=this.#s(er.lex,tr.parse);parseInline=this.#s(er.lexInline,tr.parseInline);Parser=tr;parser=tr.parse;Renderer=Ei;TextRenderer=za;Lexer=er;lexer=er.lex;Tokenizer=_i;Hooks=Ci;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let i=o;for(let a of i.header)r=r.concat(this.walkTokens(a.tokens,n));for(let a of i.rows)for(let s of a)r=r.concat(this.walkTokens(s.tokens,n));break}case"list":{let i=o;r=r.concat(this.walkTokens(i.items,n));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{r=r.concat(this.walkTokens(i[a],n))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=n.renderers[i.name];a?n.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=n[i.level];a?a.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){let i=this.defaults.renderer||new Ei(this.defaults);for(let a in r.renderer){let s=r.renderer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new _i(this.defaults);for(let a in r.tokenizer){let s=r.tokenizer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new Ci;for(let a in r.hooks){let s=r.hooks[a],l=a,c=i[l];Ci.passThroughHooks.has(a)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(f=>c.call(i,f));let d=s.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;o.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}#s(t,n){return(r,o)=>{let i={...o},a={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);let s=this.#n(!!a.silent,!!a.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(l=>t(l,a)).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>n(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let l=t(r,a);a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=n(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return s(l)}}}#n(t,n){return r=>{if(r.message+=`
610
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Yt(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}},Co=new Wd;function De(e,t){return Co.parse(e,t)}De.options=De.setOptions=function(e){return Co.setOptions(e),De.defaults=Co.defaults,Pw(De.defaults),De};De.getDefaults=qd;De.defaults=_o;De.use=function(...e){return Co.use(...e),De.defaults=Co.defaults,Pw(De.defaults),De};De.walkTokens=function(e,t){return Co.walkTokens(e,t)};De.parseInline=Co.parseInline;De.Parser=tr;De.parser=tr.parse;De.Renderer=Ei;De.TextRenderer=za;De.Lexer=er;De.lexer=er.lex;De.Tokenizer=_i;De.Hooks=Ci;De.parse=De;var cJ=De.options,uJ=De.setOptions,dJ=De.use,mJ=De.walkTokens,fJ=De.parseInline;var pJ=tr.parse,gJ=er.lex;var F4=w('<div class="flex flex-col animate-fade-in makebot-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:100%;height:100%></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),U4=w("<span>"),Rw=e=>{De.use({renderer:{link:(n,r,o)=>`<a href="${n}" target="_blank" rel="noopener noreferrer">${o}</a>`}});let t=re(()=>Array.isArray(e.content)?e.content:e.content.split("```").flatMap((n,r)=>r%2===0?n.split(`
611
611
 
612
- `).map(o=>_u.sanitize(Pe.parse(o.replace(/【.+】/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:!0}),{ADD_ATTR:["target"]})):[_u.sanitize(Pe.parse("```"+r+"```".replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:!0}),{ADD_ATTR:["target"]})])?.filter(pe)??[]);return(()=>{var r=QR(),n=r.firstChild,o=n.firstChild,i=o.firstChild,a=i.nextSibling;return v(a,m(we,{get each(){return t()},children:s=>(()=>{var l=e3();return l.innerHTML=s,l})()})),r})()};var t3=C('<div class="flex flex-shrink-0 items-center relative makebot-avatar-container w-6 @xs:w-10"><div>'),Vi=e=>{let t,[r,n]=O(0),o=new ResizeObserver(i=>{n(i[0].target.clientHeight)});return ae(()=>{t&&o.observe(t)}),re(()=>{t&&o.unobserve(t)}),(()=>{var i=t3(),a=i.firstChild,s=t;return typeof s=="function"?ge(s,i):t=i,v(a,m(qs,{get src(){return e.theme.chat?.hostAvatar?.url},get isChatContainerLight(){return oo({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})),$(l=>{var c=`${r()}px`,u=q("absolute flex items-center w-6 h-6 @xs:w-10 @xs:h-10 top-[max(0px,calc(var(--top)-24px))] @xs:top-[max(0px,calc(var(--top)-40px))]",e.hideAvatar?"opacity-0":"opacity-100"),d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return c!==l.e&&ne(i,"--top",l.e=c),u!==l.t&&V(a,l.t=u),d!==l.a&&ne(a,"transition",l.a=d),l},{e:void 0,t:void 0,a:void 0}),i})()};var r3=C('<div class="flex gap-1 @xs:gap-2 w-full"><div>'),n3=C('<div class="flex gap-1 @xs:gap-2"><div>'),o3=C('<div class="flex flex-col w-full min-w-0 gap-2 makebot-chat-chunk">'),Yv=e=>{let t,[r,n]=O(e.isTransitionDisabled?e.messages.length:0),[o,i]=O();ae(()=>{e.streamingMessage||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom({lastElement:t,offset:50}))});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??at.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(c=>setTimeout(c,(e.settings.typingEmulation?.delayBetweenBubbles??at.typingEmulation.delayBetweenBubbles)*1e3));let l=e.messages[r()].id;await e.onNewBubbleDisplayed(l),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom({lastElement:s}),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed())};return(()=>{var s=o3();return v(s,m(U,{get when(){return e.messages.length>0},get children(){var l=r3(),c=l.firstChild;return v(l,m(U,{get when(){return L(()=>!!(e.theme.chat?.hostAvatar?.isEnabled??yr))()&&e.messages.length>0},get children(){return m(Vi,{get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled},get theme(){return e.theme}})}}),c),v(c,m(we,{get each(){return e.messages.slice(0,r()+1)},children:(u,d)=>m(Sv,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return L(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??at.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&d()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),$(()=>V(c,q("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??Xo?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),v(s,m(U,{get when(){return L(()=>!!(e.input&&r()===e.messages.length&&!e.input.isHidden))()&&!e.isSessionFinalized},get children(){return m(av,{ref(l){var c=t;typeof c=="function"?c(l):t=l},get input(){return e.input},get chunkIndex(){return e.index},get theme(){return e.theme},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??at.general.isInputPrefillEnabled},onTransitionEnd:()=>e.onScrollToBottom({lastElement:o()}),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}}),null),v(s,m(U,{get when(){return e.streamingMessage},get children(){var l=n3(),c=l.firstChild;return v(l,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??yr},get children(){return m(Vi,{get hideAvatar(){return e.hideAvatar},get theme(){return e.theme}})}}),c),v(c,m(U,{get when(){return e.streamingMessage},children:u=>m(qv,{get content(){return u()}})})),$(()=>V(c,q("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??Xo?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),s})()};var i3=C('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:64px;height:32px></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),Kv=()=>(()=>{var e=i3(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return v(n,m(Ke,{})),e})();var a3=C('<div class="flex w-full makebot-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),Xv=e=>(()=>{var t=a3(),r=t.firstChild,n=r.firstChild;return v(n,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??yr},get children(){return m(Vi,{get theme(){return e.theme}})}}),null),v(n,m(Kv,{}),null),t})();var l3=C('<div><div><div class="w-full flex flex-col gap-2 @xs:px-5 px-3">'),c3=C('<div class="w-full flex-shrink-0 makebot-bottom-spacer h-5">'),u3=.6,d3=50,Qv=e=>{let t,r=sa(),[n,o]=Jo(O([{version:"2",input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions,dynamicTheme:e.initialChatReply.dynamicTheme}]),{key:`makebot-${e.context.makebot.id}-chatChunks`,storage:e.context.storage,transformInitDataFromStorage:I=>Iy(I,{storage:e.context.storage,makebotId:e.context.makebot.id}),onRecovered:()=>{setTimeout(()=>{f()?.scrollTo(0,f().scrollHeight)},200)}}),[i,a]=Jo(O(!1),{key:`makebot-${e.context.makebot.id}-isEnded`,storage:e.context.storage}),[s,l]=O(!1),[c,u]=O(!0),[d,p]=O(!1);ae(()=>{window.addEventListener("message",A),window.addEventListener("makebot-api-response",I=>{console.log("\u{1F50D} Evento de resposta da API recebido:",I.detail),I.detail?.response&&y({data:I.detail.response,error:void 0})}),(async()=>{if(n().length>1){x();let B=n().findLast(j=>j.dynamicTheme?.backgroundUrl)?.dynamicTheme;B?.backgroundUrl&&Jv(B.backgroundUrl,r()?.style),n().at(-1)?.input?.answer&&b(n().at(-1)?.input?.answer)}await P()})()});let f=()=>r()?.querySelector(".scrollable-container"),x=()=>{n().at(-1)?.streamingMessage&&o(I=>I.slice(0,-1))},h=({message:I})=>{l(!1),u(!1),n().at(-1)?.streamingMessage?o(B=>B.map((j,he)=>he===B.length-1?{...j,messages:[],streamingMessage:I}:j)):o(B=>[...B,{version:"2",messages:[],streamingMessage:I}])},w=async I=>{if(!I||(e.onNewLogs?.(I),e.context.isPreview))return;let B=e.initialChatReply.sessionId;B&&await Mc({apiHost:e.context.apiHost,sessionId:B,clientLogs:I})},T=()=>{$t.create({title:e.context.makebot.settings.general?.systemMessages?.networkErrorTitle??Lt.networkErrorTitle,description:e.context.makebot.settings.general?.systemMessages?.networkErrorMessage??Lt.networkErrorMessage})},b=async I=>{if(d())return;let B=n().at(-1);if(I&&I.type!=="clientSideResult"&&o(Zv(I)),B?.clientSideActions&&B.clientSideActions.length>0&&B.input?.answer?.status==="retry"){await P();return}B?.input?.id&&I&&I.type!=="clientSideResult"&&e.onAnswer&&e.onAnswer({message:_y(I),blockId:B.input.id});let j=e.initialChatReply.sessionId;if(!j)return;let he=setTimeout(()=>{l(!0)},1e3);g();let{data:le,error:Q}=await ki({apiHost:e.context.apiHost,sessionId:j,message:f3(I)});clearTimeout(he),l(!1),await y({data:le,error:Q})},y=async({data:I,error:B})=>{if(B){let j=B instanceof Error?B.message:String(B);if(j.includes("Sess\xE3o n\xE3o encontrada")||j.includes("NOT_FOUND")||B?.code==="NOT_FOUND"||B?.response?.status===404||B?.type==="HTTP_ERROR"){p(!0),a(!0);let _e=e.initialChatReply.makebot.settings.general?.systemMessages?.sessionFinalized??Lt.sessionFinalized;o(jt=>[...jt,{version:"2",messages:[{id:`finalization-${Date.now()}`,type:"text",content:{type:"richText",richText:[{type:"p",children:[{text:_e}]}]}}],input:void 0,clientSideActions:[]}]);return}let le=[await Jr({err:B,context:"Ao enviar mensagem"})];e.onNewLogs?.(le);let Q=e.initialChatReply.sessionId;Q&&await Mc({apiHost:e.context.apiHost,sessionId:Q,clientLogs:le});return}I&&(I.progress&&e.onProgressUpdate?.(I.progress),I.lastMessageNewFormat&&o(g3(I.lastMessageNewFormat)),I.logs&&e.onNewLogs?.(I.logs),I.dynamicTheme?.backgroundUrl&&Jv(I.dynamicTheme.backgroundUrl,r()?.style),I.input&&e.onNewInputBlock&&e.onNewInputBlock(I.input),o(b3(I)),await P())},g=({lastElement:I,offset:B=0}={})=>{let j=f();if(!j||j.scrollTop+j.clientHeight<j.scrollHeight-j.clientHeight*u3&&!c())return;let le=Q=>{let Ge,_e=()=>{clearTimeout(Ge),Ge=window.setTimeout(()=>{Q(),j?.removeEventListener("scroll",_e)},100)};j?.addEventListener("scroll",_e,{passive:!0})};setTimeout(()=>{le(()=>{if(!j)return;let Q=Math.abs(j.scrollHeight-j.scrollTop-j.clientHeight)<2;u(Q)}),j?.scrollTo({top:I?I.offsetTop-B:j?.scrollHeight,behavior:"smooth"})},d3)},k=async()=>{let I=n().at(-1);I&&Ze(I.input)&&(a(!0),e.onEnd?.())},S=async I=>{await P(I)},P=async I=>{let B=!1,j=[];for(let le of n().at(-1)?.clientSideActions??[]){if(I!==le.lastBubbleBlockId)break;j.push(le)}if(j.length===0)return;let he=e.initialChatReply.sessionId;if(he)for(let le of j){("streamOpenAiChatCompletion"in le||"webhookToExecute"in le||"stream"in le)&&l(!0);let Q=await Py({clientSideAction:le,context:{apiHost:e.context.apiHost,wsHost:e.context.wsHost,sessionId:he,resultId:e.initialChatReply.resultId},onMessageStream:h,onStreamError:async Ge=>{o(v3),B=!0,await w([Ge]),e.onNewLogs?.([Ge])}});if(("streamOpenAiChatCompletion"in le||"stream"in le)&&Q&&"replyToSend"in Q&&!Q.replyToSend){l(!1);continue}if(B)return;if(o(h3),Q&&"logs"in Q&&w(Q.logs),Q&&"replyToSend"in Q){l(!1),b(Q.replyToSend?{type:"clientSideResult",result:Q.replyToSend}:void 0);return}Q&&"blockedPopupUrl"in Q&&$t.create({title:e.context.makebot.settings.general?.systemMessages?.popupBlockedTitle??Lt.popupBlockedTitle,description:e.context.makebot.settings.general?.systemMessages?.popupBlockedDescription??Lt.popupBlockedDescription,meta:{link:Q.blockedPopupUrl}}),Q&&"scriptCallbackMessage"in Q&&e.onScriptExecutionSuccess?.(Q.scriptCallbackMessage)}};re(()=>{window.removeEventListener("message",A)});let A=async I=>{let{data:B}=I;!B.isFromMakebot||B.id&&e.context.makebot.id!==B.id||B.command==="sendCommand"&&!i()&&await N(B.text)},N=async(I,B=0,j=5)=>{if(s()){if(B>=j)throw new Error("O n\xFAmero m\xE1ximo de tentativas de repeti\xE7\xE3o para o comando foi atingido");return await new Promise(jt=>setTimeout(jt,5e3)),N(I,B+1,j)}let he=e.initialChatReply.sessionId;if(!he)return;let le=setTimeout(()=>{l(!0)},1e3);g();let{data:Q,error:Ge}=await ki({apiHost:e.context.apiHost,sessionId:he,message:{type:"command",command:I}});return clearTimeout(le),l(!1),n().at(-1)?.input?.id&&Q&&o(p3),y({data:Q,error:Ge})},D=I=>{o(Zv({type:"text",value:I})),b(void 0)},F=ee(()=>Ko(e.initialChatReply.makebot.theme,n().findLast(I=>I.dynamicTheme)?.dynamicTheme)),R=ry(()=>t),M=ee(()=>(e.initialChatReply.makebot.theme.chat?.container?.backgroundColor??sn)==="transparent"),z=ee(()=>n().filter(x3)),K=ee(()=>{let I=z(),B=s();return I.map((j,he)=>{let le=I[he+1];return((!j.input||j.input?.isHidden)&&((le?.messages?.length??0)>0||le?.streamingMessage!==void 0||j.messages.length>0&&B))??!1})});return m(Nc.Provider,{value:R,get children(){var I=l3(),B=I.firstChild,j=B.firstChild,he=t;return typeof he=="function"?ge(he,B):t=B,v(j,m(Go,{get each(){return z()},children:(le,Q)=>{let Ge=le().messages.some(_e=>_e.id?.startsWith("finalization-"));return m(Yv,{index:Q,get messages(){return le().messages},get input(){return le().input},get theme(){return Ko(e.initialChatReply.makebot.theme,le().dynamicTheme)},get settings(){return e.initialChatReply.makebot.settings},get context(){return e.context},get hideAvatar(){return K()[Q]},get isTransitionDisabled(){return Ge||Q!==z().length-1},get streamingMessage(){return le().streamingMessage},get isSessionFinalized(){return d()},onNewBubbleDisplayed:S,onAllBubblesDisplayed:k,onSubmit:b,onScrollToBottom:g,onSkip:D})}}),null),v(j,m(U,{get when(){return s()},get children(){return m(Xv,{get theme(){return F()}})}}),null),v(B,m(m3,{}),null),$(le=>{var Q=q("w-full h-full px-[calc((100%-var(--makebot-chat-container-max-width))/2)]",M()?"overflow-y-auto scroll-smooth scrollable-container":"@container flex @xs:items-center"),Ge=q("@container relative makebot-chat-view w-full flex flex-col items-center pt-5 max-w-chat-container",M()?void 0:q("overflow-y-auto scroll-smooth scrollable-container","@xs:min-h-chat-container max-h-full @xs:max-h-chat-container @xs:rounded-chat-container"));return Q!==le.e&&V(I,le.e=Q),Ge!==le.t&&V(B,le.t=Ge),le},{e:void 0,t:void 0}),I}})},m3=()=>c3(),f3=e=>{if(e){if(e.type==="clientSideResult")return{type:"text",text:e.result};if(e.type==="text")return{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return{type:"audio",url:e.url}}},p3=e=>{let t=e[e.length-1];return!t||!t.input||t.input.answer?e:e.map((r,n)=>n===e.length-1?{...r,input:{...r.input,isHidden:!0}}:r)},g3=e=>t=>{let r=t[t.length-1];return!r||!r.input||!r.input.answer||r.input.answer.type==="recording"||r.input.answer?.type==="text"&&r.input.answer.label?t:r.input.type!=="file input"?t.map((n,o)=>o===t.length-1?{...n,input:{...n.input,answer:{...n.input.answer,label:e}}}:n):t},Zv=e=>t=>{let r=t[t.length-1];return!r||!r.input?t:t.map((n,o)=>o===t.length-1?{...n,input:{...n.input,answer:e}}:n)},h3=e=>{let t=e[e.length-1];return!t||!t.clientSideActions?e:e.reduce((r,n,o)=>{if(o===e.length-1){let i=n.clientSideActions.slice(1);if(i.length===0&&n.messages.length===0&&!n.input)return r;r.push({...n,clientSideActions:i})}else r.push(n);return r},[])},Jv=(e,t)=>{Ml({background:{type:"Image",content:e},documentStyle:t??document.documentElement.style,makebotVersion:"6.1"})},b3=e=>t=>[...t,{version:"2",clientSideActions:e.clientSideActions,input:e.input,dynamicTheme:e.dynamicTheme,messages:y3(e.messages)}],y3=e=>e.filter(t=>t.type!=="text"||t.content.type!=="richText"||t.content.richText.length>1||t.content.richText[0].type!=="variable"||t.content.richText[0].children.length>0),x3=e=>!e.clientSideActions||e.clientSideActions.every(t=>t.lastBubbleBlockId),v3=e=>{let t=e[e.length-1];return!t||!t.input||!t.input.answer?e:e.map((r,n)=>n===e.length-1?{...r,input:{...r.input,answer:{...r.input.answer,status:"retry"}}}:r)};var w3=C('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),e0=e=>(()=>{var t=w3(),r=t.firstChild,n=r.nextSibling;return v(r,()=>e.error.message),v(n,()=>JSON.stringify(e.error.cause,null,2)),t})();var k3=C(`<svg viewBox="0 0 234 38"width=120 fill=#000000><path fill=#22C55E d="M13.5489721,3.8939648c-5.0947256,0-9.4274693,3.2543087-11.0383406,7.7968044
612
+ `).map(o=>Gd.sanitize(De.parse(o.replace(/【.+】/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:!0}),{ADD_ATTR:["target"]})):[Gd.sanitize(De.parse("```"+n+"```".replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:!0}),{ADD_ATTR:["target"]})])?.filter(Ue)??[]);return(()=>{var n=F4(),r=n.firstChild,o=r.firstChild,i=o.firstChild,a=i.nextSibling;return v(a,m(Re,{get each(){return t()},children:s=>(()=>{var l=U4();return l.innerHTML=s,l})()})),n})()};var V4=w('<div class="flex flex-shrink-0 items-center relative makebot-avatar-container w-6 @xs:w-10"><div>'),Ga=e=>{let t,[n,r]=O(0),o=new ResizeObserver(i=>{r(i[0].target.clientHeight)});return me(()=>{t&&o.observe(t)}),ie(()=>{t&&o.unobserve(t)}),(()=>{var i=V4(),a=i.firstChild,s=t;return typeof s=="function"?ke(s,i):t=i,v(a,m(tc,{get src(){return e.theme.chat?.hostAvatar?.url},get isChatContainerLight(){return qo({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})),$(l=>{var c=`${n()}px`,u=q("absolute flex items-center w-6 h-6 @xs:w-10 @xs:h-10 top-[max(0px,calc(var(--top)-24px))] @xs:top-[max(0px,calc(var(--top)-40px))]",e.hideAvatar?"opacity-0":"opacity-100"),d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return c!==l.e&&ae(i,"--top",l.e=c),u!==l.t&&G(a,l.t=u),d!==l.a&&ae(a,"transition",l.a=d),l},{e:void 0,t:void 0,a:void 0}),i})()};var j4=w('<div class="flex gap-1 @xs:gap-2 w-full"><div>'),z4=w('<div class="flex gap-1 @xs:gap-2"><div>'),G4=w('<div class="flex flex-col w-full min-w-0 gap-2 makebot-chat-chunk">'),Ow=e=>{let t,[n,r]=O(e.isTransitionDisabled?e.messages.length:0),[o,i]=O();me(()=>{e.streamingMessage||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom({lastElement:t,offset:50}))});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??ht.typingEmulation.delayBetweenBubbles)>0&&n()<e.messages.length-1&&await new Promise(c=>setTimeout(c,(e.settings.typingEmulation?.delayBetweenBubbles??ht.typingEmulation.delayBetweenBubbles)*1e3));let l=e.messages[n()].id;await e.onNewBubbleDisplayed(l),r(n()===e.messages.length?n():n()+1),e.onScrollToBottom({lastElement:s}),n()===e.messages.length&&(i(s),e.onAllBubblesDisplayed())};return(()=>{var s=G4();return v(s,m(U,{get when(){return e.messages.length>0},get children(){var l=j4(),c=l.firstChild;return v(l,m(U,{get when(){return L(()=>!!(e.theme.chat?.hostAvatar?.isEnabled??Ln))()&&e.messages.length>0},get children(){return m(Ga,{get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled},get theme(){return e.theme}})}}),c),v(c,m(Re,{get each(){return e.messages.slice(0,n()+1)},children:(u,d)=>m(cw,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return L(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??ht.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&d()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),$(()=>G(c,q("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??Wi?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),v(s,m(U,{get when(){return L(()=>!!(e.input&&n()===e.messages.length&&!e.input.isHidden))()&&!e.isSessionFinalized},get children(){return m(G0,{ref(l){var c=t;typeof c=="function"?c(l):t=l},get input(){return e.input},get chunkIndex(){return e.index},get theme(){return e.theme},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??ht.general.isInputPrefillEnabled},onTransitionEnd:()=>e.onScrollToBottom({lastElement:o()}),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}}),null),v(s,m(U,{get when(){return e.streamingMessage},get children(){var l=z4(),c=l.firstChild;return v(l,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Ln},get children(){return m(Ga,{get hideAvatar(){return e.hideAvatar},get theme(){return e.theme}})}}),c),v(c,m(U,{get when(){return e.streamingMessage},children:u=>m(Rw,{get content(){return u()}})})),$(()=>G(c,q("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??Wi?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),s})()};var H4=w('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:64px;height:32px></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),Nw=()=>(()=>{var e=H4(),t=e.firstChild,n=t.firstChild,r=n.firstChild;return v(r,m(tt,{})),e})();var W4=w('<div class="flex w-full makebot-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),$w=e=>(()=>{var t=W4(),n=t.firstChild,r=n.firstChild;return v(r,m(U,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Ln},get children(){return m(Ga,{get theme(){return e.theme}})}}),null),v(r,m(Nw,{}),null),t})();var Z4=w('<div><div><div class="w-full flex flex-col gap-2 @xs:px-5 px-3">'),Y4=w('<div class="w-full flex-shrink-0 makebot-bottom-spacer h-5">'),K4=.6,X4=50,Lw=e=>{let t,n=us(),[r,o]=Zi(O([{version:"2",input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions,dynamicTheme:e.initialChatReply.dynamicTheme}]),{key:`makebot-${e.context.makebot.id}-chatChunks`,storage:e.context.storage,transformInitDataFromStorage:I=>rx(I,{storage:e.context.storage,makebotId:e.context.makebot.id}),onRecovered:()=>{setTimeout(()=>{p()?.scrollTo(0,p().scrollHeight)},200)}}),[i,a]=Zi(O(!1),{key:`makebot-${e.context.makebot.id}-isEnded`,storage:e.context.storage}),[s,l]=O(!1),[c,u]=O(!0),[d,f]=O(!1);me(()=>{window.addEventListener("message",R),window.addEventListener("makebot-api-response",I=>{console.log("\u{1F50D} Evento de resposta da API recebido:",I.detail),I.detail?.response&&T({data:I.detail.response,error:void 0})}),(async()=>{if(r().length>1){y();let B=r().findLast(H=>H.dynamicTheme?.backgroundUrl)?.dynamicTheme;B?.backgroundUrl&&Dw(B.backgroundUrl,n()?.style),r().at(-1)?.input?.answer&&b(r().at(-1)?.input?.answer)}await P()})()});let p=()=>n()?.querySelector(".scrollable-container"),y=()=>{r().at(-1)?.streamingMessage&&o(I=>I.slice(0,-1))},h=({message:I})=>{l(!1),u(!1),r().at(-1)?.streamingMessage?o(B=>B.map((H,we)=>we===B.length-1?{...H,messages:[],streamingMessage:I}:H)):o(B=>[...B,{version:"2",messages:[],streamingMessage:I}])},k=async I=>{if(!I||(e.onNewLogs?.(I),e.context.isPreview))return;let B=e.initialChatReply.sessionId;B&&await zu({apiHost:e.context.apiHost,sessionId:B,clientLogs:I})},C=()=>{Wt.create({title:e.context.makebot.settings.general?.systemMessages?.networkErrorTitle??Jt.networkErrorTitle,description:e.context.makebot.settings.general?.systemMessages?.networkErrorMessage??Jt.networkErrorMessage})},b=async I=>{if(d())return;let B=r().at(-1);if(I&&I.type!=="clientSideResult"&&o(Mw(I)),B?.clientSideActions&&B.clientSideActions.length>0&&B.input?.answer?.status==="retry"){await P();return}B?.input?.id&&I&&I.type!=="clientSideResult"&&e.onAnswer&&e.onAnswer({message:nx(I),blockId:B.input.id});let H=e.initialChatReply.sessionId;if(!H)return;let we=setTimeout(()=>{l(!0)},1e3);g();let{data:de,error:te}=await ya({apiHost:e.context.apiHost,sessionId:H,message:Q4(I)});clearTimeout(we),l(!1),await T({data:de,error:te})},T=async({data:I,error:B})=>{if(B){let H=B instanceof Error?B.message:String(B);if(H.includes("Sess\xE3o n\xE3o encontrada")||H.includes("NOT_FOUND")||B?.code==="NOT_FOUND"||B?.response?.status===404||B?.type==="HTTP_ERROR"){f(!0),a(!0);let Le=e.initialChatReply.makebot.settings.general?.systemMessages?.sessionFinalized??Jt.sessionFinalized;o(cn=>[...cn,{version:"2",messages:[{id:`finalization-${Date.now()}`,type:"text",content:{type:"richText",richText:[{type:"p",children:[{text:Le}]}]}}],input:void 0,clientSideActions:[]}]);return}let de=[await Sr({err:B,context:"Ao enviar mensagem"})];e.onNewLogs?.(de);let te=e.initialChatReply.sessionId;te&&await zu({apiHost:e.context.apiHost,sessionId:te,clientLogs:de});return}I&&(I.progress&&e.onProgressUpdate?.(I.progress),I.lastMessageNewFormat&&o(tN(I.lastMessageNewFormat)),I.logs&&e.onNewLogs?.(I.logs),I.dynamicTheme?.backgroundUrl&&Dw(I.dynamicTheme.backgroundUrl,n()?.style),I.input&&e.onNewInputBlock&&e.onNewInputBlock(I.input),o(rN(I)),await P())},g=({lastElement:I,offset:B=0}={})=>{let H=p();if(!H||H.scrollTop+H.clientHeight<H.scrollHeight-H.clientHeight*K4&&!c())return;let de=te=>{let Ye,Le=()=>{clearTimeout(Ye),Ye=window.setTimeout(()=>{te(),H?.removeEventListener("scroll",Le)},100)};H?.addEventListener("scroll",Le,{passive:!0})};setTimeout(()=>{de(()=>{if(!H)return;let te=Math.abs(H.scrollHeight-H.scrollTop-H.clientHeight)<2;u(te)}),H?.scrollTo({top:I?I.offsetTop-B:H?.scrollHeight,behavior:"smooth"})},X4)},x=async()=>{let I=r().at(-1);I&&rt(I.input)&&(a(!0),e.onEnd?.())},S=async I=>{await P(I)},P=async I=>{let B=!1,H=[];for(let de of r().at(-1)?.clientSideActions??[]){if(I!==de.lastBubbleBlockId)break;H.push(de)}if(H.length===0)return;let we=e.initialChatReply.sessionId;if(we)for(let de of H){("streamOpenAiChatCompletion"in de||"webhookToExecute"in de||"stream"in de)&&l(!0);let te=await tx({clientSideAction:de,context:{apiHost:e.context.apiHost,wsHost:e.context.wsHost,sessionId:we,resultId:e.initialChatReply.resultId},onMessageStream:h,onStreamError:async Ye=>{o(aN),B=!0,await k([Ye]),e.onNewLogs?.([Ye])}});if(("streamOpenAiChatCompletion"in de||"stream"in de)&&te&&"replyToSend"in te&&!te.replyToSend){l(!1);continue}if(B)return;if(o(nN),te&&"logs"in te&&k(te.logs),te&&"replyToSend"in te){l(!1),b(te.replyToSend?{type:"clientSideResult",result:te.replyToSend}:void 0);return}te&&"blockedPopupUrl"in te&&Wt.create({title:e.context.makebot.settings.general?.systemMessages?.popupBlockedTitle??Jt.popupBlockedTitle,description:e.context.makebot.settings.general?.systemMessages?.popupBlockedDescription??Jt.popupBlockedDescription,meta:{link:te.blockedPopupUrl}}),te&&"scriptCallbackMessage"in te&&e.onScriptExecutionSuccess?.(te.scriptCallbackMessage)}};ie(()=>{window.removeEventListener("message",R)});let R=async I=>{let{data:B}=I;!B.isFromMakebot||B.id&&e.context.makebot.id!==B.id||B.command==="sendCommand"&&!i()&&await N(B.text)},N=async(I,B=0,H=5)=>{if(s()){if(B>=H)throw new Error("O n\xFAmero m\xE1ximo de tentativas de repeti\xE7\xE3o para o comando foi atingido");return await new Promise(cn=>setTimeout(cn,5e3)),N(I,B+1,H)}let we=e.initialChatReply.sessionId;if(!we)return;let de=setTimeout(()=>{l(!0)},1e3);g();let{data:te,error:Ye}=await ya({apiHost:e.context.apiHost,sessionId:we,message:{type:"command",command:I}});return clearTimeout(de),l(!1),r().at(-1)?.input?.id&&te&&o(eN),T({data:te,error:Ye})},D=I=>{o(Mw({type:"text",value:I})),b(void 0)},F=re(()=>Hi(e.initialChatReply.makebot.theme,r().findLast(I=>I.dynamicTheme)?.dynamicTheme)),A=yv(()=>t),M=re(()=>(e.initialChatReply.makebot.theme.chat?.container?.backgroundColor??$r)==="transparent"),V=re(()=>r().filter(iN)),Y=re(()=>{let I=V(),B=s();return I.map((H,we)=>{let de=I[we+1];return((!H.input||H.input?.isHidden)&&((de?.messages?.length??0)>0||de?.streamingMessage!==void 0||H.messages.length>0&&B))??!1})});return m(ju.Provider,{value:A,get children(){var I=Z4(),B=I.firstChild,H=B.firstChild,we=t;return typeof we=="function"?ke(we,B):t=B,v(H,m(Fi,{get each(){return V()},children:(de,te)=>{let Ye=de().messages.some(Le=>Le.id?.startsWith("finalization-"));return m(Ow,{index:te,get messages(){return de().messages},get input(){return de().input},get theme(){return Hi(e.initialChatReply.makebot.theme,de().dynamicTheme)},get settings(){return e.initialChatReply.makebot.settings},get context(){return e.context},get hideAvatar(){return Y()[te]},get isTransitionDisabled(){return Ye||te!==V().length-1},get streamingMessage(){return de().streamingMessage},get isSessionFinalized(){return d()},onNewBubbleDisplayed:S,onAllBubblesDisplayed:x,onSubmit:b,onScrollToBottom:g,onSkip:D})}}),null),v(H,m(U,{get when(){return s()},get children(){return m($w,{get theme(){return F()}})}}),null),v(B,m(J4,{}),null),$(de=>{var te=q("w-full h-full px-[calc((100%-var(--makebot-chat-container-max-width))/2)]",M()?"overflow-y-auto scroll-smooth scrollable-container":"@container flex @xs:items-center"),Ye=q("@container relative makebot-chat-view w-full flex flex-col items-center pt-5 max-w-chat-container",M()?void 0:q("overflow-y-auto scroll-smooth scrollable-container","@xs:min-h-chat-container max-h-full @xs:max-h-chat-container @xs:rounded-chat-container"));return te!==de.e&&G(I,de.e=te),Ye!==de.t&&G(B,de.t=Ye),de},{e:void 0,t:void 0}),I}})},J4=()=>Y4(),Q4=e=>{if(e){if(e.type==="clientSideResult")return{type:"text",text:e.result};if(e.type==="text")return{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return{type:"audio",url:e.url}}},eN=e=>{let t=e[e.length-1];return!t||!t.input||t.input.answer?e:e.map((n,r)=>r===e.length-1?{...n,input:{...n.input,isHidden:!0}}:n)},tN=e=>t=>{let n=t[t.length-1];return!n||!n.input||!n.input.answer||n.input.answer.type==="recording"||n.input.answer?.type==="text"&&n.input.answer.label?t:n.input.type!=="file input"?t.map((r,o)=>o===t.length-1?{...r,input:{...r.input,answer:{...r.input.answer,label:e}}}:r):t},Mw=e=>t=>{let n=t[t.length-1];return!n||!n.input?t:t.map((r,o)=>o===t.length-1?{...r,input:{...r.input,answer:e}}:r)},nN=e=>{let t=e[e.length-1];return!t||!t.clientSideActions?e:e.reduce((n,r,o)=>{if(o===e.length-1){let i=r.clientSideActions.slice(1);if(i.length===0&&r.messages.length===0&&!r.input)return n;n.push({...r,clientSideActions:i})}else n.push(r);return n},[])},Dw=(e,t)=>{zc({background:{type:"Image",content:e},documentStyle:t??document.documentElement.style,makebotVersion:"6.1"})},rN=e=>t=>[...t,{version:"2",clientSideActions:e.clientSideActions,input:e.input,dynamicTheme:e.dynamicTheme,messages:oN(e.messages)}],oN=e=>e.filter(t=>t.type!=="text"||t.content.type!=="richText"||t.content.richText.length>1||t.content.richText[0].type!=="variable"||t.content.richText[0].children.length>0),iN=e=>!e.clientSideActions||e.clientSideActions.every(t=>t.lastBubbleBlockId),aN=e=>{let t=e[e.length-1];return!t||!t.input||!t.input.answer?e:e.map((n,r)=>r===e.length-1?{...n,input:{...n.input,answer:{...n.input.answer,status:"retry"}}}:n)};var sN=w('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Bw=e=>(()=>{var t=sN(),n=t.firstChild,r=n.nextSibling;return v(n,()=>e.error.message),v(r,()=>JSON.stringify(e.error.cause,null,2)),t})();var lN=w(`<svg viewBox="0 0 234 38"width=120 fill=#000000><path fill=#22C55E d="M13.5489721,3.8939648c-5.0947256,0-9.4274693,3.2543087-11.0383406,7.7968044
613
613
  c-1.3952296,0.2563066-2.4532197,1.4763889-2.4532197,2.9457264v4.2195015c0,1.4153919,0.9821827,2.5986042,2.3013499,2.9129047
614
614
  c1.4411333,4.6643772,5.7187138,8.0823364,10.8184519,8.2417374v0.0031719c0,0,1.9996777,0.0249481,1.9996777,0.9279823
615
615
  c0,0.9030628,0,2.4457989,0,2.4457989s-0.3786688,1.1664505,1.3898201,0.5267715
@@ -674,7 +674,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
674
674
  c0,0.5805359,0.1890106,0.8546009,0.8856506,0.8546009h1.0233612c0.1363525,0,0.1903534,0.0634556,0.1903534,0.1903629v0.8640518
675
675
  c0,0.1269073-0.0540009,0.190361-0.1903534,0.190361h-1.2758331c-1.6875916,0-2.1412201-0.6007862-2.1412201-2.0993767v-2.4463463
676
676
  h-1.0031128c-0.1255646,0-0.1890106-0.0634537-0.1890106-0.1903629v-0.8640518c0-0.1269073,0.063446-0.190361,0.1890106-0.190361
677
- H230.3351746z">`),t0=()=>k3();var C3=C('<a href="https://makebot.it/?utm_source=litebadge"target=_blank rel="noopener noreferrer"class=lite-badge id=lite-badge>'),r0=e=>{let t,r,n,o={display:"flex",opacity:"1",visibility:"visible","pointer-events":"auto",transform:"none","clip-path":"none",width:"auto",height:"auto",position:"absolute",padding:"4px 8px","background-color":"white","z-index":"50","border-radius":"4px",color:"rgb(17 24 39)",gap:"8px","font-size":"14px","line-height":"20px","font-weight":"600","border-width":"1px","border-color":"#cecece",top:"auto",right:"auto",left:"auto",bottom:"20px",transition:"background-color 0.2s ease-in-out","text-decoration":"none"};return ae(()=>{!document||!e.botContainer||!t||(r=new MutationObserver(i=>{i.forEach(a=>{a.removedNodes.forEach(s=>{"id"in s&&t&&s.id==="lite-badge"&&(console.log("Desculpe, voc\xEA n\xE3o pode remover a marca \u{1F605}"),e.botContainer?.append(t))})})}),r.observe(e.botContainer,{subtree:!1,childList:!0}),n=new MutationObserver(i=>{i.forEach(a=>{a.type==="attributes"&&t&&(a.attributeName==="style"&&Object.assign(t.style,o),a.attributeName==="class"&&(t.className="lite-badge"),a.attributeName==="href"&&(t.href="https://makebot.it/?utm_source=litebadge"),a.attributeName==="id"&&(t.id="lite-badge"))})}),n.observe(t,{attributes:!0,attributeFilter:["style","class","href","id"]}))}),re(()=>{r&&r.disconnect(),n&&n.disconnect()}),(()=>{var i=C3(),a=t;return typeof a=="function"?ge(a,i):t=i,v(i,m(t0,{})),$(s=>Ho(i,o,s)),i})()};var T3=C("<div class=makebot-progress-bar-container part=progress-bar-container><div class=makebot-progress-bar>"),Ou=e=>(()=>{var t=T3(),r=t.firstChild;return $(n=>ne(r,"width",`${e.value}%`)),t})();var S3=C("<style>"),E3=C("<div>"),P3=C("<a target=_blank rel=noreferrer>"),Oo=e=>{let[t,r]=O(),[n,o]=O(""),[i,a]=O(!1),[s,l]=O(),c=async()=>{e.font&&Al(e.font),a(!0);let u=new URLSearchParams(location.search);e.onInit?.();let d={};u.forEach((T,b)=>{d[b]=T});let p=typeof e.makebot=="string"?e.makebot:void 0,f=typeof e.makebot!="string"||(e.isPreview??!1),x=$m(p),{data:h,error:w}=await em({stripeRedirectStatus:u.get("redirect_status")??void 0,makebot:e.makebot,apiHost:e.apiHost,isPreview:f,resultId:pe(e.resultId)?e.resultId:x,prefilledVariables:{...d,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(w instanceof sr)return f?l(new Error("Ocorreu um erro ao carregar o bot.",{cause:{status:w.response.status,body:await w.response.json()}})):w.response.status===400||w.response.status===403?l(new Error((await w.response.json()).message)):w.response.status===404?l(new Error("O bot que voc\xEA est\xE1 procurando n\xE3o existe.")):l(new Error(`Erro! N\xE3o foi poss\xEDvel iniciar o chat. (${w.response.statusText})`));if(w instanceof pa)return l(new Error(w.message));if(!h)return w&&(console.error(w),f)?l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o.",{cause:w})):l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o."));if(h.resultId&&p&&(h.makebot.settings.general?.rememberUser?.isEnabled??at.general.rememberUser.isEnabled)){x&&x!==h.resultId&&wa(h.makebot.id);let T=h.makebot.settings.general?.rememberUser?.storage??at.general.rememberUser.storage;Nm(T)(p,h.resultId);let b=Mm(h.makebot.id);b&&b.makebot.publishedAt&&h.makebot.publishedAt?new Date(b.makebot.publishedAt).getTime()===new Date(h.makebot.publishedAt).getTime()?r({...b,sessionId:h.sessionId}):(wa(h.makebot.id),r(h),Nl(h,{makebotId:h.makebot.id,storage:T})):(r(h),Nl(h,{makebotId:h.makebot.id,storage:T})),e.onChatStatePersisted?.(!0)}else wa(h.makebot.id),r(h),h.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(h.input),h.logs&&e.onNewLogs?.(h.logs),e.onChatStatePersisted?.(!1);o(h.makebot.theme.customCss??"")};return ve(()=>{Ze(e.makebot)||i()||c().then()}),ve(()=>{Ze(e.makebot)||typeof e.makebot=="string"||(o(e.makebot.theme.customCss??""),e.makebot.theme.general?.progressBar?.isEnabled&&t()&&!t()?.makebot.theme.general?.progressBar?.isEnabled&&(a(!1),c().then()))}),re(()=>{a(!1)}),[m(U,{get when(){return n()},children:u=>(()=>{var d=S3();return v(d,u),d})()}),m(U,{get when(){return s()},keyed:!0,children:u=>m(e0,{error:u})}),m(U,{get when(){return t()},keyed:!0,children:u=>m(_3,{get class(){return e.class},get initialChatReply(){return{...u,makebot:{...u.makebot,settings:typeof e.makebot=="string"||!e.makebot?u.makebot.settings:e.makebot?.settings,theme:typeof e.makebot=="string"||!e.makebot?u.makebot.theme:e.makebot?.theme}}},get context(){return{apiHost:e.apiHost,wsHost:e.wsHost,isPreview:typeof e.makebot!="string"||(e.isPreview??!1),resultId:u.resultId,sessionId:u.sessionId||"",makebot:u.makebot,storage:u.makebot.settings.general?.rememberUser?.isEnabled&&!(typeof e.makebot!="string"||(e.isPreview??!1))?u.makebot.settings.general?.rememberUser?.storage??at.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},_3=e=>{let[t,r]=Jo(O(e.initialChatReply.progress),{storage:e.context.storage,key:`makebot-${e.context.makebot.id}-progressValue`}),n,[o,i]=O("100%");return ve(()=>{n&&i(`${n.clientHeight}px`)}),ve(()=>{Al(e.initialChatReply.makebot.theme.general?.font??{type:tm,family:Qn}),n&&Lm({theme:Ko(e.initialChatReply.makebot.theme,e.initialChatReply.dynamicTheme),container:n,isPreview:e.context.isPreview,makebotVersion:ls(e.initialChatReply.makebot.version)?e.initialChatReply.makebot.version:"6"})}),m(vl.Provider,{value:()=>n,get children(){var a=E3(),s=n;return typeof s=="function"?ge(s,a):n=a,v(a,m(U,{get when(){return L(()=>!!de(t()))()&&e.initialChatReply.makebot.theme.general?.progressBar?.isEnabled},get children(){return m(U,{get when(){return L(()=>!!e.progressBarRef)()&&(e.initialChatReply.makebot.theme.general?.progressBar?.position??ga)==="fixed"},get fallback(){return m(Ou,{get value(){return t()}})},get children(){return m(oa,{get mount(){return e.progressBarRef},get children(){return m(Ou,{get value(){return t()}})}})}})}}),null),v(a,m(Qv,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:r,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),v(a,m(U,{get when(){return e.initialChatReply.makebot.settings.general?.isBrandingEnabled},get children(){return m(r0,{botContainer:n})}}),null),v(a,m(fc,{toaster:$t,class:"w-full",children:l=>m(wn.Root,{class:"flex flex-col pl-4 py-4 pr-8 gap-2 max-w-[350px] rounded-chat text-input-text border-input border-input-border bg-input-bg shadow-input data-[state=open]:animate-fade-in-from-bottom data-[state=closed]:animate-fade-out-from-bottom",get children(){return[m(wn.Title,{class:"font-semibold",get children(){return l().title}}),m(wn.Description,{class:"text-sm",get children(){return l().description}}),m(wn.CloseTrigger,{get class(){return Zr("absolute right-2 top-2",fs({variant:"secondary",size:"icon"}))},get children(){return m(pr,{class:"w-4 h-4"})}}),m(U,{get when(){return l().meta?.link},children:c=>(()=>{var u=P3();return v(u,()=>e.initialChatReply.makebot.settings.general?.systemMessages?.popupBlockedButtonLabel??Lt.popupBlockedButtonLabel),$(d=>{var p=c(),f=Zr(fs({variant:"primary",size:"sm"}),"no-underline");return p!==d.e&&G(u,"href",d.e=p),f!==d.t&&V(u,d.t=f),d},{e:void 0,t:void 0}),u})()})]}})}),null),$(l=>{var c=q("relative flex w-full overflow-hidden h-full text-base flex-col justify-center items-center makebot-container",e.class),u=o();return c!==l.e&&V(a,l.e=c),u!==l.t&&ne(a,"--bot-container-height",l.t=u),l},{e:void 0,t:void 0}),a}})};var $u=(e,{isHidden:t=!1}={})=>t?"0px":e==="large"?"64px":e==="medium"||!e?"48px":typeof e=="string"&&/^\d+px$/.test(e.trim())?e.trim():(console.warn("[Makebot] Tamanho de bot\xE3o inv\xE1lido. Use 'm\xE9dio', 'grande' ou um valor em pixels expl\xEDcita (ex.: '52px')."),"48px");var $o=`:root,
677
+ H230.3351746z">`),Fw=()=>lN();var cN=w('<a href="https://makebot.it/?utm_source=litebadge"target=_blank rel="noopener noreferrer"class=lite-badge id=lite-badge>'),Uw=e=>{let t,n,r,o={display:"flex",opacity:"1",visibility:"visible","pointer-events":"auto",transform:"none","clip-path":"none",width:"auto",height:"auto",position:"absolute",padding:"4px 8px","background-color":"white","z-index":"50","border-radius":"4px",color:"rgb(17 24 39)",gap:"8px","font-size":"14px","line-height":"20px","font-weight":"600","border-width":"1px","border-color":"#cecece",top:"auto",right:"auto",left:"auto",bottom:"20px",transition:"background-color 0.2s ease-in-out","text-decoration":"none"};return me(()=>{!document||!e.botContainer||!t||(n=new MutationObserver(i=>{i.forEach(a=>{a.removedNodes.forEach(s=>{"id"in s&&t&&s.id==="lite-badge"&&(console.log("Desculpe, voc\xEA n\xE3o pode remover a marca \u{1F605}"),e.botContainer?.append(t))})})}),n.observe(e.botContainer,{subtree:!1,childList:!0}),r=new MutationObserver(i=>{i.forEach(a=>{a.type==="attributes"&&t&&(a.attributeName==="style"&&Object.assign(t.style,o),a.attributeName==="class"&&(t.className="lite-badge"),a.attributeName==="href"&&(t.href="https://makebot.it/?utm_source=litebadge"),a.attributeName==="id"&&(t.id="lite-badge"))})}),r.observe(t,{attributes:!0,attributeFilter:["style","class","href","id"]}))}),ie(()=>{n&&n.disconnect(),r&&r.disconnect()}),(()=>{var i=cN(),a=t;return typeof a=="function"?ke(a,i):t=i,v(i,m(Fw,{})),$(s=>Ui(i,o,s)),i})()};var uN=w("<div class=makebot-progress-bar-container part=progress-bar-container><div class=makebot-progress-bar>"),Zd=e=>(()=>{var t=uN(),n=t.firstChild;return $(r=>ae(n,"width",`${e.value}%`)),t})();var dN=w("<style>"),mN=w("<div>"),fN=w("<a target=_blank rel=noreferrer>"),Pi=e=>{let[t,n]=O(),[r,o]=O(""),[i,a]=O(!1),[s,l]=O(),c=async()=>{e.font&&Bc(e.font),a(!0);let u=new URLSearchParams(location.search);e.onInit?.();let d={};u.forEach((C,b)=>{d[b]=C});let f=typeof e.makebot=="string"?e.makebot:void 0,p=typeof e.makebot!="string"||(e.isPreview??!1),y=Kf(f),{data:h,error:k}=await bf({stripeRedirectStatus:u.get("redirect_status")??void 0,makebot:e.makebot,apiHost:e.apiHost,isPreview:p,resultId:Ue(e.resultId)?e.resultId:y,prefilledVariables:{...d,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(k instanceof Cn)return p?l(new Error("Ocorreu um erro ao carregar o bot.",{cause:{status:k.response.status,body:await k.response.json()}})):k.response.status===400||k.response.status===403?l(new Error((await k.response.json()).message)):k.response.status===404?l(new Error("O bot que voc\xEA est\xE1 procurando n\xE3o existe.")):l(new Error(`Erro! N\xE3o foi poss\xEDvel iniciar o chat. (${k.response.statusText})`));if(k instanceof bs)return l(new Error(k.message));if(!h)return k&&(console.error(k),p)?l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o.",{cause:k})):l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o."));if(h.resultId&&f&&(h.makebot.settings.general?.rememberUser?.isEnabled??ht.general.rememberUser.isEnabled)){y&&y!==h.resultId&&Ss(h.makebot.id);let C=h.makebot.settings.general?.rememberUser?.storage??ht.general.rememberUser.storage;Xf(C)(f,h.resultId);let b=Jf(h.makebot.id);b&&b.makebot.publishedAt&&h.makebot.publishedAt?new Date(b.makebot.publishedAt).getTime()===new Date(h.makebot.publishedAt).getTime()?n({...b,sessionId:h.sessionId}):(Ss(h.makebot.id),n(h),jc(h,{makebotId:h.makebot.id,storage:C})):(n(h),jc(h,{makebotId:h.makebot.id,storage:C})),e.onChatStatePersisted?.(!0)}else Ss(h.makebot.id),n(h),h.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(h.input),h.logs&&e.onNewLogs?.(h.logs),e.onChatStatePersisted?.(!1);o(h.makebot.theme.customCss??"")};return $e(()=>{rt(e.makebot)||i()||c().then()}),$e(()=>{rt(e.makebot)||typeof e.makebot=="string"||(o(e.makebot.theme.customCss??""),e.makebot.theme.general?.progressBar?.isEnabled&&t()&&!t()?.makebot.theme.general?.progressBar?.isEnabled&&(a(!1),c().then()))}),ie(()=>{a(!1)}),[m(U,{get when(){return r()},children:u=>(()=>{var d=dN();return v(d,u),d})()}),m(U,{get when(){return s()},keyed:!0,children:u=>m(Bw,{error:u})}),m(U,{get when(){return t()},keyed:!0,children:u=>m(pN,{get class(){return e.class},get initialChatReply(){return{...u,makebot:{...u.makebot,settings:typeof e.makebot=="string"||!e.makebot?u.makebot.settings:e.makebot?.settings,theme:typeof e.makebot=="string"||!e.makebot?u.makebot.theme:e.makebot?.theme}}},get context(){return{apiHost:e.apiHost,wsHost:e.wsHost,isPreview:typeof e.makebot!="string"||(e.isPreview??!1),resultId:u.resultId,sessionId:u.sessionId||"",makebot:u.makebot,storage:u.makebot.settings.general?.rememberUser?.isEnabled&&!(typeof e.makebot!="string"||(e.isPreview??!1))?u.makebot.settings.general?.rememberUser?.storage??ht.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},pN=e=>{let[t,n]=Zi(O(e.initialChatReply.progress),{storage:e.context.storage,key:`makebot-${e.context.makebot.id}-progressValue`}),r,[o,i]=O("100%");return $e(()=>{r&&i(`${r.clientHeight}px`)}),$e(()=>{Bc(e.initialChatReply.makebot.theme.general?.font??{type:yf,family:jo}),r&&ep({theme:Hi(e.initialChatReply.makebot.theme,e.initialChatReply.dynamicTheme),container:r,isPreview:e.context.isPreview,makebotVersion:dl(e.initialChatReply.makebot.version)?e.initialChatReply.makebot.version:"6"})}),m(Pc.Provider,{value:()=>r,get children(){var a=mN(),s=r;return typeof s=="function"?ke(s,a):r=a,v(a,m(U,{get when(){return L(()=>!!ye(t()))()&&e.initialChatReply.makebot.theme.general?.progressBar?.isEnabled},get children(){return m(U,{get when(){return L(()=>!!e.progressBarRef)()&&(e.initialChatReply.makebot.theme.general?.progressBar?.position??ys)==="fixed"},get fallback(){return m(Zd,{get value(){return t()}})},get children(){return m(ss,{get mount(){return e.progressBarRef},get children(){return m(Zd,{get value(){return t()}})}})}})}}),null),v(a,m(Lw,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),v(a,m(U,{get when(){return e.initialChatReply.makebot.settings.general?.isBrandingEnabled},get children(){return m(Uw,{botContainer:r})}}),null),v(a,m(wu,{toaster:Wt,class:"w-full",children:l=>m(Zr.Root,{class:"flex flex-col pl-4 py-4 pr-8 gap-2 max-w-[350px] rounded-chat text-input-text border-input border-input-border bg-input-bg shadow-input data-[state=open]:animate-fade-in-from-bottom data-[state=closed]:animate-fade-out-from-bottom",get children(){return[m(Zr.Title,{class:"font-semibold",get children(){return l().title}}),m(Zr.Description,{class:"text-sm",get children(){return l().description}}),m(Zr.CloseTrigger,{get class(){return vr("absolute right-2 top-2",hl({variant:"secondary",size:"icon"}))},get children(){return m(_r,{class:"w-4 h-4"})}}),m(U,{get when(){return l().meta?.link},children:c=>(()=>{var u=fN();return v(u,()=>e.initialChatReply.makebot.settings.general?.systemMessages?.popupBlockedButtonLabel??Jt.popupBlockedButtonLabel),$(d=>{var f=c(),p=vr(hl({variant:"primary",size:"sm"}),"no-underline");return f!==d.e&&K(u,"href",d.e=f),p!==d.t&&G(u,d.t=p),d},{e:void 0,t:void 0}),u})()})]}})}),null),$(l=>{var c=q("relative flex w-full overflow-hidden h-full text-base flex-col justify-center items-center makebot-container",e.class),u=o();return c!==l.e&&G(a,l.e=c),u!==l.t&&ae(a,"--bot-container-height",l.t=u),l},{e:void 0,t:void 0}),a}})};var Yd=(e,{isHidden:t=!1}={})=>t?"0px":e==="large"?"64px":e==="medium"||!e?"48px":typeof e=="string"&&/^\d+px$/.test(e.trim())?e.trim():(console.warn("[Makebot] Tamanho de bot\xE3o inv\xE1lido. Use 'm\xE9dio', 'grande' ou um valor em pixels expl\xEDcita (ex.: '52px')."),"48px");var Ii=`:root,
678
678
  .light {
679
679
  --blue-1: 252 253 254;
680
680
  --blue-2: 246 249 255;
@@ -822,7 +822,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
822
822
  --gray-11: 180 180 180;
823
823
  --gray-12: 238 238 238;
824
824
  }
825
- `;var No=`*, ::before, ::after {
825
+ `;var Ai=`*, ::before, ::after {
826
826
  --tw-border-spacing-x: 0;
827
827
  --tw-border-spacing-y: 0;
828
828
  --tw-translate-x: 0;
@@ -1476,6 +1476,9 @@ video {
1476
1476
  .mb-2 {
1477
1477
  margin-bottom: 8px;
1478
1478
  }
1479
+ .mb-3 {
1480
+ margin-bottom: 12px;
1481
+ }
1479
1482
  .ml-2 {
1480
1483
  margin-left: 8px;
1481
1484
  }
@@ -1485,15 +1488,15 @@ video {
1485
1488
  .mr-4 {
1486
1489
  margin-right: 16px;
1487
1490
  }
1491
+ .mt-0\\.5 {
1492
+ margin-top: 2px;
1493
+ }
1488
1494
  .mt-1 {
1489
1495
  margin-top: 4px;
1490
1496
  }
1491
1497
  .mt-4 {
1492
1498
  margin-top: 16px;
1493
1499
  }
1494
- .\\!block {
1495
- display: block !important;
1496
- }
1497
1500
  .block {
1498
1501
  display: block;
1499
1502
  }
@@ -1596,8 +1599,8 @@ video {
1596
1599
  .h-screen {
1597
1600
  height: 100vh;
1598
1601
  }
1599
- .max-h-\\[464px\\] {
1600
- max-height: 464px;
1602
+ .max-h-\\[360px\\] {
1603
+ max-height: 360px;
1601
1604
  }
1602
1605
  .max-h-\\[calc\\(100dvh-var\\(--container-bottom\\)-var\\(--button-gap\\)-var\\(--button-size\\)\\)\\] {
1603
1606
  max-height: calc(100dvh - var(--container-bottom) - var(--button-gap) - var(--button-size));
@@ -1608,6 +1611,9 @@ video {
1608
1611
  .max-h-\\[calc\\(var\\(--bot-container-height\\)-100px\\)\\] {
1609
1612
  max-height: calc(var(--bot-container-height) - 100px);
1610
1613
  }
1614
+ .max-h-\\[min\\(80vh\\2c 560px\\)\\] {
1615
+ max-height: min(80vh,560px);
1616
+ }
1611
1617
  .max-h-full {
1612
1618
  max-height: 100%;
1613
1619
  }
@@ -1632,6 +1638,9 @@ video {
1632
1638
  .w-64 {
1633
1639
  width: 256px;
1634
1640
  }
1641
+ .w-7 {
1642
+ width: 28px;
1643
+ }
1635
1644
  .w-8 {
1636
1645
  width: 32px;
1637
1646
  }
@@ -1650,6 +1659,9 @@ video {
1650
1659
  .w-\\[calc\\(100vw-16px\\)\\] {
1651
1660
  width: calc(100vw - 16px);
1652
1661
  }
1662
+ .w-\\[min\\(92vw\\2c 360px\\)\\] {
1663
+ width: min(92vw,360px);
1664
+ }
1653
1665
  .w-full {
1654
1666
  width: 100%;
1655
1667
  }
@@ -1815,9 +1827,6 @@ video {
1815
1827
  .overflow-y-auto {
1816
1828
  overflow-y: auto;
1817
1829
  }
1818
- .overflow-y-scroll {
1819
- overflow-y: scroll;
1820
- }
1821
1830
  .scroll-smooth {
1822
1831
  scroll-behavior: smooth;
1823
1832
  }
@@ -1857,6 +1866,9 @@ video {
1857
1866
  .rounded-sm {
1858
1867
  border-radius: 2px;
1859
1868
  }
1869
+ .rounded-xl {
1870
+ border-radius: 12px;
1871
+ }
1860
1872
  .rounded-b-host-bubble {
1861
1873
  border-bottom-right-radius: var(--makebot-host-bubble-border-radius);
1862
1874
  border-bottom-left-radius: var(--makebot-host-bubble-border-radius);
@@ -2051,6 +2063,9 @@ video {
2051
2063
  .pr-8 {
2052
2064
  padding-right: 32px;
2053
2065
  }
2066
+ .pt-4 {
2067
+ padding-top: 16px;
2068
+ }
2054
2069
  .pt-5 {
2055
2070
  padding-top: 20px;
2056
2071
  }
@@ -2074,6 +2089,9 @@ video {
2074
2089
  font-size: 36px;
2075
2090
  line-height: 40px;
2076
2091
  }
2092
+ .text-\\[11px\\] {
2093
+ font-size: 11px;
2094
+ }
2077
2095
  .text-base {
2078
2096
  font-size: 16px;
2079
2097
  line-height: 24px;
@@ -2092,15 +2110,30 @@ video {
2092
2110
  .font-light {
2093
2111
  font-weight: 300;
2094
2112
  }
2113
+ .font-medium {
2114
+ font-weight: 500;
2115
+ }
2095
2116
  .font-normal {
2096
2117
  font-weight: 400;
2097
2118
  }
2098
2119
  .font-semibold {
2099
2120
  font-weight: 600;
2100
2121
  }
2122
+ .uppercase {
2123
+ text-transform: uppercase;
2124
+ }
2101
2125
  .italic {
2102
2126
  font-style: italic;
2103
2127
  }
2128
+ .leading-relaxed {
2129
+ line-height: 1.625;
2130
+ }
2131
+ .leading-tight {
2132
+ line-height: 1.25;
2133
+ }
2134
+ .tracking-wide {
2135
+ letter-spacing: 0.025em;
2136
+ }
2104
2137
  .text-black {
2105
2138
  --tw-text-opacity: 1;
2106
2139
  color: rgb(0 0 0 / var(--tw-text-opacity, 1));
@@ -2136,6 +2169,12 @@ video {
2136
2169
  .opacity-50 {
2137
2170
  opacity: 0.5;
2138
2171
  }
2172
+ .opacity-55 {
2173
+ opacity: 0.55;
2174
+ }
2175
+ .opacity-70 {
2176
+ opacity: 0.7;
2177
+ }
2139
2178
  .opacity-75 {
2140
2179
  opacity: 0.75;
2141
2180
  }
@@ -2801,12 +2840,20 @@ select option {
2801
2840
  max-width: 350px;
2802
2841
  }
2803
2842
 
2843
+ .last\\:mb-0:last-child {
2844
+ margin-bottom: 0px;
2845
+ }
2846
+
2804
2847
  .hover\\:scale-110:hover {
2805
2848
  --tw-scale-x: 1.1;
2806
2849
  --tw-scale-y: 1.1;
2807
2850
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2808
2851
  }
2809
2852
 
2853
+ .hover\\:bg-black\\/5:hover {
2854
+ background-color: rgb(0 0 0 / 0.05);
2855
+ }
2856
+
2810
2857
  .hover\\:shadow-lg:hover {
2811
2858
  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2812
2859
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
@@ -3030,14 +3077,14 @@ select option {
3030
3077
  opacity: 0;
3031
3078
  }
3032
3079
  }
3033
- `;var R3=C("<button part=button>"),O3=C('<svg part=button-icon viewBox="0 0 16 16"><path d="M8 15C12.418 15 16 11.866 16 8C16 4.134 12.418 1 8 1C3.582 1 0 4.134 0 8C0 9.76 0.743 11.37 1.97 12.6C1.873 13.616 1.553 14.73 1.199 15.566C1.12 15.752 1.273 15.96 1.472 15.928C3.728 15.558 5.069 14.99 5.652 14.694C6.41791 14.8983 7.20732 15.0012 8 15Z"fill=currentColor>'),$3=C('<img part=button-icon alt="Bubble button icon">'),n0=C(`<span part=button-icon style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'">`),N3=C('<svg part=button-icon viewBox="0 0 24 24"style=fill:#fff><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),M3=C('<img part=button-icon alt="Bubble button close icon">');var el=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),o0=e=>(()=>{var t=R3();return t.$$click=()=>e.toggleBot(),v(t,m(D3,e),null),v(t,m(L3,e),null),$(r=>{var n=q("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in size-[var(--button-size)]"),o=e.backgroundColor??Ne.gray.dark[2],i=e.backgroundColor?Fr(e.backgroundColor)?Ne.gray.light[12]:Ne.gray.dark[12]:Ne.gray.dark[12],a=e.isBotOpen?"Fechar chatbot":"Abrir chatbot",s=e.isBotOpen;return n!==r.e&&V(t,r.e=n),o!==r.t&&ne(t,"background-color",r.t=o),i!==r.a&&ne(t,"color",r.a=i),a!==r.o&&G(t,"aria-label",r.o=a),s!==r.i&&G(t,"aria-pressed",r.i=s),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})(),D3=e=>m(Ie,{get children(){return[m(Z,{get when(){return Ze(e.customIconSrc)},get children(){var t=O3();return $(()=>G(t,"class",q("fill-transparent absolute duration-200 transition size-6",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}}),m(Z,{get when(){return L(()=>!!e.customIconSrc)()&&el(e.customIconSrc)},get children(){var t=$3();return $(r=>{var n=e.customIconSrc,o=q("duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100",qt(e.customIconSrc)?"w-[60%]":"w-full h-full",qt(e.customIconSrc)?"":"object-cover rounded-2xl");return n!==r.e&&G(t,"src",r.e=n),o!==r.t&&V(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(Z,{get when(){return L(()=>!!e.customIconSrc)()&&!el(e.customIconSrc)},get children(){var t=n0();return v(t,()=>e.customIconSrc),$(()=>V(t,q("text-4xl duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}})]}}),L3=e=>m(Ie,{get children(){return[m(Z,{get when(){return Ze(e.customCloseIconSrc)},get children(){var t=N3();return $(()=>G(t,"class",q("absolute duration-200 transition w-[60%]",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}}),m(Z,{get when(){return L(()=>!!e.customCloseIconSrc)()&&el(e.customCloseIconSrc)},get children(){var t=M3();return $(r=>{var n=e.customCloseIconSrc,o=q("absolute duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",qt(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",qt(e.customCloseIconSrc)?"":"object-cover rounded-2xl");return n!==r.e&&G(t,"src",r.e=n),o!==r.t&&V(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(Z,{get when(){return L(()=>!!e.customCloseIconSrc)()&&!el(e.customCloseIconSrc)},get children(){var t=n0();return v(t,()=>e.customCloseIconSrc),$(()=>V(t,q("absolute text-4xl duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}})]}});Se(["click"]);var B3=C("<div part=preview-message><p>"),F3=C('<img class="rounded-full w-8 h-8 object-cover"alt="Avatar do bot"elementtiming="Bot avatar"fetchpriority=high>'),U3=C('<button part=preview-message-close-button aria-label=Fechar><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),i0=e=>{let[t,r]=O(!1),[n,o]=O({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0})},a=s=>{let l=s.changedTouches[0]?.clientX??0,c=s.changedTouches[0]?.clientY??0;(Math.abs(l-n().x)>10||c-n().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{var s=B3(),l=s.firstChild;return s.$$touchend=a,s.$$touchstart=i,s.addEventListener("mouseleave",()=>r(!1)),s.addEventListener("mouseenter",()=>r(!0)),s.$$click=()=>e.onClick(),v(s,m(V3,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),l),v(s,m(U,{get when(){return e.avatarUrl},keyed:!0,children:c=>(()=>{var u=F3();return G(u,"src",c),u})()}),l),v(l,()=>e.message),$(c=>{var u=q("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),d=e.previewMessageTheme?.backgroundColor??Pm,p=e.previewMessageTheme?.textColor??_m;return u!==c.e&&V(s,c.e=u),d!==c.t&&ne(s,"background-color",c.t=d),p!==c.a&&ne(s,"color",c.a=p),c},{e:void 0,t:void 0,a:void 0}),s})()},V3=e=>(()=>{var t=U3();return t.$$click=r=>(r.stopPropagation(),e.onClick()),$(r=>{var n="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??Im,i=e.previewMessageTheme?.closeButtonIconColor??Am;return n!==r.e&&V(t,r.e=n),o!==r.t&&ne(t,"background-color",r.t=o),i!==r.a&&ne(t,"color",r.a=i),r},{e:void 0,t:void 0,a:void 0}),t})();Se(["click","touchstart","touchend"]);var z3=C("<style>"),G3=C("<div>"),H3=C('<div style=--container-bottom:20px;--button-gap:12px;--container-border-radius:7px><div part=bot style="transition:transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out">');var a0=(e,t)=>{let{element:r}=t,[n,o]=De(e,["isOpen","onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[i,a]=O("idle"),[s,l]=O(!1),c=ee(()=>de(n.isOpen)),u=ee(()=>c()?n.isOpen:i()==="open"),[d,p]=O(o.prefilledVariables),[f,x]=O({message:n.previewMessage?.message??"",avatarUrl:n.previewMessage?.avatarUrl}),[h,w]=O(!1),T=()=>{window.addEventListener("message",y)},b=()=>{window.removeEventListener("message",y)};ve(()=>{i()!=="idle"||!o.makebot||(a("ready"),T(),R())}),re(()=>{a("idle"),b()}),ve(()=>{n.isOpen&&!s()&&l(!0)});let y=I=>{let{data:B}=I;if(!(!B.isFromMakebot||B.id&&r.id!==B.id))switch(B.command){case"open":g();break;case"close":k();break;case"toggle":S();break;case"showPreviewMessage":N(B.message);break;case"hidePreviewMessage":D();break;case"setPrefilledVariables":p(j=>({...j,...B.variables}));break;case"unmount":F();break;case"reload":P();break}},g=()=>{n.onOpen?.(),!c()&&(l(!0),D(),a("open"))},k=()=>{n.onClose?.(),!c()&&(a("closed"),xa())},S=()=>{u()?k():g()},P=()=>{l(!1),l(!0)},A=()=>{n.onPreviewMessageClick?.(),g()},N=I=>{if(u())return;let B=I??(n.previewMessage?{message:n.previewMessage.message,avatarUrl:n.previewMessage.avatarUrl}:void 0);B&&(x(B),w(!0))},D=()=>{w(!1),n.onPreviewMessageDismissed?.()},F=()=>{u()?(k(),setTimeout(()=>{a("unmounted")},200)):a("unmounted")},R=()=>{(va()||Xn())&&g(),de(n.autoShowDelay)&&setTimeout(g,n.autoShowDelay);let I=n.previewMessage?.autoShowDelay;de(I)&&setTimeout(N,I)},M=I=>{o.onChatStatePersisted?.(I),I&&ya()},z=I=>{o.onScriptExecutionSuccess?.(I)},K;return m(U,{get when(){return i()!=="unmounted"},get children(){return m(pn,{get value(){return document.querySelector("makebot-bubble")?.shadowRoot},get children(){return[(()=>{var I=z3();return v(I,$o,null),v(I,No,null),I})(),(()=>{var I=G3(),B=K;return typeof B=="function"?ge(B,I):K=I,I})(),(()=>{var I=H3(),B=I.firstChild;return v(I,m(U,{get when(){return h()},get children(){return m(i0,ce(f,{get placement(){return n.theme?.placement},get previewMessageTheme(){return n.theme?.previewMessage},onClick:A,onCloseClick:D}))}}),B),v(I,m(U,{get when(){return!n.theme?.button?.isHidden},get children(){return m(o0,ce(()=>n.theme?.button,{get placement(){return n.theme?.placement},toggleBot:S,get isBotOpen(){return u()}}))}}),B),v(B,m(U,{get when(){return s()},get children(){return m(Oo,ce(o,{onScriptExecutionSuccess:z,onChatStatePersisted:M,get prefilledVariables(){return d()}}))}})),$(j=>{var he=q(n.theme?.position==="static"?"relative":"z-[424242] fixed bottom-[var(--container-bottom)] right-5",n.theme?.placement==="left"&&"left-5"),le={"--button-size":$u(n.theme?.button?.size??"medium",{isHidden:n.theme?.button?.isHidden}),"--bot-bg-color":n.theme?.chatWindow?.backgroundColor,"--bot-max-width":n.theme?.chatWindow?.maxWidth??"400px","--bot-max-height":n.theme?.chatWindow?.maxHeight??"704px",...n.inlineStyle},Q=n.theme?.placement==="left"?"bottom left":"bottom right",Ge=u()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",_e=q("absolute rounded-lg max-h-[calc(100dvh-var(--container-bottom)-var(--button-gap)-var(--button-size))] shadow-lg bg-[var(--bot-bg-color)] h-[var(--bot-max-height)] max-w-[var(--bot-max-width)] overflow-hidden",u()?"opacity-1":"opacity-0 pointer-events-none",n.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5",n.theme?.button?.isHidden?"bottom-0 ml-2 sm:ml-0 w-[calc(100vw-16px)] sm:w-screen":"bottom-[calc(100%+var(--button-gap))] w-screen");return he!==j.e&&V(I,j.e=he),j.t=Ho(I,le,j.t),Q!==j.a&&ne(B,"transform-origin",j.a=Q),Ge!==j.o&&ne(B,"transform",j.o=Ge),_e!==j.i&&V(B,j.i=_e),j},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),I})()]}})}})};var j3=C("<style>"),W3=C('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),s0=(e,t)=>{let{element:r}=t,[n,o]=De(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[i,a]=O(o.prefilledVariables),[s,l]=O(n.isOpen??!1);ae(()=>{(n.defaultOpen||Xn()||va())&&d(),window.addEventListener("message",u);let T=n.autoShowDelay;de(T)&&setTimeout(()=>{d()},T)}),re(()=>{window.removeEventListener("message",u)}),ve(()=>{Ze(e.isOpen)||e.isOpen===s()||f()}),ve(()=>{e.prefilledVariables&&a(T=>({...T,...e.prefilledVariables}))});let c=T=>{T.stopPropagation()},u=T=>{let{data:b}=T;if(!(!b.isFromMakebot||b.id&&r.id!==b.id))switch(b.command){case"open":d();break;case"close":p();break;case"toggle":f();break;case"setPrefilledVariables":a(y=>({...y,...b.variables}));break;case"reload":x();break}},d=()=>{l(!0),n.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",p)},p=()=>{l(!1),n.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",p),xa()},f=()=>{s()?p():d()},x=()=>{l(!1),l(!0)},h=T=>{o.onChatStatePersisted?.(T),T&&ya()},w=T=>{e.onScriptExecutionSuccess?.(T)};return m(U,{get when(){return s()},get children(){return m(pn,{get value(){return document.querySelector("makebot-popup")?.shadowRoot},get children(){return[(()=>{var T=j3();return v(T,$o,null),v(T,No,null),T})(),(()=>{var T=W3(),b=T.firstChild,y=b.nextSibling,g=y.firstChild,k=g.firstChild;return Be(k,"pointerdown",c),v(k,m(Oo,ce(o,{onScriptExecutionSuccess:w,get prefilledVariables(){return i()},onChatStatePersisted:h}))),$(S=>{var P=e.theme?.zIndex??1999,A="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),N=e.theme?.backgroundColor??"transparent",D=e.theme?.width??"512px";return P!==S.e&&ne(T,"z-index",S.e=P),A!==S.t&&V(k,S.t=A),N!==S.a&&ne(k,"background-color",S.a=N),D!==S.o&&ne(k,"max-width",S.o=D),S},{e:void 0,t:void 0,a:void 0,o:void 0}),T})()]}})}})};var q3=C(`<style>
3080
+ `;var bN=w("<button part=button>"),yN=w('<svg part=button-icon viewBox="0 0 16 16"><path d="M8 15C12.418 15 16 11.866 16 8C16 4.134 12.418 1 8 1C3.582 1 0 4.134 0 8C0 9.76 0.743 11.37 1.97 12.6C1.873 13.616 1.553 14.73 1.199 15.566C1.12 15.752 1.273 15.96 1.472 15.928C3.728 15.558 5.069 14.99 5.652 14.694C6.41791 14.8983 7.20732 15.0012 8 15Z"fill=currentColor>'),vN=w('<img part=button-icon alt="Bubble button icon">'),Vw=w(`<span part=button-icon style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'">`),xN=w('<svg part=button-icon viewBox="0 0 24 24"style=fill:#fff><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),wN=w('<img part=button-icon alt="Bubble button close icon">');var lc=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),jw=e=>(()=>{var t=bN();return t.$$click=()=>e.toggleBot(),v(t,m(kN,e),null),v(t,m(TN,e),null),$(n=>{var r=q("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in size-[var(--button-size)]"),o=e.backgroundColor??Ge.gray.dark[2],i=e.backgroundColor?sr(e.backgroundColor)?Ge.gray.light[12]:Ge.gray.dark[12]:Ge.gray.dark[12],a=e.isBotOpen?"Fechar chatbot":"Abrir chatbot",s=e.isBotOpen;return r!==n.e&&G(t,n.e=r),o!==n.t&&ae(t,"background-color",n.t=o),i!==n.a&&ae(t,"color",n.a=i),a!==n.o&&K(t,"aria-label",n.o=a),s!==n.i&&K(t,"aria-pressed",n.i=s),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})(),kN=e=>m(Fe,{get children(){return[m(ee,{get when(){return rt(e.customIconSrc)},get children(){var t=yN();return $(()=>K(t,"class",q("fill-transparent absolute duration-200 transition size-6",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}}),m(ee,{get when(){return L(()=>!!e.customIconSrc)()&&lc(e.customIconSrc)},get children(){var t=vN();return $(n=>{var r=e.customIconSrc,o=q("duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100",Rr(e.customIconSrc)?"w-[60%]":"w-full h-full",Rr(e.customIconSrc)?"":"object-cover rounded-2xl");return r!==n.e&&K(t,"src",n.e=r),o!==n.t&&G(t,n.t=o),n},{e:void 0,t:void 0}),t}}),m(ee,{get when(){return L(()=>!!e.customIconSrc)()&&!lc(e.customIconSrc)},get children(){var t=Vw();return v(t,()=>e.customIconSrc),$(()=>G(t,q("text-4xl duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}})]}}),TN=e=>m(Fe,{get children(){return[m(ee,{get when(){return rt(e.customCloseIconSrc)},get children(){var t=xN();return $(()=>K(t,"class",q("absolute duration-200 transition w-[60%]",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}}),m(ee,{get when(){return L(()=>!!e.customCloseIconSrc)()&&lc(e.customCloseIconSrc)},get children(){var t=wN();return $(n=>{var r=e.customCloseIconSrc,o=q("absolute duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",Rr(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",Rr(e.customCloseIconSrc)?"":"object-cover rounded-2xl");return r!==n.e&&K(t,"src",n.e=r),o!==n.t&&G(t,n.t=o),n},{e:void 0,t:void 0}),t}}),m(ee,{get when(){return L(()=>!!e.customCloseIconSrc)()&&!lc(e.customCloseIconSrc)},get children(){var t=Vw();return v(t,()=>e.customCloseIconSrc),$(()=>G(t,q("absolute text-4xl duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}})]}});Ne(["click"]);var SN=w("<div part=preview-message><p>"),CN=w('<img class="rounded-full w-8 h-8 object-cover"alt="Avatar do bot"elementtiming="Bot avatar"fetchpriority=high>'),_N=w('<button part=preview-message-close-button aria-label=Fechar><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),zw=e=>{let[t,n]=O(!1),[r,o]=O({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0})},a=s=>{let l=s.changedTouches[0]?.clientX??0,c=s.changedTouches[0]?.clientY??0;(Math.abs(l-r().x)>10||c-r().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{var s=SN(),l=s.firstChild;return s.$$touchend=a,s.$$touchstart=i,s.addEventListener("mouseleave",()=>n(!1)),s.addEventListener("mouseenter",()=>n(!0)),s.$$click=()=>e.onClick(),v(s,m(EN,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),l),v(s,m(U,{get when(){return e.avatarUrl},keyed:!0,children:c=>(()=>{var u=CN();return K(u,"src",c),u})()}),l),v(l,()=>e.message),$(c=>{var u=q("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),d=e.previewMessageTheme?.backgroundColor??Gf,f=e.previewMessageTheme?.textColor??Hf;return u!==c.e&&G(s,c.e=u),d!==c.t&&ae(s,"background-color",c.t=d),f!==c.a&&ae(s,"color",c.a=f),c},{e:void 0,t:void 0,a:void 0}),s})()},EN=e=>(()=>{var t=_N();return t.$$click=n=>(n.stopPropagation(),e.onClick()),$(n=>{var r="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??Wf,i=e.previewMessageTheme?.closeButtonIconColor??qf;return r!==n.e&&G(t,n.e=r),o!==n.t&&ae(t,"background-color",n.t=o),i!==n.a&&ae(t,"color",n.a=i),n},{e:void 0,t:void 0,a:void 0}),t})();Ne(["click","touchstart","touchend"]);var PN=w("<style>"),IN=w("<div>"),AN=w('<div style=--container-bottom:20px;--button-gap:12px;--container-border-radius:7px><div part=bot style="transition:transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out">');var Gw=(e,t)=>{let{element:n}=t,[r,o]=qe(e,["isOpen","onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[i,a]=O("idle"),[s,l]=O(!1),c=re(()=>ye(r.isOpen)),u=re(()=>c()?r.isOpen:i()==="open"),[d,f]=O(o.prefilledVariables),[p,y]=O({message:r.previewMessage?.message??"",avatarUrl:r.previewMessage?.avatarUrl}),[h,k]=O(!1),C=()=>{window.addEventListener("message",T)},b=()=>{window.removeEventListener("message",T)};$e(()=>{i()!=="idle"||!o.makebot||(a("ready"),C(),A())}),ie(()=>{a("idle"),b()}),$e(()=>{r.isOpen&&!s()&&l(!0)});let T=I=>{let{data:B}=I;if(!(!B.isFromMakebot||B.id&&n.id!==B.id))switch(B.command){case"open":g();break;case"close":x();break;case"toggle":S();break;case"showPreviewMessage":N(B.message);break;case"hidePreviewMessage":D();break;case"setPrefilledVariables":f(H=>({...H,...B.variables}));break;case"unmount":F();break;case"reload":P();break}},g=()=>{r.onOpen?.(),!c()&&(l(!0),D(),a("open"))},x=()=>{r.onClose?.(),!c()&&(a("closed"),ks())},S=()=>{u()?x():g()},P=()=>{l(!1),l(!0)},R=()=>{r.onPreviewMessageClick?.(),g()},N=I=>{if(u())return;let B=I??(r.previewMessage?{message:r.previewMessage.message,avatarUrl:r.previewMessage.avatarUrl}:void 0);B&&(y(B),k(!0))},D=()=>{k(!1),r.onPreviewMessageDismissed?.()},F=()=>{u()?(x(),setTimeout(()=>{a("unmounted")},200)):a("unmounted")},A=()=>{(Ts()||Fo())&&g(),ye(r.autoShowDelay)&&setTimeout(g,r.autoShowDelay);let I=r.previewMessage?.autoShowDelay;ye(I)&&setTimeout(N,I)},M=I=>{o.onChatStatePersisted?.(I),I&&ws()},V=I=>{o.onScriptExecutionSuccess?.(I)},Y;return m(U,{get when(){return i()!=="unmounted"},get children(){return m(Vr,{get value(){return document.querySelector("makebot-bubble")?.shadowRoot},get children(){return[(()=>{var I=PN();return v(I,Ii,null),v(I,Ai,null),I})(),(()=>{var I=IN(),B=Y;return typeof B=="function"?ke(B,I):Y=I,I})(),(()=>{var I=AN(),B=I.firstChild;return v(I,m(U,{get when(){return h()},get children(){return m(zw,ge(p,{get placement(){return r.theme?.placement},get previewMessageTheme(){return r.theme?.previewMessage},onClick:R,onCloseClick:D}))}}),B),v(I,m(U,{get when(){return!r.theme?.button?.isHidden},get children(){return m(jw,ge(()=>r.theme?.button,{get placement(){return r.theme?.placement},toggleBot:S,get isBotOpen(){return u()}}))}}),B),v(B,m(U,{get when(){return s()},get children(){return m(Pi,ge(o,{onScriptExecutionSuccess:V,onChatStatePersisted:M,get prefilledVariables(){return d()}}))}})),$(H=>{var we=q(r.theme?.position==="static"?"relative":"z-[424242] fixed bottom-[var(--container-bottom)] right-5",r.theme?.placement==="left"&&"left-5"),de={"--button-size":Yd(r.theme?.button?.size??"medium",{isHidden:r.theme?.button?.isHidden}),"--bot-bg-color":r.theme?.chatWindow?.backgroundColor,"--bot-max-width":r.theme?.chatWindow?.maxWidth??"400px","--bot-max-height":r.theme?.chatWindow?.maxHeight??"704px",...r.inlineStyle},te=r.theme?.placement==="left"?"bottom left":"bottom right",Ye=u()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",Le=q("absolute rounded-lg max-h-[calc(100dvh-var(--container-bottom)-var(--button-gap)-var(--button-size))] shadow-lg bg-[var(--bot-bg-color)] h-[var(--bot-max-height)] max-w-[var(--bot-max-width)] overflow-hidden",u()?"opacity-1":"opacity-0 pointer-events-none",r.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5",r.theme?.button?.isHidden?"bottom-0 ml-2 sm:ml-0 w-[calc(100vw-16px)] sm:w-screen":"bottom-[calc(100%+var(--button-gap))] w-screen");return we!==H.e&&G(I,H.e=we),H.t=Ui(I,de,H.t),te!==H.a&&ae(B,"transform-origin",H.a=te),Ye!==H.o&&ae(B,"transform",H.o=Ye),Le!==H.i&&G(B,H.i=Le),H},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),I})()]}})}})};var RN=w("<style>"),ON=w('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),Hw=(e,t)=>{let{element:n}=t,[r,o]=qe(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[i,a]=O(o.prefilledVariables),[s,l]=O(r.isOpen??!1);me(()=>{(r.defaultOpen||Fo()||Ts())&&d(),window.addEventListener("message",u);let C=r.autoShowDelay;ye(C)&&setTimeout(()=>{d()},C)}),ie(()=>{window.removeEventListener("message",u)}),$e(()=>{rt(e.isOpen)||e.isOpen===s()||p()}),$e(()=>{e.prefilledVariables&&a(C=>({...C,...e.prefilledVariables}))});let c=C=>{C.stopPropagation()},u=C=>{let{data:b}=C;if(!(!b.isFromMakebot||b.id&&n.id!==b.id))switch(b.command){case"open":d();break;case"close":f();break;case"toggle":p();break;case"setPrefilledVariables":a(T=>({...T,...b.variables}));break;case"reload":y();break}},d=()=>{l(!0),r.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",f)},f=()=>{l(!1),r.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",f),ks()},p=()=>{s()?f():d()},y=()=>{l(!1),l(!0)},h=C=>{o.onChatStatePersisted?.(C),C&&ws()},k=C=>{e.onScriptExecutionSuccess?.(C)};return m(U,{get when(){return s()},get children(){return m(Vr,{get value(){return document.querySelector("makebot-popup")?.shadowRoot},get children(){return[(()=>{var C=RN();return v(C,Ii,null),v(C,Ai,null),C})(),(()=>{var C=ON(),b=C.firstChild,T=b.nextSibling,g=T.firstChild,x=g.firstChild;return gt(x,"pointerdown",c),v(x,m(Pi,ge(o,{onScriptExecutionSuccess:k,get prefilledVariables(){return i()},onChatStatePersisted:h}))),$(S=>{var P=e.theme?.zIndex??1999,R="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),N=e.theme?.backgroundColor??"transparent",D=e.theme?.width??"512px";return P!==S.e&&ae(C,"z-index",S.e=P),R!==S.t&&G(x,S.t=R),N!==S.a&&ae(x,"background-color",S.a=N),D!==S.o&&ae(x,"max-width",S.o=D),S},{e:void 0,t:void 0,a:void 0,o:void 0}),C})()]}})}})};var NN=w(`<style>
3034
3081
  :host {
3035
3082
  display: block;
3036
3083
  width: 100%;
3037
3084
  height: 100%;
3038
3085
  overflow-y: hidden;
3039
3086
  }
3040
- `);var l0=(e,{element:t})=>{let[r,n]=O(!1),[o,i]=O(e.prefilledVariables),a=()=>{n(!0)},s=()=>{n(!1),setTimeout(()=>{n(!0)},1)},l=new IntersectionObserver(d=>{d.some(p=>p.isIntersecting)&&a()}),c=()=>{let d=t.getBoundingClientRect();return d.width>0&&d.height>0&&d.bottom>=0&&d.right>=0&&d.top<=window.innerHeight&&d.left<=window.innerWidth};ae(()=>{if(window.addEventListener("message",u),c()){a();return}l.observe(t)}),ve(()=>{e.prefilledVariables&&i(d=>({...d,...e.prefilledVariables}))});let u=d=>{let{data:p}=d;if(!(!p.isFromMakebot||p.id&&t.id!==p.id))switch(p.command){case"setPrefilledVariables":i(f=>({...f,...p.variables}));break;case"reload":s();break}};return re(()=>{l.disconnect()}),m(pn,{get value(){return document.querySelector("makebot-standard")?.shadowRoot},get children(){return[(()=>{var d=q3(),p=d.firstChild;return v(d,$o,p),v(d,No,p),d})(),m(U,{get when(){return r()},get children(){return m(Oo,ce(e,{get prefilledVariables(){return o()}}))}})]}})};var c0=()=>{typeof window>"u"||(ia("makebot-standard",aa,l0),ia("makebot-bubble",Rd,a0),ia("makebot-popup",Ad,s0))};var u0=({id:e}={})=>{let t={isFromMakebot:!0,command:"close",id:e};window.postMessage(t)};var d0=({id:e}={})=>{let t={isFromMakebot:!0,command:"hidePreviewMessage",id:e};window.postMessage(t)};var m0=({id:e}={})=>{let t={isFromMakebot:!0,command:"open",id:e};window.postMessage(t)};var f0=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"sendCommand",text:e,id:t};window.postMessage(r)};var p0=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"setInputValue",value:e,id:t};window.postMessage(r)};var g0=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r)};var h0=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"showPreviewMessage",message:e,id:t};window.postMessage(r)};var b0=({id:e}={})=>{let t={isFromMakebot:!0,command:"toggle",id:e};window.postMessage(t)};var y0=({id:e}={})=>{let t={isFromMakebot:!0,command:"unmount",id:e};window.postMessage(t)};var x0=({id:e}={})=>{let t={isFromMakebot:!0,command:"reload",id:e};window.postMessage(t)};var Y3=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("makebot-standard");if(!t)throw new Error("<makebot-standard> element not found.");Object.assign(t,e)},K3=e=>{let t=document.createElement("makebot-popup");Object.assign(t,e),document.body.prepend(t)},X3=e=>{let t=document.createElement("makebot-bubble");Object.assign(t,e),document.body.prepend(t)},v0=()=>({initStandard:Y3,initPopup:K3,initBubble:X3,close:u0,hidePreviewMessage:d0,open:m0,setPrefilledVariables:g0,showPreviewMessage:h0,toggle:b0,setInputValue:p0,unmount:y0,sendCommand:f0,reload:x0}),w0=e=>{typeof window>"u"||(window.Makebot={...e})};c0();var k0=v0();w0(k0);var xee=k0;export{xee as default};
3087
+ `);var Ww=(e,{element:t})=>{let[n,r]=O(!1),[o,i]=O(e.prefilledVariables),a=()=>{r(!0)},s=()=>{r(!1),setTimeout(()=>{r(!0)},1)},l=new IntersectionObserver(d=>{d.some(f=>f.isIntersecting)&&a()}),c=()=>{let d=t.getBoundingClientRect();return d.width>0&&d.height>0&&d.bottom>=0&&d.right>=0&&d.top<=window.innerHeight&&d.left<=window.innerWidth};me(()=>{if(window.addEventListener("message",u),c()){a();return}l.observe(t)}),$e(()=>{e.prefilledVariables&&i(d=>({...d,...e.prefilledVariables}))});let u=d=>{let{data:f}=d;if(!(!f.isFromMakebot||f.id&&t.id!==f.id))switch(f.command){case"setPrefilledVariables":i(p=>({...p,...f.variables}));break;case"reload":s();break}};return ie(()=>{l.disconnect()}),m(Vr,{get value(){return document.querySelector("makebot-standard")?.shadowRoot},get children(){return[(()=>{var d=NN(),f=d.firstChild;return v(d,Ii,f),v(d,Ai,f),d})(),m(U,{get when(){return n()},get children(){return m(Pi,ge(e,{get prefilledVariables(){return o()}}))}})]}})};var qw=()=>{typeof window>"u"||(ls("makebot-standard",cs,Ww),ls("makebot-bubble",qm,Gw),ls("makebot-popup",Wm,Hw))};var Zw=({id:e}={})=>{let t={isFromMakebot:!0,command:"close",id:e};window.postMessage(t)};var Yw=({id:e}={})=>{let t={isFromMakebot:!0,command:"hidePreviewMessage",id:e};window.postMessage(t)};var Kw=({id:e}={})=>{let t={isFromMakebot:!0,command:"open",id:e};window.postMessage(t)};var Xw=(e,{id:t}={})=>{let n={isFromMakebot:!0,command:"sendCommand",text:e,id:t};window.postMessage(n)};var Jw=(e,{id:t}={})=>{let n={isFromMakebot:!0,command:"setInputValue",value:e,id:t};window.postMessage(n)};var Qw=(e,{id:t}={})=>{let n={isFromMakebot:!0,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(n)};var e1=(e,{id:t}={})=>{let n={isFromMakebot:!0,command:"showPreviewMessage",message:e,id:t};window.postMessage(n)};var t1=({id:e}={})=>{let t={isFromMakebot:!0,command:"toggle",id:e};window.postMessage(t)};var n1=({id:e}={})=>{let t={isFromMakebot:!0,command:"unmount",id:e};window.postMessage(t)};var r1=({id:e}={})=>{let t={isFromMakebot:!0,command:"reload",id:e};window.postMessage(t)};var $N=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("makebot-standard");if(!t)throw new Error("<makebot-standard> element not found.");Object.assign(t,e)},MN=e=>{let t=document.createElement("makebot-popup");Object.assign(t,e),document.body.prepend(t)},DN=e=>{let t=document.createElement("makebot-bubble");Object.assign(t,e),document.body.prepend(t)},o1=()=>({initStandard:$N,initPopup:MN,initBubble:DN,close:Zw,hidePreviewMessage:Yw,open:Kw,setPrefilledVariables:Qw,showPreviewMessage:e1,toggle:t1,setInputValue:Jw,unmount:n1,sendCommand:Xw,reload:r1}),i1=e=>{typeof window>"u"||(window.Makebot={...e})};qw();var a1=o1();i1(a1);var Jne=a1;export{Jne as default};
3041
3088
  /*! Bundled license information:
3042
3089
 
3043
3090
  ky/distribution/index.js: