@superleapai/flow-ui 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/superleap-flow.min.js +2 -2
- package/index.js +4 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* @superleapai/flow-ui v2.2.
|
|
2
|
-
!function(){"use strict";var e,t,r;!function(e){const t={Int:1,Varchar:5,Checkbox:6,DateTime:7,Date:8,SecondsSinceMidnight:9,Email:11,Text:14,SingleSelect:15,MultiSelect:16,Url:17,FileUpload:20,PhoneNumber:21,Rating:22,Decimal:4,Currency:23,Stage:24,Location:18,Region:27,MultiFileUpload:29},r={OneToOne:1,OneToMany:2,ManyToOne:3,Restricted:6};class n{constructor(e,t=null){this.value=e,this.createdAt=Date.now(),this.ttl=t&&"number"==typeof t&&t>0?t:null}isExpired(){return!!this.ttl&&Date.now()-this.createdAt>this.ttl}getValue(){return this.isExpired()?null:this.value}}class a{constructor(e={}){this.enabled=!1!==e.enabled,this.maxSize=e.maxSize||1e3,this.defaultTTL=e.defaultTTL||3e5,this.storage=new Map,this.stats={hits:0,misses:0,sets:0,deletes:0,evictions:0}}get(e){if(!this.enabled)return null;const t=this.storage.get(e);return t?t.isExpired()?(this.storage.delete(e),this.stats.misses++,null):(this.stats.hits++,t.getValue()):(this.stats.misses++,null)}set(e,t,r=null){if(!this.enabled)return;const a=r&&"number"==typeof r&&r>0?r:this.defaultTTL;this.storage.size>=this.maxSize&&this._evictOldest();const o=new n(t,a);this.storage.set(e,o),this.stats.sets++}delete(e){if(!this.enabled)return!1;const t=this.storage.delete(e);return t&&this.stats.deletes++,t}clear(){this.storage.clear(),this.stats={hits:0,misses:0,sets:0,deletes:0,evictions:0}}getStats(){return{...this.stats,size:this.storage.size,maxSize:this.maxSize,hitRate:this.stats.hits+this.stats.misses>0?(this.stats.hits/(this.stats.hits+this.stats.misses)*100).toFixed(2)+"%":"0%"}}_evictOldest(){let e=null,t=Date.now();for(const[r,n]of this.storage.entries())n.createdAt<t&&(t=n.createdAt,e=r);e&&(this.storage.delete(e),this.stats.evictions++)}cleanExpired(){let e=0;for(const[t,r]of this.storage.entries())r.isExpired()&&(this.storage.delete(t),e++);return e}}const o={EQ:"eq",NEQ:"neq",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NOT_IN:"nin",LIKE:"ilike",NOT_LIKE:"not_ilike",SW:"starts_with",EW:"ends_with",IS_EMPTY:"is_empty",NOT_EMPTY:"not_empty",CONTAINS:"contains",NOT_CONTAINS:"not_contains",BETWEEN:"between",LOWER_EQ:"leq",LOWER_NOT_EQ:"nleq",IN_ACCESSIBLE_OWNERS:"in_accessible_owners"},i={TODAY:"is_today",ON:"on",IS_YESTERDAY:"is_yesterday",BEFORE_TODAY:"before_today",AFTER_TODAY:"after_today",TOMORROW:"tomorrow",THIS_WEEK:"this_week",NEXT_WEEK:"next_week",LAST_WEEK:"last_week",LAST_SEVEN_DAYS:"last_seven_days",LAST_TEN_DAYS:"last_ten_days",LAST_FIFTEEN_DAYS:"last_fifteen_days",LAST_THIRTY_DAYS:"last_thirty_days",THIS_MONTH:"this_month",NEXT_MONTH:"next_month",LAST_MONTH:"last_month",LAST_MONTH_TILL_DATE:"last_month_till_date",LAST_NINETY_DAYS:"last_ninety_days",THIS_QUARTER:"this_quarter",NEXT_QUARTER:"next_quarter",LAST_QUARTER:"last_quarter",LAST_180_DAYS:"last_180_days",LAST_365_DAYS:"last_365_days",THIS_YEAR:"this_year",NEXT_YEAR:"next_year",LAST_YEAR:"last_year",ALL_TIME:"all_time"};function l(e){if("string"==typeof e&&""===e?.trim()||null==e||Array.isArray(e)&&0===e.length)return!0}function s(e){return o.IS_EMPTY===e||o.NOT_EMPTY===e||o.IN_ACCESSIBLE_OWNERS===e||i.TODAY===e||i.IS_YESTERDAY===e||i.BEFORE_TODAY===e||i.THIS_WEEK===e||i.LAST_WEEK===e||i.LAST_SEVEN_DAYS===e||i.LAST_FIFTEEN_DAYS===e||i.LAST_THIRTY_DAYS===e||i.THIS_MONTH===e||i.LAST_MONTH===e||i.LAST_MONTH_TILL_DATE===e||i.THIS_QUARTER===e||i.LAST_QUARTER===e||i.THIS_YEAR===e||i.LAST_YEAR===e||i.AFTER_TODAY===e}function c(e){if(!e||"object"!=typeof e)return 0;if(e.field&&e.operator)return s(e.operator)?1:l(e.value)?0:1;if(Array.isArray(e))return e.reduce((e,t)=>e+c(t),0);let t=0;return e.and&&Array.isArray(e.and)&&(t+=c(e.and)),e.or&&Array.isArray(e.or)&&(t+=c(e.or)),t}function d(e,t){const r=e[t];return Array.isArray(r)?c(r):0}class u{constructor(e,t){this.objectSlug=e,this.sdk=t,this.query={fields:[],filters:{and:[],or:[]},sort:[]},this._executed=!1}then(e,t){return this._execute().then(e,t)}catch(e){return this._execute().catch(e)}finally(e){return this._execute().finally(e)}select(...e){return this.query.fields=[...new Set([...this.query.fields,...e])],this}selectAll(){return this._selectAll=!0,this.query.fields=[],this}where(e){return Object.entries(e).forEach(([e,t])=>{this.query.filters.and.push({field:e,operator:"eq",value:t})}),this}whereAnd(e){const t=new u(this.objectSlug,this.sdk);e(t);const r=t.query.filters.and.length>0,n=t.query.filters.or.length>0;if(!r&&!n)return this;const a=[];return r&&a.push(...t.query.filters.and),n&&a.push({or:t.query.filters.or}),1===a.length?this.query.filters.and.push(a[0]):this.query.filters.and.push({and:a}),this}whereOr(e){const t=new u(this.objectSlug,this.sdk);e(t);const r=t.query.filters.and.length>0,n=t.query.filters.or.length>0;if(!r&&!n)return this;const a=[];return r&&a.push(...t.query.filters.and),n&&a.push(...t.query.filters.or),a.forEach(e=>{this.query.filters.or.push(e)}),this}filter(e,t,r){return this.query.filters.and.push({field:e,operator:t,value:r}),this}exact(e,t){return this.filter(e,"eq",t)}iexact(e,t){return this.filter(e,"leq",t)}notexact(e,t){return this.filter(e,"neq",t)}notiexact(e,t){return this.filter(e,"nleq",t)}contains(e,t){return this.filter(e,"contains",t)}icontains(e,t){return this.filter(e,"ilike",t)}startswith(e,t){return this.filter(e,"starts_with",t)}endswith(e,t){return this.filter(e,"ends_with",t)}in(e,t){return this.filter(e,"in",t)}notin(e,t){return this.filter(e,"nin",t)}gt(e,t){return this.filter(e,"gt",t)}gte(e,t){return this.filter(e,"gte",t)}lt(e,t){return this.filter(e,"lt",t)}lte(e,t){return this.filter(e,"lte",t)}between(e,t){return this.filter(e,"between",t)}notcontains(e,t){return this.filter(e,"not_contains",t)}isempty(e){return this.filter(e,"is_empty",null)}isnotempty(e){return this.filter(e,"not_empty",null)}exists(e){return this.filter(e,"exists",null)}notexists(e){return this.filter(e,"not_exists",null)}like(e,t){return this.filter(e,"like",t)}ilike(e,t){return this.filter(e,"ilike",t)}isnull(e){return console.warn("isnull is deprecated, use isempty() instead"),this.filter(e,"is_empty",null)}isnotnull(e){return console.warn("isnotnull is deprecated, use isnotempty() instead"),this.filter(e,"not_empty",null)}filterBy(e){if(!e||"object"!=typeof e)throw new Error("Filter must be an object");let t=!1;return e.field&&e.operator?!s(e.operator)&&l(e.value)||(t=!0):(e.and&&d(e,"and")>0&&(t=!0),e.or&&d(e,"or")>0&&(t=!0)),t?!e.and||!Array.isArray(e.and)||e.or||e.field||e.operator?!e.or||!Array.isArray(e.or)||e.and||e.field||e.operator?this.query.filters.and.push(e):this.query.filters.or.push(...e.or):this.query.filters.and.push(...e.and):console.warn("FilterBy: Skipping filter with no valid conditions",e),this}orderBy(...e){return this.query.sort=e.map(e=>e.startsWith("-")?{field:e.slice(1),direction:"desc"}:{field:e,direction:"asc"}),this}limit(e){return this.query.pagination?this.query.pagination.page_size=e:this.query.pagination={page:1,page_size:e},this}page(e){return this.query.pagination?this.query.pagination.page=e:this.query.pagination={page:e,page_size:100},this}offset(e){if(this.query.pagination){const t=this.query.pagination.page_size;this.query.pagination.page=Math.floor(e/t)+1}else this.query.pagination={page:Math.floor(e/100)+1,page_size:100};return this}async _execute(){if(this._executed)return console.warn("Query already executed. Create a new query builder."),[];try{if(!0===this._selectAll)try{const e=this.sdk.getModel(this.objectSlug),t=await e.getSchema();t&&t.org_object_columns&&Array.isArray(t.org_object_columns)?(this.query.fields=t.org_object_columns.filter(e=>e&&e.slug).filter(e=>!e.relation||e.relation&&e.relationship_type!==r.OneToMany).map(e=>e.slug),this.query.fields.length>0?console.log(`Using ${this.query.fields.length} explicit fields from schema`):console.warn("Schema returned no valid fields, using empty fields array")):console.warn("No valid schema structure found, using empty fields array")}catch(e){console.error("Error fetching schema fields:",e),console.log("Falling back to empty fields array")}const e={...this.query};e.fields.length>0&&!e.fields.includes("id")&&e.fields.push("id"),0===e.sort.length&&(e.sort=[{field:"id",direction:"desc"}]),e.filters=this._buildFilterStructure(e.filters),e.filters||(e.filters={and:[]}),console.log("Executing query with fields:",e.fields);const t=this._cacheOptions||{},n=await this.sdk.getRecords(this.objectSlug,e,t);if(this._executed=!0,n.success){let e=[];return Array.isArray(n.data)?e=n.data:n.data&&Array.isArray(n.data.records)?e=n.data.records:n.data&&n.data.data&&Array.isArray(n.data.data)&&(e=n.data.data),console.log(`Query returned ${e.length} records`),e.map(e=>new p(e,this.sdk.getModel(this.objectSlug)))}return console.warn("Query failed:",n.message),[]}catch(e){return console.error("Error executing query:",e),[]}}_buildFilterStructure(e){if(!e||!e.and.length&&!e.or.length)return null;const t={};return e.and.length>0&&(t.and=e.and),e.or.length>0&&(t.or=e.or),t}async first(){this.limit(1);const e=await this._execute();return e.length>0?e[0]:null}async count(){const e=this._buildFilterStructure(this.query.filters),t=this._cacheOptions||{},r=await this.sdk.getRecordsCount(this.objectSlug,e,t);return r.success?r.data.count:0}async exists(){return await this.count()>0}cacheOptions(e={}){return this._cacheOptions=e,this}noCache(){return this.cacheOptions({useCache:!1})}cacheTTL(e){return this.cacheOptions({useCache:!0,cacheTTL:e})}cache(e={}){return this.cacheOptions({useCache:!0,cacheTTL:e.ttl})}}class p{constructor(e,t){if(!e||"object"!=typeof e)throw new Error("Record data must be a valid object");if(!t)throw new Error("Model instance is required");this.data=e,this.model=t,this.id=e.id}get(e){if(!this.data||"object"!=typeof this.data)throw new Error("Record data is not valid");const t=Object.keys(this.data);if(!(e in this.data))throw new Error(`Field '${e}' not found. Available fields: ${t.join(", ")}`);return this.data[e]}set(e,t){this.data[e]=t}async update(e){console.warn("update is deprecated, use model('object').update(id,updatedData) instead");try{const t=await this.model.update(this.id,e);return this.data=t.data,this}catch(e){throw new Error(e.message||"Update failed")}}async delete(){return(await this.model.delete(this.id)).success}async refresh(){const e=await this.model.get(this.id);return this.data=e.data,this}toJSON(){return this.data}}class f{constructor(e,t){this.objectSlug=e,this.sdk=t,this._schema=null,this._schemaLoaded=!1}async getSchema(){try{if(!this._schemaLoaded){console.log(`Fetching schema for ${this.objectSlug}...`);const e=await this.sdk.getObjectSchema(this.objectSlug);e.success&&e.data?(this._schema=e.data,this._schemaLoaded=!0,console.log(`Schema loaded for ${this.objectSlug}`)):console.warn(`Failed to load schema for ${this.objectSlug}:`,e.message)}return this._schema}catch(e){return console.error(`Error loading schema for ${this.objectSlug}:`,e),null}}async getField(e){const t=await this.getSchema();if(!t||!t.org_object_columns)return null;const r=t.org_object_columns.find(t=>t.slug===e);return r?{slug:r.slug,displayName:r.display_name,dataType:r.column_data_type,isRequired:1===r.is_required,isUnique:1===r.is_unique,enumGroup:r.enum_group,constraints:r.constraints,properties:r.properties}:null}async getFields(){try{const e=await this.getSchema();return e?e.org_object_columns&&Array.isArray(e.org_object_columns)?(console.log(`Found ${e.org_object_columns.length} fields for ${this.objectSlug}`),e.org_object_columns.map(e=>({slug:e.slug,displayName:e.display_name,dataType:e.column_data_type,isRequired:1===e.is_required,isUnique:1===e.is_unique,enumGroup:e.enum_group,constraints:e.constraints,properties:e.properties}))):(console.warn(`Schema for ${this.objectSlug} doesn't contain org_object_columns array`),[]):(console.warn(`No schema available for ${this.objectSlug}`),[])}catch(e){return console.error(`Error getting fields for ${this.objectSlug}:`,e),[]}}select(...e){return new u(this.objectSlug,this.sdk).select(...e)}selectAll(){console.warn("selectAll is deprecated, use select() with fields instead");return new u(this.objectSlug,this.sdk).selectAll()}async create(e){const t=await this.sdk.createRecord(this.objectSlug,e);if(t.success)return this.sdk.invalidateCache(this.objectSlug),new p(t.data,this);throw new Error(JSON.stringify(t.data))}async get(e){console.warn("get is deprecated, use select() instead");const t=await this.sdk.getRecordById(this.objectSlug,e);if(t.success)return new p(t.data,this);throw new Error(t.message||"Record not found")}async update(e,t){const r=await this.sdk.updateRecord(this.objectSlug,e,t);if(r.success)return this.sdk.invalidateCache(this.objectSlug),new p(r.data||{},this)}async delete(e){const t=await this.sdk.deleteRecord(this.objectSlug,e);return t.success&&this.sdk.invalidateCache(this.objectSlug),t.success}async deleteMany(e){const t=await this.sdk.deleteRecords(this.objectSlug,e);return t.success&&this.sdk.invalidateCache(this.objectSlug),t.success}async getOrCreate(e,t={}){console.warn("getOrCreate is deprecated, use select() instead");const r=await this.selectAll().where(e).first();if(r)return{record:r,created:!1};const n={...t,...e},a=await this.create(n);return console.warn("getOrCreate is deprecated, use select() instead"),{record:a,created:!0}}async updateOrCreate(e,t={}){console.warn("updateOrCreate is deprecated, use model('object').update(id,updatedData) instead");const r=await this.selectAll().where(e).first();if(r){return{record:await this.update(r.id,t),created:!1}}const n={...t,...e};return{record:await this.create(n),created:!0}}async bulkCreate(e,t=!0,r=!1){const n=await this.sdk.bulkUpsert(this.objectSlug,e,!0,r);if(n.success){this.sdk.invalidateCache(this.objectSlug);return(n.data?.records||[]).map(e=>new p(e,this))}throw new Error(n.message||"Bulk create failed")}async bulkUpdate(e,t=!1,r=!1){const n=await this.sdk.bulkUpsert(this.objectSlug,e,t,r,!0);if(n.success){this.sdk.invalidateCache(this.objectSlug);return(n.data?.records||[]).map(e=>new p(e,this))}throw new Error(n.message||"Bulk update failed")}}class h{constructor(e={}){this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||"https://app.superleap.dev/api/v1",this.clientId=e.clientId||"",this.clientSecret=e.clientSecret||"";const t=e.cache||{};t.maxSize&&("number"!=typeof t.maxSize||t.maxSize<=0)&&(console.warn("Invalid cache maxSize, using default: 1000"),t.maxSize=1e3),t.defaultTTL&&("number"!=typeof t.defaultTTL||t.defaultTTL<=0)&&(console.warn("Invalid cache defaultTTL, using default: 5 minutes"),t.defaultTTL=3e5),this.cache=new a(t),this.cacheTTL={schema:t.ttl?.schema&&"number"==typeof t.ttl.schema&&t.ttl.schema>0?t.ttl.schema:18e5,records:t.ttl?.records&&"number"==typeof t.ttl.records&&t.ttl.records>0?t.ttl.records:12e4,count:t.ttl?.count&&"number"==typeof t.ttl.count&&t.ttl.count>0?t.ttl.count:6e4,user:t.ttl?.user&&"number"==typeof t.ttl.user&&t.ttl.user>0?t.ttl.user:6e5},this._models=new Map,this._schemas=new Map}getModel(e){return this._models.has(e)||this._models.set(e,new f(e,this)),this._models.get(e)}async getCurrentUserData(){const e=await this.request("/org/user/me",{cache:{useCache:!1,ttl:this.cacheTTL.user}});return e?.data}async getCurrentUser(){const e=await this.request("/org/user/me",{cache:{useCache:!1,ttl:this.cacheTTL.user}});return{user:{id:e.data.user_id,name:e.data.user_name,email:e.data.user_email},orgId:e.data.org_id,timezone:e.data.timezone}}model(e){return this.getModel(e)}async getObjectSchema(e){try{console.log(`Fetching schema from API for ${e}`);const t=await this.request(`/org/objects/${e}`,{cache:{useCache:!1,ttl:this.cacheTTL.schema}});return t.success&&t.data?(console.log(`Successfully fetched schema for ${e}`),this._schemas.set(e,t.data)):console.warn(`Failed to fetch schema for ${e}:`,t.message),t}catch(t){return console.error(`Error fetching schema for ${e}:`,t),{success:!1,data:null,message:t instanceof Error?t.message:"Unknown error"}}}_isCacheableRequest(e,t,r){if("GET"===t)return!0;if("POST"===t){if(e.includes("/filter")&&!e.includes("/delete"))return!0;if(e.includes("/filter/count"))return!0;if(e.includes("/org/objects/")&&!e.includes("/record"))return!0}return!1}_generateCacheKey(e,t,r){const n=[t,e];if(r&&Object.keys(r).length>0)try{const e=Object.keys(r).sort().reduce((e,t)=>(e[t]=r[t],e),{});n.push(JSON.stringify(e))}catch(e){console.warn("Failed to generate cache key, using fallback:",e.message),n.push("fallback:"+Date.now())}return n.join(":")}_getDefaultTTL(e){return e.includes("/org/objects/")&&!e.includes("/record")?this.cacheTTL.schema:e.includes("/org/user/me")?this.cacheTTL.user:e.includes("/filter/count")?this.cacheTTL.count:e.includes("/filter")?this.cacheTTL.records:this.cache.defaultTTL}setApiKey(e){this.apiKey=e}setClientCredentials(e,t){this.clientId=e,this.clientSecret=t}setCacheEnabled(e){this.cache.enabled=e}clearCache(){this.cache.clear(),this._schemas.clear(),this._models.clear()}getCacheStats(){return this.cache.getStats()}invalidateCache(e){if(e)try{const t=[];for(const[r]of this.cache.storage.entries())(r.includes(`/org/objects/${e}`)||r.includes(`schema:${e}`)||r.includes(`fields:${e}`))&&t.push(r);t.forEach(e=>this.cache.delete(e)),this._schemas.delete(e),this._models.delete(e)}catch(e){console.warn("Error during cache invalidation:",e.message),this.clearCache()}else this.clearCache()}cleanExpiredCache(){return this.cache.cleanExpired()}async request(e,t={}){const{method:r="GET",headers:n={},body:a,cache:o={}}=t,{useCache:i=!1,ttl:l=null,key:s=null}=o,c={"Content-Type":"application/json","Client-ID":this.clientId,"Client-Secret":this.clientSecret,...n};this.apiKey&&(c.Authorization=`Bearer ${this.apiKey}`);const d=a instanceof FormData;d&&delete c["Content-Type"];const u=`${this.baseUrl}${e.startsWith("/")?e:`/${e}`}`;if(i&&("GET"===r||this._isCacheableRequest(e,r,a))){const p=s||this._generateCacheKey(e,r,a),f=this.cache.get(p);if(f){async function m(e){return new Promise(t=>{setTimeout(()=>t(e),0)})}return console.log(`Using cached response for ${e}`),m(f)}const h=await this._makeRequest(u,r,c,a,d);if(h.success){const g=l||this._getDefaultTTL(e);this.cache.set(p,h,g)}return h}return await this._makeRequest(u,r,c,a,d)}async _makeRequest(e,t,r,n,a){try{const o=await fetch(e,{method:t,headers:r,body:a?n:n?JSON.stringify(n):void 0}),i=o.headers.get("content-type");let l={};if(i&&i.includes("application/json"))try{l=await o.json()}catch(e){console.warn("Failed to parse JSON response:",e),l={message:await o.text()}}else{l={message:await o.text()}}return{data:l.data||null,status:o.status,success:o.ok,message:l.message||o.statusText}}catch(e){return console.error("API request failed:",e),{data:e,status:0,success:!1,message:e instanceof Error?e.message:"Unknown error occurred"}}}async getRecords(e,t=null,r={}){const{useCache:n=!1,cacheTTL:a=null}=r;return this.request(`/org/objects/${e}/filter`,{method:"POST",body:{query:t},cache:{useCache:n,ttl:a||this.cacheTTL.records}})}async getRecordById(e,t){return this.request(`/org/objects/${e}/record/${t}`,{cache:{useCache:!1,ttl:this.cacheTTL.records}})}async createRecord(e,t){return this.request(`/org/objects/${e}/record`,{method:"POST",body:t,cache:{useCache:!1}})}async updateRecord(e,t,r){return this.request(`/org/objects/${e}/record/${t}`,{method:"PUT",body:r,cache:{useCache:!1}})}async deleteRecord(e,t){return this.request(`/org/objects/${e}/record/delete`,{method:"POST",body:{record_ids:[t]},cache:{useCache:!1}})}async deleteRecords(e,t){return this.request(`/org/objects/${e}/record/delete`,{method:"POST",body:{record_ids:t},cache:{useCache:!1}})}async getRecordsCount(e,t=null,r={}){const{useCache:n=!1,cacheTTL:a=null}=r,o={};return t&&(o.filters=t),this.request(`/org/objects/${e}/filter/count`,{method:"POST",body:{query:o},cache:{useCache:n,ttl:a||this.cacheTTL.count}})}async bulkUpsert(e,t,r=!1,n=!1,a=!1){return this.request(`/org/objects/${e}/record/bulk_upsert`,{method:"POST",body:{values:t,ignore_duplicates:r,enable_partial_upsert:n,disable_create:a},cache:{useCache:!1}})}async transactionalBulkCreate(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!0,partial_upsert:t},cache:{useCache:!1}})}async transactionalBulkUpdate(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!1,partial_upsert:t,disable_create:!0},cache:{useCache:!1}})}async transactionalBulkUpsert(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!1,partial_upsert:t},cache:{useCache:!1}})}}function createSuperLeapSDK(e={}){return new h(e)}e.SuperLeapSDK=h,e.createSuperLeapSDK=createSuperLeapSDK,e.CacheManager=a,e.CacheEntry=n,"undefined"!=typeof module&&module.exports?module.exports={SuperLeapSDK:h,createSuperLeapSDK:createSuperLeapSDK,DataType:t,RelationshipType:r,CacheManager:a,CacheEntry:n,Operators:o,AdvancedDateOperators:i}:"function"==typeof define&&define.amd&&define([],function(){return{SuperLeapSDK:h,createSuperLeapSDK:createSuperLeapSDK,DataType:t,RelationshipType:r,CacheManager:a,CacheEntry:n,Operators:o,AdvancedDateOperators:i}})}("undefined"!=typeof window?window:void 0),function(e){var t=null,r=null,n={apiKey:"NWM2MGEZMDMTYME2YI0ZYZDHLTLKNWQTNDM3NDNIZDU3YTQ1",baseUrl:"https://razorpay-sandbox.superleap.dev/api/v1",clientId:"",clientSecret:"",cache:{enabled:!0,maxSize:1e3,defaultTTL:3e5,ttl:{schema:18e5,records:12e4,count:6e4,user:6e5}}};function a(e,t){if(!t||"object"!=typeof t)return e;var r,n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=t[r],i=n[r];i&&o&&"object"==typeof i&&"object"==typeof o&&!Array.isArray(i)&&!Array.isArray(o)?n[r]=a(i,o):n[r]=o}return n}var superleapClient={init:function(o){if(null==o)return t=null,void(r=null);t=a(n,o),"function"==typeof e.createSuperLeapSDK?r=e.createSuperLeapSDK(t):"function"==typeof e.SuperLeapSDK?r=new e.SuperLeapSDK(t):(console.warn("[superleapClient] SuperLeap SDK not found. Install with: npm install superleap-sdk"),r=null)},getSdk:function(){return r},isAvailable:function(){return null!=t&&null!=r},getDefaultConfig:function(){return a({},n)}};e&&(e.superleapClient=superleapClient)}("undefined"!=typeof window?window:void 0),function(e){var t="superleap-bridge",r=null,n=null,a=null,o=!1,i=null,l=null,s=null,c={},d=null,u=null,p=null,f=!0;function h(e,n){return{type:t,instanceId:r,action:e,payload:n||{}}}function m(t,r){if("react-native"!==i)if(a)a.postMessage(t);else{var n=l||"*";e.parent.postMessage(t,n)}else e.ReactNativeWebView.postMessage(JSON.stringify(t))}function g(y,b){if(y&&y.type===t&&(!y.instanceId||y.instanceId===r)){var x=y.action;if("handshake-ack"===x&&d){if(!y.payload||y.payload.nonce!==n)return u&&u(new Error("SuperleapBridge: Nonce validation failed (possible replay)")),void v();if("iframe"===i&&l&&b!==l)return u&&u(new Error("SuperleapBridge: Origin validation failed")),void v();if("iframe"===i&&b&&(l=b),clearTimeout(p),p=null,"iframe"===i&&f&&"undefined"!=typeof MessageChannel){var w=new MessageChannel;(a=w.port1).onmessage=function(e){g(e.data,"")};var C=h("handshake-complete",{});e.parent.postMessage(C,l,[w.port2])}else m(h("handshake-complete",{}));o=!0,n=null,a&&s&&(e.removeEventListener("message",s),s=null);var E=d;return d=null,u=null,void E(y.payload)}if(o){if("iframe"===i&&!a&&l&&b&&b!==l)return;!function(e,t){var r=c[e];if(!r||!r.length)return;for(var n=r.slice(),a=0;a<n.length;a++)try{n[a](t)}catch(t){console.error("SuperleapBridge: handler error for "+e,t)}}(x,y.payload)}}}function v(){if(p&&(clearTimeout(p),p=null),a){try{a.close()}catch(e){}a=null}s&&(e.removeEventListener("message",s),s=null),"react-native"===i&&e.__superleapBridge&&delete e.__superleapBridge,r=null,n=null,o=!1,i=null,l=null,d=null,u=null}function y(e,t){var r=c[e];if(r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}var SuperleapBridge={connect:function(t){if(o)return Promise.reject(new Error("SuperleapBridge: Already connected. Call disconnect() first."));var a=t||{};return new Promise(function(t,c){try{i=function(){if(e.ReactNativeWebView&&"function"==typeof e.ReactNativeWebView.postMessage)return"react-native";if(e.parent&&e.parent!==e)return"iframe";throw new Error("SuperleapBridge: Not running in an embedded context (no parent window or ReactNativeWebView)")}()}catch(e){return void c(e)}r=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();var e;if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)e=new Uint8Array(16),crypto.getRandomValues(e);else{e=new Uint8Array(16);for(var t=0;t<16;t++)e[t]=256*Math.random()|0}e[6]=15&e[6]|64,e[8]=63&e[8]|128;for(var r=[],n=0;n<16;n++)r.push(("0"+e[n].toString(16)).slice(-2));return r.slice(0,4).join("")+"-"+r.slice(4,6).join("")+"-"+r.slice(6,8).join("")+"-"+r.slice(8,10).join("")+"-"+r.slice(10).join("")}(),n=function(){var e;if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)e=new Uint8Array(16),crypto.getRandomValues(e);else{e=new Uint8Array(16);for(var t=0;t<16;t++)e[t]=256*Math.random()|0}for(var r="",n=0;n<e.length;n++)r+=("0"+e[n].toString(16)).slice(-2);return r}(),l=a.crmOrigin||null,d=t,u=c,f="undefined"!=typeof MessageChannel,"iframe"===i?(s=function(e){g(e.data,e.origin)},e.addEventListener("message",s)):(e.__superleapBridge={receive:function(e){var t;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){return}else t=e;g(t,"")}},s=function(e){var t=e.data;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return}g(t,"")},e.addEventListener("message",s)),m(h("handshake-request",{flowId:a.flowId||"",version:a.version||"",nonce:n}));var y=a.timeout||5e3;p=setTimeout(function(){if(!o){var e=new Error("SuperleapBridge: Handshake timed out after "+y+"ms. Is this page embedded in the SuperLeap CRM?");u&&u(e),v()}},y)})},disconnect:function(){if(o)try{m(h("disconnect",{}))}catch(e){}v()},send:function(e,t){if(!o)throw new Error("SuperleapBridge: Not connected. Call connect() first.");m(h(e,t))},onMessage:function(e,t){return c[e]||(c[e]=[]),c[e].push(t),function(){y(e,t)}},offMessage:y,isConnected:function(){return o},getInstanceId:function(){return r}};e&&(e.SuperleapBridge=SuperleapBridge)}("undefined"!=typeof window?window:void 0),function(e){var t=null,r=null,n=null,a=!1;function o(){if(n)return n;if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("SuperleapBridge");if(t)return n=t}return e.SuperleapBridge?n=e.SuperleapBridge:null}e.superleapClient?(e.superleapClient.connect=function(n){var i=n||{},l=o();return l?a?Promise.reject(new Error("SuperleapCRM: Already connected. Call disconnect() first.")):l.connect({flowId:i.flowId||"",version:"2.1.0",crmOrigin:i.crmOrigin,timeout:i.timeout}).then(function(n){t=n&&n.context||{},r=n&&n.config||{};var o=n&&n.sdkConfig;if(!1!==i.autoInit&&o){var s=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient?e.superleapClient:e.SuperLeap?e.SuperLeap:null}();s&&"function"==typeof s.init&&s.init(o)}if(a=!0,l.onMessage("data:context",function(e){if(e&&"object"==typeof e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}),"undefined"!=typeof CustomEvent&&"undefined"!=typeof document){var c=new CustomEvent("superleap-crm:connected",{detail:{context:t,config:r}});document.dispatchEvent(c)}return{context:t,config:r}}):Promise.reject(new Error("SuperleapCRM: bridge.js is not loaded"))},e.superleapClient.isConnected=function(){return a},e.superleapClient.disconnect=function(){var e=o();e&&e.disconnect(),t=null,r=null,a=!1,n=null},e.superleapClient.setLoading=function(e){var t=o();t&&t.isConnected()&&t.send("crm:loading",{loading:!!e})},e.superleapClient.closeForm=function(){var e=o();e&&e.isConnected()&&e.send("crm:close",{})},e.superleapClient.toast=function(e,t,r){var n=o();n&&n.isConnected()&&n.send("crm:toast",{message:e,type:t||"info",duration:r||4e3})},e.superleapClient.navigate=function(e){var t=o();t&&t.isConnected()&&t.send("crm:navigate",{path:e})},e.superleapClient.getContext=function(){if(!t)return null;var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.superleapClient.send=function(e,t){var r=o();r&&r.isConnected()&&r.send("custom:"+e,t)},e.superleapClient.on=function(e,t){var r=o();return r?r.onMessage("custom:"+e,t):function(){}},e.superleapClient.off=function(e,t){var r=o();r&&r.offMessage("custom:"+e,t)}):console.warn("SuperLeap CRM Bridge: superleapClient not found. Make sure core/superleapClient.js loads before core/crm.js")}("undefined"!=typeof window?window:void 0),e="undefined"!=typeof window?window:void 0,t={default:"text-reg-13",small:"text-reg-12",large:"text-reg-14"},r={left:"required-left",right:"required-right",none:"required-none"},e.Label={create:function(e){var n=null!=e.label?String(e.label):"",a=!!e.required,o=e.requiredPosition||"right",i=!!e.optional,l=e.size||"default",s=e.icon,c=e.className||"",d=e.htmlFor,u=e.suffix,p=t[l]||t.default,f=r[o]||r.none,h=i?"optional-true":"optional-false",m=document.createElement("label");if(m.className=function(){for(var e=[],t=0;t<arguments.length;t++)arguments[t]&&e.push(arguments[t]);return e.join(" ")}("!text-typography-tertiary-text","inline-flex items-center gap-2 flex-shrink-0 pb-8 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p,f,h,c),d&&(m.htmlFor=d),a&&"left"===o){var g=document.createElement("span");g.className="required-label text-error-base",g.textContent="*",m.appendChild(g)}if(m.appendChild(document.createTextNode(n)),s){var v=document.createElement("span");v.className="box-content flex size-16 items-center justify-center",v.appendChild(s),m.appendChild(v)}if(a&&"right"===o){var y=document.createElement("span");y.className="required-label text-error-base",y.textContent=" *",m.appendChild(y)}if(i){var b=document.createElement("span");b.className="optional-label text-typography-tertiary-text",b.textContent=" (optional)",m.appendChild(b)}return u&&m.appendChild(u),m}},function(e){let t={},r=null;function n(e){t={...t,...e},r&&r(t)}function a(e){return t[e]}function o(e,t){n({[e]:t})}function i(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){const r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function l(e,t=!1,r=null){const n=document.createElement("div");let a;n.className="field";const o=i("Label");if(o&&"function"==typeof o.create){const n=r&&i("Tooltip")?i("Tooltip").create(r):null;a=o.create({label:e,required:t,requiredPosition:"right",optional:!1,size:"default",suffix:n||void 0})}else{a=document.createElement("label"),a.className="field-label";const n=document.createElement("span");if(n.style.display="inline-flex",n.style.alignItems="center",n.style.gap="0.25rem",t){n.appendChild(document.createTextNode(e+" "));const t=document.createElement("span");t.className="required-asterisk",t.textContent="*",n.appendChild(t)}else n.appendChild(document.createTextNode(e));if(r&&i("Tooltip")){const e=i("Tooltip").create(r);e&&n.appendChild(e)}a.appendChild(n)}return n.appendChild(a),n}function s(e){const t=i("Avatar");if(t&&"function"==typeof t.create)return t.create(e);const r=document.createElement("div");return r.className="flex shrink-0 size-32 items-center justify-center rounded-full bg-primary-base",r.textContent=e&&e.name&&e.name.charAt(0)||"?",r}function c(e){const t=i("Avatar");if(t&&"function"==typeof t.createGroup)return t.createGroup(e);const r=document.createElement("div");return r.className="flex -space-x-4",r.textContent="",r}e.FlowUI={initState:function(e,n){t={...e},r=n},getState:function(){return t},setState:n,get:a,set:o,createScreen:function(e,t){const r=document.createElement("div");r.className="screen";const n=document.createElement("h2");n.className="screen-title",n.textContent=e;const a=document.createElement("p");return a.className="screen-description",a.textContent=t,r.appendChild(n),r.appendChild(a),r},createGrid:function(){const e=document.createElement("div");return e.className="form-grid",e},createFieldWrapper:l,createInput:function(e){const{label:t,fieldId:r,placeholder:n,required:s=!1,type:c="text",helpText:d=null,variant:u,inputSize:p,disabled:f=!1,showReadOnlyIcon:h}=e,m=l(t,s,d);if(i("InputComponent")&&i("InputComponent").create){const e=a(r)||"",l=i("InputComponent").create({variant:u||"default",inputSize:p||"default",type:c,placeholder:n||`Enter ${t.toLowerCase()}`,value:e,disabled:f,showReadOnlyIcon:h,onChange:e=>o(r,e.target.value),onInput:e=>o(r,e.target.value)});l._fieldId=r,m.appendChild(l)}return m},createTextarea:function(e){const{label:t,fieldId:r,placeholder:n,required:s=!1,helpText:c=null,variant:d,rows:u,disabled:p=!1}=e,f=l(t,s,c);if(f.setAttribute("data-field-id",r),i("TextareaComponent")&&i("TextareaComponent").create){const e=a(r)||"",l=i("TextareaComponent").create({variant:d||"default",placeholder:n||`Enter ${t.toLowerCase()}`,value:e,rows:u,disabled:p,onChange:e=>o(r,e.target.value),onInput:e=>o(r,e.target.value)});return l._fieldId=r,f.appendChild(l),f}const h=document.createElement("textarea");return h.className="textarea",h.placeholder=n||`Enter ${t.toLowerCase()}`,h.value=a(r)||"",h.disabled=p,null!=u&&(h.rows=u),h.addEventListener("change",e=>o(r,e.target.value)),f.appendChild(h),f},createSelect:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,disabled:d=!1,helpText:u=null}=e,p=l(t,s,u);if(i("Select")&&i("Select").create){const e=a(r)||"",l=`Select ${t}`,s=i("Select").create({fieldId:r,options:n,placeholder:l,value:e,disabled:d,onChange:e=>{o(r,e),c&&c(e)}});return s._fieldId=r,s._onChange=c,p.appendChild(s),p}const f=document.createElement("select");f.className="select",f.disabled=d;const h=document.createElement("option");return h.value="",h.textContent=`Select ${t}`,h.className="select-placeholder",h.disabled=!0,h.selected=!0,f.appendChild(h),n.forEach(e=>{const t=document.createElement("option");t.value=e.value||e.slug||e.id,t.textContent=e.label||e.name||e.value,f.appendChild(t)}),f.value=a(r)||"",f.value||f.setAttribute("data-placeholder","true"),f.addEventListener("change",e=>{const t=e.target.value;o(r,t),""===t?f.setAttribute("data-placeholder","true"):f.removeAttribute("data-placeholder"),c&&c(t)}),p.appendChild(f),p},createTimePicker:function(e){const{label:t,fieldId:r,value:n,placeholder:s,required:c=!1,onChange:d,disabled:u=!1,use24Hour:p=!1,helpText:f=null}=e,h=l(t,c,f);if(i("TimePicker")&&i("TimePicker").create){const e=a(r)||n||"",l=i("TimePicker").create({fieldId:r,value:e,placeholder:s||`Select ${t}`,disabled:u,use24Hour:p,onChange:e=>{o(r,e),d&&d(e)}});return l._fieldId=r,h.appendChild(l),h}const m=document.createElement("input");return m.type="time",m.className="input",m.value=a(r)||"",m.disabled=u,m.addEventListener("change",e=>{o(r,e.target.value),d&&d(e.target.value)}),h.appendChild(m),h},createDateTimePicker:function(e){const{label:t,fieldId:r,value:n,placeholder:s,required:c=!1,onChange:d,disabled:u=!1,hourCycle:p=12,granularity:f="minute",size:h="default",fromDate:m,toDate:g,helpText:v=null}=e,y=l(t,c,v);if(i("DateTimePicker")&&i("DateTimePicker").create){const e=a(r);let l;if(n instanceof Date)l=n;else if(null==e||""===e)l=void 0;else try{l="string"==typeof e?new Date(e):e,Number.isNaN(l.getTime())&&(l=void 0)}catch(e){l=void 0}const c=i("DateTimePicker").create({value:l,placeholder:s||`Pick ${t.toLowerCase()}`,disabled:u,hourCycle:p,granularity:f,size:h,fromDate:m,toDate:g,onChange:e=>{o(r,e?e.toISOString():null),d&&d(e)}});return c._fieldId=r,y.appendChild(c),y}const b=document.createElement("input");b.type="date",b.className="input";const x=a(r);if(x)try{const e="string"==typeof x?new Date(x):x;Number.isNaN(e.getTime())||(b.value=e.toISOString().slice(0,10))}catch(e){}return b.disabled=u,b.addEventListener("change",e=>{const t=e.target.value?new Date(e.target.value+"T12:00:00Z").toISOString():null;o(r,t),d&&d(t?new Date(t):void 0)}),y.appendChild(b),y},createRadioGroup:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,helpText:d=null,orientation:u="horizontal",disabled:p=!1}=e,f=l(t,s,d);if(i("RadioGroup")&&i("RadioGroup").create){const e=a(r),t=i("RadioGroup").create({name:r,options:n.map(e=>({value:e.value,label:e.label||e.value,disabled:e.disabled})),value:e,disabled:p,orientation:u,onChange:e=>{o(r,e),c&&c(e)}});return t._fieldId=r,f.appendChild(t),f}const h=document.createElement("div");return h.className="radio-group",n.forEach(e=>{const t=document.createElement("div");t.className="radio-option";const n=document.createElement("input");n.type="radio",n.name=r,n.value=e.value,n.id=`${r}-${e.value}`,n.checked=a(r)===e.value,n.disabled=p||!!e.disabled,n.addEventListener("change",()=>{o(r,e.value),c&&c(e.value)});const i=document.createElement("label");i.htmlFor=`${r}-${e.value}`,i.textContent=e.label||e.value,t.appendChild(n),t.appendChild(i),h.appendChild(t)}),f.appendChild(h),f},createMultiSelect:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,placeholder:d,helpText:u=null,variant:p,size:f,type:h,disabled:m=!1}=e,g=l(t,s,u);if(i("MultiSelect")&&i("MultiSelect").create){const e=a(r)||[],l=i("MultiSelect").create({fieldId:r,options:n,placeholder:d||`Select ${t}`,value:e,label:"selected",variant:p||"default",size:f||"default",type:h||"default",disabled:m,onValuesChange:e=>{o(r,e),c&&c(e)}});return l._fieldId=r,g.appendChild(l),g}const v=document.createElement("div");v.className="checkbox-group";const y=a(r)||[];return n.forEach(e=>{const t=document.createElement("label");t.className="checkbox-label";const n=document.createElement("input");n.type="checkbox";const i=e.value||e.slug||e.id;n.value=i,n.checked=y.includes(i),n.addEventListener("change",()=>{const e=a(r)||[],t=n.checked?[...e,i]:e.filter(e=>e!==i);o(r,t),c&&c(t)}),t.appendChild(n),t.appendChild(document.createTextNode(" "+(e.label||e.name||e.display_name||e.value))),v.appendChild(t)}),g.appendChild(v),g},createRecordSelect:function(e){const{label:t,fieldId:r,objectSlug:n,placeholder:s,searchPlaceholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,initialLimit:g,helpText:v=null}=e,y=l(t,d,v);if(i("RecordSelect")&&i("RecordSelect").create){const e=a(r)||"",l=i("RecordSelect").create({fieldId:r,objectSlug:n,placeholder:s||`Select ${t}`,searchPlaceholder:c,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,initialLimit:g,onChange:(e,t)=>{o(r,e),u&&u(e,t)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Record select requires RecordSelect component and SuperLeap client.",y.appendChild(b),y},createRecordMultiSelect:function(e){const{label:t,fieldId:r,objectSlug:n,placeholder:s,searchPlaceholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,initialLimit:m,displayFields:g,helpText:v=null}=e,y=l(t,d,v);if(i("RecordMultiSelect")&&i("RecordMultiSelect").create){const e=a(r)||[],l=i("RecordMultiSelect").create({fieldId:r,objectSlug:n,placeholder:s||`Select ${t}`,searchPlaceholder:c,value:e,disabled:p,variant:f||"default",size:h||"default",initialLimit:m,displayFields:g||[],onValuesChange:(e,t)=>{o(r,e),u&&u(e,t)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Record multi-select requires RecordMultiSelect component and SuperLeap client.",y.appendChild(b),y},createEnumSelect:function(e){const{label:t,fieldId:r,objectSlug:n,columnSlug:s,placeholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,currentRecordData:g,helpText:v=null}=e,y=l(t,d,v);if(i("EnumSelect")&&i("EnumSelect").create){const e=a(r)||"",l=i("EnumSelect").create({fieldId:r,objectSlug:n,columnSlug:s,placeholder:c||`Select ${t}`,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,currentRecordData:g||{},onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enum select requires EnumSelect component and SuperLeap client.",y.appendChild(b),y},createEnumMultiSelect:function(e){const{label:t,fieldId:r,objectSlug:n,columnSlug:s,placeholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,currentRecordData:g,helpText:v=null}=e,y=l(t,d,v);if(i("EnumMultiSelect")&&i("EnumMultiSelect").create){const e=a(r)||[],l=i("EnumMultiSelect").create({fieldId:r,objectSlug:n,columnSlug:s,placeholder:c||`Select ${t}`,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,currentRecordData:g||{},onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enum multi-select requires EnumMultiSelect component and SuperLeap client.",y.appendChild(b),y},createDuration:function(e){const{label:t,fieldId:r,value:n,formatType:s="seconds",placeholder:c="hh:mm:ss",required:d=!1,onChange:u,disabled:p=!1,variant:f="default",size:h="default",helpText:m=null}=e,g=l(t,d,m);if(g.setAttribute("data-field-id",r),i("Duration")&&i("Duration").create){const e=a(r),t=null!=e?e:n,l=i("Duration").create({value:t,formatType:s,placeholder:c,disabled:p,variant:f,size:h,onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,g.appendChild(l),g}const v=document.createElement("div");return v.className="text-reg-13 text-typography-quaternary-text",v.textContent="Duration picker requires Duration component.",g.appendChild(v),g},createEnumeration:function(e){const{label:t,fieldId:r,totalElements:n,enabledIcon:s,disabledIcon:c,defaultValue:d=0,required:u=!1,onChange:p,disabled:f=!1,readOnly:h=!1,variant:m="default",size:g="default",helpText:v=null}=e,y=l(t,u,v);if(y.setAttribute("data-field-id",r),i("Enumeration")&&i("Enumeration").create){const e=a(r),t=null!=e?e:d,l=i("Enumeration").create({totalElements:n,enabledIcon:s,disabledIcon:c,defaultValue:t,disabled:f,readOnly:h,variant:m,size:g,onValueChange:e=>{o(r,e),p&&p(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enumeration requires Enumeration component.",y.appendChild(b),y},createFileUpload:function(e){const{label:t,fieldId:r,multiple:n=!0,accept:s,required:c=!1,helpText:d=null,isPrivate:u,maxFiles:p,maxFileSize:f}=e;if(i("FileInput")&&i("FileInput").create)return i("FileInput").create({label:t,fieldId:r,multiple:n,accept:s||"*",required:c,helpText:d,isPrivate:!!u,maxFiles:null!=p?p:null,maxFileSize:null!=f?f:10485760});const h=l(t,c,d),m=document.createElement("div");m.className="file-upload-wrapper";const g=document.createElement("div");g.className="file-upload-button",g.textContent="Choose a file";const v=a(r)||[],y=document.createElement("div");y.className="file-upload-text",y.textContent=v.length>0?`${v.length} file(s) selected`:"No files chosen";const b=document.createElement("input");b.type="file",b.multiple=n,b.className="file-upload-input",s&&(b.accept=s),b.addEventListener("change",function(){const e=Array.from(this.files||[]);o(r,e),y.textContent=e.length>0?`${e.length} file(s) selected`:"No files chosen"}),m.appendChild(g),m.appendChild(y),m.appendChild(b),h.appendChild(m);const x=document.createElement("div");return x.className="field-hint",x.textContent=n?"Multiple files allowed.":"Single file only.",h.appendChild(x),h},createCurrency:function(e){const{label:t,fieldId:r,column:n={},placeholder:s,required:c=!1,helpText:d=null,variant:u="default",size:p="default",disabled:f=!1,onChange:h}=e,m=l(t||"Amount",c,d);if(m.setAttribute("data-field-id",r),i("CurrencyComponent")&&i("CurrencyComponent").create){const e=a(r),t=i("CurrencyComponent").create({variant:u,size:p,placeholder:s||n.placeholder||"Enter value",disabled:f,column:n,value:null!=e?e:null,onChange:e=>{o(r,e),h&&h(e)}});return t._fieldId=r,m.appendChild(t),m}const g=document.createElement("input");return g.type="number",g.step="0.01",g.placeholder=s||"Enter amount",g.value=null!=a(r)?a(r):"",g.disabled=f,g.className="input w-full",g.addEventListener("input",e=>{const t=e.target.value,n=""===t?null:parseFloat(t);o(r,isNaN(n)?null:n),h&&h(isNaN(n)?null:n)}),m.appendChild(g),m},createPhoneInput:function(e){const{label:t,fieldId:r,defaultCountryCode:n,placeholder:s,required:c=!1,helpText:d=null,variant:u="default",inputSize:p="default",disabled:f=!1,disableCountrySelect:h=!1,hideCountrySelect:m=!1,onChange:g}=e,v=l(t,c,d);if(v.setAttribute("data-field-id",r),i("PhoneInput")&&i("PhoneInput").create){const e=a(r)||"",t=i("PhoneInput").create({variant:u,inputSize:p,defaultCountryCode:n||"IN",defaultPhoneNumber:e,placeholder:s,disabled:f,disableCountrySelect:h,hideCountrySelect:m,onChange:(e,t)=>{o(r,e),g&&g(e,t)}});return t._fieldId=r,v.appendChild(t),v}const y=document.createElement("input");return y.type="tel",y.className="input",y.placeholder=s||"Enter phone number",y.value=a(r)||"",y.disabled=f,y.addEventListener("input",e=>{o(r,e.target.value),g&&g(e.target.value,null)}),v.appendChild(y),v},createCheckbox:function(e){const{label:t,fieldId:r,checked:n=!1,indeterminate:s=!1,disabled:c=!1,helpText:d=null,size:u="default",align:p="left",isLabelCaps:f=!1,onChange:h}=e,m=l(t,!1,d);if(m.setAttribute("data-field-id",r),i("Checkbox")&&i("Checkbox").create){const e=a(r),t=i("Checkbox").create({id:r,name:r,checked:void 0!==e?e:n,indeterminate:s,disabled:c,size:u,align:p,isLabelCaps:f,onChange:e=>{o(r,e),h&&h(e)}});return t._fieldId=r,m.appendChild(t),m}const g=document.createElement("input");return g.type="checkbox",g.className="checkbox",g.id=r,g.name=r,g.checked=a(r)||n,g.disabled=c,g.addEventListener("change",e=>{o(r,e.target.checked),h&&h(e.target.checked)}),m.appendChild(g),m},createButton:function(e){const Button=i("Button");if(Button&&"function"==typeof Button.create)return Button.create(e);const t=document.createElement("button");return t.type=e&&e.type||"button",t.className="btn "+(e&&"primary"===e.variant?"btn-primary":"btn-ghost"),t.textContent=e&&(e.text||e.label)||"Button",e&&e.disabled&&(t.disabled=!0),e&&"function"==typeof e.onClick&&t.addEventListener("click",e.onClick),t},renderStepper:function(e,t,r){e&&(e.innerHTML="",t.forEach((t,n)=>{const a=document.createElement("div");a.className="step-pill"+(t.id===r?" step-pill--active":"");const o=document.createElement("span");o.className="step-pill-index",o.textContent=String(n+1);const i=document.createElement("span");i.textContent=t.label,a.appendChild(o),a.appendChild(i),e.appendChild(a)}))},showToast:function(e,t="info",r=4e3){const Toast=i("Toast");return Toast&&"function"==typeof Toast.show?Toast.show(e,t,r):(console.warn("[FlowUI] Toast component not loaded. Message:",e,"Type:",t),{close:function(){},element:null})},renderAlerts:function(e,t=[],r="error"){if(!e)return;e.innerHTML="";const Alert=i("Alert"),n=Alert&&"function"==typeof Alert.create;t.forEach(t=>{const a="string"==typeof t?t:t.description||t.title||"",o="object"==typeof t&&t.title?t.title:"";if(n&&(a||o)){const t={error:"error",info:"info",success:"success"}[r]||r,n=Alert.create({title:o,description:a,variant:t});n&&e.appendChild(n)}else{const t=document.createElement("div");t.className=`alert alert--${r}`,t.textContent=a||o,e.appendChild(t)}})},createDataTable:function(e){const{columns:t,data:r=[],fieldId:n,idKey:i="id",onSelect:l}=e,s=document.createElement("div");s.className="table-container";const c=document.createElement("div");c.className="table-scroll";const d=document.createElement("table");d.className="table";const u=document.createElement("thead"),p=document.createElement("tr");p.innerHTML="<th></th>",t.forEach(e=>{const t=document.createElement("th");t.textContent=e.label,p.appendChild(t)}),u.appendChild(p),d.appendChild(u);const f=document.createElement("tbody");if(0===r.length){const e=document.createElement("tr");e.innerHTML=`<td colspan="${t.length+1}" style="text-align: center; padding: 2rem; color: var(--text-muted);">No results found.</td>`,f.appendChild(e)}else r.forEach(e=>{const r=document.createElement("tr"),s=document.createElement("td"),c=document.createElement("input");c.type="radio",c.name=n,c.value=e[i],c.checked=a(n)===e[i],c.addEventListener("change",()=>{o(n,e[i]),l&&l(e)}),s.appendChild(c),r.appendChild(s),t.forEach(t=>{const n=document.createElement("td");n.textContent=e[t.key]||"",r.appendChild(n)}),f.appendChild(r)});return d.appendChild(f),c.appendChild(d),s.appendChild(c),s},createTable:function(e){const t=i("SuperleapTable");if(t&&"function"==typeof t.createTable)return t.createTable(e);const r=document.createElement("div");return r.className="table-container",r.textContent="Table component (SuperleapTable) not loaded.",r},createSearchInput:function(e){const{placeholder:t="Search...",fieldId:r,onSearch:n}=e,i=document.createElement("div");return i.className="search-container",i.innerHTML=`\n <svg class="search-icon" 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"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>\n <input type="text" class="search-input" placeholder="${t}" value="${a(r)||""}">\n `,i.querySelector(".search-input").addEventListener("input",e=>{o(r,e.target.value.toLowerCase()),n&&n(e.target.value.toLowerCase())}),i},createSummaryRow:function(e,t){const r=document.createElement("div");r.className="field";const n=document.createElement("div");n.className="field-label",n.textContent=e;const a=document.createElement("div");return a.className="field-hint",a.textContent=t||"-",r.appendChild(n),r.appendChild(a),r},createBadge:function(e){const t=i("Badge");if(t&&"function"==typeof t.create)return t.create(e);const r=document.createElement("span");return r.className="badge",r.textContent=e&&(e.content||""),r},createLoader:function(e){const t=i("Loader"),r=i("Spinner"),n=t||r;if(n&&"function"==typeof n.create)return n.create(e||{});const a=document.createElement("div");return a.className="spinner",a.textContent=e&&e.text?e.text:"Loading...",a},createAvatar:s,createVividAvatar:function(e){const t=i("Avatar");return t&&"function"==typeof t.createVivid?t.createVivid(e):s(e)},createAvatarGroup:c,createVividAvatarGroup:function(e){const t=i("Avatar");return t&&"function"==typeof t.createVividGroup?t.createVividGroup(e):c(e)}},console.log("[FlowUI] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){const t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',infoCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>',loader:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',playstationX:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>'},r={loading:"loader",default:"alertCircle",warning:"alertCircle",error:"playstationX",success:"circleCheck",info:"infoCircle",notification:null};let n=null,a=0,o=!1;function i(){return n&&document.body.contains(n)||(function(){if(o)return;const e=document.createElement("style");e.id="toast-styles",e.textContent='\n @keyframes toast-slide-in {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes toast-slide-out {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(-100%);\n }\n }\n @keyframes toast-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .toast-viewport {\n position: fixed;\n left: 50%;\n top: 5%;\n z-index: 100;\n max-height: 100vh;\n width: fit-content;\n transform: translateX(-50%);\n padding: 1rem;\n max-width: 26rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n pointer-events: none;\n }\n .toast-root {\n pointer-events: auto;\n width: 100%;\n border-radius: 8px;\n position: relative;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n overflow: hidden;\n padding: 0.75rem 1rem;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n .toast-root[data-state="closed"] {\n animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n .toast-icon-spin {\n animation: toast-spin 1s linear infinite;\n }\n ',document.head.appendChild(e),o=!0}(),n=document.createElement("div"),n.className="toast-viewport",n.setAttribute("role","region"),n.setAttribute("aria-label","Notifications"),document.body.appendChild(n)),n}function l(e={}){const{title:o="",description:l="",variant:s="default",duration:c=4e3,onClose:d=null,showClose:u=!0}=e;if(!l&&!o)return console.warn("[Toast] No title or description provided"),{close:function(){},element:null};const p=i(),f=++a,h=function(e){const t={loading:"bg-fill-tertiary-fill-light-gray border-borderColor-border-primary text-typography-primary-text",default:"bg-fill-quarternary-fill-white border-borderColor-border-primary text-typography-primary-text",warning:"bg-warning-surface border-warning-border text-warning-text-base",error:"bg-error-surface border-error-border text-error-text-base",success:"bg-success-surface border-success-border text-success-text-base",info:"bg-info-surface border-info-border text-info-text-base",notification:"bg-fill-quarternary-fill-white border-borderColor-border-primary text-typography-primary-text"};return t[e]||t.default}(s),m=document.createElement("div");m.className=`toast-root border-1/2 ${h}`,m.setAttribute("data-toast-id",f),m.setAttribute("data-state","closed"),m.setAttribute("role","status"),m.setAttribute("aria-live","polite"),m.setAttribute("aria-atomic","true");const g=document.createElement("div");g.className="flex w-full items-center justify-start gap-8";const v=r[s];if(v){const e=document.createElement("div");e.className="flex items-center justify-center "+("loading"===s?"toast-icon-spin":""),e.style.cssText="width: 16px; height: 16px; flex-shrink: 0;",e.innerHTML=t[v],g.appendChild(e)}const y=document.createElement("div");if(y.className="flex-1 text-reg-12",o){const e=document.createElement("div");e.className="text-med-12 mb-4",e.textContent=o,y.appendChild(e)}if(l){const e=document.createElement("div");e.className="text-reg-12",e.textContent=l,y.appendChild(e)}if(g.appendChild(y),u){const e=document.createElement("button");e.type="button",e.className="ml-auto flex items-center justify-center rounded-4 p-4 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none",e.style.cssText="flex-shrink: 0; width: 16px; height: 16px; border: none; background: transparent; opacity: 0.6; cursor: pointer;",e.innerHTML=t.x,e.addEventListener("click",b),g.appendChild(e)}function b(){m.setAttribute("data-state","closed"),setTimeout(()=>{m.parentElement&&m.parentElement.removeChild(m),n&&0===n.children.length&&(n.remove(),n=null),d&&d()},300)}return m.appendChild(g),p.appendChild(m),requestAnimationFrame(()=>{m.setAttribute("data-state","open")}),c>0&&setTimeout(b,c),{close:b,element:m}}function s(e,t="info",r=4e3){return console.log("[Toast] Showing toast:",e,"Type:",t),l({description:e,variant:t,duration:r})}e.Toast={create:l,show:s,success:function(e,t=4e3){return s(e,"success",t)},error:function(e,t=4e3){return s(e,"error",t)},warning:function(e,t=4e3){return s(e,"warning",t)},info:function(e,t=4e3){return s(e,"info",t)},loading:function(e,t=0){return s(e,"loading",t)}}}("undefined"!=typeof window?window:void 0),function(e){const t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',infoCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>',playstationX:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>'},r={default:null,destructive:"playstationX",warning:"alertCircle",error:"playstationX",success:"circleCheck",info:"infoCircle"};function n(e){const t={default:{container:"bg-fill-quarternary-fill-white border-borderColor-border-primary",title:"text-typography-primary-text",description:"text-typography-secondary-text"},destructive:{container:"bg-fill-quarternary-fill-white border-error-border",title:"text-error-text-base",description:"text-error-text-base"},warning:{container:"bg-warning-surface border-warning-border",title:"text-warning-text-base",description:"text-warning-text-base"},error:{container:"bg-error-surface border-error-border",title:"text-error-text-base",description:"text-error-text-base"},success:{container:"bg-success-surface border-success-border",title:"text-success-text-base",description:"text-success-text-base"},info:{container:"bg-info-surface border-info-border",title:"text-info-text-base",description:"text-info-text-base"}};return t[e]||t.default}function a(e={}){const{title:a="",description:o="",variant:i="default",icon:l=null,action:s=null,className:c=""}=e;if(!o&&!a)return console.warn("[Alert] No title or description provided"),null;const d=n(i),u=document.createElement("div");u.setAttribute("data-slot","alert"),u.setAttribute("role","alert");u.className=`flex gap-8 rounded-4 border-1/2 p-8 text-left w-full ${d.container} ${c}`.trim();const p=r[i];if(null!==l||p){const e=document.createElement("div");e.className="flex-shrink-0 flex items-start pt-2",e.style.cssText="width: 16px; height: 16px;",null!==l?"string"==typeof l?e.innerHTML=l:l instanceof HTMLElement&&e.appendChild(l):p&&(e.innerHTML=t[p]),u.appendChild(e)}const f=document.createElement("div");if(f.className="flex-1 flex flex-col gap-4 min-w-0",a){const e=document.createElement("div");e.setAttribute("data-slot","alert-title"),e.className=`text-med-12 ${d.title}`,"string"==typeof a?e.textContent=a:a instanceof HTMLElement&&e.appendChild(a),f.appendChild(e)}if(o){const e=document.createElement("div");e.setAttribute("data-slot","alert-description"),e.className=`text-reg-12 ${d.description}`,"string"==typeof o?e.textContent=o:o instanceof HTMLElement&&e.appendChild(o),f.appendChild(e)}if(u.appendChild(f),null!==s){const e=document.createElement("div");e.setAttribute("data-slot","alert-action"),e.className="flex-shrink-0 flex items-start pt-2",e.style.cssText="margin-left: auto;","string"==typeof s?e.innerHTML=s:s instanceof HTMLElement&&e.appendChild(s),u.appendChild(e)}return u}function o(e,t="default",r={}){return a({description:e,variant:t,...r})}e.Alert={create:a,simple:o,success:function(e,t={}){return o(e,"success",t)},error:function(e,t={}){return o(e,"error",t)},warning:function(e,t={}){return o(e,"warning",t)},info:function(e,t={}){return o(e,"info",t)},destructive:function(e,t={}){return o(e,"destructive",t)},createCloseButton:function(e,r="default"){const a=document.createElement("button");a.type="button";const o=n(r).title;return a.className=`flex items-center justify-center rounded-4 transition-opacity opacity-70 hover:opacity-100 focus:opacity-100 focus:outline-none ${o}`,a.style.cssText="flex-shrink: 0; width: 20px; height: 20px; border: none; background: transparent; cursor: pointer; padding: 2px;",a.innerHTML=t.x,e&&a.addEventListener("click",e),a}}}("undefined"!=typeof window?window:void 0),function(e){var t="inline-flex items-center justify-center whitespace-nowrap !text-med-12 transition-colors disabled:pointer-events-none hover:cursor-pointer h-fit",r={primary:"shadow-soft-extra-small group bg-primary-base border-1/2 border-primary-base text-typography-invert-text hover:bg-primary-hover active:bg-primary-active disabled:opacity-50",outline:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-border-primary text-typography-primary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:opacity-50 disabled:border-fill-secondary-fill-gray",ghost:"group text-typography-primary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:text-typography-quaternary-text",link:"group text-primary-text-base hover:bg-primary-surface active:bg-primary-surface-hover disabled:text-typography-quaternary-text",primaryDestructive:"shadow-soft-extra-small group bg-error-base text-typography-invert-text border-1/2 border-error-base hover:bg-error-hover active:bg-error-active disabled:opacity-50",outlineDestructive:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-error-border text-error-text-base hover:bg-error-surface active:bg-error-surface-hover active:text-error-text-active disabled:opacity-50 disabled:border-fill-secondary-fill-gray disabled:text-typography-quaternary-text",ghostDestructive:"group text-error-text-base hover:bg-error-surface active:bg-error-surface-hover active:text-error-text-active disabled:opacity-50",dashed:"group bg-fill-quarternary-fill-white border border-border-primary border-dashed text-typography-secondary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:opacity-50 disabled:border-fill-secondary-fill-gray",toggleOff:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-border-primary text-typography-primary-text hover:bg-primary-surface active:bg-primary-surface disabled:opacity-50 disabled:border-fill-secondary-fill-gray",toggleOn:"shadow-soft-extra-small group bg-primary-surface border-1/2 border-border-primary text-primary-text-base hover:bg-primary-surface active:bg-primary-surface disabled:opacity-50 disabled:border-fill-secondary-fill-gray",ghostInline:"group text-typography-primary-text disabled:text-typography-quaternary-text hover:bg-transparent active:bg-transparent !px-0 hover:text-typography-secondary-text",linkInline:"group text-primary-text-base hover:bg-transparent active:bg-transparent disabled:text-typography-quaternary-text !px-0 hover:text-primary-text-active"},n={small:"px-8 py-4 gap-4 rounded-4",medium:"px-12 py-6 gap-4 rounded-4",default:"px-8 py-4 gap-4 rounded-4",large:"px-16 py-8 gap-4 rounded-4"},a="shadow-soft-extra-small",o={small:"box-content size-16 p-4 rounded-4",medium:"box-content size-16 p-6 rounded-4",default:"box-content size-16 p-4 rounded-4",large:"box-content size-16 p-8 rounded-4"},i="flex items-center justify-center disabled:pointer-events-none hover:cursor-pointer";function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function s(e,t){null!=t&&("string"==typeof t?e.insertAdjacentHTML("beforeend",t):(t instanceof HTMLElement||t instanceof Node)&&e.appendChild(t))}var Button={create:function(e){var c=e||{},d=c.variant||"primary",u=c.size||"default",p=!0===c.isShadow,f=c.className||"",h=!0===c.disabled,m=c.type||"button",g=c.label,v=c.text,y=c.innerHTML,b=c.startIcon,x=c.endIcon,w=null!=c.icon,C=c.icon,E=c.onClick,k=document.createElement("button");k.type=m,h&&(k.disabled=!0),g&&k.setAttribute("aria-label",g);var N=null!=r[d]?r[d]:r.primary,S=null!=n[u]?n[u]:n.default;if(w){var A=null!=r[d]?r[d]:r.primary,L=null!=o[u]?o[u]:o.default;k.className=l(t,i,A,L,p?a:"",f),s(k,C)}else{if(k.className=l(t,N,S,p?a:"",f),b){var T=document.createElement("span");T.className="box-content flex size-16 items-center justify-center rounded-4 !p-0",s(T,b),k.appendChild(T)}if(null!=y){var I=document.createElement("span");for(I.innerHTML=y;I.firstChild;)k.appendChild(I.firstChild)}else null!=v&&k.appendChild(document.createTextNode(v));if(x){var M=document.createElement("span");M.className="box-content flex size-16 items-center justify-center rounded-4 !p-0",s(M,x),k.appendChild(M)}}return"function"==typeof E&&k.addEventListener("click",E),k},getButtonClasses:function(e){var s=e||{},c=s.variant||"primary",d=s.size||"default",u=!0===s.isShadow,p=!0===s.iconOnly,f=null!=r[c]?r[c]:r.primary,h=p?null!=o[d]?o[d]:o.default:null!=n[d]?n[d]:n.default,m=p?l(t,i):t;return l(m,f,h,u?a:"")},VARIANTS:r,SIZES:n};"undefined"!=typeof module&&module.exports?module.exports=Button:e.Button=Button}("undefined"!=typeof window?window:void 0),function(e){function t(e={}){const{size:t="medium",color:r="currentColor",text:n=null}=e;let a;switch(t){case"small":a="16px";break;case"medium":a="24px";break;case"large":a="32px";break;default:a=t}const o=document.createElement("div");o.setAttribute("data-spinner","container"),o.className="inline-flex items-center gap-2";const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("width",a),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("fill","none"),i.setAttribute("stroke",r),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.classList.add("animate-spin");const l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("stroke","none"),l.setAttribute("d","M0 0h24v24H0z"),l.setAttribute("fill","none");const s=document.createElementNS("http://www.w3.org/2000/svg","path");if(s.setAttribute("d","M12 3a9 9 0 1 0 9 9"),i.appendChild(l),i.appendChild(s),o.appendChild(i),n){const e=document.createElement("span");e.className="text-sm text-typography-tertiary-text",e.textContent=n,o.appendChild(e)}return o}function r(e={}){const r=t(e);return r.classList.add("flex","justify-center","items-center","p-5"),r}e.Spinner={create:t,createCentered:r,show:function(e,t={}){if(!e)return null;const n=r(t);return e.innerHTML="",e.appendChild(n),n},hide:function(e){if(!e)return;const t=e.querySelector('[data-spinner="container"]');t&&t.remove()}},e.Loader=e.Spinner}("undefined"!=typeof window?window:void 0),function(e){var t={default:"bg-fill-tertiary-fill-light-gray text-typography-primary-text hover:text-typography-secondary-text border-border-primary ",info:"text-info-text-base bg-info-surface-hover border-info-border-base",warning:"text-warning-text-base bg-warning-surface-hover border-warning-border-base",error:"text-error-text-base bg-error-surface-hover border-error-border-base",success:"text-success-text-base bg-success-surface-hover border-success-border-base"},r={small:"px-8 py-2",medium:"px-8 py-6",large:"px-8 py-6"},n={default:"bg-fill-default-fill-gray",primary:"border-none"},a={default:"bg-fill-default-fill-gray",info:"text-info-text-base bg-info-surface-hover border-info-surface-hover",warning:"text-warning-text-base bg-warning-surface-hover border-warning-surface-hover",error:"text-error-text-base bg-error-surface-hover border-error-surface-hover",success:"text-success-text-base bg-success-surface-hover border-success-surface-hover"},o="flex size-16 items-center justify-center";function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Badge={create:function(e){var l=e.variant||"default",s=e.color||"default",c=e.size||"large",d=e.className||"";if(e.icon){var u=document.createElement("div");u.className=i("flex items-center justify-center p-4 text-typography-primary-text bg-fill-default-fill-gray rounded-4 border-1/2 border-border-primary !text-med-12 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n[l]||n.default,a[s]||a.default,d);var p=e.icon;return"string"==typeof p?u.innerHTML=p:p&&1===p.nodeType&&u.appendChild(p),u}var f=document.createElement("div");if(f.className=i("inline-flex items-center gap-4 rounded-4 border-1/2 !text-med-12 transition-colors focus:outline-none",t[s]||t.default,r[c]||r.large,d),e.startIcon){var h=document.createElement("span");h.className=o,"string"==typeof e.startIcon?h.innerHTML=e.startIcon:e.startIcon&&1===e.startIcon.nodeType&&h.appendChild(e.startIcon),f.appendChild(h)}if(void 0!==e.content&&null!==e.content){var m=e.content;"string"==typeof m?f.appendChild(document.createTextNode(m)):m&&1===m.nodeType&&f.appendChild(m)}if(e.endIcon){var g=document.createElement("span");g.className="string"==typeof e.endIcon?o:"flex items-center justify-center shrink-0","string"==typeof e.endIcon?g.innerHTML=e.endIcon:e.endIcon&&1===e.endIcon.nodeType&&g.appendChild(e.endIcon),f.appendChild(g)}return f}},console.log("[Badge] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t={custom:"size-full",large:"size-40 text-reg-14",default:"size-32 text-reg-12",small:"size-20 text-reg-12"},r={circle:"rounded-128",square:"rounded-4"},n={custom:"-space-x-12",large:"-space-x-12",default:"-space-x-4",small:"-space-x-8"},a=[{backgroundColor:"#f8cfcd",textColor:"#550b15"},{backgroundColor:"#fde09b",textColor:"#5f1a05"},{backgroundColor:"#a6eb84",textColor:"#004433"},{backgroundColor:"#c7dcfc",textColor:"#0c2c5b"},{backgroundColor:"#a5dbe2",textColor:"#002a2e"},{backgroundColor:"#82ffd3",textColor:"#00916b"},{backgroundColor:"#8eeee2",textColor:"#016f66"},{backgroundColor:"#f8d5d8",textColor:"#5c0d21"},{backgroundColor:"#fef7be",textColor:"#4a4410"},{backgroundColor:"#f1d4fc",textColor:"#4c0e5f"},{backgroundColor:"#f8d4eb",textColor:"#570e45"},{backgroundColor:"#d9d8fc",textColor:"#2b0c7b"},{backgroundColor:"#d8dcd2",textColor:"#233400"},{backgroundColor:"#dbd6e1",textColor:"#371c51"},{backgroundColor:"#bcfb94",textColor:"#213b0d"},{backgroundColor:"#d4dcfc",textColor:"#190d8a"},{backgroundColor:"#ffd2b1",textColor:"#4a2400"}];function o(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function i(e){if(!e||"string"!=typeof e)return{backgroundColor:"#f4f6f6",textColor:"#292929"};for(var t=e.toLowerCase(),r=0,n=0;n<t.length;n+=1)r=t.charCodeAt(n)+((r<<5)-r);var o=Math.abs(r%a.length);return a[o]}function l(e){var n=e&&e.size||"default",a=e&&e.shape||"circle",i=e&&e.name||"",l=e&&e.image,s=e&&e.className||"",c=document.createElement("div");c.className=o("flex shrink-0 overflow-hidden items-center justify-center bg-primary-base !text-typography-invert-text object-cover",t[n],r[a],s);var d=document.createElement("span");if(d.className="flex h-full w-full items-center justify-center capitalize",d.textContent=i?i.charAt(0).toUpperCase():"?",c.appendChild(d),l){var u=document.createElement("img");u.src=l,u.alt=i||"Avatar",u.className="h-full w-full object-cover",u.setAttribute("referrerpolicy","no-referrer"),u.onerror=function(){u.style.display="none",d.style.display="flex"},u.onload=function(){d.style.display="none"},d.style.display="none",c.appendChild(u)}return c}function s(e){var t=e&&e.name||"",r=l(e),n=i(t);r.style.backgroundColor=n.backgroundColor;var a=r.querySelector("span");return a&&(a.style.color=n.textColor),r}function c(e){var t=e&&e.users||[],r=e&&e.size||"default",a=e&&e.className||"",i=!(!e||!e.vivid),c=document.createElement("div");c.className=o("flex",n[r],a);var d=t.slice(0,3),u=t.length-3;if(d.forEach(function(e){var t=i?s({name:e.name,image:e.image,size:r,shape:"circle"}):l({name:e.name,image:e.image,size:r,shape:"circle"});c.appendChild(t)}),u>0){var p=l({name:"",size:r,shape:"circle"}),f=p.querySelector("span");f&&(f.textContent="+"+u),c.appendChild(p)}return c}e.Avatar={stringToColor:i,create:l,createVivid:s,createGroup:c,createVividGroup:function(e){return c(Object.assign({},e,{vivid:!0}))}},console.log("[Avatar] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t=' xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"',r='<path stroke="none" d="M0 0h24v24H0z" fill="none"/>',n={IconDatabase:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0"/><path d="M4 6v6a8 3 0 0 0 16 0v-6"/><path d="M4 12v6a8 3 0 0 0 16 0v-6"/></svg>',IconUsers:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"/><path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/><path d="M21 21v-2a4 4 0 0 0 -3 -3.85"/></svg>',IconShield:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3"/></svg>',IconLayout:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M4 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M4 13m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M14 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M14 15m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/></svg>',IconUser:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"/><path d="M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"/></svg>',IconCurrencyDollar:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2"/><path d="M12 3v3m0 12v3"/></svg>',IconPhone:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"/></svg>',IconMessage:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M8 9h8"/><path d="M8 13h6"/><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"/></svg>',IconClock:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/><path d="M12 7v5l4 2"/></svg>',IconMail:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10"/><path d="M3 7l9 6l9 -6"/></svg>',IconCircleFilled:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" fill="currentColor"/></svg>'};function a(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function o(e){return null==e||("string"==typeof e&&""===e.trim()||!(!Array.isArray(e)||0!==e.length))}function i(e){if(!e||"string"!=typeof e)return!1;var t=e.trim();if(0===t.length||t.length>4)return!1;var r=t.charCodeAt(0);return r>=127744&&r<=129535||r>=9728&&r<=9983||r>=9984&&r<=10175||65039===r}function l(e){var t=e&&e.iconStr||"",r=e&&e.iconSvg,o=null!=(e&&e.color)?e.color:"neutral",l=e&&e.fallbackIconStr||"IconDatabase",s=!(!e||!e.defaultIcon),c=!(!e||!e.fullSizeIcon),d=e&&e.className||"";if(i(t)){var u=document.createElement("span");return u.className=a("pr-4",d),u.textContent=t,u}var p=r||n[t]||n[l];if(!p&&!s)return null;p||(p=n[l]||n.IconDatabase);var f=document.createElement("span");if(f.className=a("box-content flex size-16 items-center justify-center rounded-4","bg-"+o+"-surface-hover","text-"+o+"-text-base",d),c){var h=document.createElement("span");h.className="size-full flex items-center justify-center",h.innerHTML=p,f.appendChild(h)}else f.innerHTML=p;return f}e.Icon={iconMap:n,create:l,createIconOrColor:function(e){if(!e)return null;if(o(e.start_icon)&&o(e.icon_color))return null;var t=o(e.start_icon)&&!o(e.icon_color),r=e.icon_color||"neutral",n=(e.className||"")+(t?" !bg-transparent text-"+r+"-base":"");return l({iconStr:t?"IconCircleFilled":e.start_icon,color:r,fallbackIconStr:"IconCircleFilled",defaultIcon:!0,className:n.trim()})},isEmoji:i,isFieldValueEmpty:o},console.log("[Icon] Module loaded successfully")}("undefined"!=typeof window?window:void 0),("undefined"!=typeof window?window:void 0).Popover={create:function(e={}){const{trigger:t,content:r="",placement:n="bottom",align:a="start",title:o="",closeOnClickOutside:i=!0,onClose:l=null,onOpen:s=null,bodyClassName:c="",panelClassName:d=""}=e,u="string"==typeof t?document.querySelector(t):t;if(!u)return console.warn("[Popover] Trigger element not found"),{show:m,hide:m,destroy:m,element:null};const p=document.createElement("div");p.className="fixed z-50 pointer-events-none opacity-0 invisible transition-opacity duration-150 ease-out",p.setAttribute("aria-hidden","true");const f=document.createElement("div");if(f.className="relative z-50 rounded-4 bg-fill-quarternary-fill-white text-typography-primary-text shadow-default-medium outline-none border-1/2 border-border-primary min-w-0 pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",f.setAttribute("role","dialog"),f.setAttribute("data-side",n),f.setAttribute("data-state","closed"),f.setAttribute("tabindex","-1"),o){const e=document.createElement("div");e.className="text-semi-14 text-typography-primary-text border-b-1/2 border-border-primary",e.textContent=o,f.appendChild(e)}const h=document.createElement("div");function m(){}function g(){const e=u.getBoundingClientRect(),t=f.getBoundingClientRect();let r=0,o=0;const i="center"===a?(e.width-t.width)/2:"end"===a?e.width-t.width:0,l="center"===a?(e.height-t.height)/2:"end"===a?e.height-t.height:0;switch(n){case"bottom":default:r=e.bottom+8,o=e.left+i;break;case"top":r=e.top-t.height-8,o=e.left+i;break;case"right":r=e.top+l,o=e.right+8;break;case"left":r=e.top+l,o=e.left-t.width-8}o<8&&(o=8),o+t.width>window.innerWidth-8&&(o=window.innerWidth-t.width-8),r<8&&(r=8),r+t.height>window.innerHeight-8&&(r=window.innerHeight-t.height-8),p.style.left="0",p.style.top="0",p.style.transform="translate("+o+"px, "+r+"px)",p.offsetHeight}function v(){f.setAttribute("data-state","closed"),p.classList.add("invisible","opacity-0","pointer-events-none"),p.classList.remove("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","true"),l&&l()}function y(){s&&s();var e=!p.parentNode;e&&document.body.appendChild(p),e?requestAnimationFrame(function(){g(),p.classList.remove("invisible","opacity-0","pointer-events-none"),p.classList.add("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","false"),requestAnimationFrame(function(){requestAnimationFrame(function(){f.setAttribute("data-state","open")})})}):(g(),p.classList.remove("invisible","opacity-0","pointer-events-none"),p.classList.add("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","false"),requestAnimationFrame(function(){requestAnimationFrame(function(){f.setAttribute("data-state","open")})}))}function b(e){e.stopPropagation(),p.classList.contains("visible")?v():y()}function x(e){!p.classList.contains("visible")||p.contains(e.target)||u.contains(e.target)||v()}function w(e){"Escape"===e.key&&p.classList.contains("visible")&&v()}return h.className=c||"text-reg-14 text-typography-secondary-text leading-5 [&_p]:mb-2 [&_p:last-child]:mb-0",d&&(f.className=f.className+" "+d),"string"==typeof r?h.innerHTML=r:r instanceof HTMLElement&&h.appendChild(r),f.appendChild(h),p.appendChild(f),u.addEventListener("click",b),i&&document.addEventListener("click",x),document.addEventListener("keydown",w),{show:y,hide:v,destroy:function(){v(),p.parentNode&&p.parentNode.removeChild(p),i&&document.removeEventListener("click",x),u.removeEventListener("click",b),document.removeEventListener("keydown",w)},setContent(e){h.innerHTML="","string"==typeof e?h.innerHTML=e:e instanceof HTMLElement&&h.appendChild(e)},element:p,panel:f}}},function(e){function t(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Select={create:function(e){var n=e.fieldId,a=e.options||[],o=e.placeholder||"Select an option",i=e.onChange,l=e.variant||"default",s=e.size||"default",c=!!e.canClear,d=e.onClear,u=!0===e.disabled,p=void 0!==e.value&&null!==e.value?e.value:"",f=a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p}),h=f?f.label||f.name||f.display_name||f.value:o,m=document.createElement("div");m.className="custom-select relative w-full group",m.setAttribute("data-field-id",n);var g=document.createElement("span");g.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var v=document.createElement("button");v.type="button",v.className=t(l,s,u,!p,c&&!!p&&!u),v.disabled=u,v.setAttribute("aria-haspopup","listbox"),v.setAttribute("aria-expanded","false"),v.setAttribute("aria-label",o);var y=document.createElement("div");y.className="truncate text-inherit",y.textContent=h,v.appendChild(y);var b=document.createElement("span");b.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",b.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',b.setAttribute("aria-hidden","true"),("inline"!==l||!p)&&v.appendChild(b),g.appendChild(v);var x=document.createElement("button");function w(){x&&(x.style.display=c&&p&&!u?"":"none")}x.type="button",x.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",x.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',x.setAttribute("aria-label","Clear selection"),x.style.display=c&&p&&!u?"":"none",x.addEventListener("click",function(e){e.stopPropagation(),p="",a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p}),y.textContent=o,v.className=t(l,s,u,!0,!1);var r="inline"!==l||!p;r&&!b.parentNode?v.appendChild(b):!r&&b.parentNode&&b.parentNode.removeChild(b),w(),M(),d&&d(),i&&i("")}),g.appendChild(x),m.appendChild(g);var C=document.createElement("div");C.setAttribute("role","listbox");var E="custom-select-content absolute left-0 right-0 z-50 max-h-[200px] min-w-[8rem] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ";C.className=E+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0";var k=document.createElement("div");if(k.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",0===a.length){var N=document.createElement("div");N.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",N.textContent="No options available",k.appendChild(N)}else a.forEach(function(e){var t=void 0!==e.value&&null!==e.value?e.value:e.slug||e.id,n=e.label||e.name||e.display_name||e.value,a=t===p,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",a),o.className=r("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex items-center gap-8 flex-1 truncate",i.textContent=n,o.appendChild(i),o.addEventListener("click",function(e){e.stopPropagation(),u||q(t)}),o.addEventListener("mouseenter",function(){u||_(o)}),k.appendChild(o)});C.appendChild(k),m.appendChild(C);var S=!1,A=-1;function L(){var e,t,r,n,a;u||(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==m){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),S=!0,m.classList.add("open"),v.setAttribute("aria-expanded","true"),e=p,(t=k.querySelector('[data-value="'+e+'"]'))&&(_(t),j(t)),r=v.getBoundingClientRect(),n=window.innerHeight-r.bottom,a=r.top,C.className=n<200&&a>n?E+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":E+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0")}function T(){S=!1,m.classList.remove("open"),v.setAttribute("aria-expanded","false"),A=-1}function I(){var e=document.querySelectorAll(".custom-select.open, .record-select.open");Array.from(e).some(function(e){return e!==m})?L():S?T():L()}function M(){k.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=t===String(p)||"false"===t&&!1===p||"true"===t&&!0===p;e.setAttribute("aria-selected",!!r),e.classList.remove("bg-primary-surface","hover:!bg-primary-surface-hover"),e.classList.add("hover:bg-fill-tertiary-fill-light-gray"),r?(e.classList.add("bg-primary-surface","hover:!bg-primary-surface-hover"),e.classList.remove("hover:bg-fill-tertiary-fill-light-gray")):e.classList.remove("bg-primary-surface","hover:!bg-primary-surface-hover")})}function q(e){var r=a.find(function(t){return(void 0!==t.value&&null!==t.value?t.value:t.slug||t.id)===e});if(r){p=e,y.textContent=r.label||r.name||r.display_name||r.value,v.className=t(l,s,u,!1,c&&!!p&&!u);var n="inline"!==l||!p;n&&!b.parentNode?v.appendChild(b):!n&&b.parentNode&&b.parentNode.removeChild(b),w(),M(),T(),i&&i(e)}}function _(e){k.querySelectorAll("[role=option]").forEach(function(e){e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),A=Array.from(k.children).indexOf(e)}function j(e){if(e){var t=C.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=C.scrollTop,o=a+t.height;r<a?C.scrollTop=r-8:n>o&&(C.scrollTop=n-t.height+8)}}function D(e){var t=Array.from(k.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){(A+=e)<0?A=t.length-1:A>=t.length&&(A=0);var r=t[A];_(r),j(r)}}return v.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),I()}),v.addEventListener("keydown",function(e){if(!u)switch(e.key){case"Enter":case" ":e.preventDefault(),I();break;case"ArrowDown":e.preventDefault(),S?D(1):L();break;case"ArrowUp":e.preventDefault(),S?D(-1):L();break;case"Escape":S&&(e.preventDefault(),T())}}),document.addEventListener("click",function(e){S&&!m.contains(e.target)&&T()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&S&&T()}),m.updateValue=function(e){p=null!=e?e:"";var r=a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p});y.textContent=r?r.label||r.name||r.display_name||r.value:o,v.className=t(l,s,u,!p,c&&!!p&&!u);var n="inline"!==l||!p;n&&!b.parentNode?v.appendChild(b):!n&&b.parentNode&&b.parentNode.removeChild(b),w(),M()},m.updateOptions=function(e){if(a.length=0,a.push.apply(a,e),k.innerHTML="",0===e.length){var t=document.createElement("div");return t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",t.textContent="No options available",void k.appendChild(t)}e.forEach(function(e){var t=void 0!==e.value&&null!==e.value?e.value:e.slug||e.id,n=e.label||e.name||e.display_name||e.value,a=t===p,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",a),o.className=r("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex items-center gap-8 flex-1 truncate",i.textContent=n,o.appendChild(i),o.addEventListener("click",function(){u||q(t)}),o.addEventListener("mouseenter",function(){u||_(o)}),k.appendChild(o)})},m.setDisabled=function(e){u=!!e,v.disabled=u,v.className=t(l,s,u,!p,c&&!!p&&!u),w(),u&&S&&T()},m}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function r(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}e.EnumSelect={create:function(n){var a=n.fieldId,o=n.objectSlug,i=n.columnSlug,l=n.placeholder||"Select an option",s=n.onChange,c=n.variant||"default",d=n.size||"default",u=!!n.canClear,p=n.onClear,f=n.currentRecordData||{},h=n.showSearch,m=n.onLoad,g=n.onError,v=!0===n.disabled,y=void 0!==n.value&&null!==n.value?n.value:"",b=[],x=null,w=null,C="",E=null,k=!(!e.Popover||"function"!=typeof e.Popover.create),N=!1,S=document.createElement("div");S.className="enum-select relative w-full group",S.setAttribute("data-field-id",a);var A=document.createElement("span");A.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var L=document.createElement("button");L.type="button",L.className=r(c,d,v,!y,u&&!!y&&!v),L.disabled=v,L.setAttribute("aria-haspopup","listbox"),L.setAttribute("aria-expanded","false"),L.setAttribute("aria-label",l);var T=document.createElement("div");T.className="truncate text-inherit",T.textContent=l,L.appendChild(T);var I=document.createElement("span");I.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",I.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',I.setAttribute("aria-hidden","true"),("inline"!==c||!y)&&L.appendChild(I),A.appendChild(L);var M=document.createElement("button");function q(){M&&(M.style.display=u&&y&&!v?"":"none")}M.type="button",M.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",M.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',M.setAttribute("aria-label","Clear selection"),M.style.display=u&&y&&!v?"":"none",M.addEventListener("click",function(e){e.stopPropagation(),y="",T.textContent=l,L.className=r(c,d,v,!0,!1);var t="inline"!==c||!y;t&&!I.parentNode?L.appendChild(I):!t&&I.parentNode&&I.parentNode.removeChild(I),q(),$(),p&&p(),s&&s("")}),A.appendChild(M),S.appendChild(A);var _=document.createElement("div");_.setAttribute("role","listbox");var j="w-full min-w-[200px]";j+=k?" max-h-[30vh] overflow-hidden flex flex-col":" absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium border-1/2 border-border-primary opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0 flex flex-col",_.className=j;var D=document.createElement("div");D.className="py-2 border-b-1/2 border-border-primary hidden";var F=null,z=null;if(e.InputComponent&&"function"==typeof e.InputComponent.create){var U=(F=e.InputComponent.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Search...",value:"",startIcon:t,className:"!border-0 !p-0",onInput:function(){C=F.getValue().trim(),$()}})).getInput();U&&(U.setAttribute("aria-label","Search options"),U.addEventListener("click",function(e){e.stopPropagation()}),z=U),D.appendChild(F)}else{var O=document.createElement("div");O.className="flex items-center gap-8";var P=document.createElement("span");P.className="shrink-0 text-typography-tertiary-text",P.innerHTML=t,O.appendChild(P);var B=document.createElement("input");B.type="text",B.placeholder="Search...",B.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",B.addEventListener("input",function(e){C=e.target.value.trim(),$()}),B.addEventListener("click",function(e){e.stopPropagation()}),z=B,O.appendChild(B),D.appendChild(O)}var H=document.createElement("div");H.className="overflow-y-auto max-h-[30vh] p-2 w-full rounded-4 bg-fill-quarternary-fill-white flex-1 min-h-0",_.appendChild(D),_.appendChild(H),k||S.appendChild(_);var R=-1;function V(e){H.innerHTML="";var t=document.createElement("div");t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-error-text",t.textContent=e||"Error loading options",H.appendChild(t)}function $(){H.innerHTML="";var t=function(){if(!C.trim())return b;var e=C.toLowerCase();return b.filter(function(t){var r=t.display_name.toLowerCase().includes(e),n=String(t.slug||"").toLowerCase().includes(e);return r||n})}(),n=void 0!==h?h:b.length>10;if(D.className=n?"p-8 border-b-1/2 border-border-primary ":"p-8 hidden",0===t.length){var a=document.createElement("div");return a.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",a.textContent=C.trim()?"No options found":"No options available",void H.appendChild(a)}t.forEach(function(t){var n=t.slug||t.display_name,a=t.display_name,o=n===y,i=0===t.is_active||!1===t.is_active,l=document.createElement("div");l.setAttribute("role","option"),l.setAttribute("data-value",n),l.setAttribute("aria-selected",o),l.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",o?"bg-primary-surface hover:!bg-primary-surface-hover":"");var p=document.createElement("span");p.className="flex items-center gap-8 flex-1 truncate";var f=document.createElement("span");f.textContent=a;var h=t.badge_config;if(h&&(h.icon_color||h.start_icon)){var m=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}();if(m&&"function"==typeof m.createIconOrColor){var g=m.createIconOrColor({start_icon:h.start_icon,icon_color:h.icon_color,className:(h.class_name||"")+" shrink-0"});g&&p.appendChild(g)}}if(p.appendChild(f),l.appendChild(p),i){var b=document.createElement("span");b.className="ml-8 px-6 py-2 text-xs rounded-2 bg-info-surface-hover text-info-text-base border-1/2 border-info-border-base",b.textContent="Archived",l.appendChild(b)}l.addEventListener("click",function(e){e.stopPropagation(),v||function(e,t){y=e,T.textContent=t,L.className=r(c,d,v,!1,u&&!!y&&!v);var n="inline"!==c||!y;n&&!I.parentNode?L.appendChild(I):!n&&I.parentNode&&I.parentNode.removeChild(I);q(),$(),W(),s&&s(e)}(n,a)}),l.addEventListener("mouseenter",function(){v||Z(l)}),H.appendChild(l)})}function Y(){if(!v){if(E)return document.querySelectorAll(".enum-select, .custom-select, .record-select").forEach(function(e){e!==S&&e.popoverInstance&&e.popoverInstance.hide()}),E.show(),L.setAttribute("aria-expanded","true"),J(y),void(z&&setTimeout(function(){z.focus()},50));document.querySelectorAll(".enum-select.open").forEach(function(e){if(e!==S){e.classList.remove("open");var t=e.querySelector("button");t&&t.setAttribute("aria-expanded","false")}}),N=!0,S.classList.add("open"),L.setAttribute("aria-expanded","true"),J(y),z&&setTimeout(function(){z.focus()},50)}}function W(){E?E.hide():(N=!1,S.classList.remove("open")),L.setAttribute("aria-expanded","false"),R=-1,G(),$()}function K(){(E?E.element&&E.element.classList.contains("visible"):N)?W():Y()}function G(){C="",F?F.setValue(""):z&&(z.value="")}function Z(e){H.querySelectorAll("[role=option]").forEach(function(e){e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),R=Array.from(H.children).indexOf(e)}function J(e){var t=H.querySelector('[data-value="'+e+'"]');t&&(Z(t),Q(t))}function Q(e){if(e){var t=H.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=H.scrollTop,o=a+t.height;r<a?H.scrollTop=r-8:n>o&&(H.scrollTop=n-t.height+8)}}function X(e){var t=Array.from(H.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){(R+=e)<0?R=t.length-1:R>=t.length&&(R=0);var r=t[R];Z(r),Q(r)}}function ee(){var t=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}();if(!t||"function"==typeof t.isAvailable&&!t.isAvailable())return V(w="SuperLeap SDK not initialized"),void(g&&g(w));!function(){H.innerHTML="";var e=document.createElement("div");e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="Loading options...",H.appendChild(e)}();var n="function"==typeof t.getSdk?t.getSdk():null;if(!n)return V(w="Failed to get SDK instance"),void(g&&g(w));n.model(o).getField(i).then(function(e){if(!e)throw new Error("Field '"+i+"' not found in object '"+o+"'");if(x=e,!e.enumGroup||!e.enumGroup.values)throw new Error("Field '"+i+"' does not have enum options");var t=e.enumGroup,n=t.values||[];if(x.is_dependent_field&&t.properties&&t.properties.parent_column_slug){var a=t.properties.parent_column_slug,s=f[a];if(!s)return b=[],l="Select "+a+" first",void $();b=n.filter(function(e){return!!e.dependent_enum_slugs&&(Array.isArray(s)?s.some(function(t){return e.dependent_enum_slugs.includes(t)}):e.dependent_enum_slugs.includes(s))})}else b=n.filter(function(e){return 1===e.is_active||!0===e.is_active||e.slug===y});if(b.sort(function(e,t){return(void 0!==e.rank&&null!==e.rank?e.rank:999999)-(void 0!==t.rank&&null!==t.rank?t.rank:999999)}),$(),y){var p=b.find(function(e){return e.slug===y});if(p){T.textContent=p.display_name,L.className=r(c,d,v,!1,u&&!!y&&!v);var h="inline"!==c||!y;h&&!I.parentNode?L.appendChild(I):!h&&I.parentNode&&I.parentNode.removeChild(I),q()}}m&&m(b)}).catch(function(e){w=e.message||"Failed to load options",console.error("EnumSelect error:",w),V(w),g&&g(w)})}return L.addEventListener("keydown",function(e){if(!v){var t=E&&E.element&&E.element.classList.contains("visible");switch(e.key){case"Enter":case" ":e.preventDefault(),K();break;case"ArrowDown":e.preventDefault(),t?X(1):Y();break;case"ArrowUp":e.preventDefault(),t?X(-1):Y();break;case"Escape":t&&(e.preventDefault(),W())}}}),function(){if(k){E=e.Popover.create({trigger:L,content:_,placement:"bottom",align:"start",closeOnClickOutside:!0,onClose:function(){L.setAttribute("aria-expanded","false"),I.style.transform="",R=-1,G(),$()},onOpen:function(){L.setAttribute("aria-expanded","true"),I.style.transform="rotate(180deg)"},bodyClassName:"p-0 overflow-hidden",panelClassName:"min-w-[var(--trigger-width)] overflow-hidden"}),S.popoverInstance=E;var t=L.offsetWidth;E.panel&&(E.panel.style.setProperty("--trigger-width",t+"px"),E.panel.style.minWidth=t+"px")}}(),ee(),k||(L.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),v||K()}),document.addEventListener("click",function(e){N&&!S.contains(e.target)&&W()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&N&&W()})),S.updateValue=function(e){y=null!=e?e:"";var t=b.find(function(e){return e.slug===y});T.textContent=t?t.display_name:l,L.className=r(c,d,v,!y,u&&!!y&&!v);var n="inline"!==c||!y;n&&!I.parentNode?L.appendChild(I):!n&&I.parentNode&&I.parentNode.removeChild(I),q(),$()},S.updateRecordData=function(e){f=e||{},ee()},S.setDisabled=function(e){v=!!e,L.disabled=v,L.className=r(c,d,v,!y,u&&!!y&&!v),q();var t=E&&E.element&&E.element.classList.contains("visible");v&&(t||N)&&W()},S.reload=function(){ee()},S.getOptions=function(){return b},S.getColumnData=function(){return x},S.destroy=function(){E&&E.destroy()},S}}}("undefined"!=typeof window?window:void 0),function(e){var t=e.Popover,r=e.InputComponent,n=e.Spinner,a="user",o={team:{iconStr:"IconUsers",color:"primary"},role:{iconStr:"IconShield",color:"info"},iframe:{iconStr:"IconLayout",color:"neutral"},lead:{iconStr:"IconUser",color:"primary"},opportunity:{iconStr:"IconCurrencyDollar",color:"success"},call_log:{iconStr:"IconPhone",color:"info"},communication:{iconStr:"IconMessage",color:"primary"},history_field:{iconStr:"IconClock",color:"neutral"},email:{iconStr:"IconMail",color:"info"}},i='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function l(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}function s(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}function c(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Avatar");if(t)return t}return e.Avatar}function d(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}function u(e,t){var r="neutral",n="IconDatabase";if(t&&t.properties&&t.properties.icon_data){var a=t.properties.icon_data;"string"==typeof a.color&&a.color&&(r=a.color),"string"==typeof a.icon&&a.icon&&(n=a.icon)}return t&&t.properties&&t.properties.icon_data&&t.properties.icon_data.icon||(o[e]?(n=o[e].iconStr,o[e].color&&(r=o[e].color)):(n="IconDatabase",r="neutral")),{iconStr:n,color:r||"neutral"}}e.RecordSelect={create:function(e){var o=e.fieldId,p=e.objectSlug,f=e.objectSchema||null,h=e.placeholder||"Select a record",m=e.searchPlaceholder||"Search "+(p||"")+"...",g=e.onChange,v=e.variant||"default",y=e.size||"default",b=!!e.canClear,x=null!=e.initialLimit?e.initialLimit:50,w=!0===e.disabled,C=void 0!==e.value&&null!==e.value?e.value:"";if(!p){var E=document.createElement("div");return E.className="text-reg-13 text-typography-quaternary-text",E.textContent="Record select: objectSlug is required.",E}var k=document.createElement("div");k.className="record-select relative w-full group",k.setAttribute("data-field-id",o),k.setAttribute("data-object-slug",p);var N=null,S=[],A=[],L=!1,T="",I=null,M=t&&"function"==typeof t.create,q=null,_=!0,j=1,D=!1,F="record-select-content min-w-[8rem] ";M||(F+="absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ");var z=document.createElement("span");z.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var U=document.createElement("button");U.type="button",U.className=l(v,y,w,!C,b&&!!C&&!w),U.disabled=w,U.setAttribute("aria-haspopup","listbox"),U.setAttribute("aria-expanded","false"),U.setAttribute("aria-label",h),U.classList.add("record-select-trigger");var O=document.createElement("div");O.className="record-select-trigger-content flex items-center gap-8 flex-1 min-w-0";var P=document.createElement("span");P.className="record-select-trigger-icon shrink-0 hidden",O.appendChild(P);var B=document.createElement("div");B.className="truncate text-inherit record-select-value",B.textContent=h,O.appendChild(B),U.appendChild(O);var H=document.createElement("span");H.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",H.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',H.setAttribute("aria-hidden","true"),U.appendChild(H),z.appendChild(U);var R=null;b&&((R=document.createElement("button")).type="button",R.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none record-select-clear",R.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',R.setAttribute("aria-label","Clear selection"),R.addEventListener("click",function(e){e.stopPropagation(),X(""),g&&g("")}),z.appendChild(R)),k.appendChild(z);var V=document.createElement("div");V.setAttribute("role","listbox"),V.className=F+(M?"max-h-[30vh] overflow-hidden flex flex-col":"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0");var $,Y=document.createElement("div");Y.className="py-8 border-b-1/2 border-border-primary";var W=null;if(r&&"function"==typeof r.create){var K=(W=r.create({variant:"borderless",inputSize:"small",type:"text",placeholder:m,value:"",startIcon:i,className:"!border-0 !p-0",onInput:function(){(T=W.getValue().trim())?ce():se()}})).getInput();K&&K.setAttribute("aria-label","Search records"),$=K,Y.appendChild(W)}else{var G=document.createElement("div");G.className="flex items-center gap-8 px-12";var Z=document.createElement("span");Z.className="shrink-0 text-typography-tertiary-text",Z.innerHTML=i,G.appendChild(Z);var J=document.createElement("input");J.type="text",J.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",J.placeholder=m,J.setAttribute("aria-label","Search records"),$=J,G.appendChild(J),Y.appendChild(G)}V.appendChild(Y);var Q=document.createElement("div");function X(e){N=null,(C=null!=e?e:"")?re():ee()}function ee(){if(N)if(B.textContent=N.name||N.label||C,U.classList.remove("placeholder"),U.className=l(v,y,w,!1,b&&!!C&&!w),P.className="record-select-trigger-icon shrink-0 flex items-center justify-center size-20 rounded-4 overflow-hidden",P.innerHTML="",p===a){var e=c();if(e&&"function"==typeof e.createVivid){var t=e.createVivid({name:N.name||N.label||"",size:"small",shape:"circle"});P.appendChild(t)}else r=N.name||N.label,n=r&&String(r).charAt(0).toUpperCase()||"?",(o=document.createElement("div")).className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold",o.textContent=n,P.appendChild(o)}else!function(){var e=d();if(!e||"function"!=typeof e.create)return;var t=u(p,f),r=e.create({iconStr:t.iconStr,color:t.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});r&&P.appendChild(r)}();else B.textContent=h,U.classList.add("placeholder"),U.className=l(v,y,w,!0,b&&!!C&&!w),P.className="record-select-trigger-icon shrink-0 hidden",P.innerHTML="";var r,n,o;R&&(R.style.display=b&&C&&!w?"":"none")}function te(e,t,r){var n=s();if(!n||"function"!=typeof n.getSdk)return Promise.resolve({records:[],hasMore:!1});var a=n.getSdk();if(!a)return Promise.resolve({records:[],hasMore:!1});var o=a.model(p),i=t||x,l=r?(r-1)*i:0;try{if(o&&"function"==typeof o.select){var c=o.select.apply(o,["id","name"]);e&&e.trim()&&(c=c.filterBy({or:[{field:"name",operator:"contains",value:e.trim()},{field:"id",operator:"eq",value:e.trim()}]}));var d=["name"];return"account"===p&&d.push("-ParentId"),c.limit(i).offset(l).orderBy.apply(c,d).cache({ttl:12e4}).then(function(e){var t=e.map(function(e){var t=e.toJSON?e.toJSON():e;return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id}});return{records:t,hasMore:t.length>=i}})}}catch(e){console.error("[RecordSelect] fetchRecords error:",e)}return Promise.resolve({records:[],hasMore:!1})}function re(){if(C){var e=s();if(e&&"function"==typeof e.getSdk){var t=e.getSdk();if(t)t.model(p).select("id","name").where({id:C}).limit(1).first().then(function(e){if(e){var t=e.toJSON?e.toJSON():e;N={id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id}}ee()}).catch(function(){N={id:C,value:C,name:C,label:C},ee()});else ee()}else ee()}else ee()}function ne(){Q.innerHTML="";var e=document.createElement("div");if(e.className="flex flex-row items-center justify-center gap-8 py-12 px-12 w-full text-reg-12 text-typography-quaternary-text record-select-loading",n&&"function"==typeof n.create)e.appendChild(n.create({size:"small",text:"Loading..."}));else{var t=document.createElement("span");t.textContent="Loading...",e.appendChild(t)}Q.appendChild(e)}function ae(){var e=Q.querySelector(".record-select-loading-more");e&&e.remove();var t=document.createElement("div");if(t.className="flex flex-row items-center justify-center gap-8 py-8 px-12 w-full text-reg-12 text-typography-quaternary-text record-select-loading-more",n&&"function"==typeof n.create)t.appendChild(n.create({size:"small"}));else{var r=document.createElement("span");r.textContent="Loading more...",t.appendChild(r)}Q.appendChild(t)}function oe(){var e=Q.querySelector(".record-select-loading-more");e&&e.remove()}function ie(e){Q.innerHTML="";var t=document.createElement("div");t.className="w-full justify-center px-12 py-6 text-center text-reg-12 text-typography-quaternary-text record-select-empty",t.textContent=e||"No records found",Q.appendChild(t)}function le(){Q.querySelectorAll("[role=option]").forEach(function(e){e.remove()}),Q.querySelectorAll(".record-select-loading, .record-select-empty").forEach(function(e){e.remove()}),A.forEach(function(e){var t=e.id||e.value,r=e.name||e.label||e.value,n=t===C,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",n),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");if(i.className="flex items-center gap-8 flex-1 truncate",p===a){var l=c();if(l&&"function"==typeof l.createVivid){var s=l.createVivid({name:r||"",size:"small",shape:"circle"});i.appendChild(s)}else{(y=document.createElement("span")).className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold shrink-0",y.textContent=(r||"?").charAt(0).toUpperCase(),i.appendChild(y)}}else{var h=d();if(h&&"function"==typeof h.create){var m=u(p,f),v=h.create({iconStr:m.iconStr,color:m.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});v&&i.appendChild(v)}else{var y;(y=document.createElement("span")).className="size-20 rounded-4 flex items-center justify-center shrink-0 bg-neutral-surface-hover text-neutral-text-base",y.textContent="?",i.appendChild(y)}}var b=document.createElement("span");b.textContent=r,i.appendChild(b),o.appendChild(i),o.addEventListener("click",function(r){r.stopPropagation(),w||(C=t,N=e,ee(),ue(),g&&g(C,e))}),Q.appendChild(o)}),D&&ae()}function se(){ne(),j=1,_=!0,te(T,x,1).then(function(e){if(S=e.records,A=e.records,_=e.hasMore,e.records.length,j=1,C&&!e.records.some(function(e){return(e.id||e.value)===C}))re();else if(C&&e.records.length){var t=e.records.find(function(e){return(e.id||e.value)===C});t&&(N=t),ee()}0===A.length?ie(T?"No results found":"No records available"):le()}).catch(function(){ie("Failed to load records"),_=!1})}function ce(){I&&clearTimeout(I),I=setTimeout(function(){I=null,ne(),j=1,_=!0,te(T,x,1).then(function(e){S=e.records,A=e.records,_=e.hasMore,e.records.length,0===e.records.length?ie("No results found"):le()}).catch(function(){ie("Search failed"),_=!1})},500)}function de(){w||(M&&q?q.show():(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==k){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),L=!0,k.classList.add("open"),U.setAttribute("aria-expanded","true"),T="",W?W.setValue(""):$&&($.value=""),se(),setTimeout(function(){$&&$.focus()},0),function(){if(M)return;var e=U.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;V.className=t<200&&r>t?F+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":F+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0"}()))}function ue(){M&&q?q.hide():(L=!1,k.classList.remove("open"),U.setAttribute("aria-expanded","false"),T="",W?W.setValue(""):$&&($.value=""),I&&(clearTimeout(I),I=null))}return Q.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white record-select-options",Q.addEventListener("scroll",function(){if(!D&&_){var e=Q.scrollHeight;Q.scrollTop+Q.clientHeight>=e-50&&function(){if(D||!_)return;D=!0,j+=1,ae(),te(T,x,j).then(function(e){D=!1,oe(),e.records.length>0?(S=S.concat(e.records),A=A.concat(e.records),e.records.length,_=e.hasMore,le()):_=!1}).catch(function(e){console.error("[RecordSelect] loadMoreRecords error:",e),D=!1,oe(),_=!1})}()}}),V.appendChild(Q),M||k.appendChild(V),M&&(q=t.create({trigger:U,content:V,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0 overflow-hidden",panelClassName:"max-h-[30vh] overflow-hidden",onOpen:function(){w?q.hide():(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==k){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),L=!0,k.classList.add("open"),U.setAttribute("aria-expanded","true"),T="",W?W.setValue(""):$&&($.value=""),V.style.minWidth=U.offsetWidth+"px",se(),setTimeout(function(){$&&$.focus()},0))},onClose:function(){L=!1,k.classList.remove("open"),U.setAttribute("aria-expanded","false"),T="",W?W.setValue(""):$&&($.value=""),I&&(clearTimeout(I),I=null)}})),R&&(R.style.display=b&&C&&!w?"":"none"),!W&&$&&$.addEventListener("input",function(){(T=this.value.trim())?ce():se()}),$&&$.addEventListener("keydown",function(e){e.stopPropagation()}),M&&q?U.addEventListener("keydown",function(e){w||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L?q.hide():q.show())}):(U.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),L?ue():de()}),U.addEventListener("keydown",function(e){w||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L?ue():de()),"Escape"===e.key&&L&&(e.preventDefault(),ue()))}),document.addEventListener("click",function(e){L&&!k.contains(e.target)&&ue()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&L&&ue()})),k.updateValue=function(e){X(e)},k.setDisabled=function(e){w=!!e,U.disabled=w,U.className=l(v,y,w,!C,b&&!!C&&!w),w&&L&&ue()},C?re():ee(),k}}}("undefined"!=typeof window?window:void 0),function(e){function t(e,t,r,n){var a={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},o={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(a[e]||a.default)+" "+(o[t]||o.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}e.MultiSelect={create:function(e){var r=e.fieldId,n=e.options||[],a=e.placeholder||"Select options",o=e.label||"selected",i=e.onValuesChange,l=e.variant||"default",s=e.size||"default",c=!0===e.disabled,d=Array.isArray(e.value)?e.value.slice():Array.isArray(e.values)?e.values.slice():[],u=document.createElement("div");u.className="custom-multiselect relative w-full group",r&&u.setAttribute("data-field-id",r);var p=document.createElement("span");p.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var f=document.createElement("button");f.type="button",f.className=t(l,s,c,0===d.length),f.disabled=c,f.setAttribute("aria-haspopup","listbox"),f.setAttribute("aria-expanded","false"),f.setAttribute("aria-multiselectable","true"),f.setAttribute("aria-label",a);var h=document.createElement("div");function m(){if(h.innerHTML="",0===d.length){var e=document.createElement("span");e.className="text-inherit",e.textContent=a,h.appendChild(e)}else{var t=document.createElement("span");t.className="text-inherit",t.textContent=d.length+" "+o,h.appendChild(t)}}h.className="flex flex-1 items-center gap-6 truncate text-left text-inherit",m(),f.appendChild(h);var g=document.createElement("span");g.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",g.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',g.setAttribute("aria-hidden","true"),f.appendChild(g),p.appendChild(f),u.appendChild(p);var v=document.createElement("div");v.setAttribute("role","listbox"),v.setAttribute("aria-multiselectable","true"),v.className="custom-multiselect-content absolute left-0 right-0 z-50 max-h-[200px] min-w-[8rem] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0";var y=document.createElement("div");function b(e){return d.some(function(t){return t===e||String(t)===String(e)})}function x(){y.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=d.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)})}function w(){if(y.innerHTML="",0===n.length){var e=document.createElement("div");return e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="No options available",void y.appendChild(e)}n.forEach(function(e){var r=function(e){return void 0!==e.value&&null!==e.value?e.value:e.slug||e.id}(e),n=function(e){return e.label||e.name||e.display_name||e.value}(e),a=b(r),o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",r),o.setAttribute("aria-selected",a),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var u=document.createElement("span");u.className="flex items-center gap-8 flex-1 truncate",u.textContent=n,o.appendChild(u);var p=document.createElement("span");p.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",p.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',p.style.visibility=a?"visible":"hidden",o.appendChild(p),o.addEventListener("click",function(e){e.stopPropagation(),c||function(e){var r=d.findIndex(function(t){return t===e||String(t)===String(e)});r>=0?d.splice(r,1):d.push(e),m(),f.className=t(l,s,c,0===d.length),x(),i&&i(d.slice())}(r)}),o.addEventListener("mouseenter",function(){c||(y.querySelectorAll("[role=option]").forEach(function(e){e===o||b(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),o.classList.contains("bg-primary-surface")||o.classList.add("bg-fill-tertiary-fill-light-gray"))}),y.appendChild(o)})}y.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",w(),v.appendChild(y),u.appendChild(v);var C=!1;function E(){c||(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open").forEach(function(e){if(e!==u){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button");t&&t.setAttribute("aria-expanded","false")}}),C=!0,u.classList.add("open"),f.setAttribute("aria-expanded","true"))}function k(){C=!1,u.classList.remove("open"),f.setAttribute("aria-expanded","false")}function N(){C?k():E()}return f.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),N()}),f.addEventListener("keydown",function(e){if(!c)switch(e.key){case"Enter":case" ":e.preventDefault(),N();break;case"ArrowDown":case"ArrowUp":e.preventDefault(),C||E();break;case"Escape":C&&(e.preventDefault(),k())}}),document.addEventListener("click",function(e){C&&!u.contains(e.target)&&k()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&C&&k()}),u.updateValues=function(e){d=Array.isArray(e)?e.slice():[],m(),w(),x()},u.updateOptions=function(e){n.length=0,n.push.apply(n,e||[]),w(),x()},u.setDisabled=function(e){c=!!e,f.disabled=c,f.className=t(l,s,c,0===d.length),c&&C&&k()},u.getValues=function(){return d.slice()},u}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function r(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}e.EnumMultiSelect={create:function(n){var a=n.fieldId,o=n.objectSlug,i=n.columnSlug,l=n.placeholder||"Select options",s=n.label||"selected",c=n.onChange,d=n.variant||"default",u=n.size||"default",p=!!n.canClear,f=n.onClear,h=n.currentRecordData||{},m=n.showSearch,g=n.onLoad,v=n.onError,y=!0===n.disabled,b=Array.isArray(n.value)?n.value.slice():Array.isArray(n.values)?n.values.slice():[],x=[],w=null,C=null,E="",k=null,N=!(!e.Popover||"function"!=typeof e.Popover.create),S=!1,A=document.createElement("div");A.className="enum-multiselect relative w-full group",A.setAttribute("data-field-id",a);var L=document.createElement("span");L.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var T=document.createElement("button");T.type="button",T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y),T.disabled=y,T.setAttribute("aria-haspopup","listbox"),T.setAttribute("aria-expanded","false"),T.setAttribute("aria-multiselectable","true"),T.setAttribute("aria-label",l);var I=document.createElement("div");function M(){if(I.innerHTML="",0===b.length){var e=document.createElement("span");e.className="text-inherit",e.textContent=l,I.appendChild(e)}else{var t=document.createElement("span");t.className="text-inherit",t.textContent=b.length+" "+s,I.appendChild(t)}}I.className="flex flex-1 items-center gap-6 truncate text-left text-inherit",M(),T.appendChild(I);var q=document.createElement("span");q.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",q.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',q.setAttribute("aria-hidden","true"),("inline"!==d||0===b.length)&&T.appendChild(q),L.appendChild(T);var _=document.createElement("button");function j(){_&&(_.style.display=p&&b.length>0&&!y?"":"none")}_.type="button",_.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",_.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',_.setAttribute("aria-label","Clear selection"),_.style.display=p&&b.length>0&&!y?"":"none",_.addEventListener("click",function(e){e.stopPropagation(),b=[],M(),T.className=r(d,u,y,!0,!1);var t="inline"!==d||0===b.length;t&&!q.parentNode?T.appendChild(q):!t&&q.parentNode&&q.parentNode.removeChild(q),j(),K(),f&&f(),c&&c([])}),L.appendChild(_),A.appendChild(L);var D=document.createElement("div");D.setAttribute("role","listbox"),D.setAttribute("aria-multiselectable","true");var F="w-full min-w-[200px]";F+=N?" max-h-[30vh] overflow-hidden flex flex-col":" absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium border-1/2 border-border-primary opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0 flex flex-col",D.className=F;var z=document.createElement("div");z.className="py-2 border-b-1/2 border-border-primary hidden";var U=null,O=null;if(e.InputComponent&&"function"==typeof e.InputComponent.create){var P=(U=e.InputComponent.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Search...",value:"",startIcon:t,className:"!border-0 !p-0",onInput:function(){E=U.getValue().trim(),G()}})).getInput();P&&(P.setAttribute("aria-label","Search options"),P.addEventListener("click",function(e){e.stopPropagation()}),O=P),z.appendChild(U)}else{var B=document.createElement("div");B.className="flex items-center gap-8";var H=document.createElement("span");H.className="shrink-0 text-typography-tertiary-text",H.innerHTML=t,B.appendChild(H);var R=document.createElement("input");R.type="text",R.placeholder="Search...",R.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",R.addEventListener("input",function(e){E=e.target.value.trim(),G()}),R.addEventListener("click",function(e){e.stopPropagation()}),O=R,B.appendChild(R),z.appendChild(B)}var V=document.createElement("div");V.className="overflow-y-auto max-h-[30vh] p-2 w-full rounded-4 bg-fill-quarternary-fill-white flex-1 min-h-0",D.appendChild(z),D.appendChild(V),N||A.appendChild(D);var $=-1;function Y(e){V.innerHTML="";var t=document.createElement("div");t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-error-text",t.textContent=e||"Error loading options",V.appendChild(t)}function W(e){return b.some(function(t){return t===e||String(t)===String(e)})}function K(){V.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=b.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)})}function G(){V.innerHTML="";var t=function(){if(!E.trim())return x;var e=E.toLowerCase();return x.filter(function(t){var r=t.display_name.toLowerCase().includes(e),n=String(t.slug||"").toLowerCase().includes(e);return r||n})}(),n=void 0!==m?m:x.length>10;if(z.className=n?"p-8 border-b-1/2 border-border-primary ":"p-8 hidden",0===t.length){var a=document.createElement("div");return a.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",a.textContent=E.trim()?"No options found":"No options available",void V.appendChild(a)}t.forEach(function(t){var n=t.slug||t.display_name,a=t.display_name,o=W(n),i=0===t.is_active||!1===t.is_active,l=document.createElement("div");l.setAttribute("role","option"),l.setAttribute("data-value",n),l.setAttribute("aria-selected",o),l.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",o?"bg-primary-surface hover:!bg-primary-surface-hover":"");var s=document.createElement("span");s.className="flex items-center gap-8 flex-1 truncate";var f=t.badge_config;if(f&&(f.icon_color||f.start_icon)){var h=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}();if(h&&"function"==typeof h.createIconOrColor){var m=h.createIconOrColor({start_icon:f.start_icon,icon_color:f.icon_color,className:(f.class_name||"")+" shrink-0"});m&&s.appendChild(m)}}var g=document.createElement("span");if(g.textContent=a,s.appendChild(g),l.appendChild(s),i){var v=document.createElement("span");v.className="ml-8 px-6 py-2 text-xs rounded-2 bg-info-surface-hover text-info-text-base border-1/2 border-info-border-base",v.textContent="Archived",l.appendChild(v)}var x=document.createElement("span");x.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",x.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',x.style.visibility=o?"visible":"hidden",l.appendChild(x),l.addEventListener("click",function(e){e.stopPropagation(),y||function(e){var t=b.findIndex(function(t){return t===e||String(t)===String(e)});t>=0?b.splice(t,1):b.push(e),M(),T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y);var n="inline"!==d||0===b.length;n&&!q.parentNode?T.appendChild(q):!n&&q.parentNode&&q.parentNode.removeChild(q),j(),K(),c&&c(b.slice())}(n)}),l.addEventListener("mouseenter",function(){y||ee(l)}),V.appendChild(l)})}function Z(){if(!y){if(k)return document.querySelectorAll(".enum-select, .enum-multiselect, .custom-select, .record-select, .custom-multiselect").forEach(function(e){e!==A&&e.popoverInstance&&e.popoverInstance.hide()}),k.show(),T.setAttribute("aria-expanded","true"),void(O&&setTimeout(function(){O.focus()},50));document.querySelectorAll(".enum-multiselect.open, .enum-select.open").forEach(function(e){if(e!==A){e.classList.remove("open");var t=e.querySelector("button");t&&t.setAttribute("aria-expanded","false")}}),S=!0,A.classList.add("open"),T.setAttribute("aria-expanded","true"),O&&setTimeout(function(){O.focus()},50)}}function J(){k?k.hide():(S=!1,A.classList.remove("open")),T.setAttribute("aria-expanded","false"),$=-1,X(),G()}function Q(){(k?k.element&&k.element.classList.contains("visible"):S)?J():Z()}function X(){E="",U?U.setValue(""):O&&(O.value="")}function ee(e){V.querySelectorAll("[role=option]").forEach(function(e){W(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),$=Array.from(V.children).indexOf(e)}function te(e){var t=Array.from(V.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){($+=e)<0?$=t.length-1:$>=t.length&&($=0);var r=t[$];ee(r),function(e){if(e){var t=V.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=V.scrollTop,o=a+t.height;r<a?V.scrollTop=r-8:n>o&&(V.scrollTop=n-t.height+8)}}(r)}}function re(){var t=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}();if(!t||"function"==typeof t.isAvailable&&!t.isAvailable())return Y(C="SuperLeap SDK not initialized"),void(v&&v(C));!function(){V.innerHTML="";var e=document.createElement("div");e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="Loading options...",V.appendChild(e)}();var n="function"==typeof t.getSdk?t.getSdk():null;if(!n)return Y(C="Failed to get SDK instance"),void(v&&v(C));n.model(o).getField(i).then(function(e){if(!e)throw new Error("Field '"+i+"' not found in object '"+o+"'");if(w=e,!e.enumGroup||!e.enumGroup.values)throw new Error("Field '"+i+"' does not have enum options");var t=e.enumGroup,n=t.values||[];if(w.is_dependent_field&&t.properties&&t.properties.parent_column_slug){var a=t.properties.parent_column_slug,s=h[a];if(!s)return x=[],l="Select "+a+" first",void G();x=n.filter(function(e){return!!e.dependent_enum_slugs&&(Array.isArray(s)?s.some(function(t){return e.dependent_enum_slugs.includes(t)}):e.dependent_enum_slugs.includes(s))})}else x=n.filter(function(e){return 1===e.is_active||!0===e.is_active||b.includes(e.slug)});if(x.sort(function(e,t){return(void 0!==e.rank&&null!==e.rank?e.rank:999999)-(void 0!==t.rank&&null!==t.rank?t.rank:999999)}),G(),b.length>0){M(),T.className=r(d,u,y,!1,p&&b.length>0&&!y);var c="inline"!==d||0===b.length;c&&!q.parentNode?T.appendChild(q):!c&&q.parentNode&&q.parentNode.removeChild(q),j()}g&&g(x)}).catch(function(e){C=e.message||"Failed to load options",console.error("EnumMultiSelect error:",C),Y(C),v&&v(C)})}return T.addEventListener("keydown",function(e){if(!y){var t=k&&k.element&&k.element.classList.contains("visible");switch(e.key){case"Enter":case" ":e.preventDefault(),Q();break;case"ArrowDown":e.preventDefault(),t?te(1):Z();break;case"ArrowUp":e.preventDefault(),t?te(-1):Z();break;case"Escape":t&&(e.preventDefault(),J())}}}),function(){if(N){k=e.Popover.create({trigger:T,content:D,placement:"bottom",align:"start",closeOnClickOutside:!0,onClose:function(){T.setAttribute("aria-expanded","false"),q.style.transform="",$=-1,X(),G()},onOpen:function(){T.setAttribute("aria-expanded","true"),q.style.transform="rotate(180deg)"},bodyClassName:"p-0 overflow-hidden",panelClassName:"min-w-[var(--trigger-width)] overflow-hidden"}),A.popoverInstance=k;var t=T.offsetWidth;k.panel&&(k.panel.style.setProperty("--trigger-width",t+"px"),k.panel.style.minWidth=t+"px")}}(),re(),N||(T.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),y||Q()}),document.addEventListener("click",function(e){S&&!A.contains(e.target)&&J()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&S&&J()})),A.updateValues=function(e){b=Array.isArray(e)?e.slice():[],M(),T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y);var t="inline"!==d||0===b.length;t&&!q.parentNode?T.appendChild(q):!t&&q.parentNode&&q.parentNode.removeChild(q),j(),K()},A.updateRecordData=function(e){h=e||{},re()},A.setDisabled=function(e){y=!!e,T.disabled=y,T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y),j();var t=k&&k.element&&k.element.classList.contains("visible");y&&(t||S)&&J()},A.reload=function(){re()},A.getValues=function(){return b.slice()},A.getOptions=function(){return x},A.getColumnData=function(){return w},A.destroy=function(){k&&k.destroy()},A}}}("undefined"!=typeof window?window:void 0),function(e){var t=e.Popover,r=e.InputComponent,n=e.Spinner,a="user",o={team:{iconStr:"IconUsers",color:"primary"},role:{iconStr:"IconShield",color:"info"},iframe:{iconStr:"IconLayout",color:"neutral"},lead:{iconStr:"IconUser",color:"primary"},opportunity:{iconStr:"IconCurrencyDollar",color:"success"},call_log:{iconStr:"IconPhone",color:"info"},communication:{iconStr:"IconMessage",color:"primary"},history_field:{iconStr:"IconClock",color:"neutral"},email:{iconStr:"IconMail",color:"info"}},i='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function l(e,t,r,n){var a={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},o={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(a[e]||a.default)+" "+(o[t]||o.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}function s(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}function c(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Avatar");if(t)return t}return e.Avatar}function d(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}function u(e,t){var r="neutral",n="IconDatabase";if(t&&t.properties&&t.properties.icon_data){var a=t.properties.icon_data;"string"==typeof a.color&&a.color&&(r=a.color),"string"==typeof a.icon&&a.icon&&(n=a.icon)}return t&&t.properties&&t.properties.icon_data&&t.properties.icon_data.icon||(o[e]?(n=o[e].iconStr,o[e].color&&(r=o[e].color)):(n="IconDatabase",r="neutral")),{iconStr:n,color:r||"neutral"}}e.RecordMultiSelect={create:function(e){var o=e.fieldId,p=e.objectSlug,f=e.objectSchema||null,h=e.placeholder||"Select records",m=e.searchPlaceholder||"Search "+(p||"")+"...",g=e.label||"selected",v=e.onValuesChange,y=e.variant||"default",b=e.size||"default",x=null!=e.initialLimit?e.initialLimit:50,w=e.displayFields||[],C=!0===e.disabled,E=Array.isArray(e.value)?e.value.slice():Array.isArray(e.values)?e.values.slice():[];if(!p){var k=document.createElement("div");return k.className="text-reg-13 text-typography-quaternary-text",k.textContent="Record multiselect: objectSlug is required.",k}var N=document.createElement("div");N.className="record-multiselect relative w-full group",N.setAttribute("data-field-id",o),N.setAttribute("data-object-slug",p);var S=[],A=[],L=[],T=!1,I="",M=null,q=t&&"function"==typeof t.create,_=null,j=!0,D=1,F=!1,z="record-multiselect-content min-w-[8rem] ";q||(z+="absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ");var U=document.createElement("span");U.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var O=document.createElement("button");O.type="button",O.className=l(y,b,C,0===E.length),O.disabled=C,O.setAttribute("aria-haspopup","listbox"),O.setAttribute("aria-expanded","false"),O.setAttribute("aria-multiselectable","true"),O.setAttribute("aria-label",h),O.classList.add("record-multiselect-trigger");var P=document.createElement("div");P.className="record-multiselect-trigger-content flex items-center gap-8 flex-1 min-w-0";var B=document.createElement("span");B.className="record-multiselect-trigger-icon shrink-0 hidden",P.appendChild(B);var H=document.createElement("div");function R(){if(H.textContent=0===E.length?h:E.length+" "+g,B.innerHTML="",0===E.length)B.className="record-multiselect-trigger-icon shrink-0 hidden";else if(B.className="record-multiselect-trigger-icon shrink-0 flex items-center justify-center size-20 rounded-4 overflow-hidden",p===a){var e=c();if(e&&"function"==typeof e.createVivid){var t=S.length>0?S[0]:null,r=t&&(t.name||t.label),n=e.createVivid({name:r||"?",size:"small",shape:"circle"});B.appendChild(n)}else!function(e){var t=e&&String(e).charAt(0).toUpperCase()||"?",r=document.createElement("div");r.className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold",r.textContent=t,B.appendChild(r)}(S.length>0&&(S[0].name||S[0].label))}else!function(){var e=d();if(e&&"function"==typeof e.create){var t=u(p,f),r=e.create({iconStr:t.iconStr,color:t.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});r&&B.appendChild(r)}}()}H.className="truncate text-inherit record-multiselect-value",P.appendChild(H),R(),O.appendChild(P);var V=document.createElement("span");V.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",V.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',V.setAttribute("aria-hidden","true"),O.appendChild(V),U.appendChild(O),N.appendChild(U);var $=document.createElement("div");$.setAttribute("role","listbox"),$.setAttribute("aria-multiselectable","true"),$.className=z+(q?"max-h-[30vh] overflow-hidden flex flex-col":"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0");var Y,W=document.createElement("div");W.className="p-8 pb-4 border-b-1/2 border-border-primary ";var K=null;if(r&&"function"==typeof r.create){var G=(K=r.create({variant:"borderless",inputSize:"small",type:"text",placeholder:m,value:"",startIcon:i,className:"!border-0 !p-0",onInput:function(){(I=K.getValue().trim())?de():ce()}})).getInput();G&&G.setAttribute("aria-label","Search records"),Y=G,W.appendChild(K)}else{var Z=document.createElement("div");Z.className="flex items-center gap-8";var J=document.createElement("span");J.className="shrink-0 text-typography-tertiary-text",J.innerHTML=i,Z.appendChild(J);var Q=document.createElement("input");Q.type="text",Q.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",Q.placeholder=m,Q.setAttribute("aria-label","Search records"),Y=Q,Z.appendChild(Q),W.appendChild(Z)}$.appendChild(W);var X=document.createElement("div");function ee(e){return E.some(function(t){return t===e||String(t)===String(e)})}function te(e){var t=E.findIndex(function(t){return t===e||String(t)===String(e)});if(t>=0)E.splice(t,1),S=S.filter(function(t){return(t.id||t.value)!==e});else{E.push(e);var r=A.find(function(t){return(t.id||t.value)===e});r&&S.push(r)}R(),O.className=l(y,b,C,0===E.length),X.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=E.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)}),v&&v(E.slice(),S.slice())}function re(e,t,r){var n=s();if(!n||"function"!=typeof n.getSdk)return Promise.resolve({records:[],hasMore:!1});var a=n.getSdk();if(!a)return Promise.resolve({records:[],hasMore:!1});var o=a.model(p),i=["id","name"].concat(w||[]),l=t||x,c=r?(r-1)*l:0;try{if(o&&"function"==typeof o.select){var d=o.select.apply(o,i);e&&e.trim()&&(d=d.filterBy({or:[{field:"name",operator:"contains",value:e.trim()},{field:"id",operator:"eq",value:e.trim()}]}));var u=["name"];return"account"===p&&u.push("-ParentId"),d.limit(l).offset(c).orderBy.apply(d,u).cache({ttl:12e4}).then(function(e){var t=e.map(function(e){var t=e.toJSON?e.toJSON():e,r=t.icon||t.logo||t.icon_url||t.Icon__c||t.Logo__c||null,n=w?w.map(function(e){return t[e]||""}):[];return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id,icon:r,displayLabels:n}});return{records:t,hasMore:t.length>=l}})}}catch(e){console.error("[RecordMultiSelect] fetchRecords error:",e)}return Promise.resolve({records:[],hasMore:!1})}function ne(){if(E&&0!==E.length){var e=s();if(e&&"function"==typeof e.getSdk){var t=e.getSdk();if(t){var r=t.model(p),n=["id","name"].concat(w||[]);r.select.apply(r,n).filterBy({and:[{field:"id",operator:"in",value:E}]}).limit(E.length).then(function(e){S=e.map(function(e){var t=e.toJSON?e.toJSON():e,r=t.icon||t.logo||t.icon_url||t.Icon__c||t.Logo__c||null,n=w?w.map(function(e){return t[e]||""}):[];return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id,icon:r,displayLabels:n}}),R()}).catch(function(){S=E.map(function(e){return{id:e,value:e,name:e,label:e,icon:null,displayLabels:[]}}),R()})}else R()}else R()}else R()}function ae(){X.innerHTML="";var e=document.createElement("div");if(e.className="flex flex-row items-center justify-center gap-8 py-12 px-12 w-full text-reg-12 text-typography-quaternary-text record-multiselect-loading",n&&"function"==typeof n.create)e.appendChild(n.create({size:"small",text:"Loading..."}));else{var t=document.createElement("span");t.textContent="Loading...",e.appendChild(t)}X.appendChild(e)}function oe(){var e=X.querySelector(".record-multiselect-loading-more");e&&e.remove();var t=document.createElement("div");if(t.className="flex flex-row items-center justify-center gap-8 py-8 px-12 w-full text-reg-12 text-typography-quaternary-text record-multiselect-loading-more",n&&"function"==typeof n.create)t.appendChild(n.create({size:"small"}));else{var r=document.createElement("span");r.textContent="Loading more...",t.appendChild(r)}X.appendChild(t)}function ie(){var e=X.querySelector(".record-multiselect-loading-more");e&&e.remove()}function le(e){X.innerHTML="";var t=document.createElement("div");t.className="w-full justify-center px-12 py-6 text-center text-reg-12 text-typography-quaternary-text record-multiselect-empty",t.textContent=e||"No records found",X.appendChild(t)}function se(){X.querySelectorAll("[role=option]").forEach(function(e){e.remove()}),X.querySelectorAll(".record-multiselect-loading, .record-multiselect-empty").forEach(function(e){e.remove()}),L.forEach(function(e){var t=e.id||e.value,r=e.name||e.label||e.value,n=ee(t),o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",n),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex flex-col flex-1 truncate min-w-0";var l=document.createElement("div");if(l.className="flex items-center gap-8 truncate",p===a){var s=c();if(s&&"function"==typeof s.createVivid){var h=s.createVivid({name:r||"",size:"small",shape:"circle"});l.appendChild(h)}else{var m=document.createElement("span");m.className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold shrink-0",m.textContent=(r||"?").charAt(0).toUpperCase(),l.appendChild(m)}}else{var g=d();if(g&&"function"==typeof g.create){var v=u(p,f),y=g.create({iconStr:v.iconStr,color:v.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});y&&l.appendChild(y)}else{var b=document.createElement("span");b.className="size-20 rounded-4 flex items-center justify-center shrink-0 bg-neutral-surface-hover text-neutral-text-base",b.textContent="?",l.appendChild(b)}}var x=document.createElement("span");if(x.className="truncate",x.textContent=r,l.appendChild(x),i.appendChild(l),e.displayLabels&&e.displayLabels.length>0&&e.displayLabels.some(function(e){return e})){var w=document.createElement("div");w.className="flex items-center gap-4 truncate text-reg-10 text-typography-tertiary-text mt-2 ml-28",e.displayLabels.forEach(function(t,r){if(t){var n=document.createElement("span");if(n.className="truncate",n.textContent=t,w.appendChild(n),r<e.displayLabels.length-1&&e.displayLabels[r+1]){var a=document.createElement("span");a.textContent=" • ",w.appendChild(a)}}}),i.appendChild(w)}o.appendChild(i);var E=document.createElement("span");E.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",E.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',E.style.visibility=n?"visible":"hidden",o.appendChild(E),o.addEventListener("click",function(e){e.stopPropagation(),C||te(t)}),o.addEventListener("mouseenter",function(){C||(X.querySelectorAll("[role=option]").forEach(function(e){e===o||ee(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),o.classList.contains("bg-primary-surface")||o.classList.add("bg-fill-tertiary-fill-light-gray"))}),X.appendChild(o)}),F&&oe()}function ce(){ae(),D=1,j=!0,re(I,x,1).then(function(e){A=e.records,L=e.records,j=e.hasMore,e.records.length,D=1,0===L.length?le(I?"No results found":"No records available"):se()}).catch(function(){le("Failed to load records"),j=!1})}function de(){M&&clearTimeout(M),M=setTimeout(function(){M=null,ae(),D=1,j=!0,re(I,x,1).then(function(e){A=e.records,L=e.records,j=e.hasMore,e.records.length,0===e.records.length?le("No results found"):se()}).catch(function(){le("Search failed"),j=!1})},500)}function ue(){C||(q&&_?_.show():(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open, .record-multiselect.open").forEach(function(e){if(e!==N){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button, .record-multiselect-trigger");t&&t.setAttribute("aria-expanded","false")}}),T=!0,N.classList.add("open"),O.setAttribute("aria-expanded","true"),I="",K?K.setValue(""):Y&&(Y.value=""),ce(),setTimeout(function(){Y&&Y.focus()},0),function(){if(q)return;var e=O.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;$.className=t<200&&r>t?z+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":z+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0"}()))}function pe(){q&&_?_.hide():(T=!1,N.classList.remove("open"),O.setAttribute("aria-expanded","false"),I="",K?K.setValue(""):Y&&(Y.value=""),M&&(clearTimeout(M),M=null))}return X.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white record-multiselect-options",X.addEventListener("scroll",function(){if(!F&&j){var e=X.scrollHeight;X.scrollTop+X.clientHeight>=e-50&&function(){if(F||!j)return;F=!0,D+=1,oe(),re(I,x,D).then(function(e){F=!1,ie(),e.records.length>0?(A=A.concat(e.records),L=L.concat(e.records),e.records.length,j=e.hasMore,se()):j=!1}).catch(function(e){console.error("[RecordMultiSelect] loadMoreRecords error:",e),F=!1,ie(),j=!1})}()}}),$.appendChild(X),q||N.appendChild($),q&&(_=t.create({trigger:O,content:$,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0 overflow-hidden",panelClassName:"max-h-[30vh] overflow-hidden",onOpen:function(){C?_.hide():(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open, .record-multiselect.open").forEach(function(e){if(e!==N){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button, .record-multiselect-trigger");t&&t.setAttribute("aria-expanded","false")}}),T=!0,N.classList.add("open"),O.setAttribute("aria-expanded","true"),I="",K?K.setValue(""):Y&&(Y.value=""),$.style.minWidth=O.offsetWidth+"px",ce(),setTimeout(function(){Y&&Y.focus()},0))},onClose:function(){T=!1,N.classList.remove("open"),O.setAttribute("aria-expanded","false"),I="",K?K.setValue(""):Y&&(Y.value=""),M&&(clearTimeout(M),M=null)}})),!K&&Y&&Y.addEventListener("input",function(){(I=this.value.trim())?de():ce()}),Y&&Y.addEventListener("keydown",function(e){e.stopPropagation()}),q&&_?O.addEventListener("keydown",function(e){C||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T?_.hide():_.show())}):(O.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),T?pe():ue()}),O.addEventListener("keydown",function(e){C||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T?pe():ue()),"Escape"===e.key&&T&&(e.preventDefault(),pe()))}),document.addEventListener("click",function(e){T&&!N.contains(e.target)&&pe()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&T&&pe()})),N.updateValues=function(e){E=Array.isArray(e)?e.slice():[],ne()},N.setDisabled=function(e){C=!!e,O.disabled=C,O.className=l(y,b,C,0===E.length),C&&T&&pe()},N.getValues=function(){return E.slice()},N.getSelectedRecords=function(){return S.slice()},E&&E.length>0?ne():R(),N}}}("undefined"!=typeof window?window:void 0),function(e){var t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',eye:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>',eyeOff:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.16 13.16 0 0 0 2 12s3 7 10 7a9.9 9.9 0 0 0 5.39-1.61"/><line x1="2" y1="2" x2="22" y2="22"/></svg>',lock:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>'},r={base:"group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out",default:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",password:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent focus:bg-fill-tertiary-fill-light-gray focus-within:bg-fill-tertiary-fill-light-gray",sizeDefault:"px-12 py-6",sizeLarge:"px-12 py-8",sizeSmall:"px-12 py-4",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"},n="w-full bg-inherit text-start outline-none placeholder:text-typography-quaternary-text focus:bg-inherit hover:bg-inherit focus-visible:outline-none disabled:cursor-not-allowed disabled:text-typography-quaternary-text file:rounded-4 file:border-none file:text-typography-primary-text file:shadow-none file:outline-none",a="transition-all focus:bg-fill-tertiary-fill-light-gray group-hover:bg-fill-tertiary-fill-light-gray",o={default:"flex items-center justify-center rounded-4 size-16 text-typography-quaternary-text shrink-0",error:"flex items-center justify-center rounded-4 size-16 text-error-base shrink-0",warning:"flex items-center justify-center rounded-4 size-16 text-warning-base shrink-0",success:"flex items-center justify-center rounded-4 size-16 text-primary-base shrink-0",password:"flex items-center justify-center rounded-4 size-16 text-primary-base hover:cursor-pointer shrink-0"};function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.InputComponent={create:function(e){var l=e.variant||"default",s=e.inputSize||"default",c=e.type||"text",d=!!e.disabled,u=!!e.readOnly,p=!1!==e.showReadOnlyIcon,f="password"===c,h=document.createElement("div");if(h.className=i(r.base,r[l]||r.default,"large"===s?r.sizeLarge:"small"===s?r.sizeSmall:r.sizeDefault,d?r.disabled:"",e.className||""),h.setAttribute("data-input-variant",l),e.prefixNode){var m=document.createElement("span");m.className="shrink-0","string"==typeof e.prefixNode?m.innerHTML=e.prefixNode:m.appendChild(e.prefixNode),h.appendChild(m)}if(e.startIcon&&"inline"!==l){var g=document.createElement("span");g.className=o[l]||o.default,"string"==typeof e.startIcon?g.innerHTML=e.startIcon:g.appendChild(e.startIcon),h.appendChild(g)}var v=document.createElement("input");v.type=f?"text":c,v.autocomplete="off",null!=e.placeholder&&(v.placeholder=e.placeholder),null!=e.value&&(v.value=e.value),e.name&&(v.name=e.name),e.id&&(v.id=e.id),v.disabled=d,v.readOnly=u,v.className=i("!text-reg-13",n,"inline"===l?a:"",e.rootClassName||"");var y=!1;if(f&&(v.type="password",v.setAttribute("data-password-masked","true")),h.appendChild(v),"inline"!==l){if("error"===l){var b=document.createElement("span");b.className=o.error,b.innerHTML=t.alertCircle,b.setAttribute("aria-hidden","true"),h.appendChild(b)}else if("warning"===l){var x=document.createElement("span");x.className=o.warning,x.innerHTML=t.alertCircle,x.setAttribute("aria-hidden","true"),h.appendChild(x)}else if("success"===l){var w=document.createElement("span");w.className=o.success,w.innerHTML=t.circleCheck,w.setAttribute("aria-hidden","true"),h.appendChild(w)}if("password"===l&&f){var C=document.createElement("span");C.className=o.password,C.setAttribute("role","button"),C.setAttribute("tabindex","0"),C.setAttribute("aria-label","Toggle password visibility"),C.innerHTML=y?t.eyeOff:t.eye,C.addEventListener("click",function(){d||(y=!y,v.type=y?"text":"password",v.setAttribute("data-password-masked",y?"false":"true"),C.innerHTML=y?t.eyeOff:t.eye)}),C.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C.click())}),h.appendChild(C)}if(u&&p){var E=document.createElement("span");E.className=i(o.default,"text-typography-quaternary-text"),E.innerHTML=t.lock,E.setAttribute("aria-hidden","true"),h.appendChild(E)}if((!l||"default"===l||"borderless"===l)&&e.endIcon){var k=document.createElement("span");k.className=o.default,"string"==typeof e.endIcon?k.innerHTML=e.endIcon:k.appendChild(e.endIcon),h.appendChild(k)}}return e.onChange&&v.addEventListener("change",e.onChange),e.onInput&&v.addEventListener("input",e.onInput),e.onFocus&&v.addEventListener("focus",e.onFocus),e.onBlur&&v.addEventListener("blur",e.onBlur),h.getInput=function(){return v},h.setValue=function(e){v.value=e},h.getValue=function(){return v.value},h.setVariant=function(t){l=t,h.setAttribute("data-input-variant",t),h.className=i(r.base,r[l]||r.default,"large"===s?r.sizeLarge:"small"===s?r.sizeSmall:r.sizeDefault,d?r.disabled:"",e.className||"")},h.setDisabled=function(e){d=!!e,v.disabled=d,h.classList.toggle("cursor-not-allowed",d),h.classList.toggle("opacity-60",d)},h},ICONS:t}}("undefined"!=typeof window?window:void 0),function(e){var t={base:"group flex items-stretch border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-0 w-full transition-all ease-in-out overflow-hidden",default:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent focus:bg-fill-tertiary-fill-light-gray focus-within:bg-fill-tertiary-fill-light-gray",sizeDefault:"",sizeLarge:"",sizeSmall:"",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"},r={default:"py-6",large:"py-8",small:"py-4"},n={base:"w-full min-w-0 border-0 bg-inherit text-start outline-none placeholder:text-typography-quaternary-text focus:bg-inherit hover:bg-inherit focus-visible:outline-none disabled:cursor-not-allowed disabled:text-typography-quaternary-text file:rounded-4 file:border-none file:text-typography-primary-text file:shadow-none file:outline-none !text-reg-13 px-12",inline:"transition-all focus:bg-fill-tertiary-fill-light-gray group-hover:bg-fill-tertiary-fill-light-gray",sizeDefault:"py-6",sizeLarge:"py-8",sizeSmall:"py-4"},a=/^-?\d*\.?\d{0,2}$/;function o(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function i(e){if(""===e||null==e)return null;var t=String(e).trim();if(""===t)return null;var r=parseFloat(t);return isNaN(r)?null:Math.round(100*r)/100}function l(e){return null==e||isNaN(e)?"":Number(e).toFixed(2)}e.CurrencyComponent={create:function(e){var s=e.variant||"default",c=e.size||"default",d=!!e.disabled,u=e.className||"",p=e.column||{},f=e.onChange,h=null!=e.value?e.value:null,m=!!e.autoFocus,g=e.onBlur,v=null!=e.placeholder?e.placeholder:p.placeholder||"Enter value",y=e.rootClassName||"",b=p.properties&&p.properties.currency&&p.properties.currency.currency||"Currency",x="large"===c?"large":"small"===c?"small":"default",w=document.createElement("div");w.className=o(t.base,null!=t[s]?t[s]:t.default,d?t.disabled:"",u),w.setAttribute("data-currency-variant",s);var C=document.createElement("div");C.className=o("flex shrink-0 w-fit items-center justify-center border-r-1/2 border-border-primary bg-fill-tertiary-fill-light-gray text-typography-primary-text px-12 text-reg-12",r[x]),C.textContent=b,w.appendChild(C);var E=document.createElement("div");E.className="flex items-center flex-1 min-w-0 border-0";var k=document.createElement("input");function N(){var e=i(k.value);f&&f(e)}return k.type="text",k.inputMode="decimal",k.autocomplete="off",k.placeholder=v,k.value=null!=h?l(h):"",k.disabled=d,k.className=o(n.base,"inline"===s?n.inline:"",n["large"===x?"sizeLarge":"small"===x?"sizeSmall":"sizeDefault"],y),m&&(k.autofocus=!0),function(e){e.addEventListener("input",function(){var t=e.value;if(""!==t&&"-"!==t&&!a.test(t)){var r="-"===t.charAt(0)?"-":"",n=r?t.slice(1):t,o=n.indexOf(".");if(-1===o)e.value=r+n.replace(/\D/g,"");else{var i=n.slice(0,o).replace(/\D/g,""),l=n.slice(o+1).replace(/\D/g,"").slice(0,2);e.value=r+(l.length?i+"."+l:i)}}})}(k),k.addEventListener("input",N),k.addEventListener("change",N),g&&k.addEventListener("blur",g),E.appendChild(k),w.appendChild(E),w.getInput=function(){return k},w.setValue=function(e){k.value=null==e||""===e?"":l(Number(e))},w.getValue=function(){return i(k.value)},w.setVariant=function(r){s=r,w.setAttribute("data-currency-variant",r),w.className=o(t.base,null!=t[s]?t[s]:t.default,d?t.disabled:"",e.className||"")},w.setDisabled=function(e){d=!!e,k.disabled=d,w.classList.toggle("cursor-not-allowed",d)},w},parseDecimal:i,formatDecimal:l}}("undefined"!=typeof window?window:void 0),function(e){var t={base:"flex w-full rounded-4 border-1/2 border-border-primary bg-fill-quarternary-fill-white px-12 py-6 !text-reg-13 outline-none placeholder:text-typography-quaternary-text text-typography-primary-text resize-y transition-all ease-in-out",default:"min-h-[80px] hover:border-primary-base focus:border-primary-base",borderless:"min-h-[80px] border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus:border-transparent focus:bg-fill-tertiary-fill-light-gray py-4",error:"min-h-[80px] border-error-base hover:border-error-base focus:border-error-base",warning:"min-h-[80px] border-warning-base hover:border-warning-base focus:border-warning-base",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"};function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.TextareaComponent={create:function(e){var n=e.variant||"default",a=!!e.disabled,o=document.createElement("textarea");return o.autocomplete="off",null!=e.placeholder&&(o.placeholder=e.placeholder),null!=e.value&&(o.value=e.value),e.name&&(o.name=e.name),e.id&&(o.id=e.id),null!=e.rows&&(o.rows=e.rows),null!=e.maxLength&&(o.maxLength=e.maxLength),o.disabled=a,o.readOnly=!!e.readOnly,o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||""),o.setAttribute("data-textarea-variant",n),e.onChange&&o.addEventListener("change",e.onChange),e.onInput&&o.addEventListener("input",e.onInput),e.onFocus&&o.addEventListener("focus",e.onFocus),e.onBlur&&o.addEventListener("blur",e.onBlur),o.getInput=function(){return o},o.setValue=function(e){o.value=e},o.getValue=function(){return o.value},o.setVariant=function(i){n=i,o.setAttribute("data-textarea-variant",i),o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||"")},o.setDisabled=function(i){a=!!i,o.disabled=a,o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||"")},o}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/></svg>',n={small:{width:"12",height:"12"},default:{width:"14",height:"14"},large:{width:"16",height:"16"}},a={left:"justify-start",center:"justify-center",right:"justify-end"},o={small:"size-12",default:"size-16",large:"size-20"};function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function l(e,a,o,i){if(e.innerHTML="",a||o){var l=n[i]||n.default,s=o?r:t;s=(s=s.replace(/width="\d+"/,'width="'+l.width+'"')).replace(/height="\d+"/,'height="'+l.height+'"'),e.innerHTML=s}}var s={create:function(e){var t=e||{},r=t.id||"checkbox-"+Math.random().toString(36).substr(2,9),n=t.name,s=!!t.checked,c=!!t.indeterminate,d=!!t.disabled,u=t.label,p=!!t.isLabelCaps,f=t.align||"center",h=t.size||"default",m=t.className||"",g=t.onChange,v=document.createElement("div");v.className=i("flex gap-8 items-center",a[f]||a.center,m);var y=document.createElement("input");y.type="checkbox",y.id=r,n&&(y.name=n),y.checked=s,y.disabled=d,y.className="absolute opacity-0 w-0 h-0 peer",y.setAttribute("aria-checked",c?"mixed":s?"true":"false"),y.style.position="absolute",y.style.opacity="0",y.style.width="0",y.style.height="0",y.style.pointerEvents="none";var b=document.createElement("div");b.className=i("flex items-center justify-center rounded-2 border-1/2 border-borderColor-border-primary bg-fill-quarternary-fill-white p-4 transition-all hover:border-primary-base hover:shadow-primary-focused disabled:cursor-not-allowed disabled:border-borderColor-border-primary disabled:opacity-50 disabled:hover:shadow-none","data-checked:border-transparent data-checked:bg-primary-base data-checked:hover:border-primary-base data-checked:hover:shadow-primary-focused data-checked:disabled:border-borderColor-border-primary",o[h]||o.default,"cursor-pointer"),b.setAttribute("role","checkbox"),b.setAttribute("tabindex",d?"-1":"0"),b.setAttribute("aria-checked",c?"mixed":s?"true":"false"),d&&b.setAttribute("aria-disabled","true");var x=document.createElement("span");function w(){var e=y.checked,t=y.indeterminate;b.setAttribute("aria-checked",t?"mixed":e?"true":"false"),y.setAttribute("aria-checked",t?"mixed":e?"true":"false"),e||t?(b.setAttribute("data-checked","true"),b.classList.add("border-transparent","bg-primary-base"),b.classList.remove("border-borderColor-border-primary","bg-fill-quarternary-fill-white")):(b.removeAttribute("data-checked"),b.classList.remove("border-transparent","bg-primary-base"),b.classList.add("border-borderColor-border-primary","bg-fill-quarternary-fill-white")),l(x,e,t,h)}if(x.className="flex items-center justify-center text-current",l(x,s,c,h),b.appendChild(x),b.addEventListener("click",function(){d||(y.indeterminate=!1,y.checked=!y.checked,w(),"function"==typeof g&&g(y.checked),y.dispatchEvent(new Event("change",{bubbles:!0})))}),b.addEventListener("keydown",function(e){d||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),b.click())}),y.addEventListener("change",function(){w(),"function"==typeof g&&g(y.checked)}),v.appendChild(y),v.appendChild(b),u){var C=document.createElement("label");C.htmlFor=r,C.className=i("cursor-pointer pb-0 text-reg-12 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p?"capitalize":"",d?"text-typography-quaternary-text":""),C.textContent=u,v.appendChild(C)}return c&&(y.indeterminate=!0),w(),v.getInput=function(){return y},v.setChecked=function(e){y.indeterminate=!1,y.checked=!!e,w()},v.getChecked=function(){return y.checked},v.setIndeterminate=function(e){y.indeterminate=!!e,e&&(y.checked=!1),w()},v.getIndeterminate=function(){return y.indeterminate},v.setDisabled=function(e){d=!!e,y.disabled=d,b.setAttribute("tabindex",d?"-1":"0"),d?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled"),w()},v}};"undefined"!=typeof module&&module.exports?module.exports=s:e.Checkbox=s}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>',r="size-16 rounded-128 border focus:ring-0 transition-all cursor-pointer",n="bg-fill-quarternary-fill-white border-typography-quaternary-text hover:border-primary-base hover:shadow-primary-focused",a="bg-primary-base border-primary-base hover:border-primary-base hover:shadow-primary-focused",o="disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-none",i="size-8 rounded-128 bg-fill-quarternary-fill-white text-fill-quarternary-fill-white data-[state=checked]:text-typography-quaternary-text group-disabled:text-typography-quaternary-text data-[state=checked]:group-disabled:text-typography-quaternary-text";function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}var s={create:function(e){var s=e||{},c=s.name||"radio-group-"+Math.random().toString(36).substr(2,9),d=s.options||[],u=s.defaultValue,p=void 0!==s.value?s.value:u,f=!!s.disabled,h=s.className||"",m=s.orientation||"horizontal",g=s.onChange,v=document.createElement("div");v.setAttribute("role","radiogroup"),v.setAttribute("aria-required","false"),v.setAttribute("dir","ltr"),v.className=l("flex content-center gap-6","vertical"===m?"flex-col":"",h),v.tabIndex=0;var y=p;function b(e,s,c){e.checked=c,s.setAttribute("aria-checked",c?"true":"false"),s.setAttribute("data-state",c?"checked":"unchecked"),s.className=l(r,c?a:n,o);var d=s.querySelector("span");if(d)if(d.setAttribute("data-state",c?"checked":"unchecked"),c){d.innerHTML=t;var u=d.querySelector("svg");u&&u.setAttribute("class",i)}else d.innerHTML=""}return d.forEach(function(e,s){var d=e.value,u=e.label||e.value,p=f||!!e.disabled,h=d===y,m=document.createElement("div");m.className="flex items-center gap-8";var x=document.createElement("input");x.type="radio",x.name=c,x.value=d,x.id=c+"-"+s,x.checked=h,x.disabled=p,x.className="absolute opacity-0 w-0 h-0 peer",x.style.position="absolute",x.style.opacity="0",x.style.width="0",x.style.height="0",x.style.pointerEvents="none";var w=document.createElement("button");w.type="button",w.setAttribute("role","radio"),w.setAttribute("aria-checked",h?"true":"false"),w.setAttribute("data-state",h?"checked":"unchecked"),w.value=d,w.id=c+"-button-"+s,w.tabIndex=-1,w.className=l(r,h?a:n,o),p&&(w.disabled=!0);var C=document.createElement("span");if(C.setAttribute("data-state",h?"checked":"unchecked"),C.className="flex items-center justify-center",h){C.innerHTML=t;var E=C.querySelector("svg");E&&E.setAttribute("class",i)}if(w.appendChild(C),w.addEventListener("click",function(){if(!p){y=d;var e=v.querySelectorAll('input[name="'+c+'"]');Array.prototype.slice.call(e).forEach(function(e,t){var r=v.querySelector('[id="'+c+"-button-"+t+'"]');r&&b(e,r,e.value===y)}),"function"==typeof g&&g(y),x.dispatchEvent(new Event("change",{bubbles:!0}))}}),w.addEventListener("keydown",function(e){p||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),w.click())}),m.appendChild(x),m.appendChild(w),u){var k=document.createElement("label");k.htmlFor=c+"-"+s,k.className=l("cursor-pointer text-reg-12 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p?"text-typography-quaternary-text":""),k.textContent=u,k.addEventListener("click",function(){p||w.click()}),m.appendChild(k)}v.appendChild(m)}),v.getValue=function(){var e=v.querySelector('input[name="'+c+'"]:checked');return e?e.value:null},v.setValue=function(e){y=e,v.querySelectorAll('input[name="'+c+'"]').forEach(function(t,r){var n=v.querySelector('[id="'+c+"-button-"+r+'"]');n&&b(t,n,t.value===e)})},v.setDisabled=function(e){f=!!e,v.querySelectorAll('input[name="'+c+'"]').forEach(function(e,t){e.disabled=f;var r=v.querySelector('[id="'+c+"-button-"+t+'"]');r&&(r.disabled=f)})},v},createItem:function(e){var s=e||{},c=s.value,d=s.name||"radio-"+Math.random().toString(36).substr(2,9),u=s.id||d+"-"+c,p=!!s.checked,f=!!s.disabled,h=s.className||"",m=s.onChange,g=document.createElement("div");g.className="flex items-center gap-8";var v=document.createElement("input");v.type="radio",v.name=d,v.value=c,v.id=u,v.checked=p,v.disabled=f,v.className="absolute opacity-0 w-0 h-0 peer",v.style.position="absolute",v.style.opacity="0",v.style.width="0",v.style.height="0",v.style.pointerEvents="none";var y=document.createElement("button");y.type="button",y.setAttribute("role","radio"),y.setAttribute("aria-checked",p?"true":"false"),y.setAttribute("data-state",p?"checked":"unchecked"),y.value=c,y.tabIndex=f?-1:0,y.className=l(r,p?a:n,o,h),f&&(y.disabled=!0);var b=document.createElement("span");if(b.setAttribute("data-state",p?"checked":"unchecked"),b.className="flex items-center justify-center",p){b.innerHTML=t;var x=b.querySelector("svg");x&&x.setAttribute("class",i)}function w(){var e=v.checked;if(y.setAttribute("aria-checked",e?"true":"false"),y.setAttribute("data-state",e?"checked":"unchecked"),b.setAttribute("data-state",e?"checked":"unchecked"),e){y.className=l(r,a,o,h),b.innerHTML=t;var s=b.querySelector("svg");s&&s.setAttribute("class",i)}else y.className=l(r,n,o,h),b.innerHTML=""}return y.appendChild(b),y.addEventListener("click",function(){f||(v.checked=!0,w(),"function"==typeof m&&m(c),v.dispatchEvent(new Event("change",{bubbles:!0})))}),y.addEventListener("keydown",function(e){f||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),y.click())}),g.appendChild(v),g.appendChild(y),g.getInput=function(){return v},g.setChecked=function(e){v.checked=!!e,w()},g.getChecked=function(){return v.checked},g}};"undefined"!=typeof module&&module.exports?module.exports=s:e.RadioGroup=s}("undefined"!=typeof window?window:void 0),function(e){var t="flex items-center border rounded-4 text-typography-primary-text gap-4 !text-reg-13",r={default:"border-border-primary bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white"},n={default:"px-12 py-6",large:"px-12 py-8",small:"px-12 py-4"},a="pointer-events-none !cursor-not-allowed opacity-50",o="pointer-events-none",i={default:"size-16",large:"size-20",small:"size-12"};function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function s(e,t){null!=t&&(e.innerHTML="","string"==typeof t?e.insertAdjacentHTML("beforeend",t):t instanceof HTMLElement?e.appendChild(t):t instanceof Node&&e.appendChild(t.cloneNode(!0)))}var c={create:function(e){var c=e||{},d=Math.max(0,parseInt(c.totalElements,10)||0),u=null!=c.enabledIcon?c.enabledIcon:'<span class="text-primary-base">★</span>',p=null!=c.disabledIcon?c.disabledIcon:'<span class="text-typography-quaternary-text">☆</span>',f=c.variant||"default",h=c.size||"default",m=c.iconSize||"default",g=c.defaultValue,v=!0===c.disabled,y=!0===c.readOnly,b=c.className||"",x=c.onValueChange,w=c.children,C=document.createElement("div");C.className=l(t,null!=r[f]?r[f]:r.default,null!=n[h]?n[h]:n.default,v?a:"",y?o:"",b),C.setAttribute("data-enumeration-variant",f);var E=null!=g?Math.min(d,Math.max(0,parseInt(g,10)||0)):0,k=l("flex items-center justify-center text-primary-base hover:cursor-pointer",null!=i[m]?i[m]:i.default),N=[];function S(){for(var e=0;e<N.length;e++){var t=N[e],r=e+1<=E;s(t,r?u:p),t.setAttribute("aria-pressed",r?"true":"false")}}for(var A=0;A<d;A++){var L=A+1,T=document.createElement("div");T.className=k,T.setAttribute("role","button"),T.setAttribute("tabindex",v||y?"-1":"0"),T.setAttribute("aria-pressed",L<=E?"true":"false"),T.setAttribute("aria-label","Set value to "+L),s(T,L<=E?u:p),N.push(T),v||y||function(e){T.addEventListener("click",function(){var t=E===e?0:e;E=t,S(),"function"==typeof x&&x(t)}),T.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T.click())})}(L),C.appendChild(T)}if(null!=w)if("string"==typeof w){var I=document.createElement("span");I.innerHTML=w,C.appendChild(I)}else(w instanceof HTMLElement||w instanceof Node)&&C.appendChild(w);return C},getEnumerationClasses:function(e){var i=e||{},s=i.variant||"default",c=i.size||"default",d=!0===i.disabled,u=!0===i.readOnly;return l(t,null!=r[s]?r[s]:r.default,null!=n[c]?n[c]:n.default,d?a:"",u?o:"")},VARIANTS:r,SIZES:n,ITEM_ICON_SIZES:i};"undefined"!=typeof module&&module.exports?module.exports=c:e.Enumeration=c}("undefined"!=typeof window?window:void 0),function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function r(e){return String(e).padStart(2,"0")}function n(e){if(!e||"string"!=typeof e)return{hour:0,minute:0};var t=e.trim().split(":");return{hour:Math.min(23,Math.max(0,parseInt(t[0],10)||0)),minute:Math.min(59,Math.max(0,parseInt(t[1],10)||0))}}function a(e,t){return r(e)+":"+r(t)}function o(e,t,n){if(n)return r(e)+" : "+r(t);var a=e>=12?"PM":"AM";return r(0===e?12:e>12?e-12:e)+" : "+r(t)+" "+a}function i(e,t,r){return"group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base focus:outline-none min-h-0 h-full truncate hover:cursor-pointer "+("small"===r?"px-12 py-4 !text-reg-12":"px-12 py-6 !text-reg-13")+" "+(t?"text-inherit":"text-typography-quaternary-text")+(e?" pointer-events-none cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}function l(e,r,n,a){var Button=t("Button"),o=document.createElement("div");o.className="flex flex-col flex-shrink-0 min-w-32 overflow-y-auto max-h-[200px] p-6 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:[display:none]",o.setAttribute("role","listbox");var i=a?"tabular-nums":"",l=[];if(!Button||"function"!=typeof Button.create){var s=document.createElement("div");return s.className=o.className,s.setAttribute("role","listbox"),s.textContent="Button component required",{el:s,setSelected:function(){},scrollToSelected:function(){},items:[]}}return e.forEach(function(e){var t=void 0!==e.value?e.value:e.label,a=void 0!==e.label?e.label:String(t),s=String(t)===String(r),c=Button.create({variant:s?"primary":"ghost",size:"small",text:a,className:i,onClick:function(){n(t)}});c.setAttribute("role","option"),c.setAttribute("data-value",String(t)),c.setAttribute("aria-selected",s),o.appendChild(c),l.push({el:c,value:t,label:a})}),{el:o,setSelected:function(e){l.forEach(function(t){var r=String(t.value)===String(e);t.el.setAttribute("aria-selected",r),t.el.className=Button.getButtonClasses({variant:r?"primary":"ghost",size:"small"})+" "+i})},scrollToSelected:function(){var e=o.querySelector("[aria-selected=true]");e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},items:l}}e.TimePicker={create:function(e){var s=e.fieldId,c=void 0!==e.value?e.value:"",d=e.placeholder||"Select time",u=e.onChange,p=!0===e.disabled,f=!0===e.use24Hour,h="small"===e.size?"small":"default",m="string"==typeof c?c:"",g=n(m),v=g.hour,y=g.minute,b=v>=12?"PM":"AM",x=0===v?12:v>12?v-12:v,w=document.createElement("div");w.className="time-picker relative w-full group",s&&w.setAttribute("data-field-id",s);var C=document.createElement("button");C.type="button",C.disabled=p,C.setAttribute("aria-haspopup","listbox"),C.setAttribute("aria-expanded","false"),C.setAttribute("aria-label",d),C.className=i(p,!!m,h);var E=document.createElement("span");E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),E.textContent=m?o(v,y,f):d,C.appendChild(E);var k=document.createElement("span");k.className="flex size-16 shrink-0 items-center justify-center text-typography-primary-text [&_svg]:text-typography-primary-text",k.setAttribute("aria-hidden","true"),k.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',C.appendChild(k);var N=[];if(f)for(var S=0;S<=23;S++)N.push({value:S,label:r(S)});else for(S=1;S<=12;S++)N.push({value:S,label:r(S)});for(var A=[],L=0;L<=59;L++)A.push({value:L,label:r(L)});var T=l(N,f?v:x,function(e){f?v=e:(x=e,v="PM"===b?12===e?12:e+12:12===e?0:e),T.setSelected(f?v:x),T.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!0),I=l(A,y,function(e){y=e,I.setSelected(y),I.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!0),M=null;f||(M=l([{value:"AM",label:"AM"},{value:"PM",label:"PM"}],b,function(e){v="PM"===(b=e)?12===x?12:x+12:12===x?0:x,M.setSelected(b),M.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!1));var q=document.createElement("div");q.className="flex flex-row flex-nowrap items-stretch gap-0",T.el.className+=" border-r-1/2 border-border-primary",I.el.className+=" border-l-1/2 border-border-primary",M&&(I.el.className+=" border-r-1/2 border-border-primary",M.el.className+=" border-l-1/2 border-border-primary"),q.appendChild(T.el),q.appendChild(I.el),M&&q.appendChild(M.el);var _,j=null,D=t("Button"),F=D&&"function"==typeof D.create?D.create({variant:"outline",size:"small",text:"Close",onClick:function(){j&&j()}}):((_=document.createElement("button")).type="button",_.className="px-2 py-1 border rounded text-sm",_.textContent="Close",_.onclick=function(){j&&j()},_),z=document.createElement("div");z.className="flex justify-end border-t-1/2 border-border-primary pt-6 px-8 pb-12",z.appendChild(F);var U=document.createElement("div");U.setAttribute("role","listbox"),U.setAttribute("data-time-picker-dropdown","true"),U.appendChild(q),U.appendChild(z);var O=t("Popover");if(!O||"function"!=typeof O.create)return w.appendChild(C),w.updateValue=function(e){m="string"==typeof e?e:""},w.setDisabled=function(e){C.disabled=!!e},w;var P=O.create({trigger:C,content:U,placement:"bottom",closeOnClickOutside:!0,bodyClassName:"p-0",panelClassName:"!w-auto min-w-max",onOpen:function(){C.setAttribute("aria-expanded","true"),w.classList.add("open"),p||(T.setSelected(f?v:x),I.setSelected(y),M&&(b=v>=12?"PM":"AM",M.setSelected(b)),T.scrollToSelected(),I.scrollToSelected(),M&&M.scrollToSelected())},onClose:function(){C.setAttribute("aria-expanded","false"),w.classList.remove("open")}});return j=P.hide,w.appendChild(C),w.updateValue=function(e){var t=n(m="string"==typeof e?e:"");v=t.hour,y=t.minute,x=0===v?12:v>12?v-12:v,b=v>=12?"PM":"AM",E.textContent=m?o(v,y,f):d,E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),T.setSelected(f?v:x),I.setSelected(y),M&&M.setSelected(b)},w.setDisabled=function(e){p=!!e,C.disabled=p,C.className=i(p,!!m,h),p&&P.hide()},w}}}("undefined"!=typeof window?window:void 0),function(e){var t=86400,r=3600,n=60;function a(e){var a=Math.max(0,e),o=Math.floor(a/t);a-=o*t;var i=Math.floor(a/r);a-=i*r;var l=Math.floor(a/n);a-=l*n;var s=Math.floor(a);return{days:o,hours:i,minutes:l,seconds:s,milliseconds:Math.round(1e3*(a-s))}}var o={days:999,hours:23,minutes:59,seconds:59};e.DurationUtils={convertSecondsToTimeUnits:a,getSecondsFromValue:function(e,t){return"milliseconds"===t?(e||0)/1e3:e||0},getValueFromSeconds:function(e,t){return"milliseconds"===t?Math.round(1e3*e):Math.round(e)},parseDuration:function(e,a){if(!e||"string"!=typeof e)return 0;var o=e.replace(/\s+/g,"").toLowerCase();if(/^\d+(\.\d+)?$/.test(o)){var i=parseFloat(o);return"milliseconds"===a?i/1e3:i}var l=0;if([{regex:/(\d+(?:\.\d+)?)d/g,multiplier:t},{regex:/(\d+(?:\.\d+)?)h/g,multiplier:r},{regex:/(\d+(?:\.\d+)?)m(?!s)/g,multiplier:n},{regex:/(\d+(?:\.\d+)?)s/g,multiplier:1},{regex:/(\d+(?:\.\d+)?)ms/g,multiplier:.001}].forEach(function(e){for(var t,r=new RegExp(e.regex.source,e.regex.flags||"g");null!==(t=r.exec(o));)l+=parseFloat(t[1])*e.multiplier}),-1!==o.indexOf(":")&&!/[dhms]/.test(o)){var s=o.split(":").map(function(e){return parseFloat(e)||0});2===s.length?l=s[0]*n+s[1]:3===s.length?l=s[0]*r+s[1]*n+s[2]:4===s.length&&(l=s[0]*t+s[1]*r+s[2]*n+s[3])}return l},formatDuration:function(e,t){if(0===e)return t||"Select duration";var r=a(e),n=[];return r.days>0&&n.push(r.days+"d"),r.hours>0&&n.push(r.hours+"h"),r.minutes>0&&n.push(r.minutes+"m"),r.seconds>0&&n.push(r.seconds+"s"),r.milliseconds>0&&0===n.length&&n.push(r.milliseconds+"ms"),n.join(" ")||"0s"},wheelValuesToSeconds:function(e){return(e.days||0)*t+(e.hours||0)*r+(e.minutes||0)*n+(e.seconds||0)},clampWheelValue:function(e,t){var r=o[e];return Math.max(0,Math.min(r,isNaN(t)?0:t))},MAX_VALUES:o,SECONDS_PER_DAY:t,SECONDS_PER_HOUR:r,SECONDS_PER_MINUTE:n,SECONDS_PER_MILLISECOND:.001}}("undefined"!=typeof window?window:void 0),("undefined"!=typeof window?window:void 0).DurationConstants={PRESET_DURATIONS:[{title:"Seconds & Minutes",presets:[{label:"30s",value:30},{label:"1m",value:60},{label:"2m",value:120},{label:"5m",value:300},{label:"10m",value:600},{label:"15m",value:900},{label:"30m",value:1800}]},{title:"Hours & Days",presets:[{label:"1h",value:3600},{label:"2h",value:7200},{label:"6h",value:21600},{label:"12h",value:43200},{label:"1d",value:86400},{label:"2d",value:172800},{label:"7d",value:604800}]}],DURATION_WHEELS:[{unit:"days",label:"days"},{unit:"hours",label:"hours"},{unit:"minutes",label:"min"},{unit:"seconds",label:"sec"}]},function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}var r={base:"flex items-center justify-between border-1/2 rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out cursor-pointer",default:"border-border-primary bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent",sizeDefault:"px-12 py-6",sizeLarge:"px-12 py-8",sizeSmall:"px-12 py-4",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary opacity-60"};function n(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Duration={create:function(a){var o=e.DurationUtils,i=e.DurationConstants,l=t("Popover"),Button=t("Button"),s=t("InputComponent");if(!(o&&i&&l&&Button))throw new Error("Duration requires DurationUtils, DurationConstants, Popover, Button");var c=null!=a.value?a.value:null,d="milliseconds"===a.formatType?"milliseconds":"seconds",u=a.onChange,p=null!=a.placeholder?a.placeholder:"hh:mm:ss",f=a.variant||"default",h=a.size||"default",m=!!a.disabled,g=a.className||"",v=o.getSecondsFromValue(c||0,d),y=o.formatDuration(v,p),b=v>0&&"milliseconds"===d?Math.round(1e3*v)+"ms":null,x=o.convertSecondsToTimeUnits(v),w="",C=document.createElement("div");C.className=n(r.base,null!=r[f]?r[f]:r.default,"large"===h?r.sizeLarge:"small"===h?r.sizeSmall:r.sizeDefault,m?r.disabled:"",g),C.setAttribute("role","button"),C.setAttribute("tabindex",m?"-1":"0"),C.setAttribute("aria-haspopup","dialog"),C.setAttribute("aria-expanded","false");var E=document.createElement("div");E.className="flex flex-1 items-center gap-8 min-w-0";var k=document.createElement("p");if(k.className="truncate text-reg-13 "+(y===p?"text-typography-quaternary-text":""),k.textContent=y,E.appendChild(k),b){var N=document.createElement("span");N.className="text-xs text-typography-tertiary-text truncate shrink-0",N.textContent=b,E.appendChild(N)}if(C.appendChild(E),"inline"!==f){var S=document.createElement("span");S.className="size-16 text-typography-quaternary-text shrink-0 flex items-center justify-center",S.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>',S.setAttribute("aria-hidden","true"),C.appendChild(S)}var A=document.createElement("div");function L(){v=o.getSecondsFromValue(c||0,d),y=o.formatDuration(v,p),k.textContent=y,k.className="truncate text-reg-13 "+(y===p?"text-typography-quaternary-text":""),N&&(v>0&&"milliseconds"===d?(N.textContent=Math.round(1e3*v)+"ms",N.style.display=""):N.style.display="none")}function T(e){c=0===e?null:o.getValueFromSeconds(e,d),w="",L(),u&&u(c),G.hide()}function I(){T(w?o.parseDuration(w,d):o.wheelValuesToSeconds(x)),w=""}A.className="duration-picker relative w-full",A.appendChild(C);var M=document.createElement("div");M.className="p-0";var q,_,j=document.createElement("div");if(j.className="p-8",s&&s.create){var D=document.createElement("div");D.className="relative",q=s.create({type:"text",placeholder:"2d1h15m30s, 4000s, 1:30:00...",variant:"default",inputSize:"default",onChange:function(){},onInput:function(){var e=q.getInput&&q.getInput();if(e&&(w=e.value)){var t=o.parseDuration(w,d);x=o.convertSecondsToTimeUnits(t),O.forEach(function(e,t){B[t]&&B[t].setValue&&B[t].setValue(x[e.unit])})}}});var F=q.getInput&&q.getInput();F&&F.addEventListener("keydown",function(e){if("Enter"===e.key){e.preventDefault();var t=q.getValue&&q.getValue();if(t)T(o.parseDuration(t,d)),q.setValue&&q.setValue("");w=""}}),D.appendChild(q),(_=document.createElement("span")).className="absolute right-12 top-1/2 -translate-y-1/2 cursor-pointer text-typography-quaternary-text hover:text-typography-primary-text",_.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',_.setAttribute("role","button"),_.setAttribute("aria-label","Clear input"),_.style.display="none",D.appendChild(_),_.addEventListener("click",function(e){e.stopPropagation(),q.setValue&&q.setValue(""),w="",_.style.display="none"}),F&&F.addEventListener("input",function(){_.style.display=F.value?"":"none"}),j.appendChild(D)}M.appendChild(j);var z=document.createElement("div");z.className="border-t-1/2 border-border-primary w-full",M.appendChild(z);var U=document.createElement("div");U.className="flex justify-center gap-8 p-8";var O=i.DURATION_WHEELS,P=o.MAX_VALUES,B=[];function H(e){"Enter"===e.key&&(e.preventDefault(),I())}O.forEach(function(t){var r=function(t,r,a,o,i,l){var s=e.DurationUtils;if(!s)throw new Error("DurationUtils required");var c=document.createElement("div");c.className="flex flex-col items-center justify-center";var d=document.createElement("div");d.className="overflow-hidden rounded-4 border-1/2 border-border-primary";var u=document.createElement("input");u.type="number",u.min=0,u.max=o,u.value=Math.max(0,Math.min(o,a)),u.className=n("w-full bg-inherit text-center outline-none text-reg-13 px-8 py-4 border-0","placeholder:text-typography-quaternary-text focus:bg-fill-tertiary-fill-light-gray","days"===t?"!w-48 !min-w-48":"!w-40 !min-w-40"),u.setAttribute("placeholder",r),d.appendChild(u),c.appendChild(d);var p=document.createElement("span");return p.className="mt-4 text-reg-10 text-typography-tertiary-text",p.textContent=r,c.appendChild(p),u.addEventListener("input",function(){var e=parseInt(u.value,10);isNaN(e)&&(e=0);var r=s.clampWheelValue(t,e);u.value=r,i(r)}),u.addEventListener("change",function(){var e=parseInt(u.value,10);isNaN(e)&&(e=0);var r=s.clampWheelValue(t,e);u.value=r,i(r)}),l&&u.addEventListener("keydown",l),c.getInput=function(){return u},c.setValue=function(e){var r=s.clampWheelValue(t,e);u.value=r},c}(t.unit,t.label,x[t.unit],P[t.unit],function(e){x[t.unit]=e,w="",q&&q.setValue&&q.setValue(""),_&&(_.style.display="none")},H);B.push(r),U.appendChild(r)}),M.appendChild(U);var R=document.createElement("div");R.className="border-t-1/2 border-border-primary w-full",M.appendChild(R);var V=document.createElement("div");V.className="p-8",i.PRESET_DURATIONS.forEach(function(e){var t=document.createElement("div");t.className="space-y-2";var r=document.createElement("label");r.className="text-reg-12 text-typography-secondary-text block",r.textContent=e.title,t.appendChild(r);var n=document.createElement("div");n.className="grid grid-cols-4 gap-4",e.presets.forEach(function(e){var t=Math.abs(v-e.value)<1,r=Button.create({variant:t?"outline":"dashed",size:"small",text:e.label,className:"text-xs",onClick:function(){T(e.value),w=""}});n.appendChild(r)}),t.appendChild(n),V.appendChild(t)}),M.appendChild(V);var $=document.createElement("div");$.className="border-t-1/2 border-border-primary w-full",M.appendChild($);var Y=document.createElement("div");Y.className="flex justify-end gap-8 p-8";var W=Button.create({variant:"outline",size:"small",text:"Clear",className:"text-error-text-base hover:text-error-text-hover",onClick:function(){c=null,x={days:0,hours:0,minutes:0,seconds:0},w="",L(),u&&u(null),G.hide()}});v<=0&&(W.style.display="none"),Y.appendChild(W);var K=Button.create({variant:"primary",size:"small",text:"Done",onClick:I});Y.appendChild(K),M.appendChild(Y);var G=l.create({trigger:C,content:M,placement:"bottom",align:"start",closeOnClickOutside:!0,panelClassName:"w-[275px]",bodyClassName:"p-0",onOpen:function(){C.setAttribute("aria-expanded","true"),w||(x=o.convertSecondsToTimeUnits(v),B.forEach(function(e,t){e.setValue&&e.setValue(x[O[t].unit])})),q&&q.setValue&&q.setValue(w),_&&(_.style.display=w?"":"none"),W.style.display=v>0?"":"none"},onClose:function(){C.setAttribute("aria-expanded","false")}});return C.addEventListener("click",function(e){m&&(e.preventDefault(),e.stopImmediatePropagation())},!0),C.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m||C.click())}),A.getValue=function(){return c},A.setValue=function(e){c=e,L()},A.setDisabled=function(e){m=!!e,C.classList.toggle("cursor-not-allowed",m),C.classList.toggle("opacity-60",m),C.setAttribute("tabindex",m?"-1":"0"),m&&G.hide()},A}}}("undefined"!=typeof window?window:void 0),function(e){var t=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function n(e){return e instanceof Date&&!isNaN(e.getTime())}function a(e){var t=new Date(e.getTime());return t.setHours(0,0,0,0),t}function o(e,t){var r=new Date(e.getTime());return r.setDate(r.getDate()+t),r}function i(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())}function l(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}function s(e,t){return e.getTime()<t.getTime()}function c(e,t){return e.getTime()>t.getTime()}function d(e,t,r){var n=a(e);return(!t||!s(n,a(t)))&&(!r||!c(n,a(r)))}function u(e,t,r,n,o,l){return{date:e,currentMonth:t,isToday:i(e,r),isSelected:!!n&&i(e,n),disabled:o&&s(e,a(o))||l&&c(e,a(l))}}e.DateTimePickerUtils={MONTH_NAMES:t,MONTH_SHORT:r,isValidDate:n,startOfDay:a,addDays:o,addMonths:function(e,t){var r=new Date(e.getTime());return r.setMonth(r.getMonth()+t),r},isSameDay:i,isSameMonth:l,isBefore:s,isAfter:c,getValidDate:function(e,t,r){var a=new Date;if(e)return n(e)?t&&s(e,t)?new Date(t.getTime()):r&&c(e,r)?new Date(r.getTime()):new Date(e.getTime()):t&&c(t,a)?new Date(t.getTime()):r&&s(r,a)?new Date(r.getTime()):new Date(a.getTime())},isDateInRange:d,getQuickSelectionDates:function(e,t){var r=new Date,n=o(r,1);return{today:d(r,e,t)?r:void 0,tomorrow:d(n,e,t)?n:void 0}},isPreviousMonthDisabled:function(e,t){return!!t&&(l(e,t)||s(e,t))},isNextMonthDisabled:function(e,t){return!!t&&(l(e,t)||c(e,t))},genMonths:function(){return t.map(function(e,t){return{value:t,label:e}})},genYears:function(e,t,r){r=null==r?50:r;for(var n=new Date,a=e?e.getFullYear():n.getFullYear()-r,o=t?t.getFullYear():n.getFullYear()+r,i=[],l=a;l<=o;l++)i.push({value:l,label:String(l)});return i},getMonthGrid:function(e,t,r,n){for(var o=e.getFullYear(),i=e.getMonth(),l=new Date(o,i,1),s=new Date(o,i+1,0),c=l.getDay(),d=s.getDate(),p=a(new Date),f=[],h=[],m=0;m<c;m++){var g=new Date(o,i,-c+m+1);h.push(u(g,!1,p,t,r,n))}for(var v=1;v<=d;v++){var y=new Date(o,i,v);h.push(u(y,!0,p,t,r,n)),7===h.length&&(f.push(h),h=[])}for(var b=1;h.length>0&&h.length<7;){var x=new Date(o,i+1,b);h.push(u(x,!1,p,t,r,n)),b++,7===h.length&&(f.push(h),h=[])}return f},formatDateTime:function(e,t,a,o){if(!e||!n(e))return"";var i=e,l=function(e){return(e<10?"0":"")+e},s=r[i.getMonth()]+" "+i.getDate()+", "+i.getFullYear();if("day"===a)return s;var c=i.getHours(),d=i.getMinutes(),u=i.getSeconds();if(24===t){var p=l(c)+":"+l(d);return"second"===a&&(p+=":"+l(u)),s+" "+p}var f=c>=12?"PM":"AM",h=(0===c?12:c>12?c-12:c)+":"+l(d);return"second"===a&&(h+=":"+l(u)),s+" "+(h+=" "+f)},setTimeFromString:function(e,t){if(!t||"string"!=typeof t)return e;var r=t.trim().split(":"),n=Math.min(23,Math.max(0,parseInt(r[0],10)||0)),a=Math.min(59,Math.max(0,parseInt(r[1],10)||0));return e.setHours(n,a,0,0),e},getTimeString:function(e){if(!e||!n(e))return"00:00";var t=function(e){return(e<10?"0":"")+e};return t(e.getHours())+":"+t(e.getMinutes())}}}("undefined"!=typeof window?window:void 0),function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function n(n,a,o,i,l){var s=e.DateTimePickerUtils;if(!s)throw new Error("DateTimePickerUtils required");var c=s.getMonthGrid(n,a,o,i),d=document.createElement("div");d.className="w-full border-collapse border-t-1/2 border-border-primary";var u=document.createElement("div");u.className="flex gap-x-6 p-6",["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(e){var t=document.createElement("div");t.className="text-typography-tertiary-text flex-1 flex items-center justify-center text-reg-12 my-2 text-center",t.textContent=e,u.appendChild(t)}),d.appendChild(u);var Button=t("Button");if(!Button||"function"!=typeof Button.create){var p=document.createElement("div");return p.className="space-y-0 p-6 text-typography-tertiary-text text-reg-12",p.textContent="Button component required",d.appendChild(p),d}var f=document.createElement("div");return f.className="space-y-0",c.forEach(function(e){var t=document.createElement("div");t.className="flex gap-x-6 px-6",e.forEach(function(e){var n="ghost";e.isSelected?n="primary":e.isToday&&(n="outline");var a=r("!text-reg-12 my-2 flex-1 !px-0 !py-0",e.currentMonth?"":"text-typography-quaternary-text"),o=Button.create({variant:n,size:"small",text:String(e.date.getDate()),label:e.date.toDateString(),disabled:e.disabled,className:a,onClick:e.disabled?void 0:function(){l(new Date(e.date.getTime()))}});t.appendChild(o)}),f.appendChild(t)}),d.appendChild(f),d}e.DateTimePicker={create:function(a){var o=e.DateTimePickerUtils;if(!o)throw new Error("DateTimePickerUtils required");var i=t("Popover"),Button=t("Button"),l=t("TimePicker");if(!i||"function"!=typeof i.create||!Button||"function"!=typeof Button.create)throw new Error("Popover and Button required");var s=a.value,c=a.onChange,d=!!a.disabled,u=24===a.hourCycle?24:12,p=null!=a.yearRange?a.yearRange:50,f=null!=a.placeholder?a.placeholder:"Pick a date",h=a.granularity||"minute";a.variant;var m=a.size||"default",g=a.fromDate,v=a.toDate,y=a.align||"start",b=o.getValidDate(s,g,v),x=b?new Date(b.getTime()):new Date,w=document.createElement("div"),C=r("group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out","bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base","large"===m?"px-12 py-8":"small"===m?"px-12 py-4":"px-12 py-6",d?"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"cursor-pointer");w.className=C,w.setAttribute("role","button"),w.setAttribute("tabindex",d?"-1":"0"),w.setAttribute("aria-haspopup","dialog"),w.setAttribute("aria-expanded","false");var E=document.createElement("span");E.className="flex-1 truncate text-left text-reg-13";var k=o.formatDateTime(b,u,h);E.textContent=k||f,E.classList.toggle("text-typography-quaternary-text",!k),w.appendChild(E);var N=document.createElement("span");N.className="flex size-16 shrink-0 items-center justify-center text-typography-primary-text [&_svg]:text-typography-primary-text",N.setAttribute("aria-hidden","true"),N.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>',w.appendChild(N);var S,A,L,T,I=document.createElement("div");function M(){b=o.getValidDate(s,g,v),k=o.formatDateTime(b,u,h),E.textContent=k||f,E.classList.toggle("text-typography-quaternary-text",!k)}function q(e){x=new Date(e.getTime())}function _(e){var t;"day"===h?t=o.startOfDay(e):(t=new Date(e.getTime()),b&&t.setHours(b.getHours(),b.getMinutes(),b.getSeconds(),0)),s=o.getValidDate(t,g,v),b=s,M(),c&&c(s),q(t),S&&S.setMonth&&S.setMonth(x),L&&L.updateValue&&L.updateValue(o.getTimeString(s)),j()}function j(){var e=D.querySelector("[data-dtp-calendar]");e&&e.remove();var t=document.createElement("div");t.setAttribute("data-dtp-calendar","true"),A=n(x,b,g,v,_),t.appendChild(A);var r=D.firstElementChild;r?D.insertBefore(t,r.nextSibling):D.appendChild(t)}I.className="date-time-picker relative w-full "+(a.className||""),I.appendChild(w);var D=document.createElement("div");D.className="px-0",D.appendChild(function(){var r=document.createDocumentFragment();S=function(r,n,a,o,i,l,s){var c=e.DateTimePickerUtils;if(!c)throw new Error("DateTimePickerUtils required");var d=c.genMonths(),u=c.genYears(n,a,o),p=c.isPreviousMonthDisabled(r,n),f=c.isNextMonthDisabled(r,a),h=document.createElement("div");h.className="flex justify-between relative items-center p-6";var Select=t("Select");if(Select&&"function"==typeof Select.create){var m=r.getMonth(),g=r.getFullYear(),v=d.map(function(e){return{value:e.value,label:e.label.slice(0,3)}}),y=u.map(function(e){return{value:e.value,label:e.label}}),b=document.createElement("div");b.className="inline-flex gap-x-8";var x=Select.create({options:v,value:m,placeholder:"Month",size:"small",onChange:function(e){var t=new Date(r.getTime());t.setMonth(Number(e)),i(t)}}),w=Select.create({options:y,value:g,placeholder:"Year",size:"small",onChange:function(e){var t=new Date(r.getTime());t.setFullYear(Number(e)),i(t)}});b.appendChild(x),b.appendChild(w),h.appendChild(b)}var Button=t("Button");if(!Button||"function"!=typeof Button.create){var C=document.createElement("div");return C.className="flex items-center gap-x-8",C.textContent="Button component required",h.appendChild(C),{element:h,setMonth:function(){}}}var E=document.createElement("div");E.className="flex items-center gap-x-8";var k=Button.create({icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>',variant:"ghost",size:"small",label:"Previous month",disabled:p,className:"opacity-50 hover:opacity-100",onClick:p?void 0:l}),N=Button.create({icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>',variant:"ghost",size:"small",label:"Next month",disabled:f,className:"opacity-50 hover:opacity-100",onClick:f?void 0:s});return E.appendChild(k),E.appendChild(N),h.appendChild(E),{element:h,setMonth:function(e){if(Select&&h.querySelectorAll(".custom-select").length>=2){var t=h.querySelectorAll(".custom-select");t[0].updateValue&&t[0].updateValue(e.getMonth()),t[1].updateValue&&t[1].updateValue(e.getFullYear())}}}}(x,g,v,p,function(e){q(e),j(),S&&S.setMonth&&S.setMonth(x)},function(){o.isPreviousMonthDisabled(x,g)||(q(o.addMonths(x,-1)),j(),S&&S.setMonth&&S.setMonth(x))},function(){o.isNextMonthDisabled(x,v)||(q(o.addMonths(x,1)),j(),S&&S.setMonth&&S.setMonth(x))}),r.appendChild(S.element);var a=document.createElement("div");if(a.setAttribute("data-dtp-calendar","true"),A=n(x,b,g,v,_),a.appendChild(A),r.appendChild(a),"day"!==h&&l){var i=document.createElement("div");i.className="border-t-1/2 border-border-primary p-6";var d=b?o.getTimeString(b):"00:00";L=l.create({fieldId:"dtp-time",value:d,placeholder:"Time",use24Hour:24===u,size:"small",onChange:function(e){var t=s?new Date(s.getTime()):new Date;o.setTimeFromString(t,e),s=o.getValidDate(t,g,v),b=s,M(),c&&c(s)}}),i.appendChild(L),r.appendChild(i)}var f=o.getQuickSelectionDates(g,v);if((T=document.createElement("div")).className="flex flex-wrap gap-8 border-t-1/2 border-border-primary p-6",f.today){var m=Button.create({variant:"outline",size:"small",text:"Today",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><circle cx="12" cy="15" r="1"/></svg>',onClick:function(){var e="day"===h?o.startOfDay(new Date):new Date;s=o.getValidDate(e,g,v),b=s,q(s||new Date),M(),c&&c(s),j(),L&&L.updateValue&&s&&L.updateValue(o.getTimeString(s))}});T.appendChild(m)}if(f.tomorrow){var y=Button.create({variant:"outline",size:"small",text:"Tomorrow",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="m12 14 2-2 2 2"/><path d="m12 18 2-2 2 2"/></svg>',onClick:function(){var e=o.addDays(new Date,1);e="day"===h?o.startOfDay(e):e,s=o.getValidDate(e,g,v),b=s,q(s||new Date),M(),c&&c(s),j(),L&&L.updateValue&&s&&L.updateValue(o.getTimeString(s))}});T.appendChild(y)}var w=Button.create({variant:"outline",size:"small",text:"No date",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="M8 14h8"/></svg>',onClick:function(){s=void 0,b=void 0,q(new Date),M(),c&&c(void 0),F.hide()}});return T.appendChild(w),r.appendChild(T),r}());var F=i.create({trigger:w,content:D,placement:"bottom",align:y,closeOnClickOutside:!0,onOpen:function(){w.setAttribute("aria-expanded","true"),x=b?new Date(b.getTime()):new Date,S&&S.setMonth&&S.setMonth(x)},onClose:function(){w.setAttribute("aria-expanded","false")}});return w.addEventListener("click",function(e){d&&(e.preventDefault(),e.stopImmediatePropagation())},!0),w.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d||w.click())}),I.getValue=function(){return s},I.setValue=function(e){s=e,b=o.getValidDate(s,g,v),x=b?new Date(b.getTime()):new Date,M()},I.setDisabled=function(e){d=!!e,w.classList.toggle("cursor-not-allowed",d),w.classList.toggle("opacity-60",d),w.setAttribute("tabindex",d?"-1":"0"),d&&F.hide()},I}}}("undefined"!=typeof window?window:void 0),function(e){const t=[{code:"US",name:"United States",callingCode:"1"},{code:"GB",name:"United Kingdom",callingCode:"44"},{code:"CA",name:"Canada",callingCode:"1"},{code:"AU",name:"Australia",callingCode:"61"},{code:"IN",name:"India",callingCode:"91"},{code:"DE",name:"Germany",callingCode:"49"},{code:"FR",name:"France",callingCode:"33"},{code:"IT",name:"Italy",callingCode:"39"},{code:"ES",name:"Spain",callingCode:"34"},{code:"BR",name:"Brazil",callingCode:"55"},{code:"MX",name:"Mexico",callingCode:"52"},{code:"AR",name:"Argentina",callingCode:"54"},{code:"CN",name:"China",callingCode:"86"},{code:"JP",name:"Japan",callingCode:"81"},{code:"KR",name:"South Korea",callingCode:"82"},{code:"RU",name:"Russia",callingCode:"7"},{code:"ZA",name:"South Africa",callingCode:"27"},{code:"NG",name:"Nigeria",callingCode:"234"},{code:"EG",name:"Egypt",callingCode:"20"},{code:"AE",name:"United Arab Emirates",callingCode:"971"},{code:"SA",name:"Saudi Arabia",callingCode:"966"},{code:"SG",name:"Singapore",callingCode:"65"},{code:"MY",name:"Malaysia",callingCode:"60"},{code:"TH",name:"Thailand",callingCode:"66"},{code:"ID",name:"Indonesia",callingCode:"62"},{code:"PH",name:"Philippines",callingCode:"63"},{code:"VN",name:"Vietnam",callingCode:"84"},{code:"PK",name:"Pakistan",callingCode:"92"},{code:"BD",name:"Bangladesh",callingCode:"880"},{code:"NZ",name:"New Zealand",callingCode:"64"},{code:"IE",name:"Ireland",callingCode:"353"},{code:"NL",name:"Netherlands",callingCode:"31"},{code:"BE",name:"Belgium",callingCode:"32"},{code:"CH",name:"Switzerland",callingCode:"41"},{code:"AT",name:"Austria",callingCode:"43"},{code:"SE",name:"Sweden",callingCode:"46"},{code:"NO",name:"Norway",callingCode:"47"},{code:"DK",name:"Denmark",callingCode:"45"},{code:"FI",name:"Finland",callingCode:"358"},{code:"PL",name:"Poland",callingCode:"48"},{code:"PT",name:"Portugal",callingCode:"351"},{code:"GR",name:"Greece",callingCode:"30"},{code:"TR",name:"Turkey",callingCode:"90"},{code:"IL",name:"Israel",callingCode:"972"},{code:"CL",name:"Chile",callingCode:"56"},{code:"CO",name:"Colombia",callingCode:"57"},{code:"PE",name:"Peru",callingCode:"51"},{code:"VE",name:"Venezuela",callingCode:"58"}];e.PhoneInputUtils={COUNTRIES_DATA:t,isoToEmoji:function(e){if(!e||2!==e.length)return"";const t=e.toUpperCase().split("").map(e=>127397+e.charCodeAt(0));return String.fromCodePoint(...t)},getCountriesOptions:function(){return t.map(e=>({value:e.code,label:e.name,indicatif:e.callingCode}))},getCountryByCode:function(e){return t.find(t=>t.code===e)},getCountryCodeFromCallingCode:function(e){const r=e.replace(/^\+/,""),n=t.find(e=>e.callingCode===r);return n?n.code:null},replaceNumbersWithZeros:function(e){return e.replace(/\d/g,"0")},getExampleFormat:function(e){return{US:"(000) 000-0000",GB:"00000 000000",IN:"00000 00000",CA:"(000) 000-0000",AU:"0000 000 000",DE:"0000 0000000",FR:"00 00 00 00 00",IT:"000 000 0000",ES:"000 00 00 00",BR:"(00) 00000-0000",MX:"00 0000 0000",CN:"000 0000 0000",JP:"00-0000-0000",KR:"00-0000-0000",RU:"(000) 000-00-00"}[e]||"000000000000"},parsePhoneNumber:function(e){if(!e)return{callingCode:"",nationalNumber:""};const t=e.split("-");if(2===t.length)return{callingCode:t[0].replace(/^\+/,""),nationalNumber:t[1]};const r=e.match(/^\+?(\d{1,4})/);return r?{callingCode:r[1],nationalNumber:e.substring(r[0].length)}:{callingCode:"",nationalNumber:e}},formatPhoneNumber:function(e,t){return t?e?`${e}-${t}`:t:e||""}}}("undefined"!=typeof window?window:void 0),function(e){if(!e.PhoneInputUtils)return void console.error("[PhoneInput] PhoneInputUtils is required");const t=e.PhoneInputUtils;function r(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){const r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}const n='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>';e.PhoneInput={create:function(e={}){const i=e.variant||"default",l=e.inputSize||"default",s=!!e.disabled,c=!!e.disableCountrySelect,d=!!e.hideCountrySelect,u=t.getCountriesOptions();let p=null;if(e.defaultPhoneNumber){const r=t.parsePhoneNumber(e.defaultPhoneNumber);if(r.callingCode){const e=t.getCountryCodeFromCallingCode(r.callingCode);e&&(p=u.find(t=>t.value===e))}}!p&&e.defaultCountryCode&&(p=u.find(t=>t.value===e.defaultCountryCode)),p||(p=u.find(e=>"IN"===e.value)||u[0]);let f=p,h="";if(e.defaultPhoneNumber){const r=t.parsePhoneNumber(e.defaultPhoneNumber);h=r.nationalNumber}const m=document.createElement("div");m.className="flex w-full flex-col gap-4";const g=document.createElement("div");g.className="flex items-center gap-2";let v=null;d||(v=function(e){const{variant:i,inputSize:l,disabled:s,options:c,value:d,getValue:u,className:p,onChange:f}=e,h=u&&"function"==typeof u?u:()=>d,m=document.createElement("div");m.className="relative";const g=r("InputComponent");if(!g||"function"!=typeof g.create)return m;const v=g.create({variant:i,inputSize:l,type:"button",value:t.isoToEmoji(d.value)+" "+d.indicatif,disabled:s,readOnly:!0,showReadOnlyIcon:!1,className:"w-fit !gap-x-2 cursor-pointer "+(p||""),endIcon:n}),y=v.getInput();y.style.cursor="pointer",y.style.caretColor="transparent",m.appendChild(v);const b=document.createElement("div");b.className="w-[280px] max-w-full";const x=document.createElement("div");x.className="py-2 border-b-1/2 border-border-primary";const w=g.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Find your country...",startIcon:a});x.appendChild(w),b.appendChild(x);const C=document.createElement("div");function E(e=""){C.innerHTML="";const r=c.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));if(0===r.length){const e=document.createElement("div");return e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="No country found.",void C.appendChild(e)}r.forEach(e=>{const r=h(),n=r&&r.value===e.value,a=document.createElement("div");a.setAttribute("role","option"),a.setAttribute("data-value",e.value),a.setAttribute("aria-selected",n),a.className=["relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":""].filter(Boolean).join(" ");const i=document.createElement("span");if(i.className="flex items-center gap-8 flex-1 truncate",i.textContent=`${t.isoToEmoji(e.value)} ${e.label}`,a.appendChild(i),n){const e=document.createElement("span");e.className="ml-auto text-primary-base size-16",e.innerHTML=o,a.appendChild(e)}a.addEventListener("click",()=>{y.value=t.isoToEmoji(e.value)+" "+e.indicatif,f(e),S.hide()}),C.appendChild(a)})}C.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",E(),b.appendChild(C);const k=w.getInput();k.addEventListener("input",e=>{E(e.target.value)});const N=r("Popover");if(!N||"function"!=typeof N.create)return m;const S=N.create({trigger:v,content:b,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0",panelClassName:"w-[280px]",onOpen:()=>{k.value="",E(),setTimeout(()=>k.focus(),100)}});s||v.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()});return m}({variant:i,inputSize:l,disabled:s||c,options:u,value:f,getValue:()=>f,className:e.countryCodeClassName,onChange:r=>{f=r,x(),e.onCountryChange&&e.onCountryChange(r);const n=t.formatPhoneNumber(r.indicatif,h);e.onPhoneNumberChange&&e.onPhoneNumberChange(n),e.onChange&&e.onChange(n,r)}}),g.appendChild(v));const y=r("InputComponent");if(!y||"function"!=typeof y.create)return console.error("[PhoneInput] InputComponent is required"),m;const b=y.create({variant:i,inputSize:l,type:"tel",placeholder:e.placeholder||t.getExampleFormat(f.value),value:h,disabled:s,className:e.className||"",onInput:r=>{const n=r.target,a=(n.value||"").replace(/\D/g,"");n.value!==a&&(n.value=a),h=a;const o=t.formatPhoneNumber(f.indicatif,h);e.onPhoneNumberChange&&e.onPhoneNumberChange(o),e.onChange&&e.onChange(o,f)}});function x(){const r=b.getInput();if(r&&(r.placeholder=e.placeholder||t.getExampleFormat(f.value)),!d){const e=b.querySelector("span.text-typography-quaternary-text");e&&(e.textContent=`+${f.indicatif}`)}}return g.appendChild(b),m.appendChild(g),m.getValue=function(){return t.formatPhoneNumber(f.indicatif,h)},m.setValue=function(e){const r=t.parsePhoneNumber(e);if(r.callingCode){const e=t.getCountryCodeFromCallingCode(r.callingCode);if(e){const r=u.find(t=>t.value===e);if(r&&(f=r,v)){const e=v.querySelector("input");e&&(e.value=t.isoToEmoji(r.value)+" "+r.indicatif)}}}h=r.nationalNumber,b.setValue(h),x()},m.getCountry=function(){return f},m.setCountry=function(e){const r=u.find(t=>t.value===e);if(r){if(f=r,v){const e=v.querySelector("input");e&&(e.value=t.isoToEmoji(r.value)+" "+r.indicatif)}x()}},m.setDisabled=function(e){if(b.setDisabled(e),v){const t=v.querySelector("input");t&&(t.disabled=e)}},m}},console.log("[PhoneInput] Component loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M9 12h6"/><path d="M9 16h6"/><path d="M9 8h1"/></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m22 8-6 4 6 4V8Z"/><rect width="14" height="12" x="2" y="6" rx="2" ry="2"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>',i='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M8 12h8"/><path d="M8 16h8"/><path d="M8 8h8"/></svg>',l='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>',s='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',c='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>',d='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',p=/\.(jpe?g|png|gif|webp|bmp|svg|ico|avif)(\?|$)/i,f=/\.(pdf)(\?|$)/i,h=/\.(mp4|webm|mov|avi|mkv|m4v|ogv)(\?|$)/i,m=/\.(mp3|wav|ogg|m4a|aac|flac|webm)(\?|$)/i,g=/\.(xlsx?|xls|csv|ods)(\?|$)/i,v=/\.(docx?|txt|rtf|odt|pptx?|ppt)(\?|$)/i;function y(e){var s=(e||"").toLowerCase();return p.test(s)?r:f.test(s)?n:h.test(s)?a:m.test(s)?o:g.test(s)?i:v.test(s)?l:t}e.FileInput={create:function(t){const{label:r,fieldId:n,multiple:a=!0,accept:o="*",required:i=!1,helpText:l=null,isPrivate:p=!1,maxFiles:f=null,maxFileSize:h=10485760}=t;if(!e.FlowUI)throw new Error("FlowUI not available");const FlowUI=e.FlowUI,m=FlowUI.createFieldWrapper(r,i,l);m.setAttribute("data-field-id",n);const g=document.createElement("div");g.className="w-full flex flex-col gap-8";const v=document.createElement("div");v.className="relative flex w-full items-center justify-between rounded-4 border-1/2 border-border-primary bg-fill-quarternary-fill-white px-8 py-4 hover:border-primary-border focus-within:outline-none focus-within:border-1/2 focus-within:border-primary-border";const b=document.createElement("div");b.className="pointer-events-none flex min-w-0 flex-1 items-center gap-8 truncate";const x=e.Button&&"function"==typeof e.Button.create,w=a?"Choose files":"Choose a file",C=x?e.Button.create({variant:"outline",size:"small",text:w,className:"shrink-0 truncate"}):function(){const e=document.createElement("div");return e.className="shrink-0 truncate rounded-2 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-1 text-reg-13 text-typography-primary-text transition-colors duration-150 hover:bg-fill-secondary-fill-gray",e.textContent=w,e}(),E=document.createElement("p");E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text";const k=document.createElement("input");k.type="file",k.className="absolute inset-0 z-10 w-full cursor-pointer opacity-0",k.multiple=a,"*"!==o&&(k.accept=o);const N=document.createElement("div");N.className="ml-4 flex size-16 items-center justify-center shrink-0 text-typography-quaternary-text",N.style.display="none";const S=document.createElement("div");S.className="flex flex-wrap gap-8";const A=document.createElement("div");A.className="flex flex-wrap gap-8",A.style.display="none";let L=[],T=[];function I(){S.innerHTML="";var t=e.Badge&&"function"==typeof e.Badge.create;L.forEach(function(r,n){var a=document.createElement("p");a.className="max-w-[100px] truncate text-reg-10 text-typography-secondary-text",a.textContent=r.name,a.title=r.url;var o,i=document.createElement("div");if(i.className="flex items-center gap-2 shrink-0",i.appendChild(function(t){const r=document.createElement("button");return r.type="button",r.className="shrink-0 rounded-2 p-4 text-typography-quaternary-text transition-colors hover:text-typography-primary-text focus:outline-none",r.innerHTML=s,r.setAttribute("aria-label","Copy URL"),r.addEventListener("click",function(r){r.stopPropagation(),navigator.clipboard.writeText(t).then(function(){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,["Link copied"],"success")}},function(){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,["Copy failed"],"error")}})}),r}(r.url)),i.appendChild(function(e){const t=document.createElement("button");return t.type="button",t.className="shrink-0 rounded-2 p-4 text-typography-quaternary-text transition-colors hover:text-typography-primary-text focus:outline-none",t.innerHTML=c,t.setAttribute("aria-label","View file"),t.addEventListener("click",function(t){t.stopPropagation(),window.open(e,"_blank","noopener")}),t}(r.url)),i.appendChild(function(e){const t=document.createElement("button");return t.type="button",t.className="shrink-0 rounded-2 p-4 text-error-text-base transition-colors hover:bg-error-surface focus:outline-none",t.innerHTML=d,t.setAttribute("aria-label","Remove file"),t.addEventListener("click",function(t){t.stopPropagation(),e()}),t}(function(){L.splice(n,1),_(),I(),q()})),t){var l=(o=e.Badge.create({size:"small",startIcon:y(r.name||r.url),content:a,endIcon:i,className:"text-typography-primary-text"})).querySelectorAll(".flex.size-16");l.length>=1&&l[0].classList.add("text-typography-secondary-text")}else{(o=document.createElement("div")).className="inline-flex items-center gap-4 rounded-4 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-2 text-med-12 text-typography-primary-text";var u=document.createElement("span");u.className="flex size-16 shrink-0 items-center justify-center text-typography-secondary-text",u.innerHTML=y(r.name||r.url),o.appendChild(u),o.appendChild(a),o.appendChild(i)}S.appendChild(o)})}function M(){A.innerHTML="";var t=e.Badge&&"function"==typeof e.Badge.create;T.forEach(function(r){var n,a=document.createElement("p");if(a.className="max-w-[100px] truncate text-reg-10 text-typography-secondary-text",a.textContent=r.name,t){var o=(n=e.Badge.create({size:"small",startIcon:u,content:a,className:"text-typography-primary-text"})).querySelectorAll(".flex.size-16");o.length>=1&&o[0].classList.add("text-typography-secondary-text")}else{(n=document.createElement("div")).className="inline-flex items-center gap-4 rounded-4 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-2 text-med-12";var i=document.createElement("span");i.className="flex size-16 shrink-0 items-center justify-center text-typography-secondary-text",i.innerHTML=u,n.appendChild(i),n.appendChild(a)}A.appendChild(n)}),A.style.display=T.length>0?"flex":"none"}function q(){const e=L.length,t=T.length;if(e>0||t>0?t>0?(E.textContent="Uploading…",E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text"):(E.textContent=`${e} file${1!==e?"s":""} selected`,E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-primary-text"):(E.textContent="No files chosen",E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text"),N.style.display=t>0?"flex":"none",t>0&&0===N.children.length){const e=document.createElement("span");e.className="inline-block animate-spin",e.innerHTML=u,N.appendChild(e)}!function(){const e=L.length>0||T.length>0;C.textContent=a?e?"Add more files":"Choose files":e?"Replace file":"Choose a file"}()}function _(){const e=L.map(e=>e.url).filter(e=>e),t=e.length>0?e:null;FlowUI.set(n,t),console.log(`[S3FileUpload] Saved to ${n}:`,t)}async function j(t){const r=function(e){if(h&&e.size>h)return`File "${e.name}" is too large. Maximum size is ${(h/1024/1024).toFixed(2)}MB`;if("*"!==o){const t=o.split(",").map(e=>e.trim()),r="."+e.name.split(".").pop().toLowerCase(),n=e.type;if(!t.some(e=>e.startsWith(".")?r===e.toLowerCase():!!e.includes("/")&&(n===e||n.startsWith(e.split("/")[0]+"/"))))return`File "${e.name}" type is not supported. Accepted: ${o}`}return null}(t);if(r){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,[r],"error")}}else{T.push({file:t,name:t.name}),M(),q();try{const r=await async function(t,r=!1){const n=new FormData;n.append("file",t,t.name),n.append("is_private",String(!!r));const a=e.S3_UPLOAD_URL||"/org/file/upload",o=e.SUPERLEAP_BASE_URL||"https://app.superleap.com/api/v1",i=a.startsWith("http")?a:`${o}${a}`;let l=null;try{const t=e.FlowUI&&"function"==typeof e.FlowUI._getComponent?e.FlowUI._getComponent("superleapClient"):e.superleapClient;if(t&&"function"==typeof t.getSdk){const e=t.getSdk();l=e?.apiKey}}catch(e){console.warn("[S3FileUpload] Could not get API key:",e)}const s={};l&&(s.Authorization=`Bearer ${l}`);const c=await fetch(i,{method:"POST",body:n,headers:s});if(!c.ok){const e=await c.text();throw new Error(`File upload failed (${c.status}): ${e}`)}const d=await c.json();console.log("[S3FileUpload] Upload response:");const u=d?.data?.url;if(!u)throw console.error("[S3FileUpload] No URL found in response:",d),new Error("Upload response did not contain a file URL");return{url:u}}(t,p),n=r?.url;if(!n)throw new Error(`No URL returned from upload for file "${t.name}"`);console.log(`[S3FileUpload] File uploaded successfully: ${t.name} -> ${n}`),T=T.filter(e=>e.file!==t),L.push({url:n,name:t.name}),_(),I(),M(),q()}catch(r){if(console.error("[S3FileUpload] Upload error:",r),T=T.filter(e=>e.file!==t),M(),q(),e.FlowUI&&e.FlowUI.renderAlerts){const n=document.getElementById("alerts");n&&e.FlowUI.renderAlerts(n,[`Failed to upload "${t.name}": ${r.message}`],"error")}}}}return k.addEventListener("change",async function(t){const r=Array.from(t.target.files||[]);if(0!==r.length){if(a&&f&&L.length+r.length>f){const t=`You can only upload ${f} file${1!==f?"s":""}`;if(e.FlowUI&&e.FlowUI.renderAlerts){const r=document.getElementById("alerts");r&&e.FlowUI.renderAlerts(r,[t],"error")}return void(k.value="")}a||(L=[],T=[],I(),M(),q());for(const e of r)await j(e);k.value=""}}),b.appendChild(C),b.appendChild(E),v.appendChild(b),v.appendChild(N),v.appendChild(k),g.appendChild(v),g.appendChild(A),g.appendChild(S),m.appendChild(g),function(){const e=FlowUI.get(n);Array.isArray(e)&&e.length>0&&(L=e.map(e=>({url:e,name:e.split("/").pop()||"File"})),I(),q())}(),q(),m}},console.log("[FileInput] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){function t(e={}){const{data:t=[],columns:r=[],showHeader:n=!0,headerSize:a="small",hasBorder:o=!0,onRowClick:i=null,onFetch:l=null,hasMore:s=!1,isLoading:c=!1,emptyMessage:d="No data available"}=e;let u=[...t],p=null,f=null;function h(e){const t={small:"h-36",default:"h-44",large:"h-48"};return t[e]||t.default}function m(){const e=document.createElement("tbody");if(e.className="[&_tr:last-child]:border-0",0===u.length&&!c){const t=document.createElement("tr"),n=document.createElement("td");return n.colSpan=r.length,n.className="text-center py-12 text-typography-secondary-text",n.textContent=d,t.appendChild(n),e.appendChild(t),e}if(u.forEach(t=>{const n=document.createElement("tr");n.className="transition-colors hover:bg-fill-tertiary-fill-light-gray",i&&(n.className+=" cursor-pointer"),n.addEventListener("click",e=>{return r=t.id,void(i&&i(r));var r}),r.forEach((e,a)=>{const i=document.createElement("td"),l=a===r.length-1,s=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";if(i.className=`box-border w-fit min-w-[150px] max-w-[500px] text-ellipsis text-nowrap bg-fill-quarternary-fill-white px-12 py-8 align-middle !text-reg-12 text-typography-primary-text overflow-hidden truncate ${s} ${h("default")} ${l?"w-full":""}`,e.width&&(i.style.width=e.width,i.style.minWidth=e.width),e.cell&&"function"==typeof e.cell){const r=e.cell(t);"string"==typeof r?i.innerHTML=r:r instanceof HTMLElement?i.appendChild(r):i.textContent=r}else if(e.accessor){const r=t[e.accessor];i.textContent=null!=r?r:""}else i.textContent="";n.appendChild(i)}),e.appendChild(n)}),c)for(let t=0;t<3;t++){const t=document.createElement("tr");t.className="animate-pulse",r.forEach((e,n)=>{const a=document.createElement("td"),i=n===r.length-1,l=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";a.className=`px-12 py-8 ${l} ${h("default")} ${i?"w-full":""}`,e.width&&(a.style.width=e.width,a.style.minWidth=e.width);const s=document.createElement("div");s.className="h-4 bg-fill-secondary-fill-lighter-gray rounded",a.appendChild(s),t.appendChild(a)}),e.appendChild(t)}return e}function g(e){if(!l||c||!s)return;const{scrollTop:t,scrollHeight:r,clientHeight:n}=e.target;r-t<=1.5*n&&l()}function v(){if(!p)return;p.innerHTML="";const e=document.createElement("div");e.className="relative h-full max-w-full overflow-y-auto",e.addEventListener("scroll",g),f=document.createElement("table");const t=o?"border-1/2 border-borderColor-border-secondary":"";f.className=`w-full caption-bottom bg-fill-quarternary-fill-white text-reg-14 ${t}`,n&&f.appendChild(function(){const e=document.createElement("thead");e.className="[&_tr]:border-0 text-typography-quaternary-text";const t=document.createElement("tr");return r.forEach((e,n)=>{const i=document.createElement("th"),l=n===r.length-1,s=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";i.className=`min-w-[150px] max-w-[500px] text-nowrap bg-fill-tertiary-fill-light-gray px-12 py-8 text-left align-middle !text-semi-10 uppercase leading-[12px] tracking-[0.5px] text-typography-tertiary-text hover:bg-fill-tertiary-fill-light-gray ${s} ${function(e){const t={small:"h-32",default:"h-44",large:"h-48"};return t[e]||t.small}(a)} ${l?"w-full":""}`,e.width&&(i.style.width=e.width,i.style.minWidth=e.width);const c=document.createElement("span");c.textContent=e.header||"",i.appendChild(c),t.appendChild(i)}),e.appendChild(t),e}()),f.appendChild(m()),e.appendChild(f),p.appendChild(e)}return{mount(e){return p="string"==typeof e?document.querySelector(e):e,p?(v(),this):(console.error("Table: Invalid container element"),this)},setData(e){return u=[...e],v(),this},getData:()=>[...u],destroy(){p&&(p.innerHTML=""),p=null,f=null},refresh(){return v(),this}}}"undefined"!=typeof module&&module.exports?module.exports={createTable:t}:e.SuperleapTable={createTable:t}}("undefined"!=typeof window?window:void 0),function(e){const t="undefined"!=typeof window;if("undefined"!=typeof require&&"undefined"!=typeof module&&!t){try{e.createSuperLeapSDK=require("superleap-sdk")}catch(r){console.warn("[Superleap-Flow] SuperLeap SDK not found. Install with: npm install superleap-sdk")}if(require("./core/superleapClient.js"),require("./core/bridge.js"),require("./core/crm.js"),require("./components/label.js"),require("./core/flow.js"),require("./components/toast.js"),require("./components/alert.js"),require("./components/button.js"),require("./components/spinner.js"),require("./components/popover.js"),require("./components/select.js"),require("./components/enum-select.js"),require("./components/record-select.js"),require("./components/record-multiselect.js"),require("./components/time-picker.js"),require("./components/input.js"),require("./components/currency.js"),require("./components/textarea.js"),require("./components/duration/duration-utils.js"),require("./components/duration/duration-constants.js"),require("./components/duration/duration.js"),require("./components/date-time-picker/date-time-picker-utils.js"),require("./components/date-time-picker/date-time-picker.js"),require("./components/enumeration.js"),require("./components/multiselect.js"),require("./components/enum-multiselect.js"),require("./components/badge.js"),require("./components/avatar.js"),require("./components/icon.js"),require("./components/file-input.js"),require("./components/phone-input/phone-utils.js"),require("./components/phone-input/phone-input.js"),require("./components/checkbox.js"),require("./components/radio-group.js"),require("./components/table.js"),void 0!==e&&e.FlowUI){const SuperLeap=e.superleapClient?{init:e.superleapClient.init,getSdk:e.superleapClient.getSdk,isAvailable:e.superleapClient.isAvailable,getDefaultConfig:e.superleapClient.getDefaultConfig}:null;module.exports={FlowUI:e.FlowUI,SuperLeap:SuperLeap}}else if("undefined"!=typeof window&&window.FlowUI){const SuperLeap=window.superleapClient?{init:window.superleapClient.init,getSdk:window.superleapClient.getSdk,isAvailable:window.superleapClient.isAvailable,getDefaultConfig:window.superleapClient.getDefaultConfig}:null;module.exports={FlowUI:window.FlowUI,SuperLeap:SuperLeap}}}else if(t){const n={};function a(){["superleapClient","SuperleapBridge","Toast","Alert","Label","Button","Loader","Popover","Tooltip","Select","EnumSelect","RecordSelect","RecordMultiSelect","TimePicker","InputComponent","CurrencyComponent","TextareaComponent","Duration","DateTimePicker","Enumeration","MultiSelect","EnumMultiSelect","Badge","Avatar","Icon","FileInput","PhoneInput","Checkbox","RadioGroup","SuperleapTable"].forEach(e=>{window[e]&&(n[e]=window[e],delete window[e])}),window.FlowUI&&(window.FlowUI._getComponent=function(e){return n[e]});const e=n.superleapClient;e&&(window.SuperLeap={init:e.init.bind(e),getSdk:e.getSdk.bind(e),isAvailable:e.isAvailable.bind(e),getDefaultConfig:e.getDefaultConfig.bind(e),connect:e.connect?e.connect.bind(e):void 0,isConnected:e.isConnected?e.isConnected.bind(e):void 0,disconnect:e.disconnect?e.disconnect.bind(e):void 0,setLoading:e.setLoading?e.setLoading.bind(e):void 0,closeForm:e.closeForm?e.closeForm.bind(e):void 0,toast:e.toast?e.toast.bind(e):void 0,navigate:e.navigate?e.navigate.bind(e):void 0,getContext:e.getContext?e.getContext.bind(e):void 0,send:e.send?e.send.bind(e):void 0,on:e.on?e.on.bind(e):void 0,off:e.off?e.off.bind(e):void 0})}a();const o=n.superleapClient;if(o&&"function"==typeof o.init){window===window.parent&&!o.isAvailable()&&(o.init(o.getDefaultConfig()),console.log("[Superleap-Flow] SDK auto-initialized for standalone mode"))}if("undefined"!=typeof CustomEvent&&"undefined"!=typeof document){function i(){const e=new CustomEvent("superleap-flow:ready",{detail:{FlowUI:window.FlowUI,SuperLeap:window.SuperLeap,components:n}});document.dispatchEvent(e),console.log("[Superleap-Flow] Library ready - v2.2.2")}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):setTimeout(i,0)}}"undefined"!=typeof window&&window.FlowUI&&"undefined"!=typeof exports&&(exports.FlowUI=window.FlowUI,exports.SuperLeap=window.SuperLeap),void 0!==e&&e.FlowUI&&"undefined"!=typeof exports&&(exports.FlowUI=e.FlowUI,exports.SuperLeap=e.SuperLeap)}("undefined"!=typeof window?window:void 0)}();
|
|
1
|
+
/* @superleapai/flow-ui v2.2.8 | MIT License */
|
|
2
|
+
!function(){"use strict";var e,t,r;!function(e){const t={Int:1,Varchar:5,Checkbox:6,DateTime:7,Date:8,SecondsSinceMidnight:9,Email:11,Text:14,SingleSelect:15,MultiSelect:16,Url:17,FileUpload:20,PhoneNumber:21,Rating:22,Decimal:4,Currency:23,Stage:24,Location:18,Region:27,MultiFileUpload:29},r={OneToOne:1,OneToMany:2,ManyToOne:3,Restricted:6};class n{constructor(e,t=null){this.value=e,this.createdAt=Date.now(),this.ttl=t&&"number"==typeof t&&t>0?t:null}isExpired(){return!!this.ttl&&Date.now()-this.createdAt>this.ttl}getValue(){return this.isExpired()?null:this.value}}class a{constructor(e={}){this.enabled=!1!==e.enabled,this.maxSize=e.maxSize||1e3,this.defaultTTL=e.defaultTTL||3e5,this.storage=new Map,this.stats={hits:0,misses:0,sets:0,deletes:0,evictions:0}}get(e){if(!this.enabled)return null;const t=this.storage.get(e);return t?t.isExpired()?(this.storage.delete(e),this.stats.misses++,null):(this.stats.hits++,t.getValue()):(this.stats.misses++,null)}set(e,t,r=null){if(!this.enabled)return;const a=r&&"number"==typeof r&&r>0?r:this.defaultTTL;this.storage.size>=this.maxSize&&this._evictOldest();const o=new n(t,a);this.storage.set(e,o),this.stats.sets++}delete(e){if(!this.enabled)return!1;const t=this.storage.delete(e);return t&&this.stats.deletes++,t}clear(){this.storage.clear(),this.stats={hits:0,misses:0,sets:0,deletes:0,evictions:0}}getStats(){return{...this.stats,size:this.storage.size,maxSize:this.maxSize,hitRate:this.stats.hits+this.stats.misses>0?(this.stats.hits/(this.stats.hits+this.stats.misses)*100).toFixed(2)+"%":"0%"}}_evictOldest(){let e=null,t=Date.now();for(const[r,n]of this.storage.entries())n.createdAt<t&&(t=n.createdAt,e=r);e&&(this.storage.delete(e),this.stats.evictions++)}cleanExpired(){let e=0;for(const[t,r]of this.storage.entries())r.isExpired()&&(this.storage.delete(t),e++);return e}}const o={EQ:"eq",NEQ:"neq",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NOT_IN:"nin",LIKE:"ilike",NOT_LIKE:"not_ilike",SW:"starts_with",EW:"ends_with",IS_EMPTY:"is_empty",NOT_EMPTY:"not_empty",CONTAINS:"contains",NOT_CONTAINS:"not_contains",BETWEEN:"between",LOWER_EQ:"leq",LOWER_NOT_EQ:"nleq",IN_ACCESSIBLE_OWNERS:"in_accessible_owners"},i={TODAY:"is_today",ON:"on",IS_YESTERDAY:"is_yesterday",BEFORE_TODAY:"before_today",AFTER_TODAY:"after_today",TOMORROW:"tomorrow",THIS_WEEK:"this_week",NEXT_WEEK:"next_week",LAST_WEEK:"last_week",LAST_SEVEN_DAYS:"last_seven_days",LAST_TEN_DAYS:"last_ten_days",LAST_FIFTEEN_DAYS:"last_fifteen_days",LAST_THIRTY_DAYS:"last_thirty_days",THIS_MONTH:"this_month",NEXT_MONTH:"next_month",LAST_MONTH:"last_month",LAST_MONTH_TILL_DATE:"last_month_till_date",LAST_NINETY_DAYS:"last_ninety_days",THIS_QUARTER:"this_quarter",NEXT_QUARTER:"next_quarter",LAST_QUARTER:"last_quarter",LAST_180_DAYS:"last_180_days",LAST_365_DAYS:"last_365_days",THIS_YEAR:"this_year",NEXT_YEAR:"next_year",LAST_YEAR:"last_year",ALL_TIME:"all_time"};function l(e){if("string"==typeof e&&""===e?.trim()||null==e||Array.isArray(e)&&0===e.length)return!0}function s(e){return o.IS_EMPTY===e||o.NOT_EMPTY===e||o.IN_ACCESSIBLE_OWNERS===e||i.TODAY===e||i.IS_YESTERDAY===e||i.BEFORE_TODAY===e||i.THIS_WEEK===e||i.LAST_WEEK===e||i.LAST_SEVEN_DAYS===e||i.LAST_FIFTEEN_DAYS===e||i.LAST_THIRTY_DAYS===e||i.THIS_MONTH===e||i.LAST_MONTH===e||i.LAST_MONTH_TILL_DATE===e||i.THIS_QUARTER===e||i.LAST_QUARTER===e||i.THIS_YEAR===e||i.LAST_YEAR===e||i.AFTER_TODAY===e}function c(e){if(!e||"object"!=typeof e)return 0;if(e.field&&e.operator)return s(e.operator)?1:l(e.value)?0:1;if(Array.isArray(e))return e.reduce((e,t)=>e+c(t),0);let t=0;return e.and&&Array.isArray(e.and)&&(t+=c(e.and)),e.or&&Array.isArray(e.or)&&(t+=c(e.or)),t}function d(e,t){const r=e[t];return Array.isArray(r)?c(r):0}class u{constructor(e,t){this.objectSlug=e,this.sdk=t,this.query={fields:[],filters:{and:[],or:[]},sort:[]},this._executed=!1}then(e,t){return this._execute().then(e,t)}catch(e){return this._execute().catch(e)}finally(e){return this._execute().finally(e)}select(...e){return this.query.fields=[...new Set([...this.query.fields,...e])],this}selectAll(){return this._selectAll=!0,this.query.fields=[],this}where(e){return Object.entries(e).forEach(([e,t])=>{this.query.filters.and.push({field:e,operator:"eq",value:t})}),this}whereAnd(e){const t=new u(this.objectSlug,this.sdk);e(t);const r=t.query.filters.and.length>0,n=t.query.filters.or.length>0;if(!r&&!n)return this;const a=[];return r&&a.push(...t.query.filters.and),n&&a.push({or:t.query.filters.or}),1===a.length?this.query.filters.and.push(a[0]):this.query.filters.and.push({and:a}),this}whereOr(e){const t=new u(this.objectSlug,this.sdk);e(t);const r=t.query.filters.and.length>0,n=t.query.filters.or.length>0;if(!r&&!n)return this;const a=[];return r&&a.push(...t.query.filters.and),n&&a.push(...t.query.filters.or),a.forEach(e=>{this.query.filters.or.push(e)}),this}filter(e,t,r){return this.query.filters.and.push({field:e,operator:t,value:r}),this}exact(e,t){return this.filter(e,"eq",t)}iexact(e,t){return this.filter(e,"leq",t)}notexact(e,t){return this.filter(e,"neq",t)}notiexact(e,t){return this.filter(e,"nleq",t)}contains(e,t){return this.filter(e,"contains",t)}icontains(e,t){return this.filter(e,"ilike",t)}startswith(e,t){return this.filter(e,"starts_with",t)}endswith(e,t){return this.filter(e,"ends_with",t)}in(e,t){return this.filter(e,"in",t)}notin(e,t){return this.filter(e,"nin",t)}gt(e,t){return this.filter(e,"gt",t)}gte(e,t){return this.filter(e,"gte",t)}lt(e,t){return this.filter(e,"lt",t)}lte(e,t){return this.filter(e,"lte",t)}between(e,t){return this.filter(e,"between",t)}notcontains(e,t){return this.filter(e,"not_contains",t)}isempty(e){return this.filter(e,"is_empty",null)}isnotempty(e){return this.filter(e,"not_empty",null)}exists(e){return this.filter(e,"exists",null)}notexists(e){return this.filter(e,"not_exists",null)}like(e,t){return this.filter(e,"like",t)}ilike(e,t){return this.filter(e,"ilike",t)}isnull(e){return console.warn("isnull is deprecated, use isempty() instead"),this.filter(e,"is_empty",null)}isnotnull(e){return console.warn("isnotnull is deprecated, use isnotempty() instead"),this.filter(e,"not_empty",null)}filterBy(e){if(!e||"object"!=typeof e)throw new Error("Filter must be an object");let t=!1;return e.field&&e.operator?!s(e.operator)&&l(e.value)||(t=!0):(e.and&&d(e,"and")>0&&(t=!0),e.or&&d(e,"or")>0&&(t=!0)),t?!e.and||!Array.isArray(e.and)||e.or||e.field||e.operator?!e.or||!Array.isArray(e.or)||e.and||e.field||e.operator?this.query.filters.and.push(e):this.query.filters.or.push(...e.or):this.query.filters.and.push(...e.and):console.warn("FilterBy: Skipping filter with no valid conditions",e),this}orderBy(...e){return this.query.sort=e.map(e=>e.startsWith("-")?{field:e.slice(1),direction:"desc"}:{field:e,direction:"asc"}),this}limit(e){return this.query.pagination?this.query.pagination.page_size=e:this.query.pagination={page:1,page_size:e},this}page(e){return this.query.pagination?this.query.pagination.page=e:this.query.pagination={page:e,page_size:100},this}offset(e){if(this.query.pagination){const t=this.query.pagination.page_size;this.query.pagination.page=Math.floor(e/t)+1}else this.query.pagination={page:Math.floor(e/100)+1,page_size:100};return this}async _execute(){if(this._executed)return console.warn("Query already executed. Create a new query builder."),[];try{if(!0===this._selectAll)try{const e=this.sdk.getModel(this.objectSlug),t=await e.getSchema();t&&t.org_object_columns&&Array.isArray(t.org_object_columns)?(this.query.fields=t.org_object_columns.filter(e=>e&&e.slug).filter(e=>!e.relation||e.relation&&e.relationship_type!==r.OneToMany).map(e=>e.slug),this.query.fields.length>0?console.log(`Using ${this.query.fields.length} explicit fields from schema`):console.warn("Schema returned no valid fields, using empty fields array")):console.warn("No valid schema structure found, using empty fields array")}catch(e){console.error("Error fetching schema fields:",e),console.log("Falling back to empty fields array")}const e={...this.query};e.fields.length>0&&!e.fields.includes("id")&&e.fields.push("id"),0===e.sort.length&&(e.sort=[{field:"id",direction:"desc"}]),e.filters=this._buildFilterStructure(e.filters),e.filters||(e.filters={and:[]}),console.log("Executing query with fields:",e.fields);const t=this._cacheOptions||{},n=await this.sdk.getRecords(this.objectSlug,e,t);if(this._executed=!0,n.success){let e=[];return Array.isArray(n.data)?e=n.data:n.data&&Array.isArray(n.data.records)?e=n.data.records:n.data&&n.data.data&&Array.isArray(n.data.data)&&(e=n.data.data),console.log(`Query returned ${e.length} records`),e.map(e=>new p(e,this.sdk.getModel(this.objectSlug)))}return console.warn("Query failed:",n.message),[]}catch(e){return console.error("Error executing query:",e),[]}}_buildFilterStructure(e){if(!e||!e.and.length&&!e.or.length)return null;const t={};return e.and.length>0&&(t.and=e.and),e.or.length>0&&(t.or=e.or),t}async first(){this.limit(1);const e=await this._execute();return e.length>0?e[0]:null}async count(){const e=this._buildFilterStructure(this.query.filters),t=this._cacheOptions||{},r=await this.sdk.getRecordsCount(this.objectSlug,e,t);return r.success?r.data.count:0}async exists(){return await this.count()>0}cacheOptions(e={}){return this._cacheOptions=e,this}noCache(){return this.cacheOptions({useCache:!1})}cacheTTL(e){return this.cacheOptions({useCache:!0,cacheTTL:e})}cache(e={}){return this.cacheOptions({useCache:!0,cacheTTL:e.ttl})}}class p{constructor(e,t){if(!e||"object"!=typeof e)throw new Error("Record data must be a valid object");if(!t)throw new Error("Model instance is required");this.data=e,this.model=t,this.id=e.id}get(e){if(!this.data||"object"!=typeof this.data)throw new Error("Record data is not valid");const t=Object.keys(this.data);if(!(e in this.data))throw new Error(`Field '${e}' not found. Available fields: ${t.join(", ")}`);return this.data[e]}set(e,t){this.data[e]=t}async update(e){console.warn("update is deprecated, use model('object').update(id,updatedData) instead");try{const t=await this.model.update(this.id,e);return this.data=t.data,this}catch(e){throw new Error(e.message||"Update failed")}}async delete(){return(await this.model.delete(this.id)).success}async refresh(){const e=await this.model.get(this.id);return this.data=e.data,this}toJSON(){return this.data}}class f{constructor(e,t){this.objectSlug=e,this.sdk=t,this._schema=null,this._schemaLoaded=!1}async getSchema(){try{if(!this._schemaLoaded){console.log(`Fetching schema for ${this.objectSlug}...`);const e=await this.sdk.getObjectSchema(this.objectSlug);e.success&&e.data?(this._schema=e.data,this._schemaLoaded=!0,console.log(`Schema loaded for ${this.objectSlug}`)):console.warn(`Failed to load schema for ${this.objectSlug}:`,e.message)}return this._schema}catch(e){return console.error(`Error loading schema for ${this.objectSlug}:`,e),null}}async getField(e){const t=await this.getSchema();if(!t||!t.org_object_columns)return null;const r=t.org_object_columns.find(t=>t.slug===e);return r?{slug:r.slug,displayName:r.display_name,dataType:r.column_data_type,isRequired:1===r.is_required,isUnique:1===r.is_unique,enumGroup:r.enum_group,constraints:r.constraints,properties:r.properties}:null}async getFields(){try{const e=await this.getSchema();return e?e.org_object_columns&&Array.isArray(e.org_object_columns)?(console.log(`Found ${e.org_object_columns.length} fields for ${this.objectSlug}`),e.org_object_columns.map(e=>({slug:e.slug,displayName:e.display_name,dataType:e.column_data_type,isRequired:1===e.is_required,isUnique:1===e.is_unique,enumGroup:e.enum_group,constraints:e.constraints,properties:e.properties}))):(console.warn(`Schema for ${this.objectSlug} doesn't contain org_object_columns array`),[]):(console.warn(`No schema available for ${this.objectSlug}`),[])}catch(e){return console.error(`Error getting fields for ${this.objectSlug}:`,e),[]}}select(...e){return new u(this.objectSlug,this.sdk).select(...e)}selectAll(){console.warn("selectAll is deprecated, use select() with fields instead");return new u(this.objectSlug,this.sdk).selectAll()}async create(e){const t=await this.sdk.createRecord(this.objectSlug,e);if(t.success)return this.sdk.invalidateCache(this.objectSlug),new p(t.data,this);throw new Error(JSON.stringify(t.data))}async get(e){console.warn("get is deprecated, use select() instead");const t=await this.sdk.getRecordById(this.objectSlug,e);if(t.success)return new p(t.data,this);throw new Error(t.message||"Record not found")}async update(e,t){const r=await this.sdk.updateRecord(this.objectSlug,e,t);if(r.success)return this.sdk.invalidateCache(this.objectSlug),new p(r.data||{},this)}async delete(e){const t=await this.sdk.deleteRecord(this.objectSlug,e);return t.success&&this.sdk.invalidateCache(this.objectSlug),t.success}async deleteMany(e){const t=await this.sdk.deleteRecords(this.objectSlug,e);return t.success&&this.sdk.invalidateCache(this.objectSlug),t.success}async getOrCreate(e,t={}){console.warn("getOrCreate is deprecated, use select() instead");const r=await this.selectAll().where(e).first();if(r)return{record:r,created:!1};const n={...t,...e},a=await this.create(n);return console.warn("getOrCreate is deprecated, use select() instead"),{record:a,created:!0}}async updateOrCreate(e,t={}){console.warn("updateOrCreate is deprecated, use model('object').update(id,updatedData) instead");const r=await this.selectAll().where(e).first();if(r){return{record:await this.update(r.id,t),created:!1}}const n={...t,...e};return{record:await this.create(n),created:!0}}async bulkCreate(e,t=!0,r=!1){const n=await this.sdk.bulkUpsert(this.objectSlug,e,!0,r);if(n.success){this.sdk.invalidateCache(this.objectSlug);return(n.data?.records||[]).map(e=>new p(e,this))}throw new Error(n.message||"Bulk create failed")}async bulkUpdate(e,t=!1,r=!1){const n=await this.sdk.bulkUpsert(this.objectSlug,e,t,r,!0);if(n.success){this.sdk.invalidateCache(this.objectSlug);return(n.data?.records||[]).map(e=>new p(e,this))}throw new Error(n.message||"Bulk update failed")}}class h{constructor(e={}){this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||"https://app.superleap.dev/api/v1",this.clientId=e.clientId||"",this.clientSecret=e.clientSecret||"";const t=e.cache||{};t.maxSize&&("number"!=typeof t.maxSize||t.maxSize<=0)&&(console.warn("Invalid cache maxSize, using default: 1000"),t.maxSize=1e3),t.defaultTTL&&("number"!=typeof t.defaultTTL||t.defaultTTL<=0)&&(console.warn("Invalid cache defaultTTL, using default: 5 minutes"),t.defaultTTL=3e5),this.cache=new a(t),this.cacheTTL={schema:t.ttl?.schema&&"number"==typeof t.ttl.schema&&t.ttl.schema>0?t.ttl.schema:18e5,records:t.ttl?.records&&"number"==typeof t.ttl.records&&t.ttl.records>0?t.ttl.records:12e4,count:t.ttl?.count&&"number"==typeof t.ttl.count&&t.ttl.count>0?t.ttl.count:6e4,user:t.ttl?.user&&"number"==typeof t.ttl.user&&t.ttl.user>0?t.ttl.user:6e5},this._models=new Map,this._schemas=new Map}getModel(e){return this._models.has(e)||this._models.set(e,new f(e,this)),this._models.get(e)}async getCurrentUserData(){const e=await this.request("/org/user/me",{cache:{useCache:!1,ttl:this.cacheTTL.user}});return e?.data}async getCurrentUser(){const e=await this.request("/org/user/me",{cache:{useCache:!1,ttl:this.cacheTTL.user}});return{user:{id:e.data.user_id,name:e.data.user_name,email:e.data.user_email},orgId:e.data.org_id,timezone:e.data.timezone}}model(e){return this.getModel(e)}async getObjectSchema(e){try{console.log(`Fetching schema from API for ${e}`);const t=await this.request(`/org/objects/${e}`,{cache:{useCache:!1,ttl:this.cacheTTL.schema}});return t.success&&t.data?(console.log(`Successfully fetched schema for ${e}`),this._schemas.set(e,t.data)):console.warn(`Failed to fetch schema for ${e}:`,t.message),t}catch(t){return console.error(`Error fetching schema for ${e}:`,t),{success:!1,data:null,message:t instanceof Error?t.message:"Unknown error"}}}_isCacheableRequest(e,t,r){if("GET"===t)return!0;if("POST"===t){if(e.includes("/filter")&&!e.includes("/delete"))return!0;if(e.includes("/filter/count"))return!0;if(e.includes("/org/objects/")&&!e.includes("/record"))return!0}return!1}_generateCacheKey(e,t,r){const n=[t,e];if(r&&Object.keys(r).length>0)try{const e=Object.keys(r).sort().reduce((e,t)=>(e[t]=r[t],e),{});n.push(JSON.stringify(e))}catch(e){console.warn("Failed to generate cache key, using fallback:",e.message),n.push("fallback:"+Date.now())}return n.join(":")}_getDefaultTTL(e){return e.includes("/org/objects/")&&!e.includes("/record")?this.cacheTTL.schema:e.includes("/org/user/me")?this.cacheTTL.user:e.includes("/filter/count")?this.cacheTTL.count:e.includes("/filter")?this.cacheTTL.records:this.cache.defaultTTL}setApiKey(e){this.apiKey=e}setClientCredentials(e,t){this.clientId=e,this.clientSecret=t}setCacheEnabled(e){this.cache.enabled=e}clearCache(){this.cache.clear(),this._schemas.clear(),this._models.clear()}getCacheStats(){return this.cache.getStats()}invalidateCache(e){if(e)try{const t=[];for(const[r]of this.cache.storage.entries())(r.includes(`/org/objects/${e}`)||r.includes(`schema:${e}`)||r.includes(`fields:${e}`))&&t.push(r);t.forEach(e=>this.cache.delete(e)),this._schemas.delete(e),this._models.delete(e)}catch(e){console.warn("Error during cache invalidation:",e.message),this.clearCache()}else this.clearCache()}cleanExpiredCache(){return this.cache.cleanExpired()}async request(e,t={}){const{method:r="GET",headers:n={},body:a,cache:o={}}=t,{useCache:i=!1,ttl:l=null,key:s=null}=o,c={"Content-Type":"application/json","Client-ID":this.clientId,"Client-Secret":this.clientSecret,...n};this.apiKey&&(c.Authorization=`Bearer ${this.apiKey}`);const d=a instanceof FormData;d&&delete c["Content-Type"];const u=`${this.baseUrl}${e.startsWith("/")?e:`/${e}`}`;if(i&&("GET"===r||this._isCacheableRequest(e,r,a))){const p=s||this._generateCacheKey(e,r,a),f=this.cache.get(p);if(f){async function m(e){return new Promise(t=>{setTimeout(()=>t(e),0)})}return console.log(`Using cached response for ${e}`),m(f)}const h=await this._makeRequest(u,r,c,a,d);if(h.success){const g=l||this._getDefaultTTL(e);this.cache.set(p,h,g)}return h}return await this._makeRequest(u,r,c,a,d)}async _makeRequest(e,t,r,n,a){try{const o=await fetch(e,{method:t,headers:r,body:a?n:n?JSON.stringify(n):void 0}),i=o.headers.get("content-type");let l={};if(i&&i.includes("application/json"))try{l=await o.json()}catch(e){console.warn("Failed to parse JSON response:",e),l={message:await o.text()}}else{l={message:await o.text()}}return{data:l.data||null,status:o.status,success:o.ok,message:l.message||o.statusText}}catch(e){return console.error("API request failed:",e),{data:e,status:0,success:!1,message:e instanceof Error?e.message:"Unknown error occurred"}}}async getRecords(e,t=null,r={}){const{useCache:n=!1,cacheTTL:a=null}=r;return this.request(`/org/objects/${e}/filter`,{method:"POST",body:{query:t},cache:{useCache:n,ttl:a||this.cacheTTL.records}})}async getRecordById(e,t){return this.request(`/org/objects/${e}/record/${t}`,{cache:{useCache:!1,ttl:this.cacheTTL.records}})}async createRecord(e,t){return this.request(`/org/objects/${e}/record`,{method:"POST",body:t,cache:{useCache:!1}})}async updateRecord(e,t,r){return this.request(`/org/objects/${e}/record/${t}`,{method:"PUT",body:r,cache:{useCache:!1}})}async deleteRecord(e,t){return this.request(`/org/objects/${e}/record/delete`,{method:"POST",body:{record_ids:[t]},cache:{useCache:!1}})}async deleteRecords(e,t){return this.request(`/org/objects/${e}/record/delete`,{method:"POST",body:{record_ids:t},cache:{useCache:!1}})}async getRecordsCount(e,t=null,r={}){const{useCache:n=!1,cacheTTL:a=null}=r,o={};return t&&(o.filters=t),this.request(`/org/objects/${e}/filter/count`,{method:"POST",body:{query:o},cache:{useCache:n,ttl:a||this.cacheTTL.count}})}async bulkUpsert(e,t,r=!1,n=!1,a=!1){return this.request(`/org/objects/${e}/record/bulk_upsert`,{method:"POST",body:{values:t,ignore_duplicates:r,enable_partial_upsert:n,disable_create:a},cache:{useCache:!1}})}async transactionalBulkCreate(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!0,partial_upsert:t},cache:{useCache:!1}})}async transactionalBulkUpdate(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!1,partial_upsert:t,disable_create:!0},cache:{useCache:!1}})}async transactionalBulkUpsert(e,t=!1){const r={};return e.forEach(e=>{const{object_slug:t,record:n}=e;r[t]||(r[t]=[]),r[t].push(n)}),this.request("/org/objects/record/bulk_upsert",{method:"POST",body:{values:r,ignore_duplicates:!1,partial_upsert:t},cache:{useCache:!1}})}}function createSuperLeapSDK(e={}){return new h(e)}e.SuperLeapSDK=h,e.createSuperLeapSDK=createSuperLeapSDK,e.CacheManager=a,e.CacheEntry=n,"undefined"!=typeof module&&module.exports?module.exports={SuperLeapSDK:h,createSuperLeapSDK:createSuperLeapSDK,DataType:t,RelationshipType:r,CacheManager:a,CacheEntry:n,Operators:o,AdvancedDateOperators:i}:"function"==typeof define&&define.amd&&define([],function(){return{SuperLeapSDK:h,createSuperLeapSDK:createSuperLeapSDK,DataType:t,RelationshipType:r,CacheManager:a,CacheEntry:n,Operators:o,AdvancedDateOperators:i}})}("undefined"!=typeof window?window:void 0),function(e){var t=null,r=null,n={apiKey:"NWM2MGEZMDMTYME2YI0ZYZDHLTLKNWQTNDM3NDNIZDU3YTQ1",baseUrl:"https://razorpay-sandbox.superleap.dev/api/v1",clientId:"",clientSecret:"",cache:{enabled:!0,maxSize:1e3,defaultTTL:3e5,ttl:{schema:18e5,records:12e4,count:6e4,user:6e5}}};function a(e,t){if(!t||"object"!=typeof t)return e;var r,n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=t[r],i=n[r];i&&o&&"object"==typeof i&&"object"==typeof o&&!Array.isArray(i)&&!Array.isArray(o)?n[r]=a(i,o):n[r]=o}return n}var superleapClient={init:function(o){if(null==o)return t=null,void(r=null);t=a(n,o),"function"==typeof e.createSuperLeapSDK?r=e.createSuperLeapSDK(t):"function"==typeof e.SuperLeapSDK?r=new e.SuperLeapSDK(t):(console.warn("[superleapClient] SuperLeap SDK not found. Install with: npm install superleap-sdk"),r=null)},getSdk:function(){return r},isAvailable:function(){return null!=t&&null!=r},getDefaultConfig:function(){return a({},n)}};e&&(e.superleapClient=superleapClient)}("undefined"!=typeof window?window:void 0),function(e){var t="superleap-bridge",r=null,n=null,a=null,o=!1,i=null,l=null,s=null,c={},d=null,u=null,p=null,f=!0;function h(e,n){return{type:t,instanceId:r,action:e,payload:n||{}}}function m(t,r){if("react-native"!==i)if(a)a.postMessage(t);else{var n=l||"*";e.parent.postMessage(t,n)}else e.ReactNativeWebView.postMessage(JSON.stringify(t))}function g(y,b){if(y&&y.type===t&&(!y.instanceId||y.instanceId===r)){var x=y.action;if("handshake-ack"===x&&d){if(!y.payload||y.payload.nonce!==n)return u&&u(new Error("SuperleapBridge: Nonce validation failed (possible replay)")),void v();if("iframe"===i&&l&&b!==l)return u&&u(new Error("SuperleapBridge: Origin validation failed")),void v();if("iframe"===i&&b&&(l=b),clearTimeout(p),p=null,"iframe"===i&&f&&"undefined"!=typeof MessageChannel){var w=new MessageChannel;(a=w.port1).onmessage=function(e){g(e.data,"")};var C=h("handshake-complete",{});e.parent.postMessage(C,l,[w.port2])}else m(h("handshake-complete",{}));o=!0,n=null,a&&s&&(e.removeEventListener("message",s),s=null);var E=d;return d=null,u=null,void E(y.payload)}if(o){if("iframe"===i&&!a&&l&&b&&b!==l)return;!function(e,t){var r=c[e];if(!r||!r.length)return;for(var n=r.slice(),a=0;a<n.length;a++)try{n[a](t)}catch(t){console.error("SuperleapBridge: handler error for "+e,t)}}(x,y.payload)}}}function v(){if(p&&(clearTimeout(p),p=null),a){try{a.close()}catch(e){}a=null}s&&(e.removeEventListener("message",s),s=null),"react-native"===i&&e.__superleapBridge&&delete e.__superleapBridge,r=null,n=null,o=!1,i=null,l=null,d=null,u=null}function y(e,t){var r=c[e];if(r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}var SuperleapBridge={connect:function(t){if(o)return Promise.reject(new Error("SuperleapBridge: Already connected. Call disconnect() first."));var a=t||{};return new Promise(function(t,c){try{i=function(){if(e.ReactNativeWebView&&"function"==typeof e.ReactNativeWebView.postMessage)return"react-native";if(e.parent&&e.parent!==e)return"iframe";throw new Error("SuperleapBridge: Not running in an embedded context (no parent window or ReactNativeWebView)")}()}catch(e){return void c(e)}r=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();var e;if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)e=new Uint8Array(16),crypto.getRandomValues(e);else{e=new Uint8Array(16);for(var t=0;t<16;t++)e[t]=256*Math.random()|0}e[6]=15&e[6]|64,e[8]=63&e[8]|128;for(var r=[],n=0;n<16;n++)r.push(("0"+e[n].toString(16)).slice(-2));return r.slice(0,4).join("")+"-"+r.slice(4,6).join("")+"-"+r.slice(6,8).join("")+"-"+r.slice(8,10).join("")+"-"+r.slice(10).join("")}(),n=function(){var e;if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)e=new Uint8Array(16),crypto.getRandomValues(e);else{e=new Uint8Array(16);for(var t=0;t<16;t++)e[t]=256*Math.random()|0}for(var r="",n=0;n<e.length;n++)r+=("0"+e[n].toString(16)).slice(-2);return r}(),l=a.crmOrigin||null,d=t,u=c,f="undefined"!=typeof MessageChannel,"iframe"===i?(s=function(e){g(e.data,e.origin)},e.addEventListener("message",s)):(e.__superleapBridge={receive:function(e){var t;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){return}else t=e;g(t,"")}},s=function(e){var t=e.data;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return}g(t,"")},e.addEventListener("message",s)),m(h("handshake-request",{flowId:a.flowId||"",version:a.version||"",nonce:n}));var y=a.timeout||5e3;p=setTimeout(function(){if(!o){var e=new Error("SuperleapBridge: Handshake timed out after "+y+"ms. Is this page embedded in the SuperLeap CRM?");u&&u(e),v()}},y)})},disconnect:function(){if(o)try{m(h("disconnect",{}))}catch(e){}v()},send:function(e,t){if(!o)throw new Error("SuperleapBridge: Not connected. Call connect() first.");m(h(e,t))},onMessage:function(e,t){return c[e]||(c[e]=[]),c[e].push(t),function(){y(e,t)}},offMessage:y,isConnected:function(){return o},getInstanceId:function(){return r}};e&&(e.SuperleapBridge=SuperleapBridge)}("undefined"!=typeof window?window:void 0),function(e){var t=null,r=null,n=null,a=!1;function o(){if(n)return n;if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("SuperleapBridge");if(t)return n=t}return e.SuperleapBridge?n=e.SuperleapBridge:null}e.superleapClient?(e.superleapClient.connect=function(n){var i=n||{},l=o();return l?a?Promise.reject(new Error("SuperleapCRM: Already connected. Call disconnect() first.")):l.connect({flowId:i.flowId||"",version:"2.1.0",crmOrigin:i.crmOrigin,timeout:i.timeout}).then(function(n){t=n&&n.context||{},r=n&&n.config||{};var o=n&&n.sdkConfig;if(!1!==i.autoInit&&o){var s=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient?e.superleapClient:e.SuperLeap?e.SuperLeap:null}();s&&"function"==typeof s.init&&s.init(o)}if(a=!0,l.onMessage("data:context",function(e){if(e&&"object"==typeof e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}),"undefined"!=typeof CustomEvent&&"undefined"!=typeof document){var c=new CustomEvent("superleap-crm:connected",{detail:{context:t,config:r}});document.dispatchEvent(c)}return{context:t,config:r}}):Promise.reject(new Error("SuperleapCRM: bridge.js is not loaded"))},e.superleapClient.isConnected=function(){return a},e.superleapClient.disconnect=function(){var e=o();e&&e.disconnect(),t=null,r=null,a=!1,n=null},e.superleapClient.setLoading=function(e){var t=o();t&&t.isConnected()&&t.send("crm:loading",{loading:!!e})},e.superleapClient.closeForm=function(){var e=o();e&&e.isConnected()&&e.send("crm:close",{})},e.superleapClient.toast=function(e,t,r){var n=o();n&&n.isConnected()&&n.send("crm:toast",{message:e,type:t||"info",duration:r||4e3})},e.superleapClient.navigate=function(e){var t=o();t&&t.isConnected()&&t.send("crm:navigate",{path:e})},e.superleapClient.getContext=function(){if(!t)return null;var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.superleapClient.send=function(e,t){var r=o();r&&r.isConnected()&&r.send("custom:"+e,t)},e.superleapClient.on=function(e,t){var r=o();return r?r.onMessage("custom:"+e,t):function(){}},e.superleapClient.off=function(e,t){var r=o();r&&r.offMessage("custom:"+e,t)}):console.warn("SuperLeap CRM Bridge: superleapClient not found. Make sure core/superleapClient.js loads before core/crm.js")}("undefined"!=typeof window?window:void 0),e="undefined"!=typeof window?window:void 0,t={default:"text-reg-13",small:"text-reg-12",large:"text-reg-14"},r={left:"required-left",right:"required-right",none:"required-none"},e.Label={create:function(e){var n=null!=e.label?String(e.label):"",a=!!e.required,o=e.requiredPosition||"right",i=!!e.optional,l=e.size||"default",s=e.icon,c=e.className||"",d=e.htmlFor,u=e.suffix,p=t[l]||t.default,f=r[o]||r.none,h=i?"optional-true":"optional-false",m=document.createElement("label");if(m.className=function(){for(var e=[],t=0;t<arguments.length;t++)arguments[t]&&e.push(arguments[t]);return e.join(" ")}("!text-typography-tertiary-text","inline-flex items-center gap-2 flex-shrink-0 pb-8 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p,f,h,c),d&&(m.htmlFor=d),a&&"left"===o){var g=document.createElement("span");g.className="required-label text-error-base",g.textContent="*",m.appendChild(g)}if(m.appendChild(document.createTextNode(n)),s){var v=document.createElement("span");v.className="box-content flex size-16 items-center justify-center",v.appendChild(s),m.appendChild(v)}if(a&&"right"===o){var y=document.createElement("span");y.className="required-label text-error-base",y.textContent=" *",m.appendChild(y)}if(i){var b=document.createElement("span");b.className="optional-label text-typography-tertiary-text",b.textContent=" (optional)",m.appendChild(b)}return u&&m.appendChild(u),m}},function(e){let t={},r=null;function n(e){t={...t,...e},r&&r(t)}function a(e){return t[e]}function o(e,t){n({[e]:t})}function i(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){const r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function l(e,t=!1,r=null){const n=document.createElement("div");let a;n.className="field";const o=i("Label");if(o&&"function"==typeof o.create){const n=r&&i("Tooltip")?i("Tooltip").create(r):null;a=o.create({label:e,required:t,requiredPosition:"right",optional:!1,size:"default",suffix:n||void 0})}else{a=document.createElement("label"),a.className="field-label";const n=document.createElement("span");if(n.style.display="inline-flex",n.style.alignItems="center",n.style.gap="0.25rem",t){n.appendChild(document.createTextNode(e+" "));const t=document.createElement("span");t.className="required-asterisk",t.textContent="*",n.appendChild(t)}else n.appendChild(document.createTextNode(e));if(r&&i("Tooltip")){const e=i("Tooltip").create(r);e&&n.appendChild(e)}a.appendChild(n)}return n.appendChild(a),n}function s(e){const t=i("Avatar");if(t&&"function"==typeof t.create)return t.create(e);const r=document.createElement("div");return r.className="flex shrink-0 size-32 items-center justify-center rounded-full bg-primary-base",r.textContent=e&&e.name&&e.name.charAt(0)||"?",r}function c(e){const t=i("Avatar");if(t&&"function"==typeof t.createGroup)return t.createGroup(e);const r=document.createElement("div");return r.className="flex -space-x-4",r.textContent="",r}e.FlowUI={initState:function(e,n){t={...e},r=n},getState:function(){return t},setState:n,get:a,set:o,createScreen:function(e,t){const r=document.createElement("div");r.className="screen";const n=document.createElement("h2");n.className="screen-title",n.textContent=e;const a=document.createElement("p");return a.className="screen-description",a.textContent=t,r.appendChild(n),r.appendChild(a),r},createGrid:function(){const e=document.createElement("div");return e.className="form-grid",e},createFieldWrapper:l,createInput:function(e){const{label:t,fieldId:r,placeholder:n,required:s=!1,type:c="text",helpText:d=null,variant:u,inputSize:p,disabled:f=!1,showReadOnlyIcon:h}=e,m=l(t,s,d);if(i("InputComponent")&&i("InputComponent").create){const e=a(r)||"",l=i("InputComponent").create({variant:u||"default",inputSize:p||"default",type:c,placeholder:n||`Enter ${t.toLowerCase()}`,value:e,disabled:f,showReadOnlyIcon:h,onChange:e=>o(r,e.target.value),onInput:e=>o(r,e.target.value)});l._fieldId=r,m.appendChild(l)}return m},createTextarea:function(e){const{label:t,fieldId:r,placeholder:n,required:s=!1,helpText:c=null,variant:d,rows:u,disabled:p=!1}=e,f=l(t,s,c);if(f.setAttribute("data-field-id",r),i("TextareaComponent")&&i("TextareaComponent").create){const e=a(r)||"",l=i("TextareaComponent").create({variant:d||"default",placeholder:n||`Enter ${t.toLowerCase()}`,value:e,rows:u,disabled:p,onChange:e=>o(r,e.target.value),onInput:e=>o(r,e.target.value)});return l._fieldId=r,f.appendChild(l),f}const h=document.createElement("textarea");return h.className="textarea",h.placeholder=n||`Enter ${t.toLowerCase()}`,h.value=a(r)||"",h.disabled=p,null!=u&&(h.rows=u),h.addEventListener("change",e=>o(r,e.target.value)),f.appendChild(h),f},createSelect:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,disabled:d=!1,helpText:u=null}=e,p=l(t,s,u);if(i("Select")&&i("Select").create){const e=a(r)||"",l=`Select ${t}`,s=i("Select").create({fieldId:r,options:n,placeholder:l,value:e,disabled:d,onChange:e=>{o(r,e),c&&c(e)}});return s._fieldId=r,s._onChange=c,p.appendChild(s),p}const f=document.createElement("select");f.className="select",f.disabled=d;const h=document.createElement("option");return h.value="",h.textContent=`Select ${t}`,h.className="select-placeholder",h.disabled=!0,h.selected=!0,f.appendChild(h),n.forEach(e=>{const t=document.createElement("option");t.value=e.value||e.slug||e.id,t.textContent=e.label||e.name||e.value,f.appendChild(t)}),f.value=a(r)||"",f.value||f.setAttribute("data-placeholder","true"),f.addEventListener("change",e=>{const t=e.target.value;o(r,t),""===t?f.setAttribute("data-placeholder","true"):f.removeAttribute("data-placeholder"),c&&c(t)}),p.appendChild(f),p},createTimePicker:function(e){const{label:t,fieldId:r,value:n,placeholder:s,required:c=!1,onChange:d,disabled:u=!1,use24Hour:p=!1,helpText:f=null}=e,h=l(t,c,f);if(i("TimePicker")&&i("TimePicker").create){const e=a(r)||n||"",l=i("TimePicker").create({fieldId:r,value:e,placeholder:s||`Select ${t}`,disabled:u,use24Hour:p,onChange:e=>{o(r,e),d&&d(e)}});return l._fieldId=r,h.appendChild(l),h}const m=document.createElement("input");return m.type="time",m.className="input",m.value=a(r)||"",m.disabled=u,m.addEventListener("change",e=>{o(r,e.target.value),d&&d(e.target.value)}),h.appendChild(m),h},createDateTimePicker:function(e){const{label:t,fieldId:r,value:n,placeholder:s,required:c=!1,onChange:d,disabled:u=!1,hourCycle:p=12,granularity:f="minute",size:h="default",fromDate:m,toDate:g,helpText:v=null}=e,y=l(t,c,v);if(i("DateTimePicker")&&i("DateTimePicker").create){const e=a(r);let l;if(n instanceof Date)l=n;else if(null==e||""===e)l=void 0;else try{l="string"==typeof e?new Date(e):e,Number.isNaN(l.getTime())&&(l=void 0)}catch(e){l=void 0}const c=i("DateTimePicker").create({value:l,placeholder:s||`Pick ${t.toLowerCase()}`,disabled:u,hourCycle:p,granularity:f,size:h,fromDate:m,toDate:g,onChange:e=>{o(r,e?e.toISOString():null),d&&d(e)}});return c._fieldId=r,y.appendChild(c),y}const b=document.createElement("input");b.type="date",b.className="input";const x=a(r);if(x)try{const e="string"==typeof x?new Date(x):x;Number.isNaN(e.getTime())||(b.value=e.toISOString().slice(0,10))}catch(e){}return b.disabled=u,b.addEventListener("change",e=>{const t=e.target.value?new Date(e.target.value+"T12:00:00Z").toISOString():null;o(r,t),d&&d(t?new Date(t):void 0)}),y.appendChild(b),y},createRadioGroup:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,helpText:d=null,orientation:u="horizontal",disabled:p=!1}=e,f=l(t,s,d);if(i("RadioGroup")&&i("RadioGroup").create){const e=a(r),t=i("RadioGroup").create({name:r,options:n.map(e=>({value:e.value,label:e.label||e.value,disabled:e.disabled})),value:e,disabled:p,orientation:u,onChange:e=>{o(r,e),c&&c(e)}});return t._fieldId=r,f.appendChild(t),f}const h=document.createElement("div");return h.className="radio-group",n.forEach(e=>{const t=document.createElement("div");t.className="radio-option";const n=document.createElement("input");n.type="radio",n.name=r,n.value=e.value,n.id=`${r}-${e.value}`,n.checked=a(r)===e.value,n.disabled=p||!!e.disabled,n.addEventListener("change",()=>{o(r,e.value),c&&c(e.value)});const i=document.createElement("label");i.htmlFor=`${r}-${e.value}`,i.textContent=e.label||e.value,t.appendChild(n),t.appendChild(i),h.appendChild(t)}),f.appendChild(h),f},createMultiSelect:function(e){const{label:t,fieldId:r,options:n=[],required:s=!1,onChange:c,placeholder:d,helpText:u=null,variant:p,size:f,type:h,disabled:m=!1}=e,g=l(t,s,u);if(i("MultiSelect")&&i("MultiSelect").create){const e=a(r)||[],l=i("MultiSelect").create({fieldId:r,options:n,placeholder:d||`Select ${t}`,value:e,label:"selected",variant:p||"default",size:f||"default",type:h||"default",disabled:m,onValuesChange:e=>{o(r,e),c&&c(e)}});return l._fieldId=r,g.appendChild(l),g}const v=document.createElement("div");v.className="checkbox-group";const y=a(r)||[];return n.forEach(e=>{const t=document.createElement("label");t.className="checkbox-label";const n=document.createElement("input");n.type="checkbox";const i=e.value||e.slug||e.id;n.value=i,n.checked=y.includes(i),n.addEventListener("change",()=>{const e=a(r)||[],t=n.checked?[...e,i]:e.filter(e=>e!==i);o(r,t),c&&c(t)}),t.appendChild(n),t.appendChild(document.createTextNode(" "+(e.label||e.name||e.display_name||e.value))),v.appendChild(t)}),g.appendChild(v),g},createRecordSelect:function(e){const{label:t,fieldId:r,objectSlug:n,placeholder:s,searchPlaceholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,initialLimit:g,helpText:v=null}=e,y=l(t,d,v);if(i("RecordSelect")&&i("RecordSelect").create){const e=a(r)||"",l=i("RecordSelect").create({fieldId:r,objectSlug:n,placeholder:s||`Select ${t}`,searchPlaceholder:c,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,initialLimit:g,onChange:(e,t)=>{o(r,e),u&&u(e,t)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Record select requires RecordSelect component and SuperLeap client.",y.appendChild(b),y},createRecordMultiSelect:function(e){const{label:t,fieldId:r,objectSlug:n,placeholder:s,searchPlaceholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,initialLimit:m,displayFields:g,helpText:v=null}=e,y=l(t,d,v);if(i("RecordMultiSelect")&&i("RecordMultiSelect").create){const e=a(r)||[],l=i("RecordMultiSelect").create({fieldId:r,objectSlug:n,placeholder:s||`Select ${t}`,searchPlaceholder:c,value:e,disabled:p,variant:f||"default",size:h||"default",initialLimit:m,displayFields:g||[],onValuesChange:(e,t)=>{o(r,e),u&&u(e,t)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Record multi-select requires RecordMultiSelect component and SuperLeap client.",y.appendChild(b),y},createEnumSelect:function(e){const{label:t,fieldId:r,objectSlug:n,columnSlug:s,placeholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,currentRecordData:g,helpText:v=null}=e,y=l(t,d,v);if(i("EnumSelect")&&i("EnumSelect").create){const e=a(r)||"",l=i("EnumSelect").create({fieldId:r,objectSlug:n,columnSlug:s,placeholder:c||`Select ${t}`,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,currentRecordData:g||{},onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enum select requires EnumSelect component and SuperLeap client.",y.appendChild(b),y},createEnumMultiSelect:function(e){const{label:t,fieldId:r,objectSlug:n,columnSlug:s,placeholder:c,required:d=!1,onChange:u,disabled:p=!1,variant:f,size:h,canClear:m,currentRecordData:g,helpText:v=null}=e,y=l(t,d,v);if(i("EnumMultiSelect")&&i("EnumMultiSelect").create){const e=a(r)||[],l=i("EnumMultiSelect").create({fieldId:r,objectSlug:n,columnSlug:s,placeholder:c||`Select ${t}`,value:e,disabled:p,variant:f||"default",size:h||"default",canClear:!!m,currentRecordData:g||{},onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enum multi-select requires EnumMultiSelect component and SuperLeap client.",y.appendChild(b),y},createDuration:function(e){const{label:t,fieldId:r,value:n,formatType:s="seconds",placeholder:c="hh:mm:ss",required:d=!1,onChange:u,disabled:p=!1,variant:f="default",size:h="default",helpText:m=null}=e,g=l(t,d,m);if(g.setAttribute("data-field-id",r),i("Duration")&&i("Duration").create){const e=a(r),t=null!=e?e:n,l=i("Duration").create({value:t,formatType:s,placeholder:c,disabled:p,variant:f,size:h,onChange:e=>{o(r,e),u&&u(e)}});return l._fieldId=r,g.appendChild(l),g}const v=document.createElement("div");return v.className="text-reg-13 text-typography-quaternary-text",v.textContent="Duration picker requires Duration component.",g.appendChild(v),g},createEnumeration:function(e){const{label:t,fieldId:r,totalElements:n,enabledIcon:s,disabledIcon:c,defaultValue:d=0,required:u=!1,onChange:p,disabled:f=!1,readOnly:h=!1,variant:m="default",size:g="default",helpText:v=null}=e,y=l(t,u,v);if(y.setAttribute("data-field-id",r),i("Enumeration")&&i("Enumeration").create){const e=a(r),t=null!=e?e:d,l=i("Enumeration").create({totalElements:n,enabledIcon:s,disabledIcon:c,defaultValue:t,disabled:f,readOnly:h,variant:m,size:g,onValueChange:e=>{o(r,e),p&&p(e)}});return l._fieldId=r,y.appendChild(l),y}const b=document.createElement("div");return b.className="text-reg-13 text-typography-quaternary-text",b.textContent="Enumeration requires Enumeration component.",y.appendChild(b),y},createFileUpload:function(e){const{label:t,fieldId:r,multiple:n=!0,accept:s,required:c=!1,helpText:d=null,isPrivate:u,maxFiles:p,maxFileSize:f}=e;if(i("FileInput")&&i("FileInput").create)return i("FileInput").create({label:t,fieldId:r,multiple:n,accept:s||"*",required:c,helpText:d,isPrivate:!!u,maxFiles:null!=p?p:null,maxFileSize:null!=f?f:10485760});const h=l(t,c,d),m=document.createElement("div");m.className="file-upload-wrapper";const g=document.createElement("div");g.className="file-upload-button",g.textContent="Choose a file";const v=a(r)||[],y=document.createElement("div");y.className="file-upload-text",y.textContent=v.length>0?`${v.length} file(s) selected`:"No files chosen";const b=document.createElement("input");b.type="file",b.multiple=n,b.className="file-upload-input",s&&(b.accept=s),b.addEventListener("change",function(){const e=Array.from(this.files||[]);o(r,e),y.textContent=e.length>0?`${e.length} file(s) selected`:"No files chosen"}),m.appendChild(g),m.appendChild(y),m.appendChild(b),h.appendChild(m);const x=document.createElement("div");return x.className="field-hint",x.textContent=n?"Multiple files allowed.":"Single file only.",h.appendChild(x),h},createCurrency:function(e){const{label:t,fieldId:r,column:n={},placeholder:s,required:c=!1,helpText:d=null,variant:u="default",size:p="default",disabled:f=!1,onChange:h}=e,m=l(t||"Amount",c,d);if(m.setAttribute("data-field-id",r),i("CurrencyComponent")&&i("CurrencyComponent").create){const e=a(r),t=i("CurrencyComponent").create({variant:u,size:p,placeholder:s||n.placeholder||"Enter value",disabled:f,column:n,value:null!=e?e:null,onChange:e=>{o(r,e),h&&h(e)}});return t._fieldId=r,m.appendChild(t),m}const g=document.createElement("input");return g.type="number",g.step="0.01",g.placeholder=s||"Enter amount",g.value=null!=a(r)?a(r):"",g.disabled=f,g.className="input w-full",g.addEventListener("input",e=>{const t=e.target.value,n=""===t?null:parseFloat(t);o(r,isNaN(n)?null:n),h&&h(isNaN(n)?null:n)}),m.appendChild(g),m},createPhoneInput:function(e){const{label:t,fieldId:r,defaultCountryCode:n,placeholder:s,required:c=!1,helpText:d=null,variant:u="default",inputSize:p="default",disabled:f=!1,disableCountrySelect:h=!1,hideCountrySelect:m=!1,onChange:g}=e,v=l(t,c,d);if(v.setAttribute("data-field-id",r),i("PhoneInput")&&i("PhoneInput").create){const e=a(r)||"",t=i("PhoneInput").create({variant:u,inputSize:p,defaultCountryCode:n||"IN",defaultPhoneNumber:e,placeholder:s,disabled:f,disableCountrySelect:h,hideCountrySelect:m,onChange:(e,t)=>{o(r,e),g&&g(e,t)}});return t._fieldId=r,v.appendChild(t),v}const y=document.createElement("input");return y.type="tel",y.className="input",y.placeholder=s||"Enter phone number",y.value=a(r)||"",y.disabled=f,y.addEventListener("input",e=>{o(r,e.target.value),g&&g(e.target.value,null)}),v.appendChild(y),v},createCheckbox:function(e){const{label:t,fieldId:r,checked:n=!1,indeterminate:s=!1,disabled:c=!1,helpText:d=null,size:u="default",align:p="left",isLabelCaps:f=!1,onChange:h}=e,m=l(t,!1,d);if(m.setAttribute("data-field-id",r),i("Checkbox")&&i("Checkbox").create){const e=a(r),t=i("Checkbox").create({id:r,name:r,checked:void 0!==e?e:n,indeterminate:s,disabled:c,size:u,align:p,isLabelCaps:f,onChange:e=>{o(r,e),h&&h(e)}});return t._fieldId=r,m.appendChild(t),m}const g=document.createElement("input");return g.type="checkbox",g.className="checkbox",g.id=r,g.name=r,g.checked=a(r)||n,g.disabled=c,g.addEventListener("change",e=>{o(r,e.target.checked),h&&h(e.target.checked)}),m.appendChild(g),m},createButton:function(e){const Button=i("Button");if(Button&&"function"==typeof Button.create)return Button.create(e);const t=document.createElement("button");return t.type=e&&e.type||"button",t.className="btn "+(e&&"primary"===e.variant?"btn-primary":"btn-ghost"),t.textContent=e&&(e.text||e.label)||"Button",e&&e.disabled&&(t.disabled=!0),e&&"function"==typeof e.onClick&&t.addEventListener("click",e.onClick),t},renderStepper:function(e,t,r){e&&(e.innerHTML="",t.forEach((t,n)=>{const a=document.createElement("div");a.className="step-pill"+(t.id===r?" step-pill--active":"");const o=document.createElement("span");o.className="step-pill-index",o.textContent=String(n+1);const i=document.createElement("span");i.textContent=t.label,a.appendChild(o),a.appendChild(i),e.appendChild(a)}))},showToast:function(e,t="info",r=4e3){const Toast=i("Toast");return Toast&&"function"==typeof Toast.show?Toast.show(e,t,r):(console.warn("[FlowUI] Toast component not loaded. Message:",e,"Type:",t),{close:function(){},element:null})},renderAlerts:function(e,t=[],r="error"){if(!e)return;e.innerHTML="";const Alert=i("Alert"),n=Alert&&"function"==typeof Alert.create;t.forEach(t=>{const a="string"==typeof t?t:t.description||t.title||"",o="object"==typeof t&&t.title?t.title:"";if(n&&(a||o)){const t={error:"error",info:"info",success:"success"}[r]||r,n=Alert.create({title:o,description:a,variant:t});n&&e.appendChild(n)}else{const t=document.createElement("div");t.className=`alert alert--${r}`,t.textContent=a||o,e.appendChild(t)}})},createDataTable:function(e){const{columns:t,data:r=[],fieldId:n,idKey:i="id",onSelect:l}=e,s=document.createElement("div");s.className="table-container";const c=document.createElement("div");c.className="table-scroll";const d=document.createElement("table");d.className="table";const u=document.createElement("thead"),p=document.createElement("tr");p.innerHTML="<th></th>",t.forEach(e=>{const t=document.createElement("th");t.textContent=e.label,p.appendChild(t)}),u.appendChild(p),d.appendChild(u);const f=document.createElement("tbody");if(0===r.length){const e=document.createElement("tr");e.innerHTML=`<td colspan="${t.length+1}" style="text-align: center; padding: 2rem; color: var(--text-muted);">No results found.</td>`,f.appendChild(e)}else r.forEach(e=>{const r=document.createElement("tr"),s=document.createElement("td"),c=document.createElement("input");c.type="radio",c.name=n,c.value=e[i],c.checked=a(n)===e[i],c.addEventListener("change",()=>{o(n,e[i]),l&&l(e)}),s.appendChild(c),r.appendChild(s),t.forEach(t=>{const n=document.createElement("td");n.textContent=e[t.key]||"",r.appendChild(n)}),f.appendChild(r)});return d.appendChild(f),c.appendChild(d),s.appendChild(c),s},createTable:function(e){const t=i("SuperleapTable");if(t&&"function"==typeof t.createTable)return t.createTable(e);const r=document.createElement("div");return r.className="table-container",r.textContent="Table component (SuperleapTable) not loaded.",r},createSearchInput:function(e){const{placeholder:t="Search...",fieldId:r,onSearch:n}=e,i=document.createElement("div");return i.className="search-container",i.innerHTML=`\n <svg class="search-icon" 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"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>\n <input type="text" class="search-input" placeholder="${t}" value="${a(r)||""}">\n `,i.querySelector(".search-input").addEventListener("input",e=>{o(r,e.target.value.toLowerCase()),n&&n(e.target.value.toLowerCase())}),i},createSummaryRow:function(e,t){const r=document.createElement("div");r.className="field";const n=document.createElement("div");n.className="field-label",n.textContent=e;const a=document.createElement("div");return a.className="field-hint",a.textContent=t||"-",r.appendChild(n),r.appendChild(a),r},createBadge:function(e){const t=i("Badge");if(t&&"function"==typeof t.create)return t.create(e);const r=document.createElement("span");return r.className="badge",r.textContent=e&&(e.content||""),r},createLoader:function(e){const t=i("Loader"),r=i("Spinner"),n=t||r;if(n&&"function"==typeof n.create)return n.create(e||{});const a=document.createElement("div");return a.className="spinner",a.textContent=e&&e.text?e.text:"Loading...",a},createAvatar:s,createVividAvatar:function(e){const t=i("Avatar");return t&&"function"==typeof t.createVivid?t.createVivid(e):s(e)},createAvatarGroup:c,createVividAvatarGroup:function(e){const t=i("Avatar");return t&&"function"==typeof t.createVividGroup?t.createVividGroup(e):c(e)}},console.log("[FlowUI] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){const t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',infoCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>',loader:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',playstationX:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>'},r={loading:"loader",default:"alertCircle",warning:"alertCircle",error:"playstationX",success:"circleCheck",info:"infoCircle",notification:null};let n=null,a=0,o=!1;function i(){return n&&document.body.contains(n)||(function(){if(o)return;const e=document.createElement("style");e.id="toast-styles",e.textContent='\n @keyframes toast-slide-in {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes toast-slide-out {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(-100%);\n }\n }\n @keyframes toast-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .toast-viewport {\n position: fixed;\n left: 50%;\n top: 5%;\n z-index: 100;\n max-height: 100vh;\n width: fit-content;\n transform: translateX(-50%);\n padding: 1rem;\n max-width: 26rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n pointer-events: none;\n }\n .toast-root {\n pointer-events: auto;\n width: 100%;\n border-radius: 8px;\n position: relative;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n overflow: hidden;\n padding: 0.75rem 1rem;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n .toast-root[data-state="closed"] {\n animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n .toast-icon-spin {\n animation: toast-spin 1s linear infinite;\n }\n ',document.head.appendChild(e),o=!0}(),n=document.createElement("div"),n.className="toast-viewport",n.setAttribute("role","region"),n.setAttribute("aria-label","Notifications"),document.body.appendChild(n)),n}function l(e={}){const{title:o="",description:l="",variant:s="default",duration:c=4e3,onClose:d=null,showClose:u=!0}=e;if(!l&&!o)return console.warn("[Toast] No title or description provided"),{close:function(){},element:null};const p=i(),f=++a,h=function(e){const t={loading:"bg-fill-tertiary-fill-light-gray border-borderColor-border-primary text-typography-primary-text",default:"bg-fill-quarternary-fill-white border-borderColor-border-primary text-typography-primary-text",warning:"bg-warning-surface border-warning-border text-warning-text-base",error:"bg-error-surface border-error-border text-error-text-base",success:"bg-success-surface border-success-border text-success-text-base",info:"bg-info-surface border-info-border text-info-text-base",notification:"bg-fill-quarternary-fill-white border-borderColor-border-primary text-typography-primary-text"};return t[e]||t.default}(s),m=document.createElement("div");m.className=`toast-root border-1/2 ${h}`,m.setAttribute("data-toast-id",f),m.setAttribute("data-state","closed"),m.setAttribute("role","status"),m.setAttribute("aria-live","polite"),m.setAttribute("aria-atomic","true");const g=document.createElement("div");g.className="flex w-full items-center justify-start gap-8";const v=r[s];if(v){const e=document.createElement("div");e.className="flex items-center justify-center "+("loading"===s?"toast-icon-spin":""),e.style.cssText="width: 16px; height: 16px; flex-shrink: 0;",e.innerHTML=t[v],g.appendChild(e)}const y=document.createElement("div");if(y.className="flex-1 text-reg-12",o){const e=document.createElement("div");e.className="text-med-12 mb-4",e.textContent=o,y.appendChild(e)}if(l){const e=document.createElement("div");e.className="text-reg-12",e.textContent=l,y.appendChild(e)}if(g.appendChild(y),u){const e=document.createElement("button");e.type="button",e.className="ml-auto flex items-center justify-center rounded-4 p-4 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none",e.style.cssText="flex-shrink: 0; width: 16px; height: 16px; border: none; background: transparent; opacity: 0.6; cursor: pointer;",e.innerHTML=t.x,e.addEventListener("click",b),g.appendChild(e)}function b(){m.setAttribute("data-state","closed"),setTimeout(()=>{m.parentElement&&m.parentElement.removeChild(m),n&&0===n.children.length&&(n.remove(),n=null),d&&d()},300)}return m.appendChild(g),p.appendChild(m),requestAnimationFrame(()=>{m.setAttribute("data-state","open")}),c>0&&setTimeout(b,c),{close:b,element:m}}function s(e,t="info",r=4e3){return console.log("[Toast] Showing toast:",e,"Type:",t),l({description:e,variant:t,duration:r})}e.Toast={create:l,show:s,success:function(e,t=4e3){return s(e,"success",t)},error:function(e,t=4e3){return s(e,"error",t)},warning:function(e,t=4e3){return s(e,"warning",t)},info:function(e,t=4e3){return s(e,"info",t)},loading:function(e,t=0){return s(e,"loading",t)}}}("undefined"!=typeof window?window:void 0),function(e){const t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',infoCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>',playstationX:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>'},r={default:null,destructive:"playstationX",warning:"alertCircle",error:"playstationX",success:"circleCheck",info:"infoCircle"};function n(e){const t={default:{container:"bg-fill-quarternary-fill-white border-borderColor-border-primary",title:"text-typography-primary-text",description:"text-typography-secondary-text"},destructive:{container:"bg-fill-quarternary-fill-white border-error-border",title:"text-error-text-base",description:"text-error-text-base"},warning:{container:"bg-warning-surface border-warning-border",title:"text-warning-text-base",description:"text-warning-text-base"},error:{container:"bg-error-surface border-error-border",title:"text-error-text-base",description:"text-error-text-base"},success:{container:"bg-success-surface border-success-border",title:"text-success-text-base",description:"text-success-text-base"},info:{container:"bg-info-surface border-info-border",title:"text-info-text-base",description:"text-info-text-base"}};return t[e]||t.default}function a(e={}){const{title:a="",description:o="",variant:i="default",icon:l=null,action:s=null,className:c=""}=e;if(!o&&!a)return console.warn("[Alert] No title or description provided"),null;const d=n(i),u=document.createElement("div");u.setAttribute("data-slot","alert"),u.setAttribute("role","alert");u.className=`flex gap-8 rounded-4 border-1/2 p-8 text-left w-full ${d.container} ${c}`.trim();const p=r[i];if(null!==l||p){const e=document.createElement("div");e.className="flex-shrink-0 flex items-start pt-2",e.style.cssText="width: 16px; height: 16px;",null!==l?"string"==typeof l?e.innerHTML=l:l instanceof HTMLElement&&e.appendChild(l):p&&(e.innerHTML=t[p]),u.appendChild(e)}const f=document.createElement("div");if(f.className="flex-1 flex flex-col gap-4 min-w-0",a){const e=document.createElement("div");e.setAttribute("data-slot","alert-title"),e.className=`text-med-12 ${d.title}`,"string"==typeof a?e.textContent=a:a instanceof HTMLElement&&e.appendChild(a),f.appendChild(e)}if(o){const e=document.createElement("div");e.setAttribute("data-slot","alert-description"),e.className=`text-reg-12 ${d.description}`,"string"==typeof o?e.textContent=o:o instanceof HTMLElement&&e.appendChild(o),f.appendChild(e)}if(u.appendChild(f),null!==s){const e=document.createElement("div");e.setAttribute("data-slot","alert-action"),e.className="flex-shrink-0 flex items-start pt-2",e.style.cssText="margin-left: auto;","string"==typeof s?e.innerHTML=s:s instanceof HTMLElement&&e.appendChild(s),u.appendChild(e)}return u}function o(e,t="default",r={}){return a({description:e,variant:t,...r})}e.Alert={create:a,simple:o,success:function(e,t={}){return o(e,"success",t)},error:function(e,t={}){return o(e,"error",t)},warning:function(e,t={}){return o(e,"warning",t)},info:function(e,t={}){return o(e,"info",t)},destructive:function(e,t={}){return o(e,"destructive",t)},createCloseButton:function(e,r="default"){const a=document.createElement("button");a.type="button";const o=n(r).title;return a.className=`flex items-center justify-center rounded-4 transition-opacity opacity-70 hover:opacity-100 focus:opacity-100 focus:outline-none ${o}`,a.style.cssText="flex-shrink: 0; width: 20px; height: 20px; border: none; background: transparent; cursor: pointer; padding: 2px;",a.innerHTML=t.x,e&&a.addEventListener("click",e),a}}}("undefined"!=typeof window?window:void 0),function(e){var t="inline-flex items-center justify-center whitespace-nowrap !text-med-12 transition-colors disabled:pointer-events-none hover:cursor-pointer h-fit",r={primary:"shadow-soft-extra-small group bg-primary-base border-1/2 border-primary-base text-typography-invert-text hover:bg-primary-hover active:bg-primary-active disabled:opacity-50",outline:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-border-primary text-typography-primary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:opacity-50 disabled:border-fill-secondary-fill-gray",ghost:"group text-typography-primary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:text-typography-quaternary-text",link:"group text-primary-text-base hover:bg-primary-surface active:bg-primary-surface-hover disabled:text-typography-quaternary-text",primaryDestructive:"shadow-soft-extra-small group bg-error-base text-typography-invert-text border-1/2 border-error-base hover:bg-error-hover active:bg-error-active disabled:opacity-50",outlineDestructive:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-error-border text-error-text-base hover:bg-error-surface active:bg-error-surface-hover active:text-error-text-active disabled:opacity-50 disabled:border-fill-secondary-fill-gray disabled:text-typography-quaternary-text",ghostDestructive:"group text-error-text-base hover:bg-error-surface active:bg-error-surface-hover active:text-error-text-active disabled:opacity-50",dashed:"group bg-fill-quarternary-fill-white border border-border-primary border-dashed text-typography-secondary-text hover:bg-fill-tertiary-fill-light-gray active:bg-fill-secondary-fill-gray disabled:opacity-50 disabled:border-fill-secondary-fill-gray",toggleOff:"shadow-soft-extra-small group bg-fill-quarternary-fill-white border-1/2 border-border-primary text-typography-primary-text hover:bg-primary-surface active:bg-primary-surface disabled:opacity-50 disabled:border-fill-secondary-fill-gray",toggleOn:"shadow-soft-extra-small group bg-primary-surface border-1/2 border-border-primary text-primary-text-base hover:bg-primary-surface active:bg-primary-surface disabled:opacity-50 disabled:border-fill-secondary-fill-gray",ghostInline:"group text-typography-primary-text disabled:text-typography-quaternary-text hover:bg-transparent active:bg-transparent !px-0 hover:text-typography-secondary-text",linkInline:"group text-primary-text-base hover:bg-transparent active:bg-transparent disabled:text-typography-quaternary-text !px-0 hover:text-primary-text-active"},n={small:"px-8 py-4 gap-4 rounded-4",medium:"px-12 py-6 gap-4 rounded-4",default:"px-8 py-4 gap-4 rounded-4",large:"px-16 py-8 gap-4 rounded-4"},a="shadow-soft-extra-small",o={small:"box-content size-16 p-4 rounded-4",medium:"box-content size-16 p-6 rounded-4",default:"box-content size-16 p-4 rounded-4",large:"box-content size-16 p-8 rounded-4"},i="flex items-center justify-center disabled:pointer-events-none hover:cursor-pointer";function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function s(e,t){null!=t&&("string"==typeof t?e.insertAdjacentHTML("beforeend",t):(t instanceof HTMLElement||t instanceof Node)&&e.appendChild(t))}var Button={create:function(e){var c=e||{},d=c.variant||"primary",u=c.size||"default",p=!0===c.isShadow,f=c.className||"",h=!0===c.disabled,m=c.type||"button",g=c.label,v=c.text,y=c.innerHTML,b=c.startIcon,x=c.endIcon,w=null!=c.icon,C=c.icon,E=c.onClick,k=document.createElement("button");k.type=m,h&&(k.disabled=!0),g&&k.setAttribute("aria-label",g);var N=null!=r[d]?r[d]:r.primary,S=null!=n[u]?n[u]:n.default;if(w){var A=null!=r[d]?r[d]:r.primary,L=null!=o[u]?o[u]:o.default;k.className=l(t,i,A,L,p?a:"",f),s(k,C)}else{if(k.className=l(t,N,S,p?a:"",f),b){var T=document.createElement("span");T.className="box-content flex size-16 items-center justify-center rounded-4 !p-0",s(T,b),k.appendChild(T)}if(null!=y){var I=document.createElement("span");for(I.innerHTML=y;I.firstChild;)k.appendChild(I.firstChild)}else null!=v&&k.appendChild(document.createTextNode(v));if(x){var M=document.createElement("span");M.className="box-content flex size-16 items-center justify-center rounded-4 !p-0",s(M,x),k.appendChild(M)}}return"function"==typeof E&&k.addEventListener("click",E),k},getButtonClasses:function(e){var s=e||{},c=s.variant||"primary",d=s.size||"default",u=!0===s.isShadow,p=!0===s.iconOnly,f=null!=r[c]?r[c]:r.primary,h=p?null!=o[d]?o[d]:o.default:null!=n[d]?n[d]:n.default,m=p?l(t,i):t;return l(m,f,h,u?a:"")},VARIANTS:r,SIZES:n};"undefined"!=typeof module&&module.exports?module.exports=Button:e.Button=Button}("undefined"!=typeof window?window:void 0),function(e){function t(e={}){const{size:t="medium",color:r="currentColor",text:n=null}=e;let a;switch(t){case"small":a="16px";break;case"medium":a="24px";break;case"large":a="32px";break;default:a=t}const o=document.createElement("div");o.setAttribute("data-spinner","container"),o.className="inline-flex items-center gap-2";const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("width",a),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("fill","none"),i.setAttribute("stroke",r),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.classList.add("animate-spin");const l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("stroke","none"),l.setAttribute("d","M0 0h24v24H0z"),l.setAttribute("fill","none");const s=document.createElementNS("http://www.w3.org/2000/svg","path");if(s.setAttribute("d","M12 3a9 9 0 1 0 9 9"),i.appendChild(l),i.appendChild(s),o.appendChild(i),n){const e=document.createElement("span");e.className="text-sm text-typography-tertiary-text",e.textContent=n,o.appendChild(e)}return o}function r(e={}){const r=t(e);return r.classList.add("flex","justify-center","items-center","p-5"),r}e.Spinner={create:t,createCentered:r,show:function(e,t={}){if(!e)return null;const n=r(t);return e.innerHTML="",e.appendChild(n),n},hide:function(e){if(!e)return;const t=e.querySelector('[data-spinner="container"]');t&&t.remove()}},e.Loader=e.Spinner}("undefined"!=typeof window?window:void 0),function(e){var t={default:"bg-fill-tertiary-fill-light-gray text-typography-primary-text hover:text-typography-secondary-text border-border-primary ",info:"text-info-text-base bg-info-surface-hover border-info-border-base",warning:"text-warning-text-base bg-warning-surface-hover border-warning-border-base",error:"text-error-text-base bg-error-surface-hover border-error-border-base",success:"text-success-text-base bg-success-surface-hover border-success-border-base"},r={small:"px-8 py-2",medium:"px-8 py-6",large:"px-8 py-6"},n={default:"bg-fill-default-fill-gray",primary:"border-none"},a={default:"bg-fill-default-fill-gray",info:"text-info-text-base bg-info-surface-hover border-info-surface-hover",warning:"text-warning-text-base bg-warning-surface-hover border-warning-surface-hover",error:"text-error-text-base bg-error-surface-hover border-error-surface-hover",success:"text-success-text-base bg-success-surface-hover border-success-surface-hover"},o="flex size-16 items-center justify-center";function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Badge={create:function(e){var l=e.variant||"default",s=e.color||"default",c=e.size||"large",d=e.className||"";if(e.icon){var u=document.createElement("div");u.className=i("flex items-center justify-center p-4 text-typography-primary-text bg-fill-default-fill-gray rounded-4 border-1/2 border-border-primary !text-med-12 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n[l]||n.default,a[s]||a.default,d);var p=e.icon;return"string"==typeof p?u.innerHTML=p:p&&1===p.nodeType&&u.appendChild(p),u}var f=document.createElement("div");if(f.className=i("inline-flex items-center gap-4 rounded-4 border-1/2 !text-med-12 transition-colors focus:outline-none",t[s]||t.default,r[c]||r.large,d),e.startIcon){var h=document.createElement("span");h.className=o,"string"==typeof e.startIcon?h.innerHTML=e.startIcon:e.startIcon&&1===e.startIcon.nodeType&&h.appendChild(e.startIcon),f.appendChild(h)}if(void 0!==e.content&&null!==e.content){var m=e.content;"string"==typeof m?f.appendChild(document.createTextNode(m)):m&&1===m.nodeType&&f.appendChild(m)}if(e.endIcon){var g=document.createElement("span");g.className="string"==typeof e.endIcon?o:"flex items-center justify-center shrink-0","string"==typeof e.endIcon?g.innerHTML=e.endIcon:e.endIcon&&1===e.endIcon.nodeType&&g.appendChild(e.endIcon),f.appendChild(g)}return f}},console.log("[Badge] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t={custom:"size-full",large:"size-40 text-reg-14",default:"size-32 text-reg-12",small:"size-20 text-reg-12"},r={circle:"rounded-128",square:"rounded-4"},n={custom:"-space-x-12",large:"-space-x-12",default:"-space-x-4",small:"-space-x-8"},a=[{backgroundColor:"#f8cfcd",textColor:"#550b15"},{backgroundColor:"#fde09b",textColor:"#5f1a05"},{backgroundColor:"#a6eb84",textColor:"#004433"},{backgroundColor:"#c7dcfc",textColor:"#0c2c5b"},{backgroundColor:"#a5dbe2",textColor:"#002a2e"},{backgroundColor:"#82ffd3",textColor:"#00916b"},{backgroundColor:"#8eeee2",textColor:"#016f66"},{backgroundColor:"#f8d5d8",textColor:"#5c0d21"},{backgroundColor:"#fef7be",textColor:"#4a4410"},{backgroundColor:"#f1d4fc",textColor:"#4c0e5f"},{backgroundColor:"#f8d4eb",textColor:"#570e45"},{backgroundColor:"#d9d8fc",textColor:"#2b0c7b"},{backgroundColor:"#d8dcd2",textColor:"#233400"},{backgroundColor:"#dbd6e1",textColor:"#371c51"},{backgroundColor:"#bcfb94",textColor:"#213b0d"},{backgroundColor:"#d4dcfc",textColor:"#190d8a"},{backgroundColor:"#ffd2b1",textColor:"#4a2400"}];function o(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function i(e){if(!e||"string"!=typeof e)return{backgroundColor:"#f4f6f6",textColor:"#292929"};for(var t=e.toLowerCase(),r=0,n=0;n<t.length;n+=1)r=t.charCodeAt(n)+((r<<5)-r);var o=Math.abs(r%a.length);return a[o]}function l(e){var n=e&&e.size||"default",a=e&&e.shape||"circle",i=e&&e.name||"",l=e&&e.image,s=e&&e.className||"",c=document.createElement("div");c.className=o("flex shrink-0 overflow-hidden items-center justify-center bg-primary-base !text-typography-invert-text object-cover",t[n],r[a],s);var d=document.createElement("span");if(d.className="flex h-full w-full items-center justify-center capitalize",d.textContent=i?i.charAt(0).toUpperCase():"?",c.appendChild(d),l){var u=document.createElement("img");u.src=l,u.alt=i||"Avatar",u.className="h-full w-full object-cover",u.setAttribute("referrerpolicy","no-referrer"),u.onerror=function(){u.style.display="none",d.style.display="flex"},u.onload=function(){d.style.display="none"},d.style.display="none",c.appendChild(u)}return c}function s(e){var t=e&&e.name||"",r=l(e),n=i(t);r.style.backgroundColor=n.backgroundColor;var a=r.querySelector("span");return a&&(a.style.color=n.textColor),r}function c(e){var t=e&&e.users||[],r=e&&e.size||"default",a=e&&e.className||"",i=!(!e||!e.vivid),c=document.createElement("div");c.className=o("flex",n[r],a);var d=t.slice(0,3),u=t.length-3;if(d.forEach(function(e){var t=i?s({name:e.name,image:e.image,size:r,shape:"circle"}):l({name:e.name,image:e.image,size:r,shape:"circle"});c.appendChild(t)}),u>0){var p=l({name:"",size:r,shape:"circle"}),f=p.querySelector("span");f&&(f.textContent="+"+u),c.appendChild(p)}return c}e.Avatar={stringToColor:i,create:l,createVivid:s,createGroup:c,createVividGroup:function(e){return c(Object.assign({},e,{vivid:!0}))}},console.log("[Avatar] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t=' xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"',r='<path stroke="none" d="M0 0h24v24H0z" fill="none"/>',n={IconDatabase:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0"/><path d="M4 6v6a8 3 0 0 0 16 0v-6"/><path d="M4 12v6a8 3 0 0 0 16 0v-6"/></svg>',IconUsers:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"/><path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/><path d="M21 21v-2a4 4 0 0 0 -3 -3.85"/></svg>',IconShield:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3"/></svg>',IconLayout:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M4 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M4 13m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M14 4m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/><path d="M14 15m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/></svg>',IconUser:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"/><path d="M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"/></svg>',IconCurrencyDollar:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2"/><path d="M12 3v3m0 12v3"/></svg>',IconPhone:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"/></svg>',IconMessage:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M8 9h8"/><path d="M8 13h6"/><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"/></svg>',IconClock:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/><path d="M12 7v5l4 2"/></svg>',IconMail:"<svg"+t+' stroke-width="1.5">'+r+'<path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10"/><path d="M3 7l9 6l9 -6"/></svg>',IconCircleFilled:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" fill="currentColor"/></svg>'};function a(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function o(e){return null==e||("string"==typeof e&&""===e.trim()||!(!Array.isArray(e)||0!==e.length))}function i(e){if(!e||"string"!=typeof e)return!1;var t=e.trim();if(0===t.length||t.length>4)return!1;var r=t.charCodeAt(0);return r>=127744&&r<=129535||r>=9728&&r<=9983||r>=9984&&r<=10175||65039===r}function l(e){var t=e&&e.iconStr||"",r=e&&e.iconSvg,o=null!=(e&&e.color)?e.color:"neutral",l=e&&e.fallbackIconStr||"IconDatabase",s=!(!e||!e.defaultIcon),c=!(!e||!e.fullSizeIcon),d=e&&e.className||"";if(i(t)){var u=document.createElement("span");return u.className=a("pr-4",d),u.textContent=t,u}var p=r||n[t]||n[l];if(!p&&!s)return null;p||(p=n[l]||n.IconDatabase);var f=document.createElement("span");if(f.className=a("box-content flex size-16 items-center justify-center rounded-4","bg-"+o+"-surface-hover","text-"+o+"-text-base",d),c){var h=document.createElement("span");h.className="size-full flex items-center justify-center",h.innerHTML=p,f.appendChild(h)}else f.innerHTML=p;return f}e.Icon={iconMap:n,create:l,createIconOrColor:function(e){if(!e)return null;if(o(e.start_icon)&&o(e.icon_color))return null;var t=o(e.start_icon)&&!o(e.icon_color),r=e.icon_color||"neutral",n=(e.className||"")+(t?" !bg-transparent text-"+r+"-base":"");return l({iconStr:t?"IconCircleFilled":e.start_icon,color:r,fallbackIconStr:"IconCircleFilled",defaultIcon:!0,className:n.trim()})},isEmoji:i,isFieldValueEmpty:o},console.log("[Icon] Module loaded successfully")}("undefined"!=typeof window?window:void 0),("undefined"!=typeof window?window:void 0).Popover={create:function(e={}){const{trigger:t,content:r="",placement:n="bottom",align:a="start",title:o="",closeOnClickOutside:i=!0,onClose:l=null,onOpen:s=null,bodyClassName:c="",panelClassName:d=""}=e,u="string"==typeof t?document.querySelector(t):t;if(!u)return console.warn("[Popover] Trigger element not found"),{show:m,hide:m,destroy:m,element:null};const p=document.createElement("div");p.className="fixed z-50 pointer-events-none opacity-0 invisible transition-opacity duration-150 ease-out",p.setAttribute("aria-hidden","true");const f=document.createElement("div");if(f.className="relative z-50 rounded-4 bg-fill-quarternary-fill-white text-typography-primary-text shadow-default-medium outline-none border-1/2 border-border-primary min-w-0 pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",f.setAttribute("role","dialog"),f.setAttribute("data-side",n),f.setAttribute("data-state","closed"),f.setAttribute("tabindex","-1"),o){const e=document.createElement("div");e.className="text-semi-14 text-typography-primary-text border-b-1/2 border-border-primary",e.textContent=o,f.appendChild(e)}const h=document.createElement("div");function m(){}function g(){const e=u.getBoundingClientRect(),t=f.getBoundingClientRect();let r=0,o=0;const i="center"===a?(e.width-t.width)/2:"end"===a?e.width-t.width:0,l="center"===a?(e.height-t.height)/2:"end"===a?e.height-t.height:0;switch(n){case"bottom":default:r=e.bottom+8,o=e.left+i;break;case"top":r=e.top-t.height-8,o=e.left+i;break;case"right":r=e.top+l,o=e.right+8;break;case"left":r=e.top+l,o=e.left-t.width-8}o<8&&(o=8),o+t.width>window.innerWidth-8&&(o=window.innerWidth-t.width-8),r<8&&(r=8),r+t.height>window.innerHeight-8&&(r=window.innerHeight-t.height-8),p.style.left="0",p.style.top="0",p.style.transform="translate("+o+"px, "+r+"px)",p.offsetHeight}function v(){f.setAttribute("data-state","closed"),p.classList.add("invisible","opacity-0","pointer-events-none"),p.classList.remove("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","true"),l&&l()}function y(){s&&s();var e=!p.parentNode;e&&document.body.appendChild(p),e?requestAnimationFrame(function(){g(),p.classList.remove("invisible","opacity-0","pointer-events-none"),p.classList.add("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","false"),requestAnimationFrame(function(){requestAnimationFrame(function(){f.setAttribute("data-state","open")})})}):(g(),p.classList.remove("invisible","opacity-0","pointer-events-none"),p.classList.add("visible","opacity-100","pointer-events-auto"),p.setAttribute("aria-hidden","false"),requestAnimationFrame(function(){requestAnimationFrame(function(){f.setAttribute("data-state","open")})}))}function b(e){e.stopPropagation(),p.classList.contains("visible")?v():y()}function x(e){!p.classList.contains("visible")||p.contains(e.target)||u.contains(e.target)||v()}function w(e){"Escape"===e.key&&p.classList.contains("visible")&&v()}return h.className=c||"text-reg-14 text-typography-secondary-text leading-5 [&_p]:mb-2 [&_p:last-child]:mb-0",d&&(f.className=f.className+" "+d),"string"==typeof r?h.innerHTML=r:r instanceof HTMLElement&&h.appendChild(r),f.appendChild(h),p.appendChild(f),u.addEventListener("click",b),i&&document.addEventListener("click",x),document.addEventListener("keydown",w),{show:y,hide:v,destroy:function(){v(),p.parentNode&&p.parentNode.removeChild(p),i&&document.removeEventListener("click",x),u.removeEventListener("click",b),document.removeEventListener("keydown",w)},setContent(e){h.innerHTML="","string"==typeof e?h.innerHTML=e:e instanceof HTMLElement&&h.appendChild(e)},element:p,panel:f}}},function(e){function t(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Select={create:function(e){var n=e.fieldId,a=e.options||[],o=e.placeholder||"Select an option",i=e.onChange,l=e.variant||"default",s=e.size||"default",c=!!e.canClear,d=e.onClear,u=!0===e.disabled,p=void 0!==e.value&&null!==e.value?e.value:"",f=a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p}),h=f?f.label||f.name||f.display_name||f.value:o,m=document.createElement("div");m.className="custom-select relative w-full group",m.setAttribute("data-field-id",n);var g=document.createElement("span");g.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var v=document.createElement("button");v.type="button",v.className=t(l,s,u,!p,c&&!!p&&!u),v.disabled=u,v.setAttribute("aria-haspopup","listbox"),v.setAttribute("aria-expanded","false"),v.setAttribute("aria-label",o);var y=document.createElement("div");y.className="truncate text-inherit",y.textContent=h,v.appendChild(y);var b=document.createElement("span");b.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",b.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',b.setAttribute("aria-hidden","true"),("inline"!==l||!p)&&v.appendChild(b),g.appendChild(v);var x=document.createElement("button");function w(){x&&(x.style.display=c&&p&&!u?"":"none")}x.type="button",x.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",x.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',x.setAttribute("aria-label","Clear selection"),x.style.display=c&&p&&!u?"":"none",x.addEventListener("click",function(e){e.stopPropagation(),p="",a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p}),y.textContent=o,v.className=t(l,s,u,!0,!1);var r="inline"!==l||!p;r&&!b.parentNode?v.appendChild(b):!r&&b.parentNode&&b.parentNode.removeChild(b),w(),M(),d&&d(),i&&i("")}),g.appendChild(x),m.appendChild(g);var C=document.createElement("div");C.setAttribute("role","listbox");var E="custom-select-content absolute left-0 right-0 z-50 max-h-[200px] min-w-[8rem] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ";C.className=E+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0";var k=document.createElement("div");if(k.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",0===a.length){var N=document.createElement("div");N.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",N.textContent="No options available",k.appendChild(N)}else a.forEach(function(e){var t=void 0!==e.value&&null!==e.value?e.value:e.slug||e.id,n=e.label||e.name||e.display_name||e.value,a=t===p,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",a),o.className=r("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex items-center gap-8 flex-1 truncate",i.textContent=n,o.appendChild(i),o.addEventListener("click",function(e){e.stopPropagation(),u||q(t)}),o.addEventListener("mouseenter",function(){u||_(o)}),k.appendChild(o)});C.appendChild(k),m.appendChild(C);var S=!1,A=-1;function L(){var e,t,r,n,a;u||(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==m){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),S=!0,m.classList.add("open"),v.setAttribute("aria-expanded","true"),e=p,(t=k.querySelector('[data-value="'+e+'"]'))&&(_(t),j(t)),r=v.getBoundingClientRect(),n=window.innerHeight-r.bottom,a=r.top,C.className=n<200&&a>n?E+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":E+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0")}function T(){S=!1,m.classList.remove("open"),v.setAttribute("aria-expanded","false"),A=-1}function I(){var e=document.querySelectorAll(".custom-select.open, .record-select.open");Array.from(e).some(function(e){return e!==m})?L():S?T():L()}function M(){k.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=t===String(p)||"false"===t&&!1===p||"true"===t&&!0===p;e.setAttribute("aria-selected",!!r),e.classList.remove("bg-primary-surface","hover:!bg-primary-surface-hover"),e.classList.add("hover:bg-fill-tertiary-fill-light-gray"),r?(e.classList.add("bg-primary-surface","hover:!bg-primary-surface-hover"),e.classList.remove("hover:bg-fill-tertiary-fill-light-gray")):e.classList.remove("bg-primary-surface","hover:!bg-primary-surface-hover")})}function q(e){var r=a.find(function(t){return(void 0!==t.value&&null!==t.value?t.value:t.slug||t.id)===e});if(r){p=e,y.textContent=r.label||r.name||r.display_name||r.value,v.className=t(l,s,u,!1,c&&!!p&&!u);var n="inline"!==l||!p;n&&!b.parentNode?v.appendChild(b):!n&&b.parentNode&&b.parentNode.removeChild(b),w(),M(),T(),i&&i(e)}}function _(e){k.querySelectorAll("[role=option]").forEach(function(e){e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),A=Array.from(k.children).indexOf(e)}function j(e){if(e){var t=C.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=C.scrollTop,o=a+t.height;r<a?C.scrollTop=r-8:n>o&&(C.scrollTop=n-t.height+8)}}function D(e){var t=Array.from(k.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){(A+=e)<0?A=t.length-1:A>=t.length&&(A=0);var r=t[A];_(r),j(r)}}return v.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),I()}),v.addEventListener("keydown",function(e){if(!u)switch(e.key){case"Enter":case" ":e.preventDefault(),I();break;case"ArrowDown":e.preventDefault(),S?D(1):L();break;case"ArrowUp":e.preventDefault(),S?D(-1):L();break;case"Escape":S&&(e.preventDefault(),T())}}),document.addEventListener("click",function(e){S&&!m.contains(e.target)&&T()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&S&&T()}),m.updateValue=function(e){p=null!=e?e:"";var r=a.find(function(e){return(void 0!==e.value&&null!==e.value?e.value:e.slug||e.id)===p});y.textContent=r?r.label||r.name||r.display_name||r.value:o,v.className=t(l,s,u,!p,c&&!!p&&!u);var n="inline"!==l||!p;n&&!b.parentNode?v.appendChild(b):!n&&b.parentNode&&b.parentNode.removeChild(b),w(),M()},m.updateOptions=function(e){if(a.length=0,a.push.apply(a,e),k.innerHTML="",0===e.length){var t=document.createElement("div");return t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",t.textContent="No options available",void k.appendChild(t)}e.forEach(function(e){var t=void 0!==e.value&&null!==e.value?e.value:e.slug||e.id,n=e.label||e.name||e.display_name||e.value,a=t===p,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",a),o.className=r("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex items-center gap-8 flex-1 truncate",i.textContent=n,o.appendChild(i),o.addEventListener("click",function(){u||q(t)}),o.addEventListener("mouseenter",function(){u||_(o)}),k.appendChild(o)})},m.setDisabled=function(e){u=!!e,v.disabled=u,v.className=t(l,s,u,!p,c&&!!p&&!u),w(),u&&S&&T()},m}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function r(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}e.EnumSelect={create:function(n){var a=n.fieldId,o=n.objectSlug,i=n.columnSlug,l=n.placeholder||"Select an option",s=n.onChange,c=n.variant||"default",d=n.size||"default",u=!!n.canClear,p=n.onClear,f=n.currentRecordData||{},h=n.showSearch,m=n.onLoad,g=n.onError,v=!0===n.disabled,y=void 0!==n.value&&null!==n.value?n.value:"",b=[],x=null,w=null,C="",E=null,k=!(!e.Popover||"function"!=typeof e.Popover.create),N=!1,S=document.createElement("div");S.className="enum-select relative w-full group",S.setAttribute("data-field-id",a);var A=document.createElement("span");A.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var L=document.createElement("button");L.type="button",L.className=r(c,d,v,!y,u&&!!y&&!v),L.disabled=v,L.setAttribute("aria-haspopup","listbox"),L.setAttribute("aria-expanded","false"),L.setAttribute("aria-label",l);var T=document.createElement("div");T.className="truncate text-inherit",T.textContent=l,L.appendChild(T);var I=document.createElement("span");I.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",I.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',I.setAttribute("aria-hidden","true"),("inline"!==c||!y)&&L.appendChild(I),A.appendChild(L);var M=document.createElement("button");function q(){M&&(M.style.display=u&&y&&!v?"":"none")}M.type="button",M.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",M.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',M.setAttribute("aria-label","Clear selection"),M.style.display=u&&y&&!v?"":"none",M.addEventListener("click",function(e){e.stopPropagation(),y="",T.textContent=l,L.className=r(c,d,v,!0,!1);var t="inline"!==c||!y;t&&!I.parentNode?L.appendChild(I):!t&&I.parentNode&&I.parentNode.removeChild(I),q(),$(),p&&p(),s&&s("")}),A.appendChild(M),S.appendChild(A);var _=document.createElement("div");_.setAttribute("role","listbox");var j="w-full min-w-[200px]";j+=k?" max-h-[30vh] overflow-hidden flex flex-col":" absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium border-1/2 border-border-primary opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0 flex flex-col",_.className=j;var D=document.createElement("div");D.className="py-2 border-b-1/2 border-border-primary hidden";var F=null,z=null;if(e.InputComponent&&"function"==typeof e.InputComponent.create){var U=(F=e.InputComponent.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Search...",value:"",startIcon:t,className:"!border-0 !p-0",onInput:function(){C=F.getValue().trim(),$()}})).getInput();U&&(U.setAttribute("aria-label","Search options"),U.addEventListener("click",function(e){e.stopPropagation()}),z=U),D.appendChild(F)}else{var O=document.createElement("div");O.className="flex items-center gap-8";var P=document.createElement("span");P.className="shrink-0 text-typography-tertiary-text",P.innerHTML=t,O.appendChild(P);var B=document.createElement("input");B.type="text",B.placeholder="Search...",B.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",B.addEventListener("input",function(e){C=e.target.value.trim(),$()}),B.addEventListener("click",function(e){e.stopPropagation()}),z=B,O.appendChild(B),D.appendChild(O)}var H=document.createElement("div");H.className="overflow-y-auto max-h-[30vh] p-2 w-full rounded-4 bg-fill-quarternary-fill-white flex-1 min-h-0",_.appendChild(D),_.appendChild(H),k||S.appendChild(_);var R=-1;function V(e){H.innerHTML="";var t=document.createElement("div");t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-error-text",t.textContent=e||"Error loading options",H.appendChild(t)}function $(){H.innerHTML="";var t=function(){if(!C.trim())return b;var e=C.toLowerCase();return b.filter(function(t){var r=t.display_name.toLowerCase().includes(e),n=String(t.slug||"").toLowerCase().includes(e);return r||n})}(),n=void 0!==h?h:b.length>10;if(D.className=n?"p-8 border-b-1/2 border-border-primary ":"p-8 hidden",0===t.length){var a=document.createElement("div");return a.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",a.textContent=C.trim()?"No options found":"No options available",void H.appendChild(a)}t.forEach(function(t){var n=t.slug||t.display_name,a=t.display_name,o=n===y,i=0===t.is_active||!1===t.is_active,l=document.createElement("div");l.setAttribute("role","option"),l.setAttribute("data-value",n),l.setAttribute("aria-selected",o),l.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",o?"bg-primary-surface hover:!bg-primary-surface-hover":"");var p=document.createElement("span");p.className="flex items-center gap-8 flex-1 truncate";var f=document.createElement("span");f.textContent=a;var h=t.badge_config;if(h&&(h.icon_color||h.start_icon)){var m=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}();if(m&&"function"==typeof m.createIconOrColor){var g=m.createIconOrColor({start_icon:h.start_icon,icon_color:h.icon_color,className:(h.class_name||"")+" shrink-0"});g&&p.appendChild(g)}}if(p.appendChild(f),l.appendChild(p),i){var b=document.createElement("span");b.className="ml-8 px-6 py-2 text-xs rounded-2 bg-info-surface-hover text-info-text-base border-1/2 border-info-border-base",b.textContent="Archived",l.appendChild(b)}l.addEventListener("click",function(e){e.stopPropagation(),v||function(e,t){y=e,T.textContent=t,L.className=r(c,d,v,!1,u&&!!y&&!v);var n="inline"!==c||!y;n&&!I.parentNode?L.appendChild(I):!n&&I.parentNode&&I.parentNode.removeChild(I);q(),$(),W(),s&&s(e)}(n,a)}),l.addEventListener("mouseenter",function(){v||Z(l)}),H.appendChild(l)})}function Y(){if(!v){if(E)return document.querySelectorAll(".enum-select, .custom-select, .record-select").forEach(function(e){e!==S&&e.popoverInstance&&e.popoverInstance.hide()}),E.show(),L.setAttribute("aria-expanded","true"),J(y),void(z&&setTimeout(function(){z.focus()},50));document.querySelectorAll(".enum-select.open").forEach(function(e){if(e!==S){e.classList.remove("open");var t=e.querySelector("button");t&&t.setAttribute("aria-expanded","false")}}),N=!0,S.classList.add("open"),L.setAttribute("aria-expanded","true"),J(y),z&&setTimeout(function(){z.focus()},50)}}function W(){E?E.hide():(N=!1,S.classList.remove("open")),L.setAttribute("aria-expanded","false"),R=-1,G(),$()}function K(){(E?E.element&&E.element.classList.contains("visible"):N)?W():Y()}function G(){C="",F?F.setValue(""):z&&(z.value="")}function Z(e){H.querySelectorAll("[role=option]").forEach(function(e){e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),R=Array.from(H.children).indexOf(e)}function J(e){var t=H.querySelector('[data-value="'+e+'"]');t&&(Z(t),Q(t))}function Q(e){if(e){var t=H.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=H.scrollTop,o=a+t.height;r<a?H.scrollTop=r-8:n>o&&(H.scrollTop=n-t.height+8)}}function X(e){var t=Array.from(H.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){(R+=e)<0?R=t.length-1:R>=t.length&&(R=0);var r=t[R];Z(r),Q(r)}}function ee(){var t=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}();if(!t||"function"==typeof t.isAvailable&&!t.isAvailable())return V(w="SuperLeap SDK not initialized"),void(g&&g(w));!function(){H.innerHTML="";var e=document.createElement("div");e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="Loading options...",H.appendChild(e)}();var n="function"==typeof t.getSdk?t.getSdk():null;if(!n)return V(w="Failed to get SDK instance"),void(g&&g(w));n.model(o).getField(i).then(function(e){if(!e)throw new Error("Field '"+i+"' not found in object '"+o+"'");if(x=e,!e.enumGroup||!e.enumGroup.values)throw new Error("Field '"+i+"' does not have enum options");var t=e.enumGroup,n=t.values||[];if(x.is_dependent_field&&t.properties&&t.properties.parent_column_slug){var a=t.properties.parent_column_slug,s=f[a];if(!s)return b=[],l="Select "+a+" first",void $();b=n.filter(function(e){return!!e.dependent_enum_slugs&&(Array.isArray(s)?s.some(function(t){return e.dependent_enum_slugs.includes(t)}):e.dependent_enum_slugs.includes(s))})}else b=n.filter(function(e){return 1===e.is_active||!0===e.is_active||e.slug===y});if(b.sort(function(e,t){return(void 0!==e.rank&&null!==e.rank?e.rank:999999)-(void 0!==t.rank&&null!==t.rank?t.rank:999999)}),$(),y){var p=b.find(function(e){return e.slug===y});if(p){T.textContent=p.display_name,L.className=r(c,d,v,!1,u&&!!y&&!v);var h="inline"!==c||!y;h&&!I.parentNode?L.appendChild(I):!h&&I.parentNode&&I.parentNode.removeChild(I),q()}}m&&m(b)}).catch(function(e){w=e.message||"Failed to load options",console.error("EnumSelect error:",w),V(w),g&&g(w)})}return L.addEventListener("keydown",function(e){if(!v){var t=E&&E.element&&E.element.classList.contains("visible");switch(e.key){case"Enter":case" ":e.preventDefault(),K();break;case"ArrowDown":e.preventDefault(),t?X(1):Y();break;case"ArrowUp":e.preventDefault(),t?X(-1):Y();break;case"Escape":t&&(e.preventDefault(),W())}}}),function(){if(k){E=e.Popover.create({trigger:L,content:_,placement:"bottom",align:"start",closeOnClickOutside:!0,onClose:function(){L.setAttribute("aria-expanded","false"),I.style.transform="",R=-1,G(),$()},onOpen:function(){L.setAttribute("aria-expanded","true"),I.style.transform="rotate(180deg)"},bodyClassName:"p-0 overflow-hidden",panelClassName:"min-w-[var(--trigger-width)] overflow-hidden"}),S.popoverInstance=E;var t=L.offsetWidth;E.panel&&(E.panel.style.setProperty("--trigger-width",t+"px"),E.panel.style.minWidth=t+"px")}}(),ee(),k||(L.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),v||K()}),document.addEventListener("click",function(e){N&&!S.contains(e.target)&&W()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&N&&W()})),S.updateValue=function(e){y=null!=e?e:"";var t=b.find(function(e){return e.slug===y});T.textContent=t?t.display_name:l,L.className=r(c,d,v,!y,u&&!!y&&!v);var n="inline"!==c||!y;n&&!I.parentNode?L.appendChild(I):!n&&I.parentNode&&I.parentNode.removeChild(I),q(),$()},S.updateRecordData=function(e){f=e||{},ee()},S.setDisabled=function(e){v=!!e,L.disabled=v,L.className=r(c,d,v,!y,u&&!!y&&!v),q();var t=E&&E.element&&E.element.classList.contains("visible");v&&(t||N)&&W()},S.reload=function(){ee()},S.getOptions=function(){return b},S.getColumnData=function(){return x},S.destroy=function(){E&&E.destroy()},S}}}("undefined"!=typeof window?window:void 0),function(e){var t=e.Popover,r=e.InputComponent,n=e.Spinner,a="user",o={team:{iconStr:"IconUsers",color:"primary"},role:{iconStr:"IconShield",color:"info"},iframe:{iconStr:"IconLayout",color:"neutral"},lead:{iconStr:"IconUser",color:"primary"},opportunity:{iconStr:"IconCurrencyDollar",color:"success"},call_log:{iconStr:"IconPhone",color:"info"},communication:{iconStr:"IconMessage",color:"primary"},history_field:{iconStr:"IconClock",color:"neutral"},email:{iconStr:"IconMail",color:"info"}},i='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function l(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white text-typography-primary-text !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":"")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}function s(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}function c(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Avatar");if(t)return t}return e.Avatar}function d(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}function u(e,t){var r="neutral",n="IconDatabase";if(t&&t.properties&&t.properties.icon_data){var a=t.properties.icon_data;"string"==typeof a.color&&a.color&&(r=a.color),"string"==typeof a.icon&&a.icon&&(n=a.icon)}return t&&t.properties&&t.properties.icon_data&&t.properties.icon_data.icon||(o[e]?(n=o[e].iconStr,o[e].color&&(r=o[e].color)):(n="IconDatabase",r="neutral")),{iconStr:n,color:r||"neutral"}}e.RecordSelect={create:function(e){var o=e.fieldId,p=e.objectSlug,f=e.objectSchema||null,h=e.placeholder||"Select a record",m=e.searchPlaceholder||"Search "+(p||"")+"...",g=e.onChange,v=e.variant||"default",y=e.size||"default",b=!!e.canClear,x=null!=e.initialLimit?e.initialLimit:50,w=!0===e.disabled,C=void 0!==e.value&&null!==e.value?e.value:"";if(!p){var E=document.createElement("div");return E.className="text-reg-13 text-typography-quaternary-text",E.textContent="Record select: objectSlug is required.",E}var k=document.createElement("div");k.className="record-select relative w-full group",k.setAttribute("data-field-id",o),k.setAttribute("data-object-slug",p);var N=null,S=[],A=[],L=!1,T="",I=null,M=t&&"function"==typeof t.create,q=null,_=!0,j=1,D=!1,F="record-select-content min-w-[8rem] ";M||(F+="absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ");var z=document.createElement("span");z.className="select-trigger-wrapper relative flex w-full items-center justify-between gap-8";var U=document.createElement("button");U.type="button",U.className=l(v,y,w,!C,b&&!!C&&!w),U.disabled=w,U.setAttribute("aria-haspopup","listbox"),U.setAttribute("aria-expanded","false"),U.setAttribute("aria-label",h),U.classList.add("record-select-trigger");var O=document.createElement("div");O.className="record-select-trigger-content flex items-center gap-8 flex-1 min-w-0";var P=document.createElement("span");P.className="record-select-trigger-icon shrink-0 hidden",O.appendChild(P);var B=document.createElement("div");B.className="truncate text-inherit record-select-value",B.textContent=h,O.appendChild(B),U.appendChild(O);var H=document.createElement("span");H.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",H.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',H.setAttribute("aria-hidden","true"),U.appendChild(H),z.appendChild(U);var R=null;b&&((R=document.createElement("button")).type="button",R.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none record-select-clear",R.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',R.setAttribute("aria-label","Clear selection"),R.addEventListener("click",function(e){e.stopPropagation(),X(""),g&&g("")}),z.appendChild(R)),k.appendChild(z);var V=document.createElement("div");V.setAttribute("role","listbox"),V.className=F+(M?"max-h-[30vh] overflow-hidden flex flex-col":"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0");var $,Y=document.createElement("div");Y.className="py-8 border-b-1/2 border-border-primary";var W=null;if(r&&"function"==typeof r.create){var K=(W=r.create({variant:"borderless",inputSize:"small",type:"text",placeholder:m,value:"",startIcon:i,className:"!border-0 !p-0",onInput:function(){(T=W.getValue().trim())?ce():se()}})).getInput();K&&K.setAttribute("aria-label","Search records"),$=K,Y.appendChild(W)}else{var G=document.createElement("div");G.className="flex items-center gap-8 px-12";var Z=document.createElement("span");Z.className="shrink-0 text-typography-tertiary-text",Z.innerHTML=i,G.appendChild(Z);var J=document.createElement("input");J.type="text",J.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",J.placeholder=m,J.setAttribute("aria-label","Search records"),$=J,G.appendChild(J),Y.appendChild(G)}V.appendChild(Y);var Q=document.createElement("div");function X(e){N=null,(C=null!=e?e:"")?re():ee()}function ee(){if(N)if(B.textContent=N.name||N.label||C,U.classList.remove("placeholder"),U.className=l(v,y,w,!1,b&&!!C&&!w),P.className="record-select-trigger-icon shrink-0 flex items-center justify-center size-20 rounded-4 overflow-hidden",P.innerHTML="",p===a){var e=c();if(e&&"function"==typeof e.createVivid){var t=e.createVivid({name:N.name||N.label||"",size:"small",shape:"circle"});P.appendChild(t)}else r=N.name||N.label,n=r&&String(r).charAt(0).toUpperCase()||"?",(o=document.createElement("div")).className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold",o.textContent=n,P.appendChild(o)}else!function(){var e=d();if(!e||"function"!=typeof e.create)return;var t=u(p,f),r=e.create({iconStr:t.iconStr,color:t.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});r&&P.appendChild(r)}();else B.textContent=h,U.classList.add("placeholder"),U.className=l(v,y,w,!0,b&&!!C&&!w),P.className="record-select-trigger-icon shrink-0 hidden",P.innerHTML="";var r,n,o;R&&(R.style.display=b&&C&&!w?"":"none")}function te(e,t,r){var n=s();if(!n||"function"!=typeof n.getSdk)return Promise.resolve({records:[],hasMore:!1});var a=n.getSdk();if(!a)return Promise.resolve({records:[],hasMore:!1});var o=a.model(p),i=t||x,l=r?(r-1)*i:0;try{if(o&&"function"==typeof o.select){var c=o.select.apply(o,["id","name"]);e&&e.trim()&&(c=c.filterBy({or:[{field:"name",operator:"contains",value:e.trim()},{field:"id",operator:"eq",value:e.trim()}]}));var d=["name"];return"account"===p&&d.push("-ParentId"),c.limit(i).offset(l).orderBy.apply(c,d).cache({ttl:12e4}).then(function(e){var t=e.map(function(e){var t=e.toJSON?e.toJSON():e;return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id}});return{records:t,hasMore:t.length>=i}})}}catch(e){console.error("[RecordSelect] fetchRecords error:",e)}return Promise.resolve({records:[],hasMore:!1})}function re(){if(C){var e=s();if(e&&"function"==typeof e.getSdk){var t=e.getSdk();if(t)t.model(p).select("id","name").where({id:C}).limit(1).first().then(function(e){if(e){var t=e.toJSON?e.toJSON():e;N={id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id}}ee()}).catch(function(){N={id:C,value:C,name:C,label:C},ee()});else ee()}else ee()}else ee()}function ne(){Q.innerHTML="";var e=document.createElement("div");if(e.className="flex flex-row items-center justify-center gap-8 py-12 px-12 w-full text-reg-12 text-typography-quaternary-text record-select-loading",n&&"function"==typeof n.create)e.appendChild(n.create({size:"small",text:"Loading..."}));else{var t=document.createElement("span");t.textContent="Loading...",e.appendChild(t)}Q.appendChild(e)}function ae(){var e=Q.querySelector(".record-select-loading-more");e&&e.remove();var t=document.createElement("div");if(t.className="flex flex-row items-center justify-center gap-8 py-8 px-12 w-full text-reg-12 text-typography-quaternary-text record-select-loading-more",n&&"function"==typeof n.create)t.appendChild(n.create({size:"small"}));else{var r=document.createElement("span");r.textContent="Loading more...",t.appendChild(r)}Q.appendChild(t)}function oe(){var e=Q.querySelector(".record-select-loading-more");e&&e.remove()}function ie(e){Q.innerHTML="";var t=document.createElement("div");t.className="w-full justify-center px-12 py-6 text-center text-reg-12 text-typography-quaternary-text record-select-empty",t.textContent=e||"No records found",Q.appendChild(t)}function le(){Q.querySelectorAll("[role=option]").forEach(function(e){e.remove()}),Q.querySelectorAll(".record-select-loading, .record-select-empty").forEach(function(e){e.remove()}),A.forEach(function(e){var t=e.id||e.value,r=e.name||e.label||e.value,n=t===C,o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",n),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");if(i.className="flex items-center gap-8 flex-1 truncate",p===a){var l=c();if(l&&"function"==typeof l.createVivid){var s=l.createVivid({name:r||"",size:"small",shape:"circle"});i.appendChild(s)}else{(y=document.createElement("span")).className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold shrink-0",y.textContent=(r||"?").charAt(0).toUpperCase(),i.appendChild(y)}}else{var h=d();if(h&&"function"==typeof h.create){var m=u(p,f),v=h.create({iconStr:m.iconStr,color:m.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});v&&i.appendChild(v)}else{var y;(y=document.createElement("span")).className="size-20 rounded-4 flex items-center justify-center shrink-0 bg-neutral-surface-hover text-neutral-text-base",y.textContent="?",i.appendChild(y)}}var b=document.createElement("span");b.textContent=r,i.appendChild(b),o.appendChild(i),o.addEventListener("click",function(r){r.stopPropagation(),w||(C=t,N=e,ee(),ue(),g&&g(C,e))}),Q.appendChild(o)}),D&&ae()}function se(){ne(),j=1,_=!0,te(T,x,1).then(function(e){if(S=e.records,A=e.records,_=e.hasMore,e.records.length,j=1,C&&!e.records.some(function(e){return(e.id||e.value)===C}))re();else if(C&&e.records.length){var t=e.records.find(function(e){return(e.id||e.value)===C});t&&(N=t),ee()}0===A.length?ie(T?"No results found":"No records available"):le()}).catch(function(){ie("Failed to load records"),_=!1})}function ce(){I&&clearTimeout(I),I=setTimeout(function(){I=null,ne(),j=1,_=!0,te(T,x,1).then(function(e){S=e.records,A=e.records,_=e.hasMore,e.records.length,0===e.records.length?ie("No results found"):le()}).catch(function(){ie("Search failed"),_=!1})},500)}function de(){w||(M&&q?q.show():(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==k){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),L=!0,k.classList.add("open"),U.setAttribute("aria-expanded","true"),T="",W?W.setValue(""):$&&($.value=""),se(),setTimeout(function(){$&&$.focus()},0),function(){if(M)return;var e=U.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;V.className=t<200&&r>t?F+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":F+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0"}()))}function ue(){M&&q?q.hide():(L=!1,k.classList.remove("open"),U.setAttribute("aria-expanded","false"),T="",W?W.setValue(""):$&&($.value=""),I&&(clearTimeout(I),I=null))}return Q.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white record-select-options",Q.addEventListener("scroll",function(){if(!D&&_){var e=Q.scrollHeight;Q.scrollTop+Q.clientHeight>=e-50&&function(){if(D||!_)return;D=!0,j+=1,ae(),te(T,x,j).then(function(e){D=!1,oe(),e.records.length>0?(S=S.concat(e.records),A=A.concat(e.records),e.records.length,_=e.hasMore,le()):_=!1}).catch(function(e){console.error("[RecordSelect] loadMoreRecords error:",e),D=!1,oe(),_=!1})}()}}),V.appendChild(Q),M||k.appendChild(V),M&&(q=t.create({trigger:U,content:V,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0 overflow-hidden",panelClassName:"max-h-[30vh] overflow-hidden",onOpen:function(){w?q.hide():(document.querySelectorAll(".custom-select.open, .record-select.open").forEach(function(e){if(e!==k){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger");t&&t.setAttribute("aria-expanded","false")}}),L=!0,k.classList.add("open"),U.setAttribute("aria-expanded","true"),T="",W?W.setValue(""):$&&($.value=""),V.style.minWidth=U.offsetWidth+"px",se(),setTimeout(function(){$&&$.focus()},0))},onClose:function(){L=!1,k.classList.remove("open"),U.setAttribute("aria-expanded","false"),T="",W?W.setValue(""):$&&($.value=""),I&&(clearTimeout(I),I=null)}})),R&&(R.style.display=b&&C&&!w?"":"none"),!W&&$&&$.addEventListener("input",function(){(T=this.value.trim())?ce():se()}),$&&$.addEventListener("keydown",function(e){e.stopPropagation()}),M&&q?U.addEventListener("keydown",function(e){w||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L?q.hide():q.show())}):(U.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),L?ue():de()}),U.addEventListener("keydown",function(e){w||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L?ue():de()),"Escape"===e.key&&L&&(e.preventDefault(),ue()))}),document.addEventListener("click",function(e){L&&!k.contains(e.target)&&ue()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&L&&ue()})),k.updateValue=function(e){X(e)},k.setDisabled=function(e){w=!!e,U.disabled=w,U.className=l(v,y,w,!C,b&&!!C&&!w),w&&L&&ue()},C?re():ee(),k}}}("undefined"!=typeof window?window:void 0),function(e){function t(e,t,r,n){var a={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},o={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(a[e]||a.default)+" "+(o[t]||o.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}e.MultiSelect={create:function(e){var r=e.fieldId,n=e.options||[],a=e.placeholder||"Select options",o=e.label||"selected",i=e.onValuesChange,l=e.variant||"default",s=e.size||"default",c=!0===e.disabled,d=Array.isArray(e.value)?e.value.slice():Array.isArray(e.values)?e.values.slice():[],u=document.createElement("div");u.className="custom-multiselect relative w-full group",r&&u.setAttribute("data-field-id",r);var p=document.createElement("span");p.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var f=document.createElement("button");f.type="button",f.className=t(l,s,c,0===d.length),f.disabled=c,f.setAttribute("aria-haspopup","listbox"),f.setAttribute("aria-expanded","false"),f.setAttribute("aria-multiselectable","true"),f.setAttribute("aria-label",a);var h=document.createElement("div");function m(){if(h.innerHTML="",0===d.length){var e=document.createElement("span");e.className="text-inherit",e.textContent=a,h.appendChild(e)}else{var t=document.createElement("span");t.className="text-inherit",t.textContent=d.length+" "+o,h.appendChild(t)}}h.className="flex flex-1 items-center gap-6 truncate text-left text-inherit",m(),f.appendChild(h);var g=document.createElement("span");g.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",g.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',g.setAttribute("aria-hidden","true"),f.appendChild(g),p.appendChild(f),u.appendChild(p);var v=document.createElement("div");v.setAttribute("role","listbox"),v.setAttribute("aria-multiselectable","true"),v.className="custom-multiselect-content absolute left-0 right-0 z-50 max-h-[200px] min-w-[8rem] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0";var y=document.createElement("div");function b(e){return d.some(function(t){return t===e||String(t)===String(e)})}function x(){y.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=d.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)})}function w(){if(y.innerHTML="",0===n.length){var e=document.createElement("div");return e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="No options available",void y.appendChild(e)}n.forEach(function(e){var r=function(e){return void 0!==e.value&&null!==e.value?e.value:e.slug||e.id}(e),n=function(e){return e.label||e.name||e.display_name||e.value}(e),a=b(r),o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",r),o.setAttribute("aria-selected",a),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",a?"bg-primary-surface hover:!bg-primary-surface-hover":"");var u=document.createElement("span");u.className="flex items-center gap-8 flex-1 truncate",u.textContent=n,o.appendChild(u);var p=document.createElement("span");p.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",p.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',p.style.visibility=a?"visible":"hidden",o.appendChild(p),o.addEventListener("click",function(e){e.stopPropagation(),c||function(e){var r=d.findIndex(function(t){return t===e||String(t)===String(e)});r>=0?d.splice(r,1):d.push(e),m(),f.className=t(l,s,c,0===d.length),x(),i&&i(d.slice())}(r)}),o.addEventListener("mouseenter",function(){c||(y.querySelectorAll("[role=option]").forEach(function(e){e===o||b(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),o.classList.contains("bg-primary-surface")||o.classList.add("bg-fill-tertiary-fill-light-gray"))}),y.appendChild(o)})}y.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",w(),v.appendChild(y),u.appendChild(v);var C=!1;function E(){c||(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open").forEach(function(e){if(e!==u){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button");t&&t.setAttribute("aria-expanded","false")}}),C=!0,u.classList.add("open"),f.setAttribute("aria-expanded","true"))}function k(){C=!1,u.classList.remove("open"),f.setAttribute("aria-expanded","false")}function N(){C?k():E()}return f.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),N()}),f.addEventListener("keydown",function(e){if(!c)switch(e.key){case"Enter":case" ":e.preventDefault(),N();break;case"ArrowDown":case"ArrowUp":e.preventDefault(),C||E();break;case"Escape":C&&(e.preventDefault(),k())}}),document.addEventListener("click",function(e){C&&!u.contains(e.target)&&k()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&C&&k()}),u.updateValues=function(e){d=Array.isArray(e)?e.slice():[],m(),w(),x()},u.updateOptions=function(e){n.length=0,n.push.apply(n,e||[]),w(),x()},u.setDisabled=function(e){c=!!e,f.disabled=c,f.className=t(l,s,c,0===d.length),c&&C&&k()},u.getValues=function(){return d.slice()},u}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function r(e,t,r,n,a){var o={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},i={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(o[e]||o.default)+" "+(i[t]||i.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")+(a?" pr-24":"")}e.EnumMultiSelect={create:function(n){var a=n.fieldId,o=n.objectSlug,i=n.columnSlug,l=n.placeholder||"Select options",s=n.label||"selected",c=n.onChange,d=n.variant||"default",u=n.size||"default",p=!!n.canClear,f=n.onClear,h=n.currentRecordData||{},m=n.showSearch,g=n.onLoad,v=n.onError,y=!0===n.disabled,b=Array.isArray(n.value)?n.value.slice():Array.isArray(n.values)?n.values.slice():[],x=[],w=null,C=null,E="",k=null,N=!(!e.Popover||"function"!=typeof e.Popover.create),S=!1,A=document.createElement("div");A.className="enum-multiselect relative w-full group",A.setAttribute("data-field-id",a);var L=document.createElement("span");L.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var T=document.createElement("button");T.type="button",T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y),T.disabled=y,T.setAttribute("aria-haspopup","listbox"),T.setAttribute("aria-expanded","false"),T.setAttribute("aria-multiselectable","true"),T.setAttribute("aria-label",l);var I=document.createElement("div");function M(){if(I.innerHTML="",0===b.length){var e=document.createElement("span");e.className="text-inherit",e.textContent=l,I.appendChild(e)}else{var t=document.createElement("span");t.className="text-inherit",t.textContent=b.length+" "+s,I.appendChild(t)}}I.className="flex flex-1 items-center gap-6 truncate text-left text-inherit",M(),T.appendChild(I);var q=document.createElement("span");q.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",q.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',q.setAttribute("aria-hidden","true"),("inline"!==d||0===b.length)&&T.appendChild(q),L.appendChild(T);var _=document.createElement("button");function j(){_&&(_.style.display=p&&b.length>0&&!y?"":"none")}_.type="button",_.className="rounded-full absolute right-12 top-1/2 -translate-y-1/2 bg-transparent p-0 text-typography-tertiary-text hover:text-typography-secondary-text focus:outline-none",_.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></svg>',_.setAttribute("aria-label","Clear selection"),_.style.display=p&&b.length>0&&!y?"":"none",_.addEventListener("click",function(e){e.stopPropagation(),b=[],M(),T.className=r(d,u,y,!0,!1);var t="inline"!==d||0===b.length;t&&!q.parentNode?T.appendChild(q):!t&&q.parentNode&&q.parentNode.removeChild(q),j(),K(),f&&f(),c&&c([])}),L.appendChild(_),A.appendChild(L);var D=document.createElement("div");D.setAttribute("role","listbox"),D.setAttribute("aria-multiselectable","true");var F="w-full min-w-[200px]";F+=N?" max-h-[30vh] overflow-hidden flex flex-col":" absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium border-1/2 border-border-primary opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible top-full mt-1 -translate-y-1 group-[.open]:translate-y-0 flex flex-col",D.className=F;var z=document.createElement("div");z.className="py-2 border-b-1/2 border-border-primary hidden";var U=null,O=null;if(e.InputComponent&&"function"==typeof e.InputComponent.create){var P=(U=e.InputComponent.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Search...",value:"",startIcon:t,className:"!border-0 !p-0",onInput:function(){E=U.getValue().trim(),G()}})).getInput();P&&(P.setAttribute("aria-label","Search options"),P.addEventListener("click",function(e){e.stopPropagation()}),O=P),z.appendChild(U)}else{var B=document.createElement("div");B.className="flex items-center gap-8";var H=document.createElement("span");H.className="shrink-0 text-typography-tertiary-text",H.innerHTML=t,B.appendChild(H);var R=document.createElement("input");R.type="text",R.placeholder="Search...",R.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",R.addEventListener("input",function(e){E=e.target.value.trim(),G()}),R.addEventListener("click",function(e){e.stopPropagation()}),O=R,B.appendChild(R),z.appendChild(B)}var V=document.createElement("div");V.className="overflow-y-auto max-h-[30vh] p-2 w-full rounded-4 bg-fill-quarternary-fill-white flex-1 min-h-0",D.appendChild(z),D.appendChild(V),N||A.appendChild(D);var $=-1;function Y(e){V.innerHTML="";var t=document.createElement("div");t.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-error-text",t.textContent=e||"Error loading options",V.appendChild(t)}function W(e){return b.some(function(t){return t===e||String(t)===String(e)})}function K(){V.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=b.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)})}function G(){V.innerHTML="";var t=function(){if(!E.trim())return x;var e=E.toLowerCase();return x.filter(function(t){var r=t.display_name.toLowerCase().includes(e),n=String(t.slug||"").toLowerCase().includes(e);return r||n})}(),n=void 0!==m?m:x.length>10;if(z.className=n?"p-8 border-b-1/2 border-border-primary ":"p-8 hidden",0===t.length){var a=document.createElement("div");return a.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",a.textContent=E.trim()?"No options found":"No options available",void V.appendChild(a)}t.forEach(function(t){var n=t.slug||t.display_name,a=t.display_name,o=W(n),i=0===t.is_active||!1===t.is_active,l=document.createElement("div");l.setAttribute("role","option"),l.setAttribute("data-value",n),l.setAttribute("aria-selected",o),l.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",o?"bg-primary-surface hover:!bg-primary-surface-hover":"");var s=document.createElement("span");s.className="flex items-center gap-8 flex-1 truncate";var f=t.badge_config;if(f&&(f.icon_color||f.start_icon)){var h=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}();if(h&&"function"==typeof h.createIconOrColor){var m=h.createIconOrColor({start_icon:f.start_icon,icon_color:f.icon_color,className:(f.class_name||"")+" shrink-0"});m&&s.appendChild(m)}}var g=document.createElement("span");if(g.textContent=a,s.appendChild(g),l.appendChild(s),i){var v=document.createElement("span");v.className="ml-8 px-6 py-2 text-xs rounded-2 bg-info-surface-hover text-info-text-base border-1/2 border-info-border-base",v.textContent="Archived",l.appendChild(v)}var x=document.createElement("span");x.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",x.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',x.style.visibility=o?"visible":"hidden",l.appendChild(x),l.addEventListener("click",function(e){e.stopPropagation(),y||function(e){var t=b.findIndex(function(t){return t===e||String(t)===String(e)});t>=0?b.splice(t,1):b.push(e),M(),T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y);var n="inline"!==d||0===b.length;n&&!q.parentNode?T.appendChild(q):!n&&q.parentNode&&q.parentNode.removeChild(q),j(),K(),c&&c(b.slice())}(n)}),l.addEventListener("mouseenter",function(){y||ee(l)}),V.appendChild(l)})}function Z(){if(!y){if(k)return document.querySelectorAll(".enum-select, .enum-multiselect, .custom-select, .record-select, .custom-multiselect").forEach(function(e){e!==A&&e.popoverInstance&&e.popoverInstance.hide()}),k.show(),T.setAttribute("aria-expanded","true"),void(O&&setTimeout(function(){O.focus()},50));document.querySelectorAll(".enum-multiselect.open, .enum-select.open").forEach(function(e){if(e!==A){e.classList.remove("open");var t=e.querySelector("button");t&&t.setAttribute("aria-expanded","false")}}),S=!0,A.classList.add("open"),T.setAttribute("aria-expanded","true"),O&&setTimeout(function(){O.focus()},50)}}function J(){k?k.hide():(S=!1,A.classList.remove("open")),T.setAttribute("aria-expanded","false"),$=-1,X(),G()}function Q(){(k?k.element&&k.element.classList.contains("visible"):S)?J():Z()}function X(){E="",U?U.setValue(""):O&&(O.value="")}function ee(e){V.querySelectorAll("[role=option]").forEach(function(e){W(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),e.classList.contains("bg-primary-surface")||e.classList.add("bg-fill-tertiary-fill-light-gray"),$=Array.from(V.children).indexOf(e)}function te(e){var t=Array.from(V.children).filter(function(e){return"option"===e.getAttribute("role")});if(0!==t.length){($+=e)<0?$=t.length-1:$>=t.length&&($=0);var r=t[$];ee(r),function(e){if(e){var t=V.getBoundingClientRect(),r=e.offsetTop,n=r+e.offsetHeight,a=V.scrollTop,o=a+t.height;r<a?V.scrollTop=r-8:n>o&&(V.scrollTop=n-t.height+8)}}(r)}}function re(){var t=function(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}();if(!t||"function"==typeof t.isAvailable&&!t.isAvailable())return Y(C="SuperLeap SDK not initialized"),void(v&&v(C));!function(){V.innerHTML="";var e=document.createElement("div");e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="Loading options...",V.appendChild(e)}();var n="function"==typeof t.getSdk?t.getSdk():null;if(!n)return Y(C="Failed to get SDK instance"),void(v&&v(C));n.model(o).getField(i).then(function(e){if(!e)throw new Error("Field '"+i+"' not found in object '"+o+"'");if(w=e,!e.enumGroup||!e.enumGroup.values)throw new Error("Field '"+i+"' does not have enum options");var t=e.enumGroup,n=t.values||[];if(w.is_dependent_field&&t.properties&&t.properties.parent_column_slug){var a=t.properties.parent_column_slug,s=h[a];if(!s)return x=[],l="Select "+a+" first",void G();x=n.filter(function(e){return!!e.dependent_enum_slugs&&(Array.isArray(s)?s.some(function(t){return e.dependent_enum_slugs.includes(t)}):e.dependent_enum_slugs.includes(s))})}else x=n.filter(function(e){return 1===e.is_active||!0===e.is_active||b.includes(e.slug)});if(x.sort(function(e,t){return(void 0!==e.rank&&null!==e.rank?e.rank:999999)-(void 0!==t.rank&&null!==t.rank?t.rank:999999)}),G(),b.length>0){M(),T.className=r(d,u,y,!1,p&&b.length>0&&!y);var c="inline"!==d||0===b.length;c&&!q.parentNode?T.appendChild(q):!c&&q.parentNode&&q.parentNode.removeChild(q),j()}g&&g(x)}).catch(function(e){C=e.message||"Failed to load options",console.error("EnumMultiSelect error:",C),Y(C),v&&v(C)})}return T.addEventListener("keydown",function(e){if(!y){var t=k&&k.element&&k.element.classList.contains("visible");switch(e.key){case"Enter":case" ":e.preventDefault(),Q();break;case"ArrowDown":e.preventDefault(),t?te(1):Z();break;case"ArrowUp":e.preventDefault(),t?te(-1):Z();break;case"Escape":t&&(e.preventDefault(),J())}}}),function(){if(N){k=e.Popover.create({trigger:T,content:D,placement:"bottom",align:"start",closeOnClickOutside:!0,onClose:function(){T.setAttribute("aria-expanded","false"),q.style.transform="",$=-1,X(),G()},onOpen:function(){T.setAttribute("aria-expanded","true"),q.style.transform="rotate(180deg)"},bodyClassName:"p-0 overflow-hidden",panelClassName:"min-w-[var(--trigger-width)] overflow-hidden"}),A.popoverInstance=k;var t=T.offsetWidth;k.panel&&(k.panel.style.setProperty("--trigger-width",t+"px"),k.panel.style.minWidth=t+"px")}}(),re(),N||(T.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),y||Q()}),document.addEventListener("click",function(e){S&&!A.contains(e.target)&&J()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&S&&J()})),A.updateValues=function(e){b=Array.isArray(e)?e.slice():[],M(),T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y);var t="inline"!==d||0===b.length;t&&!q.parentNode?T.appendChild(q):!t&&q.parentNode&&q.parentNode.removeChild(q),j(),K()},A.updateRecordData=function(e){h=e||{},re()},A.setDisabled=function(e){y=!!e,T.disabled=y,T.className=r(d,u,y,0===b.length,p&&b.length>0&&!y),j();var t=k&&k.element&&k.element.classList.contains("visible");y&&(t||S)&&J()},A.reload=function(){re()},A.getValues=function(){return b.slice()},A.getOptions=function(){return x},A.getColumnData=function(){return w},A.destroy=function(){k&&k.destroy()},A}}}("undefined"!=typeof window?window:void 0),function(e){var t=e.Popover,r=e.InputComponent,n=e.Spinner,a="user",o={team:{iconStr:"IconUsers",color:"primary"},role:{iconStr:"IconShield",color:"info"},iframe:{iconStr:"IconLayout",color:"neutral"},lead:{iconStr:"IconUser",color:"primary"},opportunity:{iconStr:"IconCurrencyDollar",color:"success"},call_log:{iconStr:"IconPhone",color:"info"},communication:{iconStr:"IconMessage",color:"primary"},history_field:{iconStr:"IconClock",color:"neutral"},email:{iconStr:"IconMail",color:"info"}},i='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>';function l(e,t,r,n){var a={default:"border-border-primary hover:border-primary-border focus:border-1/2 focus:border-primary-border",error:"border-error-border hover:border-error-border-hover focus:border-1/2 focus:border-error-border-hover",warning:"border-warning-border hover:border-warning-border-hover focus:border-1/2 focus:border-warning-border-hover",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"focus:border-transparent border border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray hover:border-transparent"},o={default:"px-12 py-6",large:"px-12 py-8",small:"px-8 py-4"};return"w-full items-center justify-between rounded-4 border-1/2 bg-fill-quarternary-fill-white !text-reg-13 focus:outline-none flex h-full truncate hover:cursor-pointer "+(a[e]||a.default)+" "+(o[t]||o.default)+(n?" text-typography-quaternary-text":" text-typography-primary-text")+(r?" pointer-events-none cursor-not-allowed bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}function s(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("superleapClient");if(t)return t}return e.superleapClient}function c(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Avatar");if(t)return t}return e.Avatar}function d(){if(e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var t=e.FlowUI._getComponent("Icon");if(t)return t}return e.Icon}function u(e,t){var r="neutral",n="IconDatabase";if(t&&t.properties&&t.properties.icon_data){var a=t.properties.icon_data;"string"==typeof a.color&&a.color&&(r=a.color),"string"==typeof a.icon&&a.icon&&(n=a.icon)}return t&&t.properties&&t.properties.icon_data&&t.properties.icon_data.icon||(o[e]?(n=o[e].iconStr,o[e].color&&(r=o[e].color)):(n="IconDatabase",r="neutral")),{iconStr:n,color:r||"neutral"}}e.RecordMultiSelect={create:function(e){var o=e.fieldId,p=e.objectSlug,f=e.objectSchema||null,h=e.placeholder||"Select records",m=e.searchPlaceholder||"Search "+(p||"")+"...",g=e.label||"selected",v=e.onValuesChange,y=e.variant||"default",b=e.size||"default",x=null!=e.initialLimit?e.initialLimit:50,w=e.displayFields||[],C=!0===e.disabled,E=Array.isArray(e.value)?e.value.slice():Array.isArray(e.values)?e.values.slice():[];if(!p){var k=document.createElement("div");return k.className="text-reg-13 text-typography-quaternary-text",k.textContent="Record multiselect: objectSlug is required.",k}var N=document.createElement("div");N.className="record-multiselect relative w-full group",N.setAttribute("data-field-id",o),N.setAttribute("data-object-slug",p);var S=[],A=[],L=[],T=!1,I="",M=null,q=t&&"function"==typeof t.create,_=null,j=!0,D=1,F=!1,z="record-multiselect-content min-w-[8rem] ";q||(z+="absolute left-0 right-0 z-50 max-h-[30vh] overflow-hidden rounded-4 bg-fill-quarternary-fill-white shadow-default-medium opacity-0 invisible transition-all duration-150 ease-out group-[.open]:opacity-100 group-[.open]:visible ");var U=document.createElement("span");U.className="multiselect-trigger-wrapper relative flex w-full items-center justify-between gap-8";var O=document.createElement("button");O.type="button",O.className=l(y,b,C,0===E.length),O.disabled=C,O.setAttribute("aria-haspopup","listbox"),O.setAttribute("aria-expanded","false"),O.setAttribute("aria-multiselectable","true"),O.setAttribute("aria-label",h),O.classList.add("record-multiselect-trigger");var P=document.createElement("div");P.className="record-multiselect-trigger-content flex items-center gap-8 flex-1 min-w-0";var B=document.createElement("span");B.className="record-multiselect-trigger-icon shrink-0 hidden",P.appendChild(B);var H=document.createElement("div");function R(){if(H.textContent=0===E.length?h:E.length+" "+g,B.innerHTML="",0===E.length)B.className="record-multiselect-trigger-icon shrink-0 hidden";else if(B.className="record-multiselect-trigger-icon shrink-0 flex items-center justify-center size-20 rounded-4 overflow-hidden",p===a){var e=c();if(e&&"function"==typeof e.createVivid){var t=S.length>0?S[0]:null,r=t&&(t.name||t.label),n=e.createVivid({name:r||"?",size:"small",shape:"circle"});B.appendChild(n)}else!function(e){var t=e&&String(e).charAt(0).toUpperCase()||"?",r=document.createElement("div");r.className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold",r.textContent=t,B.appendChild(r)}(S.length>0&&(S[0].name||S[0].label))}else!function(){var e=d();if(e&&"function"==typeof e.create){var t=u(p,f),r=e.create({iconStr:t.iconStr,color:t.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});r&&B.appendChild(r)}}()}H.className="truncate text-inherit record-multiselect-value",P.appendChild(H),R(),O.appendChild(P);var V=document.createElement("span");V.className="ml-4 box-content flex size-16 items-center justify-center shrink-0 transition-transform duration-200 group-[.open]:rotate-180",V.innerHTML='<svg width="16" height="16" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',V.setAttribute("aria-hidden","true"),O.appendChild(V),U.appendChild(O),N.appendChild(U);var $=document.createElement("div");$.setAttribute("role","listbox"),$.setAttribute("aria-multiselectable","true"),$.className=z+(q?"max-h-[30vh] overflow-hidden flex flex-col":"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0");var Y,W=document.createElement("div");W.className="p-8 pb-4 border-b-1/2 border-border-primary ";var K=null;if(r&&"function"==typeof r.create){var G=(K=r.create({variant:"borderless",inputSize:"small",type:"text",placeholder:m,value:"",startIcon:i,className:"!border-0 !p-0",onInput:function(){(I=K.getValue().trim())?de():ce()}})).getInput();G&&G.setAttribute("aria-label","Search records"),Y=G,W.appendChild(K)}else{var Z=document.createElement("div");Z.className="flex items-center gap-8";var J=document.createElement("span");J.className="shrink-0 text-typography-tertiary-text",J.innerHTML=i,Z.appendChild(J);var Q=document.createElement("input");Q.type="text",Q.className="w-full bg-transparent text-reg-13 text-typography-primary-text placeholder:text-typography-quaternary-text focus:outline-none border-none",Q.placeholder=m,Q.setAttribute("aria-label","Search records"),Y=Q,Z.appendChild(Q),W.appendChild(Z)}$.appendChild(W);var X=document.createElement("div");function ee(e){return E.some(function(t){return t===e||String(t)===String(e)})}function te(e){var t=E.findIndex(function(t){return t===e||String(t)===String(e)});if(t>=0)E.splice(t,1),S=S.filter(function(t){return(t.id||t.value)!==e});else{E.push(e);var r=A.find(function(t){return(t.id||t.value)===e});r&&S.push(r)}R(),O.className=l(y,b,C,0===E.length),X.querySelectorAll("[role=option]").forEach(function(e){var t=e.getAttribute("data-value"),r=E.some(function(e){return e===t||String(e)===t||"false"===t&&!1===e||"true"===t&&!0===e});e.setAttribute("aria-selected",r);var n=e.querySelector(".multiselect-option-check");n&&(n.style.visibility=r?"visible":"hidden"),e.classList.toggle("bg-primary-surface",r),e.classList.toggle("hover:!bg-primary-surface-hover",r),e.classList.toggle("hover:bg-fill-tertiary-fill-light-gray",!r)}),v&&v(E.slice(),S.slice())}function re(e,t,r){var n=s();if(!n||"function"!=typeof n.getSdk)return Promise.resolve({records:[],hasMore:!1});var a=n.getSdk();if(!a)return Promise.resolve({records:[],hasMore:!1});var o=a.model(p),i=["id","name"].concat(w||[]),l=t||x,c=r?(r-1)*l:0;try{if(o&&"function"==typeof o.select){var d=o.select.apply(o,i);e&&e.trim()&&(d=d.filterBy({or:[{field:"name",operator:"contains",value:e.trim()},{field:"id",operator:"eq",value:e.trim()}]}));var u=["name"];return"account"===p&&u.push("-ParentId"),d.limit(l).offset(c).orderBy.apply(d,u).cache({ttl:12e4}).then(function(e){var t=e.map(function(e){var t=e.toJSON?e.toJSON():e,r=t.icon||t.logo||t.icon_url||t.Icon__c||t.Logo__c||null,n=w?w.map(function(e){return t[e]||""}):[];return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id,icon:r,displayLabels:n}});return{records:t,hasMore:t.length>=l}})}}catch(e){console.error("[RecordMultiSelect] fetchRecords error:",e)}return Promise.resolve({records:[],hasMore:!1})}function ne(){if(E&&0!==E.length){var e=s();if(e&&"function"==typeof e.getSdk){var t=e.getSdk();if(t){var r=t.model(p),n=["id","name"].concat(w||[]);r.select.apply(r,n).filterBy({and:[{field:"id",operator:"in",value:E}]}).limit(E.length).then(function(e){S=e.map(function(e){var t=e.toJSON?e.toJSON():e,r=t.icon||t.logo||t.icon_url||t.Icon__c||t.Logo__c||null,n=w?w.map(function(e){return t[e]||""}):[];return{id:t.id,value:t.id,name:t.name||t.id,label:t.name||t.id,icon:r,displayLabels:n}}),R()}).catch(function(){S=E.map(function(e){return{id:e,value:e,name:e,label:e,icon:null,displayLabels:[]}}),R()})}else R()}else R()}else R()}function ae(){X.innerHTML="";var e=document.createElement("div");if(e.className="flex flex-row items-center justify-center gap-8 py-12 px-12 w-full text-reg-12 text-typography-quaternary-text record-multiselect-loading",n&&"function"==typeof n.create)e.appendChild(n.create({size:"small",text:"Loading..."}));else{var t=document.createElement("span");t.textContent="Loading...",e.appendChild(t)}X.appendChild(e)}function oe(){var e=X.querySelector(".record-multiselect-loading-more");e&&e.remove();var t=document.createElement("div");if(t.className="flex flex-row items-center justify-center gap-8 py-8 px-12 w-full text-reg-12 text-typography-quaternary-text record-multiselect-loading-more",n&&"function"==typeof n.create)t.appendChild(n.create({size:"small"}));else{var r=document.createElement("span");r.textContent="Loading more...",t.appendChild(r)}X.appendChild(t)}function ie(){var e=X.querySelector(".record-multiselect-loading-more");e&&e.remove()}function le(e){X.innerHTML="";var t=document.createElement("div");t.className="w-full justify-center px-12 py-6 text-center text-reg-12 text-typography-quaternary-text record-multiselect-empty",t.textContent=e||"No records found",X.appendChild(t)}function se(){X.querySelectorAll("[role=option]").forEach(function(e){e.remove()}),X.querySelectorAll(".record-multiselect-loading, .record-multiselect-empty").forEach(function(e){e.remove()}),L.forEach(function(e){var t=e.id||e.value,r=e.name||e.label||e.value,n=ee(t),o=document.createElement("div");o.setAttribute("role","option"),o.setAttribute("data-value",t),o.setAttribute("aria-selected",n),o.className=function(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}("relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":"");var i=document.createElement("span");i.className="flex flex-col flex-1 truncate min-w-0";var l=document.createElement("div");if(l.className="flex items-center gap-8 truncate",p===a){var s=c();if(s&&"function"==typeof s.createVivid){var h=s.createVivid({name:r||"",size:"small",shape:"circle"});l.appendChild(h)}else{var m=document.createElement("span");m.className="size-20 rounded-full bg-primary-surface text-primary-text flex items-center justify-center text-reg-12 font-semibold shrink-0",m.textContent=(r||"?").charAt(0).toUpperCase(),l.appendChild(m)}}else{var g=d();if(g&&"function"==typeof g.create){var v=u(p,f),y=g.create({iconStr:v.iconStr,color:v.color,fallbackIconStr:"IconDatabase",defaultIcon:!0,className:"size-20 shrink-0"});y&&l.appendChild(y)}else{var b=document.createElement("span");b.className="size-20 rounded-4 flex items-center justify-center shrink-0 bg-neutral-surface-hover text-neutral-text-base",b.textContent="?",l.appendChild(b)}}var x=document.createElement("span");if(x.className="truncate",x.textContent=r,l.appendChild(x),i.appendChild(l),e.displayLabels&&e.displayLabels.length>0&&e.displayLabels.some(function(e){return e})){var w=document.createElement("div");w.className="flex items-center gap-4 truncate text-reg-10 text-typography-tertiary-text mt-2 ml-28",e.displayLabels.forEach(function(t,r){if(t){var n=document.createElement("span");if(n.className="truncate",n.textContent=t,w.appendChild(n),r<e.displayLabels.length-1&&e.displayLabels[r+1]){var a=document.createElement("span");a.textContent=" • ",w.appendChild(a)}}}),i.appendChild(w)}o.appendChild(i);var E=document.createElement("span");E.className="multiselect-option-check ml-auto flex size-14 shrink-0 items-center justify-center",E.innerHTML='<svg width="14" height="14" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.41574 12.2442 3.41574 12.5331 3.72684C12.822 4.03795 12.822 4.53753 12.5331 4.84863L6.81767 10.6736C6.52329 10.9901 6.05308 10.9901 5.7587 10.6736L2.46685 7.3463C2.17795 7.03519 2.17795 6.53561 2.46685 6.2245C2.75575 5.9134 3.24395 5.9134 3.53285 6.2245L6.28822 9.05351L11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"/></svg>',E.style.visibility=n?"visible":"hidden",o.appendChild(E),o.addEventListener("click",function(e){e.stopPropagation(),C||te(t)}),o.addEventListener("mouseenter",function(){C||(X.querySelectorAll("[role=option]").forEach(function(e){e===o||ee(e.getAttribute("data-value"))||e.classList.remove("bg-fill-tertiary-fill-light-gray")}),o.classList.contains("bg-primary-surface")||o.classList.add("bg-fill-tertiary-fill-light-gray"))}),X.appendChild(o)}),F&&oe()}function ce(){ae(),D=1,j=!0,re(I,x,1).then(function(e){A=e.records,L=e.records,j=e.hasMore,e.records.length,D=1,0===L.length?le(I?"No results found":"No records available"):se()}).catch(function(){le("Failed to load records"),j=!1})}function de(){M&&clearTimeout(M),M=setTimeout(function(){M=null,ae(),D=1,j=!0,re(I,x,1).then(function(e){A=e.records,L=e.records,j=e.hasMore,e.records.length,0===e.records.length?le("No results found"):se()}).catch(function(){le("Search failed"),j=!1})},500)}function ue(){C||(q&&_?_.show():(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open, .record-multiselect.open").forEach(function(e){if(e!==N){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button, .record-multiselect-trigger");t&&t.setAttribute("aria-expanded","false")}}),T=!0,N.classList.add("open"),O.setAttribute("aria-expanded","true"),I="",K?K.setValue(""):Y&&(Y.value=""),ce(),setTimeout(function(){Y&&Y.focus()},0),function(){if(q)return;var e=O.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;$.className=t<200&&r>t?z+"bottom-full mb-1 translate-y-1 group-[.open]:translate-y-0":z+"top-full mt-1 -translate-y-1 group-[.open]:translate-y-0"}()))}function pe(){q&&_?_.hide():(T=!1,N.classList.remove("open"),O.setAttribute("aria-expanded","false"),I="",K?K.setValue(""):Y&&(Y.value=""),M&&(clearTimeout(M),M=null))}return X.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white record-multiselect-options",X.addEventListener("scroll",function(){if(!F&&j){var e=X.scrollHeight;X.scrollTop+X.clientHeight>=e-50&&function(){if(F||!j)return;F=!0,D+=1,oe(),re(I,x,D).then(function(e){F=!1,ie(),e.records.length>0?(A=A.concat(e.records),L=L.concat(e.records),e.records.length,j=e.hasMore,se()):j=!1}).catch(function(e){console.error("[RecordMultiSelect] loadMoreRecords error:",e),F=!1,ie(),j=!1})}()}}),$.appendChild(X),q||N.appendChild($),q&&(_=t.create({trigger:O,content:$,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0 overflow-hidden",panelClassName:"max-h-[30vh] overflow-hidden",onOpen:function(){C?_.hide():(document.querySelectorAll(".custom-select.open, .record-select.open, .custom-multiselect.open, .record-multiselect.open").forEach(function(e){if(e!==N){e.classList.remove("open");var t=e.querySelector("button, .custom-select-trigger, .record-select-trigger, .multiselect-trigger-wrapper button, .record-multiselect-trigger");t&&t.setAttribute("aria-expanded","false")}}),T=!0,N.classList.add("open"),O.setAttribute("aria-expanded","true"),I="",K?K.setValue(""):Y&&(Y.value=""),$.style.minWidth=O.offsetWidth+"px",ce(),setTimeout(function(){Y&&Y.focus()},0))},onClose:function(){T=!1,N.classList.remove("open"),O.setAttribute("aria-expanded","false"),I="",K?K.setValue(""):Y&&(Y.value=""),M&&(clearTimeout(M),M=null)}})),!K&&Y&&Y.addEventListener("input",function(){(I=this.value.trim())?de():ce()}),Y&&Y.addEventListener("keydown",function(e){e.stopPropagation()}),q&&_?O.addEventListener("keydown",function(e){C||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T?_.hide():_.show())}):(O.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),T?pe():ue()}),O.addEventListener("keydown",function(e){C||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T?pe():ue()),"Escape"===e.key&&T&&(e.preventDefault(),pe()))}),document.addEventListener("click",function(e){T&&!N.contains(e.target)&&pe()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&T&&pe()})),N.updateValues=function(e){E=Array.isArray(e)?e.slice():[],ne()},N.setDisabled=function(e){C=!!e,O.disabled=C,O.className=l(y,b,C,0===E.length),C&&T&&pe()},N.getValues=function(){return E.slice()},N.getSelectedRecords=function(){return S.slice()},E&&E.length>0?ne():R(),N}}}("undefined"!=typeof window?window:void 0),function(e){var t={alertCircle:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',circleCheck:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',eye:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>',eyeOff:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.16 13.16 0 0 0 2 12s3 7 10 7a9.9 9.9 0 0 0 5.39-1.61"/><line x1="2" y1="2" x2="22" y2="22"/></svg>',lock:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>'},r={base:"group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out",default:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",password:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent focus:bg-fill-tertiary-fill-light-gray focus-within:bg-fill-tertiary-fill-light-gray",sizeDefault:"px-12 py-6",sizeLarge:"px-12 py-8",sizeSmall:"px-12 py-4",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"},n="w-full bg-inherit text-start outline-none placeholder:text-typography-quaternary-text focus:bg-inherit hover:bg-inherit focus-visible:outline-none disabled:cursor-not-allowed disabled:text-typography-quaternary-text file:rounded-4 file:border-none file:text-typography-primary-text file:shadow-none file:outline-none",a="transition-all focus:bg-fill-tertiary-fill-light-gray group-hover:bg-fill-tertiary-fill-light-gray",o={default:"flex items-center justify-center rounded-4 size-16 text-typography-quaternary-text shrink-0",error:"flex items-center justify-center rounded-4 size-16 text-error-base shrink-0",warning:"flex items-center justify-center rounded-4 size-16 text-warning-base shrink-0",success:"flex items-center justify-center rounded-4 size-16 text-primary-base shrink-0",password:"flex items-center justify-center rounded-4 size-16 text-primary-base hover:cursor-pointer shrink-0"};function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.InputComponent={create:function(e){var l=e.variant||"default",s=e.inputSize||"default",c=e.type||"text",d=!!e.disabled,u=!!e.readOnly,p=!1!==e.showReadOnlyIcon,f="password"===c,h=document.createElement("div");if(h.className=i(r.base,r[l]||r.default,"large"===s?r.sizeLarge:"small"===s?r.sizeSmall:r.sizeDefault,d?r.disabled:"",e.className||""),h.setAttribute("data-input-variant",l),e.prefixNode){var m=document.createElement("span");m.className="shrink-0","string"==typeof e.prefixNode?m.innerHTML=e.prefixNode:m.appendChild(e.prefixNode),h.appendChild(m)}if(e.startIcon&&"inline"!==l){var g=document.createElement("span");g.className=o[l]||o.default,"string"==typeof e.startIcon?g.innerHTML=e.startIcon:g.appendChild(e.startIcon),h.appendChild(g)}var v=document.createElement("input");v.type=f?"text":c,v.autocomplete="off",null!=e.placeholder&&(v.placeholder=e.placeholder),null!=e.value&&(v.value=e.value),e.name&&(v.name=e.name),e.id&&(v.id=e.id),v.disabled=d,v.readOnly=u,v.className=i("!text-reg-13",n,"inline"===l?a:"",e.rootClassName||"");var y=!1;if(f&&(v.type="password",v.setAttribute("data-password-masked","true")),h.appendChild(v),"inline"!==l){if("error"===l){var b=document.createElement("span");b.className=o.error,b.innerHTML=t.alertCircle,b.setAttribute("aria-hidden","true"),h.appendChild(b)}else if("warning"===l){var x=document.createElement("span");x.className=o.warning,x.innerHTML=t.alertCircle,x.setAttribute("aria-hidden","true"),h.appendChild(x)}else if("success"===l){var w=document.createElement("span");w.className=o.success,w.innerHTML=t.circleCheck,w.setAttribute("aria-hidden","true"),h.appendChild(w)}if("password"===l&&f){var C=document.createElement("span");C.className=o.password,C.setAttribute("role","button"),C.setAttribute("tabindex","0"),C.setAttribute("aria-label","Toggle password visibility"),C.innerHTML=y?t.eyeOff:t.eye,C.addEventListener("click",function(){d||(y=!y,v.type=y?"text":"password",v.setAttribute("data-password-masked",y?"false":"true"),C.innerHTML=y?t.eyeOff:t.eye)}),C.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C.click())}),h.appendChild(C)}if(u&&p){var E=document.createElement("span");E.className=i(o.default,"text-typography-quaternary-text"),E.innerHTML=t.lock,E.setAttribute("aria-hidden","true"),h.appendChild(E)}if((!l||"default"===l||"borderless"===l)&&e.endIcon){var k=document.createElement("span");k.className=o.default,"string"==typeof e.endIcon?k.innerHTML=e.endIcon:k.appendChild(e.endIcon),h.appendChild(k)}}return e.onChange&&v.addEventListener("change",e.onChange),e.onInput&&v.addEventListener("input",e.onInput),e.onFocus&&v.addEventListener("focus",e.onFocus),e.onBlur&&v.addEventListener("blur",e.onBlur),h.getInput=function(){return v},h.setValue=function(e){v.value=e},h.getValue=function(){return v.value},h.setVariant=function(t){l=t,h.setAttribute("data-input-variant",t),h.className=i(r.base,r[l]||r.default,"large"===s?r.sizeLarge:"small"===s?r.sizeSmall:r.sizeDefault,d?r.disabled:"",e.className||"")},h.setDisabled=function(e){d=!!e,v.disabled=d,h.classList.toggle("cursor-not-allowed",d),h.classList.toggle("opacity-60",d)},h},ICONS:t}}("undefined"!=typeof window?window:void 0),function(e){var t={base:"group flex items-stretch border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-0 w-full transition-all ease-in-out overflow-hidden",default:"bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent focus:bg-fill-tertiary-fill-light-gray focus-within:bg-fill-tertiary-fill-light-gray",sizeDefault:"",sizeLarge:"",sizeSmall:"",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"},r={default:"py-6",large:"py-8",small:"py-4"},n={base:"w-full min-w-0 border-0 bg-inherit text-start outline-none placeholder:text-typography-quaternary-text focus:bg-inherit hover:bg-inherit focus-visible:outline-none disabled:cursor-not-allowed disabled:text-typography-quaternary-text file:rounded-4 file:border-none file:text-typography-primary-text file:shadow-none file:outline-none !text-reg-13 px-12",inline:"transition-all focus:bg-fill-tertiary-fill-light-gray group-hover:bg-fill-tertiary-fill-light-gray",sizeDefault:"py-6",sizeLarge:"py-8",sizeSmall:"py-4"},a=/^-?\d*\.?\d{0,2}$/;function o(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function i(e){if(""===e||null==e)return null;var t=String(e).trim();if(""===t)return null;var r=parseFloat(t);return isNaN(r)?null:Math.round(100*r)/100}function l(e){return null==e||isNaN(e)?"":Number(e).toFixed(2)}e.CurrencyComponent={create:function(e){var s=e.variant||"default",c=e.size||"default",d=!!e.disabled,u=e.className||"",p=e.column||{},f=e.onChange,h=null!=e.value?e.value:null,m=!!e.autoFocus,g=e.onBlur,v=null!=e.placeholder?e.placeholder:p.placeholder||"Enter value",y=e.rootClassName||"",b=p.properties&&p.properties.currency&&p.properties.currency.currency||"Currency",x="large"===c?"large":"small"===c?"small":"default",w=document.createElement("div");w.className=o(t.base,null!=t[s]?t[s]:t.default,d?t.disabled:"",u),w.setAttribute("data-currency-variant",s);var C=document.createElement("div");C.className=o("flex shrink-0 w-fit items-center justify-center border-r-1/2 border-border-primary bg-fill-tertiary-fill-light-gray text-typography-primary-text px-12 text-reg-12",r[x]),C.textContent=b,w.appendChild(C);var E=document.createElement("div");E.className="flex items-center flex-1 min-w-0 border-0";var k=document.createElement("input");function N(){var e=i(k.value);f&&f(e)}return k.type="text",k.inputMode="decimal",k.autocomplete="off",k.placeholder=v,k.value=null!=h?l(h):"",k.disabled=d,k.className=o(n.base,"inline"===s?n.inline:"",n["large"===x?"sizeLarge":"small"===x?"sizeSmall":"sizeDefault"],y),m&&(k.autofocus=!0),function(e){e.addEventListener("input",function(){var t=e.value;if(""!==t&&"-"!==t&&!a.test(t)){var r="-"===t.charAt(0)?"-":"",n=r?t.slice(1):t,o=n.indexOf(".");if(-1===o)e.value=r+n.replace(/\D/g,"");else{var i=n.slice(0,o).replace(/\D/g,""),l=n.slice(o+1).replace(/\D/g,"").slice(0,2);e.value=r+(l.length?i+"."+l:i)}}})}(k),k.addEventListener("input",N),k.addEventListener("change",N),g&&k.addEventListener("blur",g),E.appendChild(k),w.appendChild(E),w.getInput=function(){return k},w.setValue=function(e){k.value=null==e||""===e?"":l(Number(e))},w.getValue=function(){return i(k.value)},w.setVariant=function(r){s=r,w.setAttribute("data-currency-variant",r),w.className=o(t.base,null!=t[s]?t[s]:t.default,d?t.disabled:"",e.className||"")},w.setDisabled=function(e){d=!!e,k.disabled=d,w.classList.toggle("cursor-not-allowed",d)},w},parseDecimal:i,formatDecimal:l}}("undefined"!=typeof window?window:void 0),function(e){var t={base:"flex w-full rounded-4 border-1/2 border-border-primary bg-fill-quarternary-fill-white px-12 py-6 !text-reg-13 outline-none placeholder:text-typography-quaternary-text text-typography-primary-text resize-y transition-all ease-in-out",default:"min-h-[80px] hover:border-primary-base focus:border-primary-base",borderless:"min-h-[80px] border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus:border-transparent focus:bg-fill-tertiary-fill-light-gray py-4",error:"min-h-[80px] border-error-base hover:border-error-base focus:border-error-base",warning:"min-h-[80px] border-warning-base hover:border-warning-base focus:border-warning-base",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary"};function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.TextareaComponent={create:function(e){var n=e.variant||"default",a=!!e.disabled,o=document.createElement("textarea");return o.autocomplete="off",null!=e.placeholder&&(o.placeholder=e.placeholder),null!=e.value&&(o.value=e.value),e.name&&(o.name=e.name),e.id&&(o.id=e.id),null!=e.rows&&(o.rows=e.rows),null!=e.maxLength&&(o.maxLength=e.maxLength),o.disabled=a,o.readOnly=!!e.readOnly,o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||""),o.setAttribute("data-textarea-variant",n),e.onChange&&o.addEventListener("change",e.onChange),e.onInput&&o.addEventListener("input",e.onInput),e.onFocus&&o.addEventListener("focus",e.onFocus),e.onBlur&&o.addEventListener("blur",e.onBlur),o.getInput=function(){return o},o.setValue=function(e){o.value=e},o.getValue=function(){return o.value},o.setVariant=function(i){n=i,o.setAttribute("data-textarea-variant",i),o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||"")},o.setDisabled=function(i){a=!!i,o.disabled=a,o.className=r(t.base,t[n]||t.default,a?t.disabled:"",e.className||"")},o}}}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/></svg>',n={small:{width:"12",height:"12"},default:{width:"14",height:"14"},large:{width:"16",height:"16"}},a={left:"justify-start",center:"justify-center",right:"justify-end"},o={small:"size-12",default:"size-16",large:"size-20"};function i(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function l(e,a,o,i){if(e.innerHTML="",a||o){var l=n[i]||n.default,s=o?r:t;s=(s=s.replace(/width="\d+"/,'width="'+l.width+'"')).replace(/height="\d+"/,'height="'+l.height+'"'),e.innerHTML=s}}var s={create:function(e){var t=e||{},r=t.id||"checkbox-"+Math.random().toString(36).substr(2,9),n=t.name,s=!!t.checked,c=!!t.indeterminate,d=!!t.disabled,u=t.label,p=!!t.isLabelCaps,f=t.align||"center",h=t.size||"default",m=t.className||"",g=t.onChange,v=document.createElement("div");v.className=i("flex gap-8 items-center",a[f]||a.center,m);var y=document.createElement("input");y.type="checkbox",y.id=r,n&&(y.name=n),y.checked=s,y.disabled=d,y.className="absolute opacity-0 w-0 h-0 peer",y.setAttribute("aria-checked",c?"mixed":s?"true":"false"),y.style.position="absolute",y.style.opacity="0",y.style.width="0",y.style.height="0",y.style.pointerEvents="none";var b=document.createElement("div");b.className=i("flex items-center justify-center rounded-2 border-1/2 border-borderColor-border-primary bg-fill-quarternary-fill-white p-4 transition-all hover:border-primary-base hover:shadow-primary-focused disabled:cursor-not-allowed disabled:border-borderColor-border-primary disabled:opacity-50 disabled:hover:shadow-none","data-checked:border-transparent data-checked:bg-primary-base data-checked:hover:border-primary-base data-checked:hover:shadow-primary-focused data-checked:disabled:border-borderColor-border-primary",o[h]||o.default,"cursor-pointer"),b.setAttribute("role","checkbox"),b.setAttribute("tabindex",d?"-1":"0"),b.setAttribute("aria-checked",c?"mixed":s?"true":"false"),d&&b.setAttribute("aria-disabled","true");var x=document.createElement("span");function w(){var e=y.checked,t=y.indeterminate;b.setAttribute("aria-checked",t?"mixed":e?"true":"false"),y.setAttribute("aria-checked",t?"mixed":e?"true":"false"),e||t?(b.setAttribute("data-checked","true"),b.classList.add("border-transparent","bg-primary-base"),b.classList.remove("border-borderColor-border-primary","bg-fill-quarternary-fill-white")):(b.removeAttribute("data-checked"),b.classList.remove("border-transparent","bg-primary-base"),b.classList.add("border-borderColor-border-primary","bg-fill-quarternary-fill-white")),l(x,e,t,h)}if(x.className="flex items-center justify-center text-current",l(x,s,c,h),b.appendChild(x),b.addEventListener("click",function(){d||(y.indeterminate=!1,y.checked=!y.checked,w(),"function"==typeof g&&g(y.checked),y.dispatchEvent(new Event("change",{bubbles:!0})))}),b.addEventListener("keydown",function(e){d||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),b.click())}),y.addEventListener("change",function(){w(),"function"==typeof g&&g(y.checked)}),v.appendChild(y),v.appendChild(b),u){var C=document.createElement("label");C.htmlFor=r,C.className=i("cursor-pointer pb-0 text-reg-12 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p?"capitalize":"",d?"text-typography-quaternary-text":""),C.textContent=u,v.appendChild(C)}return c&&(y.indeterminate=!0),w(),v.getInput=function(){return y},v.setChecked=function(e){y.indeterminate=!1,y.checked=!!e,w()},v.getChecked=function(){return y.checked},v.setIndeterminate=function(e){y.indeterminate=!!e,e&&(y.checked=!1),w()},v.getIndeterminate=function(){return y.indeterminate},v.setDisabled=function(e){d=!!e,y.disabled=d,b.setAttribute("tabindex",d?"-1":"0"),d?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled"),w()},v}};"undefined"!=typeof module&&module.exports?module.exports=s:e.Checkbox=s}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>',r="size-16 rounded-128 border focus:ring-0 transition-all cursor-pointer",n="bg-fill-quarternary-fill-white border-typography-quaternary-text hover:border-primary-base hover:shadow-primary-focused",a="bg-primary-base border-primary-base hover:border-primary-base hover:shadow-primary-focused",o="disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-none",i="size-8 rounded-128 bg-fill-quarternary-fill-white text-fill-quarternary-fill-white data-[state=checked]:text-typography-quaternary-text group-disabled:text-typography-quaternary-text data-[state=checked]:group-disabled:text-typography-quaternary-text";function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}var s={create:function(e){var s=e||{},c=s.name||"radio-group-"+Math.random().toString(36).substr(2,9),d=s.options||[],u=s.defaultValue,p=void 0!==s.value?s.value:u,f=!!s.disabled,h=s.className||"",m=s.orientation||"horizontal",g=s.onChange,v=document.createElement("div");v.setAttribute("role","radiogroup"),v.setAttribute("aria-required","false"),v.setAttribute("dir","ltr"),v.className=l("flex content-center gap-6","vertical"===m?"flex-col":"",h),v.tabIndex=0;var y=p;function b(e,s,c){e.checked=c,s.setAttribute("aria-checked",c?"true":"false"),s.setAttribute("data-state",c?"checked":"unchecked"),s.className=l(r,c?a:n,o);var d=s.querySelector("span");if(d)if(d.setAttribute("data-state",c?"checked":"unchecked"),c){d.innerHTML=t;var u=d.querySelector("svg");u&&u.setAttribute("class",i)}else d.innerHTML=""}return d.forEach(function(e,s){var d=e.value,u=e.label||e.value,p=f||!!e.disabled,h=d===y,m=document.createElement("div");m.className="flex items-center gap-8";var x=document.createElement("input");x.type="radio",x.name=c,x.value=d,x.id=c+"-"+s,x.checked=h,x.disabled=p,x.className="absolute opacity-0 w-0 h-0 peer",x.style.position="absolute",x.style.opacity="0",x.style.width="0",x.style.height="0",x.style.pointerEvents="none";var w=document.createElement("button");w.type="button",w.setAttribute("role","radio"),w.setAttribute("aria-checked",h?"true":"false"),w.setAttribute("data-state",h?"checked":"unchecked"),w.value=d,w.id=c+"-button-"+s,w.tabIndex=-1,w.className=l(r,h?a:n,o),p&&(w.disabled=!0);var C=document.createElement("span");if(C.setAttribute("data-state",h?"checked":"unchecked"),C.className="flex items-center justify-center",h){C.innerHTML=t;var E=C.querySelector("svg");E&&E.setAttribute("class",i)}if(w.appendChild(C),w.addEventListener("click",function(){if(!p){y=d;var e=v.querySelectorAll('input[name="'+c+'"]');Array.prototype.slice.call(e).forEach(function(e,t){var r=v.querySelector('[id="'+c+"-button-"+t+'"]');r&&b(e,r,e.value===y)}),"function"==typeof g&&g(y),x.dispatchEvent(new Event("change",{bubbles:!0}))}}),w.addEventListener("keydown",function(e){p||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),w.click())}),m.appendChild(x),m.appendChild(w),u){var k=document.createElement("label");k.htmlFor=c+"-"+s,k.className=l("cursor-pointer text-reg-12 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",p?"text-typography-quaternary-text":""),k.textContent=u,k.addEventListener("click",function(){p||w.click()}),m.appendChild(k)}v.appendChild(m)}),v.getValue=function(){var e=v.querySelector('input[name="'+c+'"]:checked');return e?e.value:null},v.setValue=function(e){y=e,v.querySelectorAll('input[name="'+c+'"]').forEach(function(t,r){var n=v.querySelector('[id="'+c+"-button-"+r+'"]');n&&b(t,n,t.value===e)})},v.setDisabled=function(e){f=!!e,v.querySelectorAll('input[name="'+c+'"]').forEach(function(e,t){e.disabled=f;var r=v.querySelector('[id="'+c+"-button-"+t+'"]');r&&(r.disabled=f)})},v},createItem:function(e){var s=e||{},c=s.value,d=s.name||"radio-"+Math.random().toString(36).substr(2,9),u=s.id||d+"-"+c,p=!!s.checked,f=!!s.disabled,h=s.className||"",m=s.onChange,g=document.createElement("div");g.className="flex items-center gap-8";var v=document.createElement("input");v.type="radio",v.name=d,v.value=c,v.id=u,v.checked=p,v.disabled=f,v.className="absolute opacity-0 w-0 h-0 peer",v.style.position="absolute",v.style.opacity="0",v.style.width="0",v.style.height="0",v.style.pointerEvents="none";var y=document.createElement("button");y.type="button",y.setAttribute("role","radio"),y.setAttribute("aria-checked",p?"true":"false"),y.setAttribute("data-state",p?"checked":"unchecked"),y.value=c,y.tabIndex=f?-1:0,y.className=l(r,p?a:n,o,h),f&&(y.disabled=!0);var b=document.createElement("span");if(b.setAttribute("data-state",p?"checked":"unchecked"),b.className="flex items-center justify-center",p){b.innerHTML=t;var x=b.querySelector("svg");x&&x.setAttribute("class",i)}function w(){var e=v.checked;if(y.setAttribute("aria-checked",e?"true":"false"),y.setAttribute("data-state",e?"checked":"unchecked"),b.setAttribute("data-state",e?"checked":"unchecked"),e){y.className=l(r,a,o,h),b.innerHTML=t;var s=b.querySelector("svg");s&&s.setAttribute("class",i)}else y.className=l(r,n,o,h),b.innerHTML=""}return y.appendChild(b),y.addEventListener("click",function(){f||(v.checked=!0,w(),"function"==typeof m&&m(c),v.dispatchEvent(new Event("change",{bubbles:!0})))}),y.addEventListener("keydown",function(e){f||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),y.click())}),g.appendChild(v),g.appendChild(y),g.getInput=function(){return v},g.setChecked=function(e){v.checked=!!e,w()},g.getChecked=function(){return v.checked},g}};"undefined"!=typeof module&&module.exports?module.exports=s:e.RadioGroup=s}("undefined"!=typeof window?window:void 0),function(e){var t="flex items-center border rounded-4 text-typography-primary-text gap-4 !text-reg-13",r={default:"border-border-primary bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white"},n={default:"px-12 py-6",large:"px-12 py-8",small:"px-12 py-4"},a="pointer-events-none !cursor-not-allowed opacity-50",o="pointer-events-none",i={default:"size-16",large:"size-20",small:"size-12"};function l(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function s(e,t){null!=t&&(e.innerHTML="","string"==typeof t?e.insertAdjacentHTML("beforeend",t):t instanceof HTMLElement?e.appendChild(t):t instanceof Node&&e.appendChild(t.cloneNode(!0)))}var c={create:function(e){var c=e||{},d=Math.max(0,parseInt(c.totalElements,10)||0),u=null!=c.enabledIcon?c.enabledIcon:'<span class="text-primary-base">★</span>',p=null!=c.disabledIcon?c.disabledIcon:'<span class="text-typography-quaternary-text">☆</span>',f=c.variant||"default",h=c.size||"default",m=c.iconSize||"default",g=c.defaultValue,v=!0===c.disabled,y=!0===c.readOnly,b=c.className||"",x=c.onValueChange,w=c.children,C=document.createElement("div");C.className=l(t,null!=r[f]?r[f]:r.default,null!=n[h]?n[h]:n.default,v?a:"",y?o:"",b),C.setAttribute("data-enumeration-variant",f);var E=null!=g?Math.min(d,Math.max(0,parseInt(g,10)||0)):0,k=l("flex items-center justify-center text-primary-base hover:cursor-pointer",null!=i[m]?i[m]:i.default),N=[];function S(){for(var e=0;e<N.length;e++){var t=N[e],r=e+1<=E;s(t,r?u:p),t.setAttribute("aria-pressed",r?"true":"false")}}for(var A=0;A<d;A++){var L=A+1,T=document.createElement("div");T.className=k,T.setAttribute("role","button"),T.setAttribute("tabindex",v||y?"-1":"0"),T.setAttribute("aria-pressed",L<=E?"true":"false"),T.setAttribute("aria-label","Set value to "+L),s(T,L<=E?u:p),N.push(T),v||y||function(e){T.addEventListener("click",function(){var t=E===e?0:e;E=t,S(),"function"==typeof x&&x(t)}),T.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T.click())})}(L),C.appendChild(T)}if(null!=w)if("string"==typeof w){var I=document.createElement("span");I.innerHTML=w,C.appendChild(I)}else(w instanceof HTMLElement||w instanceof Node)&&C.appendChild(w);return C},getEnumerationClasses:function(e){var i=e||{},s=i.variant||"default",c=i.size||"default",d=!0===i.disabled,u=!0===i.readOnly;return l(t,null!=r[s]?r[s]:r.default,null!=n[c]?n[c]:n.default,d?a:"",u?o:"")},VARIANTS:r,SIZES:n,ITEM_ICON_SIZES:i};"undefined"!=typeof module&&module.exports?module.exports=c:e.Enumeration=c}("undefined"!=typeof window?window:void 0),function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function r(e){return String(e).padStart(2,"0")}function n(e){if(!e||"string"!=typeof e)return{hour:0,minute:0};var t=e.trim().split(":");return{hour:Math.min(23,Math.max(0,parseInt(t[0],10)||0)),minute:Math.min(59,Math.max(0,parseInt(t[1],10)||0))}}function a(e,t){return r(e)+":"+r(t)}function o(e,t,n){if(n)return r(e)+" : "+r(t);var a=e>=12?"PM":"AM";return r(0===e?12:e>12?e-12:e)+" : "+r(t)+" "+a}function i(e,t,r){return"group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base focus:outline-none min-h-0 h-full truncate hover:cursor-pointer "+("small"===r?"px-12 py-4 !text-reg-12":"px-12 py-6 !text-reg-13")+" "+(t?"text-inherit":"text-typography-quaternary-text")+(e?" pointer-events-none cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"")}function l(e,r,n,a){var Button=t("Button"),o=document.createElement("div");o.className="flex flex-col flex-shrink-0 min-w-32 overflow-y-auto max-h-[200px] p-6 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:[display:none]",o.setAttribute("role","listbox");var i=a?"tabular-nums":"",l=[];if(!Button||"function"!=typeof Button.create){var s=document.createElement("div");return s.className=o.className,s.setAttribute("role","listbox"),s.textContent="Button component required",{el:s,setSelected:function(){},scrollToSelected:function(){},items:[]}}return e.forEach(function(e){var t=void 0!==e.value?e.value:e.label,a=void 0!==e.label?e.label:String(t),s=String(t)===String(r),c=Button.create({variant:s?"primary":"ghost",size:"small",text:a,className:i,onClick:function(){n(t)}});c.setAttribute("role","option"),c.setAttribute("data-value",String(t)),c.setAttribute("aria-selected",s),o.appendChild(c),l.push({el:c,value:t,label:a})}),{el:o,setSelected:function(e){l.forEach(function(t){var r=String(t.value)===String(e);t.el.setAttribute("aria-selected",r),t.el.className=Button.getButtonClasses({variant:r?"primary":"ghost",size:"small"})+" "+i})},scrollToSelected:function(){var e=o.querySelector("[aria-selected=true]");e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},items:l}}e.TimePicker={create:function(e){var s=e.fieldId,c=void 0!==e.value?e.value:"",d=e.placeholder||"Select time",u=e.onChange,p=!0===e.disabled,f=!0===e.use24Hour,h="small"===e.size?"small":"default",m="string"==typeof c?c:"",g=n(m),v=g.hour,y=g.minute,b=v>=12?"PM":"AM",x=0===v?12:v>12?v-12:v,w=document.createElement("div");w.className="time-picker relative w-full group",s&&w.setAttribute("data-field-id",s);var C=document.createElement("button");C.type="button",C.disabled=p,C.setAttribute("aria-haspopup","listbox"),C.setAttribute("aria-expanded","false"),C.setAttribute("aria-label",d),C.className=i(p,!!m,h);var E=document.createElement("span");E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),E.textContent=m?o(v,y,f):d,C.appendChild(E);var k=document.createElement("span");k.className="flex size-16 shrink-0 items-center justify-center text-typography-primary-text [&_svg]:text-typography-primary-text",k.setAttribute("aria-hidden","true"),k.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',C.appendChild(k);var N=[];if(f)for(var S=0;S<=23;S++)N.push({value:S,label:r(S)});else for(S=1;S<=12;S++)N.push({value:S,label:r(S)});for(var A=[],L=0;L<=59;L++)A.push({value:L,label:r(L)});var T=l(N,f?v:x,function(e){f?v=e:(x=e,v="PM"===b?12===e?12:e+12:12===e?0:e),T.setSelected(f?v:x),T.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!0),I=l(A,y,function(e){y=e,I.setSelected(y),I.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!0),M=null;f||(M=l([{value:"AM",label:"AM"},{value:"PM",label:"PM"}],b,function(e){v="PM"===(b=e)?12===x?12:x+12:12===x?0:x,M.setSelected(b),M.scrollToSelected(),m=a(v,y),E.textContent=o(v,y,f),E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),u&&u(m)},!1));var q=document.createElement("div");q.className="flex flex-row flex-nowrap items-stretch gap-0",T.el.className+=" border-r-1/2 border-border-primary",I.el.className+=" border-l-1/2 border-border-primary",M&&(I.el.className+=" border-r-1/2 border-border-primary",M.el.className+=" border-l-1/2 border-border-primary"),q.appendChild(T.el),q.appendChild(I.el),M&&q.appendChild(M.el);var _,j=null,D=t("Button"),F=D&&"function"==typeof D.create?D.create({variant:"outline",size:"small",text:"Close",onClick:function(){j&&j()}}):((_=document.createElement("button")).type="button",_.className="px-2 py-1 border rounded text-sm",_.textContent="Close",_.onclick=function(){j&&j()},_),z=document.createElement("div");z.className="flex justify-end border-t-1/2 border-border-primary pt-6 px-8 pb-12",z.appendChild(F);var U=document.createElement("div");U.setAttribute("role","listbox"),U.setAttribute("data-time-picker-dropdown","true"),U.appendChild(q),U.appendChild(z);var O=t("Popover");if(!O||"function"!=typeof O.create)return w.appendChild(C),w.updateValue=function(e){m="string"==typeof e?e:""},w.setDisabled=function(e){C.disabled=!!e},w;var P=O.create({trigger:C,content:U,placement:"bottom",closeOnClickOutside:!0,bodyClassName:"p-0",panelClassName:"!w-auto min-w-max",onOpen:function(){C.setAttribute("aria-expanded","true"),w.classList.add("open"),p||(T.setSelected(f?v:x),I.setSelected(y),M&&(b=v>=12?"PM":"AM",M.setSelected(b)),T.scrollToSelected(),I.scrollToSelected(),M&&M.scrollToSelected())},onClose:function(){C.setAttribute("aria-expanded","false"),w.classList.remove("open")}});return j=P.hide,w.appendChild(C),w.updateValue=function(e){var t=n(m="string"==typeof e?e:"");v=t.hour,y=t.minute,x=0===v?12:v>12?v-12:v,b=v>=12?"PM":"AM",E.textContent=m?o(v,y,f):d,E.className="flex-1 truncate text-left tabular-nums "+(m?"text-inherit":"text-typography-quaternary-text"),C.className=i(p,!!m,h),T.setSelected(f?v:x),I.setSelected(y),M&&M.setSelected(b)},w.setDisabled=function(e){p=!!e,C.disabled=p,C.className=i(p,!!m,h),p&&P.hide()},w}}}("undefined"!=typeof window?window:void 0),function(e){var t=86400,r=3600,n=60;function a(e){var a=Math.max(0,e),o=Math.floor(a/t);a-=o*t;var i=Math.floor(a/r);a-=i*r;var l=Math.floor(a/n);a-=l*n;var s=Math.floor(a);return{days:o,hours:i,minutes:l,seconds:s,milliseconds:Math.round(1e3*(a-s))}}var o={days:999,hours:23,minutes:59,seconds:59};e.DurationUtils={convertSecondsToTimeUnits:a,getSecondsFromValue:function(e,t){return"milliseconds"===t?(e||0)/1e3:e||0},getValueFromSeconds:function(e,t){return"milliseconds"===t?Math.round(1e3*e):Math.round(e)},parseDuration:function(e,a){if(!e||"string"!=typeof e)return 0;var o=e.replace(/\s+/g,"").toLowerCase();if(/^\d+(\.\d+)?$/.test(o)){var i=parseFloat(o);return"milliseconds"===a?i/1e3:i}var l=0;if([{regex:/(\d+(?:\.\d+)?)d/g,multiplier:t},{regex:/(\d+(?:\.\d+)?)h/g,multiplier:r},{regex:/(\d+(?:\.\d+)?)m(?!s)/g,multiplier:n},{regex:/(\d+(?:\.\d+)?)s/g,multiplier:1},{regex:/(\d+(?:\.\d+)?)ms/g,multiplier:.001}].forEach(function(e){for(var t,r=new RegExp(e.regex.source,e.regex.flags||"g");null!==(t=r.exec(o));)l+=parseFloat(t[1])*e.multiplier}),-1!==o.indexOf(":")&&!/[dhms]/.test(o)){var s=o.split(":").map(function(e){return parseFloat(e)||0});2===s.length?l=s[0]*n+s[1]:3===s.length?l=s[0]*r+s[1]*n+s[2]:4===s.length&&(l=s[0]*t+s[1]*r+s[2]*n+s[3])}return l},formatDuration:function(e,t){if(0===e)return t||"Select duration";var r=a(e),n=[];return r.days>0&&n.push(r.days+"d"),r.hours>0&&n.push(r.hours+"h"),r.minutes>0&&n.push(r.minutes+"m"),r.seconds>0&&n.push(r.seconds+"s"),r.milliseconds>0&&0===n.length&&n.push(r.milliseconds+"ms"),n.join(" ")||"0s"},wheelValuesToSeconds:function(e){return(e.days||0)*t+(e.hours||0)*r+(e.minutes||0)*n+(e.seconds||0)},clampWheelValue:function(e,t){var r=o[e];return Math.max(0,Math.min(r,isNaN(t)?0:t))},MAX_VALUES:o,SECONDS_PER_DAY:t,SECONDS_PER_HOUR:r,SECONDS_PER_MINUTE:n,SECONDS_PER_MILLISECOND:.001}}("undefined"!=typeof window?window:void 0),("undefined"!=typeof window?window:void 0).DurationConstants={PRESET_DURATIONS:[{title:"Seconds & Minutes",presets:[{label:"30s",value:30},{label:"1m",value:60},{label:"2m",value:120},{label:"5m",value:300},{label:"10m",value:600},{label:"15m",value:900},{label:"30m",value:1800}]},{title:"Hours & Days",presets:[{label:"1h",value:3600},{label:"2h",value:7200},{label:"6h",value:21600},{label:"12h",value:43200},{label:"1d",value:86400},{label:"2d",value:172800},{label:"7d",value:604800}]}],DURATION_WHEELS:[{unit:"days",label:"days"},{unit:"hours",label:"hours"},{unit:"minutes",label:"min"},{unit:"seconds",label:"sec"}]},function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}var r={base:"flex items-center justify-between border-1/2 rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out cursor-pointer",default:"border-border-primary bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base",error:"border-error-base bg-fill-quarternary-fill-white hover:border-error-base focus-within:border-error-base",warning:"border-warning-base bg-fill-quarternary-fill-white hover:border-warning-base focus-within:border-warning-base",success:"border-success-base bg-fill-quarternary-fill-white hover:border-success-base focus-within:border-success-base",borderless:"border-none shadow-none rounded-0 bg-fill-quarternary-fill-white",inline:"border-transparent shadow-none rounded-0 bg-fill-quarternary-fill-white hover:bg-fill-tertiary-fill-light-gray focus-within:border-transparent",sizeDefault:"px-12 py-6",sizeLarge:"px-12 py-8",sizeSmall:"px-12 py-4",disabled:"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary opacity-60"};function n(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}e.Duration={create:function(a){var o=e.DurationUtils,i=e.DurationConstants,l=t("Popover"),Button=t("Button"),s=t("InputComponent");if(!(o&&i&&l&&Button))throw new Error("Duration requires DurationUtils, DurationConstants, Popover, Button");var c=null!=a.value?a.value:null,d="milliseconds"===a.formatType?"milliseconds":"seconds",u=a.onChange,p=null!=a.placeholder?a.placeholder:"hh:mm:ss",f=a.variant||"default",h=a.size||"default",m=!!a.disabled,g=a.className||"",v=o.getSecondsFromValue(c||0,d),y=o.formatDuration(v,p),b=v>0&&"milliseconds"===d?Math.round(1e3*v)+"ms":null,x=o.convertSecondsToTimeUnits(v),w="",C=document.createElement("div");C.className=n(r.base,null!=r[f]?r[f]:r.default,"large"===h?r.sizeLarge:"small"===h?r.sizeSmall:r.sizeDefault,m?r.disabled:"",g),C.setAttribute("role","button"),C.setAttribute("tabindex",m?"-1":"0"),C.setAttribute("aria-haspopup","dialog"),C.setAttribute("aria-expanded","false");var E=document.createElement("div");E.className="flex flex-1 items-center gap-8 min-w-0";var k=document.createElement("p");if(k.className="truncate text-reg-13 "+(y===p?"text-typography-quaternary-text":""),k.textContent=y,E.appendChild(k),b){var N=document.createElement("span");N.className="text-xs text-typography-tertiary-text truncate shrink-0",N.textContent=b,E.appendChild(N)}if(C.appendChild(E),"inline"!==f){var S=document.createElement("span");S.className="size-16 text-typography-quaternary-text shrink-0 flex items-center justify-center",S.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>',S.setAttribute("aria-hidden","true"),C.appendChild(S)}var A=document.createElement("div");function L(){v=o.getSecondsFromValue(c||0,d),y=o.formatDuration(v,p),k.textContent=y,k.className="truncate text-reg-13 "+(y===p?"text-typography-quaternary-text":""),N&&(v>0&&"milliseconds"===d?(N.textContent=Math.round(1e3*v)+"ms",N.style.display=""):N.style.display="none")}function T(e){c=0===e?null:o.getValueFromSeconds(e,d),w="",L(),u&&u(c),G.hide()}function I(){T(w?o.parseDuration(w,d):o.wheelValuesToSeconds(x)),w=""}A.className="duration-picker relative w-full",A.appendChild(C);var M=document.createElement("div");M.className="p-0";var q,_,j=document.createElement("div");if(j.className="p-8",s&&s.create){var D=document.createElement("div");D.className="relative",q=s.create({type:"text",placeholder:"2d1h15m30s, 4000s, 1:30:00...",variant:"default",inputSize:"default",onChange:function(){},onInput:function(){var e=q.getInput&&q.getInput();if(e&&(w=e.value)){var t=o.parseDuration(w,d);x=o.convertSecondsToTimeUnits(t),O.forEach(function(e,t){B[t]&&B[t].setValue&&B[t].setValue(x[e.unit])})}}});var F=q.getInput&&q.getInput();F&&F.addEventListener("keydown",function(e){if("Enter"===e.key){e.preventDefault();var t=q.getValue&&q.getValue();if(t)T(o.parseDuration(t,d)),q.setValue&&q.setValue("");w=""}}),D.appendChild(q),(_=document.createElement("span")).className="absolute right-12 top-1/2 -translate-y-1/2 cursor-pointer text-typography-quaternary-text hover:text-typography-primary-text",_.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',_.setAttribute("role","button"),_.setAttribute("aria-label","Clear input"),_.style.display="none",D.appendChild(_),_.addEventListener("click",function(e){e.stopPropagation(),q.setValue&&q.setValue(""),w="",_.style.display="none"}),F&&F.addEventListener("input",function(){_.style.display=F.value?"":"none"}),j.appendChild(D)}M.appendChild(j);var z=document.createElement("div");z.className="border-t-1/2 border-border-primary w-full",M.appendChild(z);var U=document.createElement("div");U.className="flex justify-center gap-8 p-8";var O=i.DURATION_WHEELS,P=o.MAX_VALUES,B=[];function H(e){"Enter"===e.key&&(e.preventDefault(),I())}O.forEach(function(t){var r=function(t,r,a,o,i,l){var s=e.DurationUtils;if(!s)throw new Error("DurationUtils required");var c=document.createElement("div");c.className="flex flex-col items-center justify-center";var d=document.createElement("div");d.className="overflow-hidden rounded-4 border-1/2 border-border-primary";var u=document.createElement("input");u.type="number",u.min=0,u.max=o,u.value=Math.max(0,Math.min(o,a)),u.className=n("w-full bg-inherit text-center outline-none text-reg-13 px-8 py-4 border-0","placeholder:text-typography-quaternary-text focus:bg-fill-tertiary-fill-light-gray","days"===t?"!w-48 !min-w-48":"!w-40 !min-w-40"),u.setAttribute("placeholder",r),d.appendChild(u),c.appendChild(d);var p=document.createElement("span");return p.className="mt-4 text-reg-10 text-typography-tertiary-text",p.textContent=r,c.appendChild(p),u.addEventListener("input",function(){var e=parseInt(u.value,10);isNaN(e)&&(e=0);var r=s.clampWheelValue(t,e);u.value=r,i(r)}),u.addEventListener("change",function(){var e=parseInt(u.value,10);isNaN(e)&&(e=0);var r=s.clampWheelValue(t,e);u.value=r,i(r)}),l&&u.addEventListener("keydown",l),c.getInput=function(){return u},c.setValue=function(e){var r=s.clampWheelValue(t,e);u.value=r},c}(t.unit,t.label,x[t.unit],P[t.unit],function(e){x[t.unit]=e,w="",q&&q.setValue&&q.setValue(""),_&&(_.style.display="none")},H);B.push(r),U.appendChild(r)}),M.appendChild(U);var R=document.createElement("div");R.className="border-t-1/2 border-border-primary w-full",M.appendChild(R);var V=document.createElement("div");V.className="p-8",i.PRESET_DURATIONS.forEach(function(e){var t=document.createElement("div");t.className="space-y-2";var r=document.createElement("label");r.className="text-reg-12 text-typography-secondary-text block",r.textContent=e.title,t.appendChild(r);var n=document.createElement("div");n.className="grid grid-cols-4 gap-4",e.presets.forEach(function(e){var t=Math.abs(v-e.value)<1,r=Button.create({variant:t?"outline":"dashed",size:"small",text:e.label,className:"text-xs",onClick:function(){T(e.value),w=""}});n.appendChild(r)}),t.appendChild(n),V.appendChild(t)}),M.appendChild(V);var $=document.createElement("div");$.className="border-t-1/2 border-border-primary w-full",M.appendChild($);var Y=document.createElement("div");Y.className="flex justify-end gap-8 p-8";var W=Button.create({variant:"outline",size:"small",text:"Clear",className:"text-error-text-base hover:text-error-text-hover",onClick:function(){c=null,x={days:0,hours:0,minutes:0,seconds:0},w="",L(),u&&u(null),G.hide()}});v<=0&&(W.style.display="none"),Y.appendChild(W);var K=Button.create({variant:"primary",size:"small",text:"Done",onClick:I});Y.appendChild(K),M.appendChild(Y);var G=l.create({trigger:C,content:M,placement:"bottom",align:"start",closeOnClickOutside:!0,panelClassName:"w-[275px]",bodyClassName:"p-0",onOpen:function(){C.setAttribute("aria-expanded","true"),w||(x=o.convertSecondsToTimeUnits(v),B.forEach(function(e,t){e.setValue&&e.setValue(x[O[t].unit])})),q&&q.setValue&&q.setValue(w),_&&(_.style.display=w?"":"none"),W.style.display=v>0?"":"none"},onClose:function(){C.setAttribute("aria-expanded","false")}});return C.addEventListener("click",function(e){m&&(e.preventDefault(),e.stopImmediatePropagation())},!0),C.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m||C.click())}),A.getValue=function(){return c},A.setValue=function(e){c=e,L()},A.setDisabled=function(e){m=!!e,C.classList.toggle("cursor-not-allowed",m),C.classList.toggle("opacity-60",m),C.setAttribute("tabindex",m?"-1":"0"),m&&G.hide()},A}}}("undefined"!=typeof window?window:void 0),function(e){var t=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function n(e){return e instanceof Date&&!isNaN(e.getTime())}function a(e){var t=new Date(e.getTime());return t.setHours(0,0,0,0),t}function o(e,t){var r=new Date(e.getTime());return r.setDate(r.getDate()+t),r}function i(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())}function l(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}function s(e,t){return e.getTime()<t.getTime()}function c(e,t){return e.getTime()>t.getTime()}function d(e,t,r){var n=a(e);return(!t||!s(n,a(t)))&&(!r||!c(n,a(r)))}function u(e,t,r,n,o,l){return{date:e,currentMonth:t,isToday:i(e,r),isSelected:!!n&&i(e,n),disabled:o&&s(e,a(o))||l&&c(e,a(l))}}e.DateTimePickerUtils={MONTH_NAMES:t,MONTH_SHORT:r,isValidDate:n,startOfDay:a,addDays:o,addMonths:function(e,t){var r=new Date(e.getTime());return r.setMonth(r.getMonth()+t),r},isSameDay:i,isSameMonth:l,isBefore:s,isAfter:c,getValidDate:function(e,t,r){var a=new Date;if(e)return n(e)?t&&s(e,t)?new Date(t.getTime()):r&&c(e,r)?new Date(r.getTime()):new Date(e.getTime()):t&&c(t,a)?new Date(t.getTime()):r&&s(r,a)?new Date(r.getTime()):new Date(a.getTime())},isDateInRange:d,getQuickSelectionDates:function(e,t){var r=new Date,n=o(r,1);return{today:d(r,e,t)?r:void 0,tomorrow:d(n,e,t)?n:void 0}},isPreviousMonthDisabled:function(e,t){return!!t&&(l(e,t)||s(e,t))},isNextMonthDisabled:function(e,t){return!!t&&(l(e,t)||c(e,t))},genMonths:function(){return t.map(function(e,t){return{value:t,label:e}})},genYears:function(e,t,r){r=null==r?50:r;for(var n=new Date,a=e?e.getFullYear():n.getFullYear()-r,o=t?t.getFullYear():n.getFullYear()+r,i=[],l=a;l<=o;l++)i.push({value:l,label:String(l)});return i},getMonthGrid:function(e,t,r,n){for(var o=e.getFullYear(),i=e.getMonth(),l=new Date(o,i,1),s=new Date(o,i+1,0),c=l.getDay(),d=s.getDate(),p=a(new Date),f=[],h=[],m=0;m<c;m++){var g=new Date(o,i,-c+m+1);h.push(u(g,!1,p,t,r,n))}for(var v=1;v<=d;v++){var y=new Date(o,i,v);h.push(u(y,!0,p,t,r,n)),7===h.length&&(f.push(h),h=[])}for(var b=1;h.length>0&&h.length<7;){var x=new Date(o,i+1,b);h.push(u(x,!1,p,t,r,n)),b++,7===h.length&&(f.push(h),h=[])}return f},formatDateTime:function(e,t,a,o){if(!e||!n(e))return"";var i=e,l=function(e){return(e<10?"0":"")+e},s=r[i.getMonth()]+" "+i.getDate()+", "+i.getFullYear();if("day"===a)return s;var c=i.getHours(),d=i.getMinutes(),u=i.getSeconds();if(24===t){var p=l(c)+":"+l(d);return"second"===a&&(p+=":"+l(u)),s+" "+p}var f=c>=12?"PM":"AM",h=(0===c?12:c>12?c-12:c)+":"+l(d);return"second"===a&&(h+=":"+l(u)),s+" "+(h+=" "+f)},setTimeFromString:function(e,t){if(!t||"string"!=typeof t)return e;var r=t.trim().split(":"),n=Math.min(23,Math.max(0,parseInt(r[0],10)||0)),a=Math.min(59,Math.max(0,parseInt(r[1],10)||0));return e.setHours(n,a,0,0),e},getTimeString:function(e){if(!e||!n(e))return"00:00";var t=function(e){return(e<10?"0":"")+e};return t(e.getHours())+":"+t(e.getMinutes())}}}("undefined"!=typeof window?window:void 0),function(e){function t(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){var r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}function r(){return Array.prototype.filter.call(arguments,Boolean).join(" ")}function n(n,a,o,i,l){var s=e.DateTimePickerUtils;if(!s)throw new Error("DateTimePickerUtils required");var c=s.getMonthGrid(n,a,o,i),d=document.createElement("div");d.className="w-full border-collapse border-t-1/2 border-border-primary";var u=document.createElement("div");u.className="flex gap-x-6 p-6",["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(e){var t=document.createElement("div");t.className="text-typography-tertiary-text flex-1 flex items-center justify-center text-reg-12 my-2 text-center",t.textContent=e,u.appendChild(t)}),d.appendChild(u);var Button=t("Button");if(!Button||"function"!=typeof Button.create){var p=document.createElement("div");return p.className="space-y-0 p-6 text-typography-tertiary-text text-reg-12",p.textContent="Button component required",d.appendChild(p),d}var f=document.createElement("div");return f.className="space-y-0",c.forEach(function(e){var t=document.createElement("div");t.className="flex gap-x-6 px-6",e.forEach(function(e){var n="ghost";e.isSelected?n="primary":e.isToday&&(n="outline");var a=r("!text-reg-12 my-2 flex-1 !px-0 !py-0",e.currentMonth?"":"text-typography-quaternary-text"),o=Button.create({variant:n,size:"small",text:String(e.date.getDate()),label:e.date.toDateString(),disabled:e.disabled,className:a,onClick:e.disabled?void 0:function(){l(new Date(e.date.getTime()))}});t.appendChild(o)}),f.appendChild(t)}),d.appendChild(f),d}e.DateTimePicker={create:function(a){var o=e.DateTimePickerUtils;if(!o)throw new Error("DateTimePickerUtils required");var i=t("Popover"),Button=t("Button"),l=t("TimePicker");if(!i||"function"!=typeof i.create||!Button||"function"!=typeof Button.create)throw new Error("Popover and Button required");var s=a.value,c=a.onChange,d=!!a.disabled,u=24===a.hourCycle?24:12,p=null!=a.yearRange?a.yearRange:50,f=null!=a.placeholder?a.placeholder:"Pick a date",h=a.granularity||"minute";a.variant;var m=a.size||"default",g=a.fromDate,v=a.toDate,y=a.align||"start",b=o.getValidDate(s,g,v),x=b?new Date(b.getTime()):new Date,w=document.createElement("div"),C=r("group flex items-center border-1/2 border-border-primary rounded-4 text-typography-primary-text gap-x-8 w-full transition-all ease-in-out","bg-fill-quarternary-fill-white hover:border-primary-base focus-within:border-primary-base","large"===m?"px-12 py-8":"small"===m?"px-12 py-4":"px-12 py-6",d?"cursor-not-allowed border-border-primary bg-fill-tertiary-fill-light-gray text-typography-quaternary-text hover:border-border-primary":"cursor-pointer");w.className=C,w.setAttribute("role","button"),w.setAttribute("tabindex",d?"-1":"0"),w.setAttribute("aria-haspopup","dialog"),w.setAttribute("aria-expanded","false");var E=document.createElement("span");E.className="flex-1 truncate text-left text-reg-13";var k=o.formatDateTime(b,u,h);E.textContent=k||f,E.classList.toggle("text-typography-quaternary-text",!k),w.appendChild(E);var N=document.createElement("span");N.className="flex size-16 shrink-0 items-center justify-center text-typography-primary-text [&_svg]:text-typography-primary-text",N.setAttribute("aria-hidden","true"),N.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>',w.appendChild(N);var S,A,L,T,I=document.createElement("div");function M(){b=o.getValidDate(s,g,v),k=o.formatDateTime(b,u,h),E.textContent=k||f,E.classList.toggle("text-typography-quaternary-text",!k)}function q(e){x=new Date(e.getTime())}function _(e){var t;"day"===h?t=o.startOfDay(e):(t=new Date(e.getTime()),b&&t.setHours(b.getHours(),b.getMinutes(),b.getSeconds(),0)),s=o.getValidDate(t,g,v),b=s,M(),c&&c(s),q(t),S&&S.setMonth&&S.setMonth(x),L&&L.updateValue&&L.updateValue(o.getTimeString(s)),j()}function j(){var e=D.querySelector("[data-dtp-calendar]");e&&e.remove();var t=document.createElement("div");t.setAttribute("data-dtp-calendar","true"),A=n(x,b,g,v,_),t.appendChild(A);var r=D.firstElementChild;r?D.insertBefore(t,r.nextSibling):D.appendChild(t)}I.className="date-time-picker relative w-full "+(a.className||""),I.appendChild(w);var D=document.createElement("div");D.className="px-0",D.appendChild(function(){var r=document.createDocumentFragment();S=function(r,n,a,o,i,l,s){var c=e.DateTimePickerUtils;if(!c)throw new Error("DateTimePickerUtils required");var d=c.genMonths(),u=c.genYears(n,a,o),p=c.isPreviousMonthDisabled(r,n),f=c.isNextMonthDisabled(r,a),h=document.createElement("div");h.className="flex justify-between relative items-center p-6";var Select=t("Select");if(Select&&"function"==typeof Select.create){var m=r.getMonth(),g=r.getFullYear(),v=d.map(function(e){return{value:e.value,label:e.label.slice(0,3)}}),y=u.map(function(e){return{value:e.value,label:e.label}}),b=document.createElement("div");b.className="inline-flex gap-x-8";var x=Select.create({options:v,value:m,placeholder:"Month",size:"small",onChange:function(e){var t=new Date(r.getTime());t.setMonth(Number(e)),i(t)}}),w=Select.create({options:y,value:g,placeholder:"Year",size:"small",onChange:function(e){var t=new Date(r.getTime());t.setFullYear(Number(e)),i(t)}});b.appendChild(x),b.appendChild(w),h.appendChild(b)}var Button=t("Button");if(!Button||"function"!=typeof Button.create){var C=document.createElement("div");return C.className="flex items-center gap-x-8",C.textContent="Button component required",h.appendChild(C),{element:h,setMonth:function(){}}}var E=document.createElement("div");E.className="flex items-center gap-x-8";var k=Button.create({icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>',variant:"ghost",size:"small",label:"Previous month",disabled:p,className:"opacity-50 hover:opacity-100",onClick:p?void 0:l}),N=Button.create({icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>',variant:"ghost",size:"small",label:"Next month",disabled:f,className:"opacity-50 hover:opacity-100",onClick:f?void 0:s});return E.appendChild(k),E.appendChild(N),h.appendChild(E),{element:h,setMonth:function(e){if(Select&&h.querySelectorAll(".custom-select").length>=2){var t=h.querySelectorAll(".custom-select");t[0].updateValue&&t[0].updateValue(e.getMonth()),t[1].updateValue&&t[1].updateValue(e.getFullYear())}}}}(x,g,v,p,function(e){q(e),j(),S&&S.setMonth&&S.setMonth(x)},function(){o.isPreviousMonthDisabled(x,g)||(q(o.addMonths(x,-1)),j(),S&&S.setMonth&&S.setMonth(x))},function(){o.isNextMonthDisabled(x,v)||(q(o.addMonths(x,1)),j(),S&&S.setMonth&&S.setMonth(x))}),r.appendChild(S.element);var a=document.createElement("div");if(a.setAttribute("data-dtp-calendar","true"),A=n(x,b,g,v,_),a.appendChild(A),r.appendChild(a),"day"!==h&&l){var i=document.createElement("div");i.className="border-t-1/2 border-border-primary p-6";var d=b?o.getTimeString(b):"00:00";L=l.create({fieldId:"dtp-time",value:d,placeholder:"Time",use24Hour:24===u,size:"small",onChange:function(e){var t=s?new Date(s.getTime()):new Date;o.setTimeFromString(t,e),s=o.getValidDate(t,g,v),b=s,M(),c&&c(s)}}),i.appendChild(L),r.appendChild(i)}var f=o.getQuickSelectionDates(g,v);if((T=document.createElement("div")).className="flex flex-wrap gap-8 border-t-1/2 border-border-primary p-6",f.today){var m=Button.create({variant:"outline",size:"small",text:"Today",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><circle cx="12" cy="15" r="1"/></svg>',onClick:function(){var e="day"===h?o.startOfDay(new Date):new Date;s=o.getValidDate(e,g,v),b=s,q(s||new Date),M(),c&&c(s),j(),L&&L.updateValue&&s&&L.updateValue(o.getTimeString(s))}});T.appendChild(m)}if(f.tomorrow){var y=Button.create({variant:"outline",size:"small",text:"Tomorrow",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="m12 14 2-2 2 2"/><path d="m12 18 2-2 2 2"/></svg>',onClick:function(){var e=o.addDays(new Date,1);e="day"===h?o.startOfDay(e):e,s=o.getValidDate(e,g,v),b=s,q(s||new Date),M(),c&&c(s),j(),L&&L.updateValue&&s&&L.updateValue(o.getTimeString(s))}});T.appendChild(y)}var w=Button.create({variant:"outline",size:"small",text:"No date",startIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="M8 14h8"/></svg>',onClick:function(){s=void 0,b=void 0,q(new Date),M(),c&&c(void 0),F.hide()}});return T.appendChild(w),r.appendChild(T),r}());var F=i.create({trigger:w,content:D,placement:"bottom",align:y,closeOnClickOutside:!0,onOpen:function(){w.setAttribute("aria-expanded","true"),x=b?new Date(b.getTime()):new Date,S&&S.setMonth&&S.setMonth(x)},onClose:function(){w.setAttribute("aria-expanded","false")}});return w.addEventListener("click",function(e){d&&(e.preventDefault(),e.stopImmediatePropagation())},!0),w.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d||w.click())}),I.getValue=function(){return s},I.setValue=function(e){s=e,b=o.getValidDate(s,g,v),x=b?new Date(b.getTime()):new Date,M()},I.setDisabled=function(e){d=!!e,w.classList.toggle("cursor-not-allowed",d),w.classList.toggle("opacity-60",d),w.setAttribute("tabindex",d?"-1":"0"),d&&F.hide()},I}}}("undefined"!=typeof window?window:void 0),function(e){const t=[{code:"US",name:"United States",callingCode:"1"},{code:"GB",name:"United Kingdom",callingCode:"44"},{code:"CA",name:"Canada",callingCode:"1"},{code:"AU",name:"Australia",callingCode:"61"},{code:"IN",name:"India",callingCode:"91"},{code:"DE",name:"Germany",callingCode:"49"},{code:"FR",name:"France",callingCode:"33"},{code:"IT",name:"Italy",callingCode:"39"},{code:"ES",name:"Spain",callingCode:"34"},{code:"BR",name:"Brazil",callingCode:"55"},{code:"MX",name:"Mexico",callingCode:"52"},{code:"AR",name:"Argentina",callingCode:"54"},{code:"CN",name:"China",callingCode:"86"},{code:"JP",name:"Japan",callingCode:"81"},{code:"KR",name:"South Korea",callingCode:"82"},{code:"RU",name:"Russia",callingCode:"7"},{code:"ZA",name:"South Africa",callingCode:"27"},{code:"NG",name:"Nigeria",callingCode:"234"},{code:"EG",name:"Egypt",callingCode:"20"},{code:"AE",name:"United Arab Emirates",callingCode:"971"},{code:"SA",name:"Saudi Arabia",callingCode:"966"},{code:"SG",name:"Singapore",callingCode:"65"},{code:"MY",name:"Malaysia",callingCode:"60"},{code:"TH",name:"Thailand",callingCode:"66"},{code:"ID",name:"Indonesia",callingCode:"62"},{code:"PH",name:"Philippines",callingCode:"63"},{code:"VN",name:"Vietnam",callingCode:"84"},{code:"PK",name:"Pakistan",callingCode:"92"},{code:"BD",name:"Bangladesh",callingCode:"880"},{code:"NZ",name:"New Zealand",callingCode:"64"},{code:"IE",name:"Ireland",callingCode:"353"},{code:"NL",name:"Netherlands",callingCode:"31"},{code:"BE",name:"Belgium",callingCode:"32"},{code:"CH",name:"Switzerland",callingCode:"41"},{code:"AT",name:"Austria",callingCode:"43"},{code:"SE",name:"Sweden",callingCode:"46"},{code:"NO",name:"Norway",callingCode:"47"},{code:"DK",name:"Denmark",callingCode:"45"},{code:"FI",name:"Finland",callingCode:"358"},{code:"PL",name:"Poland",callingCode:"48"},{code:"PT",name:"Portugal",callingCode:"351"},{code:"GR",name:"Greece",callingCode:"30"},{code:"TR",name:"Turkey",callingCode:"90"},{code:"IL",name:"Israel",callingCode:"972"},{code:"CL",name:"Chile",callingCode:"56"},{code:"CO",name:"Colombia",callingCode:"57"},{code:"PE",name:"Peru",callingCode:"51"},{code:"VE",name:"Venezuela",callingCode:"58"}];e.PhoneInputUtils={COUNTRIES_DATA:t,isoToEmoji:function(e){if(!e||2!==e.length)return"";const t=e.toUpperCase().split("").map(e=>127397+e.charCodeAt(0));return String.fromCodePoint(...t)},getCountriesOptions:function(){return t.map(e=>({value:e.code,label:e.name,indicatif:e.callingCode}))},getCountryByCode:function(e){return t.find(t=>t.code===e)},getCountryCodeFromCallingCode:function(e){const r=e.replace(/^\+/,""),n=t.find(e=>e.callingCode===r);return n?n.code:null},replaceNumbersWithZeros:function(e){return e.replace(/\d/g,"0")},getExampleFormat:function(e){return{US:"(000) 000-0000",GB:"00000 000000",IN:"00000 00000",CA:"(000) 000-0000",AU:"0000 000 000",DE:"0000 0000000",FR:"00 00 00 00 00",IT:"000 000 0000",ES:"000 00 00 00",BR:"(00) 00000-0000",MX:"00 0000 0000",CN:"000 0000 0000",JP:"00-0000-0000",KR:"00-0000-0000",RU:"(000) 000-00-00"}[e]||"000000000000"},parsePhoneNumber:function(e){if(!e)return{callingCode:"",nationalNumber:""};const t=e.split("-");if(2===t.length)return{callingCode:t[0].replace(/^\+/,""),nationalNumber:t[1]};const r=e.match(/^\+?(\d{1,4})/);return r?{callingCode:r[1],nationalNumber:e.substring(r[0].length)}:{callingCode:"",nationalNumber:e}},formatPhoneNumber:function(e,t){return t?e?`${e}-${t}`:t:e||""}}}("undefined"!=typeof window?window:void 0),function(e){if(!e.PhoneInputUtils)return void console.error("[PhoneInput] PhoneInputUtils is required");const t=e.PhoneInputUtils;function r(t){if(void 0!==e.FlowUI&&"function"==typeof e.FlowUI._getComponent){const r=e.FlowUI._getComponent(t);if(r)return r}return e[t]}const n='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>';e.PhoneInput={create:function(e={}){const i=e.variant||"default",l=e.inputSize||"default",s=!!e.disabled,c=!!e.disableCountrySelect,d=!!e.hideCountrySelect,u=t.getCountriesOptions();let p=null;if(e.defaultPhoneNumber){const r=t.parsePhoneNumber(e.defaultPhoneNumber);if(r.callingCode){const e=t.getCountryCodeFromCallingCode(r.callingCode);e&&(p=u.find(t=>t.value===e))}}!p&&e.defaultCountryCode&&(p=u.find(t=>t.value===e.defaultCountryCode)),p||(p=u.find(e=>"IN"===e.value)||u[0]);let f=p,h="";if(e.defaultPhoneNumber){const r=t.parsePhoneNumber(e.defaultPhoneNumber);h=r.nationalNumber}const m=document.createElement("div");m.className="flex w-full flex-col gap-4";const g=document.createElement("div");g.className="flex items-center gap-2";let v=null;d||(v=function(e){const{variant:i,inputSize:l,disabled:s,options:c,value:d,getValue:u,className:p,onChange:f}=e,h=u&&"function"==typeof u?u:()=>d,m=document.createElement("div");m.className="relative";const g=r("InputComponent");if(!g||"function"!=typeof g.create)return m;const v=g.create({variant:i,inputSize:l,type:"button",value:t.isoToEmoji(d.value)+" "+d.indicatif,disabled:s,readOnly:!0,showReadOnlyIcon:!1,className:"w-fit !gap-x-2 cursor-pointer "+(p||""),endIcon:n}),y=v.getInput();y.style.cursor="pointer",y.style.caretColor="transparent",m.appendChild(v);const b=document.createElement("div");b.className="w-[280px] max-w-full";const x=document.createElement("div");x.className="py-2 border-b-1/2 border-border-primary";const w=g.create({variant:"borderless",inputSize:"small",type:"text",placeholder:"Find your country...",startIcon:a});x.appendChild(w),b.appendChild(x);const C=document.createElement("div");function E(e=""){C.innerHTML="";const r=c.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));if(0===r.length){const e=document.createElement("div");return e.className="flex h-full min-h-[100px] w-full items-center justify-center p-4 !text-reg-13 text-typography-quaternary-text",e.textContent="No country found.",void C.appendChild(e)}r.forEach(e=>{const r=h(),n=r&&r.value===e.value,a=document.createElement("div");a.setAttribute("role","option"),a.setAttribute("data-value",e.value),a.setAttribute("aria-selected",n),a.className=["relative flex w-full cursor-pointer select-none items-center gap-8 rounded-2 px-12 py-6 text-reg-13 outline-none first:rounded-t-4 last:rounded-b-4","hover:bg-fill-tertiary-fill-light-gray focus:bg-fill-tertiary-fill-light-gray",n?"bg-primary-surface hover:!bg-primary-surface-hover":""].filter(Boolean).join(" ");const i=document.createElement("span");if(i.className="flex items-center gap-8 flex-1 truncate",i.textContent=`${t.isoToEmoji(e.value)} ${e.label}`,a.appendChild(i),n){const e=document.createElement("span");e.className="ml-auto text-primary-base size-16",e.innerHTML=o,a.appendChild(e)}a.addEventListener("click",()=>{y.value=t.isoToEmoji(e.value)+" "+e.indicatif,f(e),S.hide()}),C.appendChild(a)})}C.className="overflow-y-auto max-h-[200px] p-2 w-full rounded-4 bg-fill-quarternary-fill-white",E(),b.appendChild(C);const k=w.getInput();k.addEventListener("input",e=>{E(e.target.value)});const N=r("Popover");if(!N||"function"!=typeof N.create)return m;const S=N.create({trigger:v,content:b,placement:"bottom",align:"start",closeOnClickOutside:!0,bodyClassName:"p-0",panelClassName:"w-[280px]",onOpen:()=>{k.value="",E(),setTimeout(()=>k.focus(),100)}});s||v.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()});return m}({variant:i,inputSize:l,disabled:s||c,options:u,value:f,getValue:()=>f,className:e.countryCodeClassName,onChange:r=>{f=r,x(),e.onCountryChange&&e.onCountryChange(r);const n=t.formatPhoneNumber(r.indicatif,h);e.onPhoneNumberChange&&e.onPhoneNumberChange(n),e.onChange&&e.onChange(n,r)}}),g.appendChild(v));const y=r("InputComponent");if(!y||"function"!=typeof y.create)return console.error("[PhoneInput] InputComponent is required"),m;const b=y.create({variant:i,inputSize:l,type:"tel",placeholder:e.placeholder||t.getExampleFormat(f.value),value:h,disabled:s,className:e.className||"",onInput:r=>{const n=r.target,a=(n.value||"").replace(/\D/g,"");n.value!==a&&(n.value=a),h=a;const o=t.formatPhoneNumber(f.indicatif,h);e.onPhoneNumberChange&&e.onPhoneNumberChange(o),e.onChange&&e.onChange(o,f)}});function x(){const r=b.getInput();if(r&&(r.placeholder=e.placeholder||t.getExampleFormat(f.value)),!d){const e=b.querySelector("span.text-typography-quaternary-text");e&&(e.textContent=`+${f.indicatif}`)}}return g.appendChild(b),m.appendChild(g),m.getValue=function(){return t.formatPhoneNumber(f.indicatif,h)},m.setValue=function(e){const r=t.parsePhoneNumber(e);if(r.callingCode){const e=t.getCountryCodeFromCallingCode(r.callingCode);if(e){const r=u.find(t=>t.value===e);if(r&&(f=r,v)){const e=v.querySelector("input");e&&(e.value=t.isoToEmoji(r.value)+" "+r.indicatif)}}}h=r.nationalNumber,b.setValue(h),x()},m.getCountry=function(){return f},m.setCountry=function(e){const r=u.find(t=>t.value===e);if(r){if(f=r,v){const e=v.querySelector("input");e&&(e.value=t.isoToEmoji(r.value)+" "+r.indicatif)}x()}},m.setDisabled=function(e){if(b.setDisabled(e),v){const t=v.querySelector("input");t&&(t.disabled=e)}},m}},console.log("[PhoneInput] Component loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M9 12h6"/><path d="M9 16h6"/><path d="M9 8h1"/></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m22 8-6 4 6 4V8Z"/><rect width="14" height="12" x="2" y="6" rx="2" ry="2"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>',i='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M8 12h8"/><path d="M8 16h8"/><path d="M8 8h8"/></svg>',l='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>',s='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',c='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>',d='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',p=/\.(jpe?g|png|gif|webp|bmp|svg|ico|avif)(\?|$)/i,f=/\.(pdf)(\?|$)/i,h=/\.(mp4|webm|mov|avi|mkv|m4v|ogv)(\?|$)/i,m=/\.(mp3|wav|ogg|m4a|aac|flac|webm)(\?|$)/i,g=/\.(xlsx?|xls|csv|ods)(\?|$)/i,v=/\.(docx?|txt|rtf|odt|pptx?|ppt)(\?|$)/i;function y(e){var s=(e||"").toLowerCase();return p.test(s)?r:f.test(s)?n:h.test(s)?a:m.test(s)?o:g.test(s)?i:v.test(s)?l:t}e.FileInput={create:function(t){const{label:r,fieldId:n,multiple:a=!0,accept:o="*",required:i=!1,helpText:l=null,isPrivate:p=!1,maxFiles:f=null,maxFileSize:h=10485760}=t;if(!e.FlowUI)throw new Error("FlowUI not available");const FlowUI=e.FlowUI,m=FlowUI.createFieldWrapper(r,i,l);m.setAttribute("data-field-id",n);const g=document.createElement("div");g.className="w-full flex flex-col gap-8";const v=document.createElement("div");v.className="relative flex w-full items-center justify-between rounded-4 border-1/2 border-border-primary bg-fill-quarternary-fill-white px-8 py-4 hover:border-primary-border focus-within:outline-none focus-within:border-1/2 focus-within:border-primary-border";const b=document.createElement("div");b.className="pointer-events-none flex min-w-0 flex-1 items-center gap-8 truncate";const x=e.Button&&"function"==typeof e.Button.create,w=a?"Choose files":"Choose a file",C=x?e.Button.create({variant:"outline",size:"small",text:w,className:"shrink-0 truncate"}):function(){const e=document.createElement("div");return e.className="shrink-0 truncate rounded-2 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-1 text-reg-13 text-typography-primary-text transition-colors duration-150 hover:bg-fill-secondary-fill-gray",e.textContent=w,e}(),E=document.createElement("p");E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text";const k=document.createElement("input");k.type="file",k.className="absolute inset-0 z-10 w-full cursor-pointer opacity-0",k.multiple=a,"*"!==o&&(k.accept=o);const N=document.createElement("div");N.className="ml-4 flex size-16 items-center justify-center shrink-0 text-typography-quaternary-text",N.style.display="none";const S=document.createElement("div");S.className="flex flex-wrap gap-8";const A=document.createElement("div");A.className="flex flex-wrap gap-8",A.style.display="none";let L=[],T=[];function I(){S.innerHTML="";var t=e.Badge&&"function"==typeof e.Badge.create;L.forEach(function(r,n){var a=document.createElement("p");a.className="max-w-[100px] truncate text-reg-10 text-typography-secondary-text",a.textContent=r.name,a.title=r.url;var o,i=document.createElement("div");if(i.className="flex items-center gap-2 shrink-0",i.appendChild(function(t){const r=document.createElement("button");return r.type="button",r.className="shrink-0 rounded-2 p-4 text-typography-quaternary-text transition-colors hover:text-typography-primary-text focus:outline-none",r.innerHTML=s,r.setAttribute("aria-label","Copy URL"),r.addEventListener("click",function(r){r.stopPropagation(),navigator.clipboard.writeText(t).then(function(){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,["Link copied"],"success")}},function(){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,["Copy failed"],"error")}})}),r}(r.url)),i.appendChild(function(e){const t=document.createElement("button");return t.type="button",t.className="shrink-0 rounded-2 p-4 text-typography-quaternary-text transition-colors hover:text-typography-primary-text focus:outline-none",t.innerHTML=c,t.setAttribute("aria-label","View file"),t.addEventListener("click",function(t){t.stopPropagation(),window.open(e,"_blank","noopener")}),t}(r.url)),i.appendChild(function(e){const t=document.createElement("button");return t.type="button",t.className="shrink-0 rounded-2 p-4 text-error-text-base transition-colors hover:bg-error-surface focus:outline-none",t.innerHTML=d,t.setAttribute("aria-label","Remove file"),t.addEventListener("click",function(t){t.stopPropagation(),e()}),t}(function(){L.splice(n,1),_(),I(),q()})),t){var l=(o=e.Badge.create({size:"small",startIcon:y(r.name||r.url),content:a,endIcon:i,className:"text-typography-primary-text"})).querySelectorAll(".flex.size-16");l.length>=1&&l[0].classList.add("text-typography-secondary-text")}else{(o=document.createElement("div")).className="inline-flex items-center gap-4 rounded-4 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-2 text-med-12 text-typography-primary-text";var u=document.createElement("span");u.className="flex size-16 shrink-0 items-center justify-center text-typography-secondary-text",u.innerHTML=y(r.name||r.url),o.appendChild(u),o.appendChild(a),o.appendChild(i)}S.appendChild(o)})}function M(){A.innerHTML="";var t=e.Badge&&"function"==typeof e.Badge.create;T.forEach(function(r){var n,a=document.createElement("p");if(a.className="max-w-[100px] truncate text-reg-10 text-typography-secondary-text",a.textContent=r.name,t){var o=(n=e.Badge.create({size:"small",startIcon:u,content:a,className:"text-typography-primary-text"})).querySelectorAll(".flex.size-16");o.length>=1&&o[0].classList.add("text-typography-secondary-text")}else{(n=document.createElement("div")).className="inline-flex items-center gap-4 rounded-4 border-1/2 border-border-primary bg-fill-tertiary-fill-light-gray px-8 py-2 text-med-12";var i=document.createElement("span");i.className="flex size-16 shrink-0 items-center justify-center text-typography-secondary-text",i.innerHTML=u,n.appendChild(i),n.appendChild(a)}A.appendChild(n)}),A.style.display=T.length>0?"flex":"none"}function q(){const e=L.length,t=T.length;if(e>0||t>0?t>0?(E.textContent="Uploading…",E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text"):(E.textContent=`${e} file${1!==e?"s":""} selected`,E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-primary-text"):(E.textContent="No files chosen",E.className="text-reg-13 min-w-0 flex-1 truncate text-typography-quaternary-text"),N.style.display=t>0?"flex":"none",t>0&&0===N.children.length){const e=document.createElement("span");e.className="inline-block animate-spin",e.innerHTML=u,N.appendChild(e)}!function(){const e=L.length>0||T.length>0;C.textContent=a?e?"Add more files":"Choose files":e?"Replace file":"Choose a file"}()}function _(){const e=L.map(e=>e.url).filter(e=>e),t=e.length>0?e:null;FlowUI.set(n,t),console.log(`[S3FileUpload] Saved to ${n}:`,t)}async function j(t){const r=function(e){if(h&&e.size>h)return`File "${e.name}" is too large. Maximum size is ${(h/1024/1024).toFixed(2)}MB`;if("*"!==o){const t=o.split(",").map(e=>e.trim()),r="."+e.name.split(".").pop().toLowerCase(),n=e.type;if(!t.some(e=>e.startsWith(".")?r===e.toLowerCase():!!e.includes("/")&&(n===e||n.startsWith(e.split("/")[0]+"/"))))return`File "${e.name}" type is not supported. Accepted: ${o}`}return null}(t);if(r){if(e.FlowUI&&e.FlowUI.renderAlerts){const t=document.getElementById("alerts");t&&e.FlowUI.renderAlerts(t,[r],"error")}}else{T.push({file:t,name:t.name}),M(),q();try{const r=await async function(t,r=!1){const n=new FormData;n.append("file",t,t.name),n.append("is_private",String(!!r));const a=e.S3_UPLOAD_URL||"/org/file/upload",o=e.SUPERLEAP_BASE_URL||"https://app.superleap.com/api/v1",i=a.startsWith("http")?a:`${o}${a}`;let l=null;try{const t=e.FlowUI&&"function"==typeof e.FlowUI._getComponent?e.FlowUI._getComponent("superleapClient"):e.superleapClient;if(t&&"function"==typeof t.getSdk){const e=t.getSdk();l=e?.apiKey}}catch(e){console.warn("[S3FileUpload] Could not get API key:",e)}const s={};l&&(s.Authorization=`Bearer ${l}`);const c=await fetch(i,{method:"POST",body:n,headers:s});if(!c.ok){const e=await c.text();throw new Error(`File upload failed (${c.status}): ${e}`)}const d=await c.json();console.log("[S3FileUpload] Upload response:");const u=d?.data?.url;if(!u)throw console.error("[S3FileUpload] No URL found in response:",d),new Error("Upload response did not contain a file URL");return{url:u}}(t,p),n=r?.url;if(!n)throw new Error(`No URL returned from upload for file "${t.name}"`);console.log(`[S3FileUpload] File uploaded successfully: ${t.name} -> ${n}`),T=T.filter(e=>e.file!==t),L.push({url:n,name:t.name}),_(),I(),M(),q()}catch(r){if(console.error("[S3FileUpload] Upload error:",r),T=T.filter(e=>e.file!==t),M(),q(),e.FlowUI&&e.FlowUI.renderAlerts){const n=document.getElementById("alerts");n&&e.FlowUI.renderAlerts(n,[`Failed to upload "${t.name}": ${r.message}`],"error")}}}}return k.addEventListener("change",async function(t){const r=Array.from(t.target.files||[]);if(0!==r.length){if(a&&f&&L.length+r.length>f){const t=`You can only upload ${f} file${1!==f?"s":""}`;if(e.FlowUI&&e.FlowUI.renderAlerts){const r=document.getElementById("alerts");r&&e.FlowUI.renderAlerts(r,[t],"error")}return void(k.value="")}a||(L=[],T=[],I(),M(),q());for(const e of r)await j(e);k.value=""}}),b.appendChild(C),b.appendChild(E),v.appendChild(b),v.appendChild(N),v.appendChild(k),g.appendChild(v),g.appendChild(A),g.appendChild(S),m.appendChild(g),function(){const e=FlowUI.get(n);Array.isArray(e)&&e.length>0&&(L=e.map(e=>({url:e,name:e.split("/").pop()||"File"})),I(),q())}(),q(),m}},console.log("[FileInput] Module loaded successfully")}("undefined"!=typeof window?window:void 0),function(e){function t(e={}){const{data:t=[],columns:r=[],showHeader:n=!0,headerSize:a="small",hasBorder:o=!0,onRowClick:i=null,onFetch:l=null,hasMore:s=!1,isLoading:c=!1,emptyMessage:d="No data available"}=e;let u=[...t],p=null,f=null;function h(e){const t={small:"h-36",default:"h-44",large:"h-48"};return t[e]||t.default}function m(){const e=document.createElement("tbody");if(e.className="[&_tr:last-child]:border-0",0===u.length&&!c){const t=document.createElement("tr"),n=document.createElement("td");return n.colSpan=r.length,n.className="text-center py-12 text-typography-secondary-text",n.textContent=d,t.appendChild(n),e.appendChild(t),e}if(u.forEach(t=>{const n=document.createElement("tr");n.className="transition-colors hover:bg-fill-tertiary-fill-light-gray",i&&(n.className+=" cursor-pointer"),n.addEventListener("click",e=>{return r=t.id,void(i&&i(r));var r}),r.forEach((e,a)=>{const i=document.createElement("td"),l=a===r.length-1,s=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";if(i.className=`box-border w-fit min-w-[150px] max-w-[500px] text-ellipsis text-nowrap bg-fill-quarternary-fill-white px-12 py-8 align-middle !text-reg-12 text-typography-primary-text overflow-hidden truncate ${s} ${h("default")} ${l?"w-full":""}`,e.width&&(i.style.width=e.width,i.style.minWidth=e.width),e.cell&&"function"==typeof e.cell){const r=e.cell(t);"string"==typeof r?i.innerHTML=r:r instanceof HTMLElement?i.appendChild(r):i.textContent=r}else if(e.accessor){const r=t[e.accessor];i.textContent=null!=r?r:""}else i.textContent="";n.appendChild(i)}),e.appendChild(n)}),c)for(let t=0;t<3;t++){const t=document.createElement("tr");t.className="animate-pulse",r.forEach((e,n)=>{const a=document.createElement("td"),i=n===r.length-1,l=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";a.className=`px-12 py-8 ${l} ${h("default")} ${i?"w-full":""}`,e.width&&(a.style.width=e.width,a.style.minWidth=e.width);const s=document.createElement("div");s.className="h-4 bg-fill-secondary-fill-lighter-gray rounded",a.appendChild(s),t.appendChild(a)}),e.appendChild(t)}return e}function g(e){if(!l||c||!s)return;const{scrollTop:t,scrollHeight:r,clientHeight:n}=e.target;r-t<=1.5*n&&l()}function v(){if(!p)return;p.innerHTML="";const e=document.createElement("div");e.className="relative h-full max-w-full overflow-y-auto",e.addEventListener("scroll",g),f=document.createElement("table");const t=o?"border-1/2 border-borderColor-border-secondary":"";f.className=`w-full caption-bottom bg-fill-quarternary-fill-white text-reg-14 ${t}`,n&&f.appendChild(function(){const e=document.createElement("thead");e.className="[&_tr]:border-0 text-typography-quaternary-text";const t=document.createElement("tr");return r.forEach((e,n)=>{const i=document.createElement("th"),l=n===r.length-1,s=o?"border-1/2 border-borderColor-border-secondary":"border-b-1/2 border-b-borderColor-border-secondary";i.className=`min-w-[150px] max-w-[500px] text-nowrap bg-fill-tertiary-fill-light-gray px-12 py-8 text-left align-middle !text-semi-10 uppercase leading-[12px] tracking-[0.5px] text-typography-tertiary-text hover:bg-fill-tertiary-fill-light-gray ${s} ${function(e){const t={small:"h-32",default:"h-44",large:"h-48"};return t[e]||t.small}(a)} ${l?"w-full":""}`,e.width&&(i.style.width=e.width,i.style.minWidth=e.width);const c=document.createElement("span");c.textContent=e.header||"",i.appendChild(c),t.appendChild(i)}),e.appendChild(t),e}()),f.appendChild(m()),e.appendChild(f),p.appendChild(e)}return{mount(e){return p="string"==typeof e?document.querySelector(e):e,p?(v(),this):(console.error("Table: Invalid container element"),this)},setData(e){return u=[...e],v(),this},getData:()=>[...u],destroy(){p&&(p.innerHTML=""),p=null,f=null},refresh(){return v(),this}}}"undefined"!=typeof module&&module.exports?module.exports={createTable:t}:e.SuperleapTable={createTable:t}}("undefined"!=typeof window?window:void 0),function(e){const t="undefined"!=typeof window;if("undefined"!=typeof require&&"undefined"!=typeof module&&!t){try{e.createSuperLeapSDK=require("superleap-sdk")}catch(r){console.warn("[Superleap-Flow] SuperLeap SDK not found. Install with: npm install superleap-sdk")}if(require("./core/superleapClient.js"),require("./core/bridge.js"),require("./core/crm.js"),require("./components/label.js"),require("./core/flow.js"),require("./components/toast.js"),require("./components/alert.js"),require("./components/button.js"),require("./components/spinner.js"),require("./components/popover.js"),require("./components/select.js"),require("./components/enum-select.js"),require("./components/record-select.js"),require("./components/record-multiselect.js"),require("./components/time-picker.js"),require("./components/input.js"),require("./components/currency.js"),require("./components/textarea.js"),require("./components/duration/duration-utils.js"),require("./components/duration/duration-constants.js"),require("./components/duration/duration.js"),require("./components/date-time-picker/date-time-picker-utils.js"),require("./components/date-time-picker/date-time-picker.js"),require("./components/enumeration.js"),require("./components/multiselect.js"),require("./components/enum-multiselect.js"),require("./components/badge.js"),require("./components/avatar.js"),require("./components/icon.js"),require("./components/file-input.js"),require("./components/phone-input/phone-utils.js"),require("./components/phone-input/phone-input.js"),require("./components/checkbox.js"),require("./components/radio-group.js"),require("./components/table.js"),void 0!==e&&e.FlowUI){const SuperLeap=e.superleapClient?{init:e.superleapClient.init,getSdk:e.superleapClient.getSdk,isAvailable:e.superleapClient.isAvailable,getDefaultConfig:e.superleapClient.getDefaultConfig}:null;module.exports={FlowUI:e.FlowUI,SuperLeap:SuperLeap}}else if("undefined"!=typeof window&&window.FlowUI){const SuperLeap=window.superleapClient?{init:window.superleapClient.init,getSdk:window.superleapClient.getSdk,isAvailable:window.superleapClient.isAvailable,getDefaultConfig:window.superleapClient.getDefaultConfig}:null;module.exports={FlowUI:window.FlowUI,SuperLeap:SuperLeap}}}else if(t){const n={};function a(){["superleapClient","SuperleapBridge","Toast","Alert","Label","Button","Loader","Popover","Tooltip","Select","EnumSelect","RecordSelect","RecordMultiSelect","TimePicker","InputComponent","CurrencyComponent","TextareaComponent","Duration","DateTimePicker","Enumeration","MultiSelect","EnumMultiSelect","Badge","Avatar","Icon","FileInput","PhoneInput","Checkbox","RadioGroup","SuperleapTable"].forEach(e=>{window[e]&&(n[e]=window[e],delete window[e])}),window.FlowUI&&(window.FlowUI._getComponent=function(e){return n[e]});const e=n.superleapClient;e&&(window.SuperLeap={init:e.init.bind(e),getSdk:e.getSdk.bind(e),isAvailable:e.isAvailable.bind(e),getDefaultConfig:e.getDefaultConfig.bind(e),connect:e.connect?e.connect.bind(e):void 0,isConnected:e.isConnected?e.isConnected.bind(e):void 0,disconnect:e.disconnect?e.disconnect.bind(e):void 0,setLoading:e.setLoading?e.setLoading.bind(e):void 0,closeForm:e.closeForm?e.closeForm.bind(e):void 0,toast:e.toast?e.toast.bind(e):void 0,navigate:e.navigate?e.navigate.bind(e):void 0,getContext:e.getContext?e.getContext.bind(e):void 0,send:e.send?e.send.bind(e):void 0,on:e.on?e.on.bind(e):void 0,off:e.off?e.off.bind(e):void 0})}a();const o=n.superleapClient;if(o&&"function"==typeof o.init){window===window.parent&&!o.isAvailable()&&(o.init(o.getDefaultConfig()),console.log("[Superleap-Flow] SDK auto-initialized for standalone mode"))}if("undefined"!=typeof CustomEvent&&"undefined"!=typeof document){function i(){const e=new CustomEvent("superleap-flow:ready",{detail:{FlowUI:window.FlowUI,SuperLeap:window.SuperLeap,components:n}});document.dispatchEvent(e),console.log("[Superleap-Flow] Library ready - v2.2.8")}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):setTimeout(i,0)}}"undefined"!=typeof window&&window.FlowUI&&"undefined"!=typeof exports&&(exports.FlowUI=window.FlowUI,exports.SuperLeap=window.SuperLeap),void 0!==e&&e.FlowUI&&"undefined"!=typeof exports&&(exports.FlowUI=e.FlowUI,exports.SuperLeap=e.SuperLeap)}("undefined"!=typeof window?window:void 0)}();
|