@seatlayer/core 0.71.5 → 0.72.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/{categoryInventory-r3OfIEQn.d.cts → categoryInventory-BU1j8Q70.d.cts} +1 -1
  2. package/dist/{categoryInventory-B8CDQtH4.d.ts → categoryInventory-Bt-0psga.d.ts} +1 -1
  3. package/dist/chunk-5U25QLSS.js +1 -0
  4. package/dist/{chunk-LR7WIR5Z.js → chunk-ALE2T36W.js} +1 -1
  5. package/dist/chunk-BLPBTW6I.js +1 -0
  6. package/dist/{chunk-GXMGOWKB.js → chunk-FMZ6HLDH.js} +1 -1
  7. package/dist/chunk-HXYWP6NX.js +1 -0
  8. package/dist/chunk-JBOTRSMY.js +1 -0
  9. package/dist/{chunk-MR2O5WC7.js → chunk-O5UWBFUT.js} +1 -1
  10. package/dist/chunk-XLGYWT5G.js +1 -0
  11. package/dist/chunk-YW2WGLRM.js +1 -0
  12. package/dist/core/chart-ops/index.cjs +1 -1
  13. package/dist/core/chart-ops/index.d.cts +38 -9
  14. package/dist/core/chart-ops/index.d.ts +38 -9
  15. package/dist/core/chart-ops/index.js +1 -1
  16. package/dist/core/color.cjs +1 -1
  17. package/dist/core/color.d.cts +4 -1
  18. package/dist/core/color.d.ts +4 -1
  19. package/dist/core/color.js +1 -1
  20. package/dist/core/inventory/index.cjs +1 -1
  21. package/dist/core/inventory/index.d.cts +15 -5
  22. package/dist/core/inventory/index.d.ts +15 -5
  23. package/dist/core/inventory/index.js +1 -1
  24. package/dist/core/layout/index.d.cts +6 -6
  25. package/dist/core/layout/index.d.ts +6 -6
  26. package/dist/core/quality/index.cjs +1 -1
  27. package/dist/core/quality/index.d.cts +3 -3
  28. package/dist/core/quality/index.d.ts +3 -3
  29. package/dist/core/quality/index.js +1 -1
  30. package/dist/core/render-assets/index.cjs +1 -1
  31. package/dist/core/render-assets/index.d.cts +1 -1
  32. package/dist/core/render-assets/index.d.ts +1 -1
  33. package/dist/core/render-assets/index.js +1 -1
  34. package/dist/core/seatConfidence.d.cts +1 -1
  35. package/dist/core/seatConfidence.d.ts +1 -1
  36. package/dist/core/sections/index.d.cts +7 -7
  37. package/dist/core/sections/index.d.ts +7 -7
  38. package/dist/{eventConfigurations-ByU_uPeS.d.cts → eventConfigurations-3uSorYVC.d.cts} +1 -1
  39. package/dist/{eventConfigurations-0OC43JJY.d.ts → eventConfigurations-DfVUGyCg.d.ts} +1 -1
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.cts +12 -12
  42. package/dist/index.d.ts +12 -12
  43. package/dist/index.js +1 -1
  44. package/dist/{labeling-DAGq3u0z.d.cts → labeling-9RWWmJhZ.d.cts} +1 -1
  45. package/dist/{labeling-B05IJwd2.d.ts → labeling-BiWB-8aq.d.ts} +1 -1
  46. package/dist/{layout-e0Qe7jmM.d.cts → layout-B6iOoPOv.d.cts} +3 -3
  47. package/dist/{layout-DkDRcXvu.d.ts → layout-B7URbtDR.d.ts} +3 -3
  48. package/dist/{renderedQuality-BaejczsK.d.cts → renderedQuality-BZsq3wDe.d.cts} +1 -1
  49. package/dist/{renderedQuality-BwwrqYzX.d.ts → renderedQuality-C5dQiq97.d.ts} +1 -1
  50. package/dist/{renderer-BNicx5sw.d.ts → renderer-6sFRupj0.d.ts} +2 -2
  51. package/dist/{renderer-Duv1HhQg.d.cts → renderer-CBOo1OZk.d.cts} +2 -2
  52. package/dist/{sections-CrX4vq-m.d.ts → sections-Cn_sk1Sx.d.ts} +1 -1
  53. package/dist/{sections-BjGjR21N.d.cts → sections-DU6YDYoZ.d.cts} +1 -1
  54. package/dist/{segmentedRowModel-UO_YIQRB.d.cts → segmentedRowModel-CKmyHvKv.d.cts} +1 -1
  55. package/dist/{segmentedRowModel-BOO8w9Ng.d.ts → segmentedRowModel-DbP7pWUk.d.ts} +1 -1
  56. package/dist/{ticketRestrictions-dvlNTwem.d.ts → ticketRestrictions-CvS2oQ8v.d.ts} +2 -2
  57. package/dist/{ticketRestrictions-DUQrKTpS.d.cts → ticketRestrictions-DkenahW2.d.cts} +2 -2
  58. package/dist/{types-0yruRsAj.d.cts → types-D6-wLa-m.d.cts} +200 -20
  59. package/dist/{types-0yruRsAj.d.ts → types-D6-wLa-m.d.ts} +200 -20
  60. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  61. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  62. package/dist/view3d/index.cjs +27 -27
  63. package/dist/view3d/index.d.cts +3 -3
  64. package/dist/view3d/index.d.ts +3 -3
  65. package/dist/view3d/index.js +1 -1
  66. package/dist/view3d/scene/scene.worker.cjs +1 -1
  67. package/dist/view3d/scene/scene.worker.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-7KS6TAYH.js +0 -1
  70. package/dist/chunk-CXF32VPG.js +0 -1
  71. package/dist/chunk-JBGLFOJO.js +0 -1
  72. package/dist/chunk-NXFDYBZY.js +0 -1
  73. package/dist/chunk-SKO3DCVB.js +0 -1
  74. package/dist/chunk-T2LWVOQ3.js +0 -1
@@ -1 +1 @@
1
- "use strict";var Re=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var $n=Object.getOwnPropertyNames;var Fn=Object.prototype.hasOwnProperty;var Dn=(e,t)=>{for(var n in t)Re(e,n,{get:t[n],enumerable:!0})},Bn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $n(t))!Fn.call(e,r)&&r!==n&&Re(e,r,{get:()=>t[r],enumerable:!(o=Nn(t,r))||o.enumerable});return e};var Gn=e=>Bn(Re({},"__esModule",{value:!0}),e);var _r={};Dn(_r,{CATEGORY_INVENTORY_FAMILIES:()=>Pe,GroupedTableProjectionError:()=>ie,MAX_DIRECT_ROW_SWEEP:()=>Ea,MAX_EVENT_INVENTORY:()=>Ee,MAX_GA_CAPACITY:()=>X,MAX_ROW_BLOCK_ROWS:()=>ft,MAX_ROW_SEATS:()=>Ma,MIN_ROW_BLOCK_ROWS:()=>dt,MIN_ROW_SEATS:()=>Ca,applicableTicketTiers:()=>Or,capacityControl:()=>Pn,categoryCapacity:()=>wr,chartCapacity:()=>lt,companionSelectionIssue:()=>jn,describeCategoryInventoryConflict:()=>nt,effectiveSeatOwnerCategoryCounts:()=>ge,gaAreasOf:()=>wo,gaInventorySegments:()=>Ye,gaUnitLabel:()=>Dt,gaUnitLabels:()=>We,groupedTableInventory:()=>kr,growJoinedGAInventory:()=>So,inspectCategoryInventoryConflicts:()=>fe,intactRowBlockMembers:()=>Lr,isGaUnitLabel:()=>de,pickBestAvailable:()=>bt,pickBestAvailableInventory:()=>Kn,remediateCategoryInventoryConflicts:()=>ot,resizeChartCapacity:()=>Cr,resolveRowBlockCount:()=>Er,resolveRowTerminalCapacity:()=>Pr,resolveTicketTierForSeat:()=>gt,rowBlockEdgePoint:()=>ut,rowBlockPreviewRows:()=>An,rowTerminalEndpoint:()=>On,rowWithTerminalCapacity:()=>kn,strandedSingles:()=>Mr,ticketOptionNotApplicableIssue:()=>Rn,ticketSelectionIssue:()=>jr,ticketTierAppliesToSeat:()=>Te,validGAInventorySegments:()=>Le});module.exports=Gn(_r);function je(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let n=e.id.lastIndexOf(":");if(n<0)return t;let o=Number(e.id.slice(n+1));return Number.isFinite(o)?o:t}function ye(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function pt(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function mt(e,t){return e.find(n=>n.focalPoint)?.focalPoint??t}function _e(e){return e.commercial?.premium===!0}function bt(e,t,n){let o=Math.floor(n.qty);if(!Number.isFinite(o)||o<=0)return{labels:[],reason:"sold_out"};let{categoryKey:r,zoneId:i,focal:s,preferPremium:c}=n,g=new Map,d=[];if(e.forEach((u,m)=>{let w=t.has(u.label)&&(!r||u.categoryKey===r)&&(!i||u.zoneId===i),b=u.logicalRowId??u.rowId,I=g.get(b);I||(I=[],g.set(b,I)),I.push({seat:u,index:je(u,m),elig:w}),w&&d.push(u)}),d.length===0)return{labels:[],reason:"sold_out"};let l=null,f=u=>{if(!l)return!0;if(c&&u.nonPremium!==l.nonPremium)return u.nonPremium<l.nonPremium;if(u.orphan!==l.orphan)return u.orphan<l.orphan;if(u.d2!==l.d2)return u.d2<l.d2;let m=u.rowId.localeCompare(l.rowId);return m!==0?m<0:u.startIndex<l.startIndex};for(let[u,m]of g){let w=[...m].sort((I,C)=>I.index-C.index),b=0;for(;b<w.length;){if(!w[b].elig){b++;continue}let I=b;for(;I<w.length&&w[I].elig&&(I===b||w[I].index===w[I-1].index+1);)I++;let C=I-b;for(let S=0;S+o<=C;S++){let x=S,O=C-(S+o),E=x===1||O===1?1:0,T=w.slice(b+S,b+S+o).map(A=>A.seat),a={labels:T.map(A=>A.label),seats:T,rowId:u,startIndex:w[b+S].index,orphan:E,nonPremium:c?T.reduce((A,p)=>A+(_e(p)?0:1),0):0,d2:ye(pt(T),mt(T,s))};f(a)&&(l=a)}b=I}}return l?{labels:l.labels}:d.length<o?{labels:[],reason:"not_enough_together"}:{labels:d.map((u,m)=>({seat:u,i:m,d2:ye(u,u.focalPoint??s)})).sort((u,m)=>{if(c){let b=_e(u.seat)?0:1,I=_e(m.seat)?0:1;if(b!==I)return b-I}if(u.d2!==m.d2)return u.d2-m.d2;let w=(u.seat.logicalRowId??u.seat.rowId).localeCompare(m.seat.logicalRowId??m.seat.rowId);return w!==0?w:je(u.seat,u.i)-je(m.seat,m.i)}).slice(0,o).map(u=>u.seat.label)}}function Kn(e,t,n,o){let r=Math.floor(o.qty),i=bt(e,n,o),c=t.filter(f=>f.bookingMode==="whole"&&f.capacity===r&&n.has(f.label)&&(!o.categoryKey||f.categoryKey===o.categoryKey)&&(!o.zoneId||f.zoneId===o.zoneId)).map(f=>({table:f,d2:ye(f.center,f.focalPoint??o.focal)})).sort((f,y)=>f.d2-y.d2||f.table.label.localeCompare(y.table.label))[0];if(!c)return i;if(!i.labels.length)return{labels:[c.table.label]};let g=new Map(e.map(f=>[f.label,f])),d=i.labels.map(f=>g.get(f)).filter(f=>!!f),l=d.length?ye(pt(d),mt(d,o.focal)):Number.POSITIVE_INFINITY;return c.d2<l?{labels:[c.table.label]}:i}var yt=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Un(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/yt(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let c of i.split(/\s+/)){let g=c.length;s&&s+1+g<=o?s+=1+g:(r+=Math.max(1,Math.ceil(g/o)),s=g%o)}}return Math.max(1,r)}function ht(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(c=>c.length))*yt(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=Un(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var zn=Math.PI/180;function B(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Vn(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,s=e.y-t.y;return{x:t.x+i*o-s*r,y:t.y+i*r+s*o}}function vt(e,t){return Vn(e,{x:0,y:0},t*zn)}function ae(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function xt(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function It(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[xt(e,.5)];let o=Array.from({length:n+1},(g,d)=>xt(e,d/n)),r=new Float64Array(o.length);for(let g=1;g<o.length;g+=1){let d=o[g].x-o[g-1].x,l=o[g].y-o[g-1].y;r[g]=r[g-1]+Math.hypot(d,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],c=1;for(let g=0;g<t;g+=1){let d=i*g/(t-1);for(;c<r.length-1&&r[c]<d;)c+=1;let l=r[c-1],f=r[c],y=f===l?0:(d-l)/(f-l);s.push({x:o[c-1].x+(o[c].x-o[c-1].x)*y,y:o[c-1].y+(o[c].y-o[c-1].y)*y})}return s}function V(e,t,n){return Math.max(t,Math.min(n,e))}var Z=Math.PI*2;function se(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Hn(e,t,n){let o=t-e;if(n){for(;o<0;)o+=Z;for(;o>=Z;)o-=Z}else{for(;o>0;)o-=Z;for(;o<=-Z;)o+=Z}return o}function Ne(e){if(e.version!==1||e.closed!==!0||!se(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!se(n.end))return!1;if(n.kind==="line"){if(B(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!se(n.control1)||!se(n.control2)||B(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!se(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(B(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(B(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||B(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return B(t,e.start)<=1e-4}function Xn(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function St(e,t=2){if(!Ne(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let s=Math.atan2(r.y-i.center.y,r.x-i.center.x),c=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),g=Hn(s,c,i.clockwise),d=Math.max(2,Math.ceil(Math.abs(g)*i.radius/n));for(let l=1;l<=d;l+=1){let f=s+g*l/d;o.push({x:i.center.x+Math.cos(f)*i.radius,y:i.center.y+Math.sin(f)*i.radius})}}else{let s=B(r,i.control1)+B(i.control1,i.control2)+B(i.control2,i.end),c=Math.max(2,Math.ceil(s/n));for(let g=1;g<=c;g+=1)o.push(Xn(r,i,g/c))}r=i.end}return B(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var zr=4/3;function wt(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((y,u)=>y.segmentedRow.componentIndex-u.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,c=i[0]?.segmentedRow;if(!c||!(s>=2&&i.length===s&&c?.boundaryBefore==="start"&&i.every((y,u)=>y.segmentedRow?.kind==="segmented-row-v1"&&y.segmentedRow.groupId===o&&y.segmentedRow.componentCount===s&&y.segmentedRow.componentIndex===u&&y.segmentedRow.repeatLabelOnComponents===c.repeatLabelOnComponents&&(u===0?y.segmentedRow.boundaryBefore==="start":y.segmentedRow.boundaryBefore!=="start")&&y.segmentedRow.displayLabel===c.displayLabel)))continue;let d=i.reduce((y,u)=>y+u.seatCount,0),l=0,f=0;for(let y of i)y.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(y.id,{groupId:o,adjacencyOffset:l,displayOffset:f,displayLabel:c.displayLabel,totalSeats:d,canonical:i[0],viewFromSeatUrl:c.viewFromSeatUrl,viewFromSeatMeta:c.viewFromSeatMeta,confidenceEvidence:c.confidenceEvidence}),l+=y.seatCount,f+=y.seatCount}return t}var Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Wn="abcdefghijklmnopqrstuvwxyz";function Zn(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function $e(e,t=!1){let n=t?Wn:Yn;return Zn(Math.max(0,Math.floor(e)-1),n)}var qn=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Ct(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of qn)for(;t>=o;)n+=r,t-=o;return n}function Qn(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function Fe(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",c=e.seatNumbering?.endAt,g=e.seatCount;if(i==="updown"||i==="updown-descending"){let u=Math.ceil(g/2),m=i==="updown"?t<u?n+2*t:n-1+2*(g-t):t<u?n+2*(u-1-t):n+1+2*(t-u);return`${s}${m}`}let d=i==="odd"||i==="even"?2:r,l=c!=null&&Number.isFinite(c)?c-(g-1)*d:n,f=o==="center"?Qn(g)[t]:o==="rtl"?g-1-t:t,y;switch(i){case"odd":{let u=l%2===1?l:l+1;y=String(u+f*2);break}case"even":{let u=l%2===0?l:l+1;y=String(u+f*2);break}case"roman":y=Ct(l+f*r);break;case"letters-upper":y=$e(l+f*r,!1);break;case"letters-lower":y=$e(l+f*r,!0);break;default:y=String(l+f*r);break}return`${s}${y}`}function Jn(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function he(e,t,n){return n?.label??`${e.label}-${Fe(e,t)}`}function De(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Fe(e,t)}`;let r=Jn(n),i=n.displayOffset+t;return`${n.displayLabel}-${Fe(r,i)}`}var ve=.02291666666666667,Zr=1/ve,eo=58,Mt=eo*ve,Ge=0,q=3,H=0,K=120,xe=0,Ie=45,Ke=7,Se=1.2;function Be(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function to(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Ke?e:q}function ce(e,t={}){let n=Be(t.floorBaseHeightM,H,K,0),o=Math.min(K,n+to(e.elevation)*Mt),r=e.height===void 0?o:Be(e.height,H,K,o),i=Be(e.rake,xe,Ie,0);return{height:r,rake:i}}function Et(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Lt(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],c=s.x-i.x,g=s.y-i.y,d=c*c+g*g,l=d>1e-12?((t-i.x)*c+(n-i.y)*g)/d:0;l<0?l=0:l>1&&(l=1);let f=Math.hypot(t-(i.x+l*c),n-(i.y+l*g));f<o&&(o=f)}return o}function no(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Pt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ue(e,t){let n=1/0;for(let o of Et(e)){let r=Lt(t,o.x,o.y);r<n&&(n=r)}for(let o of Et(t)){let r=Lt(e,o.x,o.y);r<n&&(n=r)}return n}function oo(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let f=Math.hypot(l.x-n,l.y-o);f>r&&(r=f,i=l)}let s=i.x-n,c=i.y-o,g=Math.hypot(s,c);g>1e-9?(s/=g,c/=g):(s=1,c=0);let d=e.map((l,f)=>({p:l,i:f,t:(l.x-n)*s+(l.y-o)*c})).sort((l,f)=>l.t-f.t);return{pts:d.map(l=>l.p),seatIndices:d.map(l=>t[l.i])}}function ro(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let C of e)n+=C.x,o+=C.y;n/=t,o/=t;let r=0,i=0,s=0,c=0,g=0,d=0,l=0;for(let C of e){let S=C.x-n,x=C.y-o;r+=S*S,s+=x*x,i+=S*x,c+=S*S*S,g+=x*x*x,d+=S*x*x,l+=x*S*S}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let y=(c+d)/2,u=(g+l)/2,m=(y*s-u*i)/f,w=(u*r-y*i)/f,b=m+n,I=w+o;return!Number.isFinite(b)||!Number.isFinite(I)?null:{cx:b,cy:I}}var io=.15;function ao(e){if(e.length<2)return null;let t=e.map(C=>{let S=0,x=0;for(let O of C.pts)S+=O.x,x+=O.y;return{x:S/C.pts.length,y:x/C.pts.length}}),n=0,o=0;for(let C of t)n+=C.x,o+=C.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let C of t){let S=C.x-n,x=C.y-o;r+=S*S,i+=S*x,s+=x*x}let c=r+s,g=r*s-i*i,d=c/2+Math.sqrt(Math.max(0,c*c/4-g)),l,f;Math.abs(i)>1e-12?(l=d-s,f=i):r>=s?(l=1,f=0):(l=0,f=1);let y=Math.hypot(l,f);if(!(y>1e-12))return null;l/=y,f/=y;let u=1/0,m=-1/0,w=[];for(let C of e){let S=1/0,x=-1/0;for(let O of C.pts){let E=O.x*l+O.y*f;E<S&&(S=E),E>x&&(x=E),E<u&&(u=E),E>m&&(m=E)}w.push(x-S)}let b=m-u;return b>1e-9?(w.sort((C,S)=>C-S),w[Math.min(w.length-1,Math.floor(w.length*.9))]/b<=so?{x:l,y:f}:null):null}var so=.35;function At(e,t,n,o){let r=new Map;for(let b of n){let I=t[b],C=I.rowId||`__seat-${b}`,S=r.get(C);S||(S={pts:[],idx:[]},r.set(C,S)),S.pts.push({x:I.x,y:I.y}),S.idx.push(b)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[b,I]of r){let C=oo(I.pts,I.idx),S=0;for(let x of C.pts)S+=Math.hypot(x.x-o.x,x.y-o.y);i.push({id:b,pts:C.pts,seatIndices:C.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:S/C.pts.length})}let s=i.map(b=>no(b.pts)),c=[];for(let b=0;b<i.length;b++){let I=1/0;for(let C=0;C<i.length;C++){if(b===C||Pt(s[b],s[C])>=I)continue;let S=Ue(i[b].pts,i[C].pts);S<I&&(I=S)}Number.isFinite(I)&&c.push(I)}c.sort((b,I)=>b-I);let g=c.length?c[Math.floor(c.length/2)]:1,d=Math.max(g*1.8,1e-6),l=i.map(()=>[]);for(let b=0;b<i.length;b++)for(let I=b+1;I<i.length;I++)Pt(s[b],s[I])>d||Ue(i[b].pts,i[I].pts)<=d&&(l[b].push(I),l[I].push(b));let f=0;for(let b=0;b<i.length;b++){if(i[b].blockId!==-1)continue;let I=f++,C=[b];for(i[b].blockId=I;C.length;){let S=C.pop();for(let x of l[S])i[x].blockId===-1&&(i[x].blockId=I,C.push(x))}}let y=new Map;for(let b of i){let I=y.get(b.blockId)??[];I.push(b),y.set(b.blockId,I)}let u=[];for(let b of i){if(b.pts.length<4)continue;let I=ro(b.pts);I&&(!Number.isFinite(I.cx)||!Number.isFinite(I.cy)||u.push({x:I.cx,y:I.cy}))}let m=u.length>=2?(()=>{let b=u.map(S=>S.x).sort((S,x)=>S-x),I=u.map(S=>S.y).sort((S,x)=>S-x),C=Math.floor(u.length/2);return{cx:b[C],cy:I[C]}})():null;if(m){let b=E=>Math.hypot(E.x-m.cx,E.y-m.cy),I=1/0,C=-1/0,S=[];for(let E of i){let T=1/0,a=-1/0;for(let A of E.pts){let p=b(A);p<T&&(T=p),p>a&&(a=p)}S.push(a-T),T<I&&(I=T),a>C&&(C=a)}let x=C-I;S.sort((E,T)=>E-T);let O=S[Math.min(S.length-1,Math.floor(S.length*.9))];if(x>1e-9&&O/x<=io){let E=i.map(P=>{let R=0;for(let D of P.pts)R+=b(D);return{row:P,radius:R/P.pts.length}}),T=0,a=0;for(let P of E)T+=P.radius,a+=P.row.focalDistance;T/=E.length,a/=E.length;let A=0;for(let P of E)A+=(P.radius-T)*(P.row.focalDistance-a);if(A<0)for(let P of E)P.radius=-P.radius;let v=1/0;for(let P of E)P.radius<v&&(v=P.radius);E.sort((P,R)=>P.radius-R.radius);let h=-1,L=-1/0,M=x/Math.max(1,E.length)*.5,k=[];for(let P of E)P.radius-L>M&&(h++,L=P.radius),P.row.ordinal=h,P.row.blockDepth=P.radius-v,k.push(P.row);return{sectionId:e,rows:k,blockCount:f}}}let w=[];for(let[,b]of y){let I=ao(b);if(I){let C=x=>{let O=0;for(let E of x.pts)O+=E.x*I.x+E.y*I.y;return O/x.pts.length};b.sort((x,O)=>C(x)-C(O)),b.length>=2&&b[0].focalDistance>b[b.length-1].focalDistance&&b.reverse();let S=0;for(let x=0;x<b.length;x++)x>0&&(S+=Ue(b[x-1].pts,b[x].pts)),b[x].ordinal=x,b[x].blockDepth=S,w.push(b[x])}else{let C=1/0;for(let S of b)S.focalDistance<C&&(C=S.focalDistance);b.sort((S,x)=>S.focalDistance-x.focalDistance);for(let S=0;S<b.length;S++)b[S].ordinal=S,b[S].blockDepth=Math.max(0,b[S].focalDistance-C),w.push(b[S])}}return{sectionId:e,rows:w,blockCount:f}}var co=/^\d{4}-\d{2}-\d{2}$/;function lo(e){let t=Date.parse(e);return Number.isFinite(t)?co.test(e)?t+864e5:t:null}function uo(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=lo(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function fo(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function go(e){return e.status!=="draft"&&e.status!=="retracted"}function po(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function kt(e,t={}){return!!e&&go(e)&&fo(e,t.activeConfigurationId,t.activeConfigurationVersion)&&po(e,t.activeBasisSha256)&&uo(e,t.now)}function _t(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var we=Math.PI/180;var le=16;function Ve(e,t,n,o){let r=n*we,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function mo(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return It(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let d=0;d<t;d++)s.push(Ve(d*n,0,r,i));return s}let c=o/(t-1)*we,g=n/(2*Math.sin(Math.abs(c)/2));for(let d=0;d<t;d++){let l=d*c,f=g*Math.sin(l),y=-g+g*Math.cos(l);s.push(Ve(f,y,r,i))}return s}function bo(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Ce(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function yo(e,t){let n=bo(e);return mo(e).map((o,r)=>{let i=n.get(r),s=_t(i),c=he(e,r,i),g={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:c,displayLabel:De(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(g).some(d=>d!==void 0&&d!==!1&&d!=="")?g:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function F(e){let t=[];for(let n of yo(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function ue(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Nt(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,f,y,u)=>{let m=o.get(l),w=_t(m),b=m?.label??`${e.label}-${l+1}`,I=e.displayLabel??e.label;return{index:l,label:b,displayLabel:m?.displayLabel??`${I}-${l+1}`,x:f+(m?.dx??0),y:y+(m?.dy??0),categoryKey:m?.categoryKey??e.categoryKey,skipped:!!m?.skip,accessible:w.length>0,accessibility:w,wheelchairSpaceType:m?.wheelchairSpaceType,commercial:m?.commercial,glyph:m?.glyph,viewUrl:m?.viewFromSeatUrl,viewMeta:m?.viewFromSeatUrl?m.viewFromSeatMeta:void 0,labelStyle:m?.labelStyle,...u?{side:u}:{}}};if(e.shape==="round"){let l=(e.radius??40)+le,f=e.rotation*we,y=Math.max(0,Math.min(360,e.seatArc??360));if(y>=360||n===1){for(let b=0;b<n;b++){let I=f+b/n*2*Math.PI;t.push(r(b,e.center.x+l*Math.cos(I),e.center.y+l*Math.sin(I)))}return t}let u=y*we,m=(2*Math.PI-u)/2,w=f+m;for(let b=0;b<n;b++){let I=w+b/(n-1)*u;t.push(r(b,e.center.x+l*Math.cos(I),e.center.y+l*Math.sin(I)))}return t}let i=e.width??80,s=e.height??50,c=ue(e),g=["top","bottom","left","right"],d=0;for(let l of g){let f=c[l];for(let y=0;y<f;y++){let u,m;l==="top"?(u=-i/2+(y+.5)*i/f,m=-s/2-le):l==="bottom"?(u=-i/2+(y+.5)*i/f,m=s/2+le):l==="left"?(u=-i/2-le,m=-s/2+(y+.5)*s/f):(u=i/2+le,m=-s/2+(y+.5)*s/f);let w=Ve(u,m,e.rotation,e.center);t.push(r(d++,w.x,w.y,l))}}return t}function $t(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Nt(e).filter(t=>!t.skipped).length}function G(e){return Nt(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function ho(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function Ot(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,g=t[r].y;s>e.y!=g>e.y&&e.x<(c-i)*(e.y-s)/(g-s)+i&&(n=!n)}return n}function vo(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),c=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=c+1e-7})}function U(e,t,n){return Ot(e,t)&&!(n??[]).some(o=>Ot(e,o)||vo(e,o))}function ze(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Q(e){switch(e.type){case"row":{let t=F(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ze(e.points);case"section":return ze(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ze(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Tt(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function xo(e,t){if(e.type!=="gaArea"||!Tt(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>Tt(r,o[i]))}function Io(e,t){let n=e.filter(s=>s.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=Q(t);return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(xo(t,s)||U(r,s.outline,s.holes))):void 0)??n.find(s=>U(r,s.outline,s.holes))}function He(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Me(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Rt(e,t,n,o,r,i,s,c,g){let d=[],l=wt(e),f=m=>!m?.eventConfigurationId||m.eventConfigurationId===o&&(m.eventConfigurationVersion===void 0||m.eventConfigurationVersion===g),y=m=>kt(m,{activeConfigurationId:o,activeConfigurationVersion:g,activeBasisSha256:r,now:c}),u=(m,w)=>y(m)?{...m,coverage:w}:void 0;for(let m of e){let w=[];if(m.type==="row"?w=F(m):m.type==="table"?w=G(m):m.type==="booth"&&(w=ho(m)),!w.length)continue;for(let x of w)x.viewUrl&&!f(x.viewMeta)&&(x.viewUrl=void 0,x.viewMeta=void 0);if(m.type==="row"){let x=l.get(m.id);if(x){let O=new Map((m.overrides??[]).map(E=>[E.index,E]));for(let E of w){let T=Number(E.id.slice(E.id.lastIndexOf(":")+1));if(!Number.isInteger(T))continue;E.logicalRowId=x.groupId,E.logicalSeatIndex=x.adjacencyOffset+T,O.get(T)?.displayLabel||(E.displayLabel=De(m,T,x)),!E.viewUrl&&x.viewFromSeatUrl&&f(x.viewFromSeatMeta)&&(E.viewUrl=x.viewFromSeatUrl,E.viewMeta=x.viewFromSeatMeta);let a=O.get(T)?.confidenceEvidence;E.confidenceEvidence=u(a,"exact-seat")??u(m.confidenceEvidence,"row-representative")??u(x.confidenceEvidence,"row-representative")}}}let b=Io(e,m),I=b?.viewFromSeatUrl,S=(b?.zone?t?.find(x=>x.id===b.zone):void 0)?.focalPoint??n;for(let x of w){if(!x.confidenceEvidence){let O=Number(x.id.slice(x.id.lastIndexOf(":")+1)),E=(m.type==="row"||m.type==="table")&&Number.isInteger(O)?m.overrides?.find(T=>T.index===O)?.confidenceEvidence:void 0;x.confidenceEvidence=u(E,"exact-seat")??(m.type==="row"?u(m.confidenceEvidence,"row-representative"):void 0)}x.confidenceEvidence??=u(b?.confidenceEvidence,"section-representative")??(s?u(s.evidence,s.coverage):void 0),!x.viewUrl&&I&&f(b?.viewFromSeatMeta)&&(x.viewUrl=I,x.viewMeta=b?.viewFromSeatMeta),!x.viewUrl&&i&&f(i.meta)&&(x.viewUrl=i.url,x.viewMeta=i.meta),b&&(x.sectionId=b.logicalSectionId??b.id),b?.zone&&(x.zoneId=b.zone),S&&(x.focalPoint={...S})}d.push(...w)}return d}function Xe(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,c=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,g=Rt(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,c,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&jt(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,g);for(let d of g)d.floorId=r.id;o.push(...g)}return o}let n=Rt(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&jt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function jt(e,t,n,o){let r=e.filter(l=>l.type==="section"),i=n>0||r.some(l=>l.height!==void 0||l.rake!==void 0||(l.elevation??0)>0);if(!r.length||!i||!t){for(let l of o)l.eyeHeightM=n+Se;return}let s=new Array(o.length),c=new Map,g=new Map;for(let l=0;l<o.length;l++){let f=o[l],u=(f.sectionId?r.find(w=>w.id===f.sectionId)??r.find(w=>w.logicalSectionId===f.sectionId&&U({x:f.x,y:f.y},w.outline,w.holes)):void 0)??r.find(w=>U({x:f.x,y:f.y},w.outline,w.holes))??null;if(s[l]=u,!u)continue;c.has(u.id)||c.set(u.id,ce(u,{floorBaseHeightM:n}));let m=g.get(u.id);m?m.push(l):g.set(u.id,[l])}let d=new Array(o.length).fill(void 0);for(let[l,f]of g){let y=c.get(l);if(!y)continue;let u=y.rake>0?Math.tan(y.rake*Math.PI/180):0,m=At(l,o,f,t);for(let w of m.rows){let b=w.blockDepth*ve*u,I=y.height+b;for(let C of w.seatIndices)d[C]=I}}for(let l=0;l<o.length;l++){let f=o[l],y=s[l];if(!y){f.eyeHeightM=n+Se;continue}let u=c.get(y.id);f.eyeHeightM=(d[l]??u.height)+Se}}var Ft="__sl_ga__",X=1e5,Ee=1e5;function Dt(e,t){return`${Ft}${encodeURIComponent(e)}__${t+1}`}function Le(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>X||(n+=r.count,n>X))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(c=>r.startIndex<c.end&&s>c.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function Ye(e){let t=Math.min(X,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:Le(e)?e.inventorySegments.map(n=>({...n})):[]}function We(e){return Ye(e).flatMap(t=>Array.from({length:t.count},(n,o)=>Dt(t.sourceAreaId,t.startIndex+o)))}function So(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let n=Ye(e);if(!n.length)return;let o=t-e.capacity;if(!o)return n;let i=n.filter(c=>c.sourceAreaId===e.id).reduce((c,g)=>Math.max(c,g.startIndex+g.count),0),s=n[n.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===i)s.count+=o;else{if(n.length>=256)return;n.push({sourceAreaId:e.id,startIndex:i,count:o})}return n}function wo(e){return Me(e).filter(t=>t.type==="gaArea")}function de(e){return e.startsWith(Ft)}var Co=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Y(e){let t=Co.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function Ze(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function qe(e){return .2126*Ze(e[0])+.7152*Ze(e[1])+.0722*Ze(e[2])}function $(e,t){let n=Y(e),o=Y(t);if(!n||!o)return null;let r=qe(n),i=qe(o);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function Mo(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=!0,s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function Bt(e){let t=Mo(e);return t?Eo(t):null}function Eo(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var Ut=7;var zt=10;var Je=.85,Vt=12,Ht=4.5,Lo=3,Gt="#000000",Kt="#ffffff",Po=24,Ao=18.67;function Xt(e,t=400){return e>=Po||t>=700&&e>=Ao?Lo:Ht}var ko={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},pi=ko.wheelchair;var Qe=$;function et(e,t,n){let o=Y(e),r=Y(t);if(!o||!r)return t;let i=Math.max(0,Math.min(1,n));return`#${o.map((c,g)=>Math.round(c*i+r[g]*(1-i))).map(c=>c.toString(16).padStart(2,"0")).join("")}`}function Yt(e,t,n=Ht){let o=Qe(t,e);if(o!=null&&o>=n)return t;let r=Qe(Gt,e)??0,i=Qe(Kt,e)??0;return r===0&&i===0?t:r>=i?Gt:Kt}var J=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],bi=new Map(J.map(e=>[e.key,e]));var Oo=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],yi=new Map(Oo.map(e=>[e.key,e]));var To=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],hi=new Set(To);var Ro=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,jo=/[\s"'<>`\\]/;function tt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Ro.test(e);if(jo.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function _o(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function ee(e){return _o(e)*2}var Pe=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function Wt(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function No(e){return Pe.find(t=>t.key===e)}function ge(e){let t=new Map,n=Math.max(0,Math.floor(e.seatCount)),o=new Map((e.overrides??[]).filter(i=>Number.isInteger(i.index)&&i.index>=0&&i.index<e.seatCount).map(i=>[i.index,i])),r=(i,s=1)=>{i&&s>0&&t.set(i,(t.get(i)??0)+s)};r(e.categoryKey,n-o.size);for(let i of o.values())i.skip||r(i.categoryKey??e.categoryKey);return t}function $o(e){return e.type==="row"||e.type==="table"?[...ge(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function Zt(e){return Pe.find(t=>t.objectType===e.type)??null}function qt(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function fe(e){let t=new Map;for(let r of Wt(e))for(let i of r.objects){if(!qt(i))continue;let s=Zt(i);for(let c of $o(i)){let g=t.get(c)??new Map,d=g.get(s.key)??[];if(!d.some(l=>l.id===i.id)){let l=i.displayLabel||i.label||i.id;d.push({id:i.id,label:l,type:s.objectType,floorId:r.id})}g.set(s.key,d),t.set(c,g)}}let n=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...t.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let i=t.get(r);if(!i||i.size<2)return[];let s=Pe.flatMap(c=>{let g=i.get(c.key);return g?.length?[{family:c.key,label:c.label,objectType:c.objectType,targets:g}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:s,objectIds:[...new Set(s.flatMap(c=>c.targets.map(g=>g.id)))]}]})}function nt(e){let t=e.families.map(n=>`${n.label} (${n.targets.map(o=>o.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory \u2014 ${t}. Each category can belong to only one kind \u2014 use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function Qt(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Fo(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?`--${t}`:`--${t}-${o}`,s=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(s))return n.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function Do(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?` (${t})`:` (${t} ${o})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,c=Qt(s);if(!n.has(c))return n.add(c),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function Bo(e,t,n,o){let r=No(t);return{...structuredClone(e),key:Fo(e.key,r.suffix,n),label:Do(e.label,r.labelSuffix,o)}}function Go(e,t,n){let o=[];for(let r of Wt(e))for(let i of r.objects){if(!qt(i))continue;let s=Zt(i),c=n.get(s.key);if(!(!c||c===t))if(i.type==="row"||i.type==="table"){let g=[];i.categoryKey===t&&(i.categoryKey=c);for(let d of i.overrides??[])d.categoryKey===t&&(d.categoryKey=c,g.push(d.index));(i.categoryKey===c||g.length)&&o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:c,...g.length?{seatOverrideIndices:g.sort((d,l)=>d-l)}:{}})}else i.categoryKey===t&&(i.categoryKey=c,o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:c}))}return o}function ot(e){let t=structuredClone(e),n=fe(t);if(!n.length)return{doc:t,changed:!1,changes:[],before:n,after:n};let o=new Set(t.categories.map(c=>c.key)),r=new Set(t.categories.map(c=>Qt(c.label))),i=[];for(let c of n){let g=t.categories.findIndex(m=>m.key===c.categoryKey);if(g<0)continue;let d=t.categories[g],l=c.families[0].family,f=new Map([[l,d.key]]),y=c.families.slice(1).map(m=>{let w=Bo(d,m.family,o,r);return f.set(m.family,w.key),{family:m.family,key:w.key,label:w.label,category:w}});t.categories.splice(g+1,0,...y.map(m=>m.category));let u=Go(t,d.key,f);i.push({categoryKey:d.key,categoryLabel:d.label,retainedFamily:l,clones:y.map(({family:m,key:w,label:b})=>({family:m,key:w,label:b})),reassignments:u})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=fe(t);return{doc:t,changed:i.length>0,changes:i,before:n,after:s}}function Ko(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function pe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function Ae(e,t,n){let o=pe(t,n,e);return Math.abs(o)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function Uo(e,t,n,o){let r=pe(e,t,n),i=pe(e,t,o),s=pe(n,o,e),c=pe(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)?!0:Math.abs(r)<=1e-7&&Ae(n,e,t)||Math.abs(i)<=1e-7&&Ae(o,e,t)||Math.abs(s)<=1e-7&&Ae(e,n,o)||Math.abs(c)<=1e-7&&Ae(t,n,o)}function zo(e){return e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n.x*r.y-r.x*n.y},0)}function Vo(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&Uo(e[t],e[n],e[o],e[r]))return!0}}return!1}function Jt(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>Ko(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(zo(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Vo(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var en="M13 4.6a1.6 1.6 0 1 0-3.2 0 1.6 1.6 0 0 0 3.2 0 M11 6.5V13h5l2.4 6 M15 16.4A5 5 0 1 1 9 11.3",tn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:"M16 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0 M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:"M15 5a3 3 0 1 0-6 0 3 3 0 0 0 6 0 M12 8l-4 10h8l-4-10 M10 18v4 M14 18v4"},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:en},{key:"first-aid",label:"First aid",group:"facilities",path:"M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z M12 8v8 M8 12h8"},{key:"coat-check",label:"Coat check",group:"facilities",path:"M12 6a2 2 0 0 1 0-4 2 2 0 0 1 1.6 3.2L21 13H3l8.4-7.8 M3 13h18"},{key:"atm",label:"ATM / cash",group:"facilities",path:"M2 6h20v12H2V6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0 M6 9h.01 M18 15h.01"},{key:"info",label:"Info point",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M12 11v5 M12 8h.01"},{key:"lost-found",label:"Lost & found",group:"facilities",path:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14 M16 16l5 5 M9 8.5a2 2 0 1 1 3 1.7c-.8.5-1 .8-1 1.8 M11 15h.01"},{key:"restrooms",label:"Restrooms",group:"facilities",path:"M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M9 18v-3.5a3 3 0 0 1 6 0V18"},{key:"charging",label:"Charging point",group:"facilities",path:"M3 8h13v8H3V8Z M16 10h3v4h-3 M9.6 9l-2 3.5h2.5l-1.5 3"},{key:"smoking",label:"Smoking area",group:"facilities",path:"M2 15h13v3H2v-3Z M18 16h2 M19 8c0 1 1 1.5 1 2.5S19 12 19 13"},{key:"no-smoking",label:"No smoking",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M5.6 5.6l12.8 12.8 M7 13h6v2H7v-2Z"},{key:"food",label:"Food",group:"food-drink",path:"M7 3v6a2 2 0 0 0 4 0V3 M9 11v10 M17 3c-1.6 1-2.2 3-2.2 6 0 2 .9 3.2 2.2 3.6V21"},{key:"bar",label:"Bar",group:"food-drink",path:"M4 5h16l-8 8-8-8Z M12 13v6 M8 20h8"},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 8h13v4a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8Z M17 9h2a2 2 0 0 1 0 4h-2 M8 2v2 M11 2v2 M4 21h14"},{key:"water",label:"Water / drinks",group:"food-drink",path:"M12 22a7 7 0 0 1-7-7c0-5 7-12 7-12s7 7 7 12a7 7 0 0 1-7 7Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:"M6 8h12l-1 12H7L6 8Z M9 8V6a3 3 0 0 1 6 0v2"},{key:"screen",label:"Screen",group:"facilities",path:"M3 4h18v12H3V4Z M9 20h6 M12 16v4 M10 8l4 2-4 2V8Z"},{key:"sound-booth",label:"Sound booth",group:"facilities",path:"M6 4v16 M6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4 M12 4v16 M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M18 4v16 M18 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4"},{key:"entrance",label:"Entrance",group:"navigation",path:"M14 3h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-5 M3 12h11 M10 8l4 4-4 4"},{key:"exit",label:"Exit",group:"navigation",path:"M10 3H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h5 M14 12h7 M17 8l4 4-4 4"},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:"M14 4.6a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0 M12.5 8l-3.5 2 1.6 3.6-2 4.4 M12.5 10l3.5 1.5 M9 10.5l-3.5 1 M15 12h6 M18 9l3 3-3 3"},{key:"stairs",label:"Stairs",group:"navigation",path:"M3 20v-4h4v-4h4v-4h4V4h5"},{key:"elevator",label:"Elevator",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M8 11l1.5-2 1.5 2 M8 14l1.5 2 1.5-2 M15 8v8"},{key:"parking",label:"Parking",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M9 17V7h4a3 3 0 0 1 0 6H9"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:en},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:"M8 20a4 4 0 0 1-2-3c0-1 .5-2 .5-3a4.5 4.5 0 1 1 9 0c0 1.4-1 2-2 2.4-1.2.5-1.5 1-1.5 2.2 M17 6a5 5 0 0 1 1 6 M19.5 4a8 8 0 0 1 1.2 9"}];var Ho=new Map(tn.map(e=>[e.key,e]));function nn(e){return typeof e=="string"&&Ho.has(e)}var Ei=tn.map(e=>e.key);var on=["butt","round","square"],rn=["miter","round","bevel"],rt=["none","arrow"];function it(e){return e==="line"||e==="polyline"}function W(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function te(e,t,n){let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>1e-7)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-1e-7)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+1e-7}function ne(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],s=t[o];if(te(e,i,s))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function z(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function sn(e,t,n,o){let r=z(e,t,n),i=z(e,t,o),s=z(n,o,e),c=z(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)?!0:Math.abs(r)<=1e-7&&te(n,e,t)||Math.abs(i)<=1e-7&&te(o,e,t)||Math.abs(s)<=1e-7&&te(e,n,o)||Math.abs(c)<=1e-7&&te(t,n,o)}function oe(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&sn(e[t],e[n],e[o],e[r]))return!0}}return!1}function me(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(sn(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return ne(e[0],t)||ne(t[0],e)}function an(e,t){return!t.some((n,o)=>te(e,n,t[(o+1)%t.length]))&&ne(e,t)}function cn(e){let t=e.outlinePath;if(!t?.segments.length)return;let n=i=>Number.isFinite(i.x)&&Number.isFinite(i.y),o=(i,s)=>Math.hypot(i.x-s.x,i.y-s.y);if(!n(t.start))return 0;let r=t.start;for(let i=0;i<t.segments.length;i++){let s=t.segments[i];if(!s||!n(s.end)||o(r,s.end)<=1e-9||s.kind==="bezier"&&(!n(s.control1)||!n(s.control2)))return i;if(s.kind==="arc"){if(!n(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return i;let c=Math.max(1e-4,s.radius*1e-4);if(Math.abs(o(r,s.center)-s.radius)>c||Math.abs(o(s.end,s.center)-s.radius)>c)return i}r=s.end}return o(r,t.start)>1e-4,t.segments.length-1}function Xo(e,t,n,o){let r=z(e,t,n),i=z(e,t,o),s=z(n,o,e),c=z(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)}function ln(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(Xo(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return e.some(n=>an(n,t))||t.some(n=>an(n,e))}function un(e){return e.role!=="reference-focal"||!e.points||!W(e.points)?null:e.points}function dn(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}function gn(e,t){if(e.displayLabel!==void 0){let n=e.displayLabel.normalize("NFKC").trim();(!n||n!==e.displayLabel||n.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let n=e.displayType.normalize("NFKC").trim();(!n||n!==e.displayType||n.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}}function fn(e,t,n,o){let r=e.crop,i=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||i)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...o?{floorId:o}:{}})}function at(e,t,n,o){let r=e.referenceImage,i=e.backgroundImage;r&&(fn(r,"reference",t,o),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...o?{floorId:o}:{}})),i&&(fn(i,i.assetId?"legacy reference":"buyer background",t,o),!i.assetId&&!i.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...o?{floorId:o}:{}}),i.assetId&&n.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...o?{floorId:o}:{}})),dn(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...o?{floorId:o}:{}})}function be(e){let t=new Set(J.map(n=>n.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(n=>!!n.trim()&&n.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=J.length&&new Set(e.accessibility.counts.map(n=>n.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(n=>t.has(n.type)&&Number.isInteger(n.count)&&n.count>0&&["user-confirmed","authoritative-source"].includes(n.evidence)&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240))}function pn(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function mn(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function bn(e,t){let n=e.floors?.length?e.floors.map(i=>({id:i.id,objects:i.objects})):[{id:"floor-0",objects:e.objects}],o=new Map,r=new Map;for(let i of n){let s=i.objects.filter(d=>d.type==="row"),c=new Map,g=new Map;for(let d of s){if(d.segmentedRow){let l=c.get(d.segmentedRow.groupId)??[];l.push(d),c.set(d.segmentedRow.groupId,l)}if(d.rowBlockGeneration){let l=g.get(d.rowBlockGeneration.groupId)??[];l.push(d),g.set(d.rowBlockGeneration.groupId,l)}d.segmentedRow&&d.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${d.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:d.id,floorId:i.id})}for(let[d,l]of c){let f=o.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" cannot span multiple floors`,objectId:l[0].id,floorId:i.id}),o.set(d,i.id);let y=l.slice().sort((I,C)=>I.segmentedRow.componentIndex-C.segmentedRow.componentIndex),u=y[0]?.segmentedRow,m=u?.componentCount??0,w=u?JSON.stringify({displayLabel:u.displayLabel,repeatLabelOnComponents:u.repeatLabelOnComponents,displayType:u.displayType,labelPresentation:u.labelPresentation,viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence,smoothing:u.smoothing}):"";u&&m>=2&&m<=64&&y.length===m&&u.boundaryBefore==="start"&&y.every((I,C)=>{let S=I.segmentedRow;return S.kind==="segmented-row-v1"&&S.groupId===d&&S.componentCount===m&&S.componentIndex===C&&(C===0?S.boundaryBefore==="start":S.boundaryBefore!=="start")&&S.displayLabel.normalize("NFKC").trim()===S.displayLabel&&S.displayLabel.length>0&&S.displayLabel.length<=80&&JSON.stringify({displayLabel:S.displayLabel,repeatLabelOnComponents:S.repeatLabelOnComponents,displayType:S.displayType,labelPresentation:S.labelPresentation,viewFromSeatUrl:S.viewFromSeatUrl,viewFromSeatMeta:S.viewFromSeatMeta,confidenceEvidence:S.confidenceEvidence,smoothing:S.smoothing})===w})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:l[0]?.id,floorId:i.id})}for(let[d,l]of g){let f=r.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:l[0].id,floorId:i.id}),r.set(d,i.id)}}}function Wo(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Zo(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:he(e,o,r),index:o})}return t}function yn(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:r?.label??`${e.label}-${o+1}`,index:o})}return t}function hn(e){let t=[];e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&t.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let n=[],o=new Set(e.categories.map(a=>a.key)),r=new Set(J.map(a=>a.key)),i=new Map(e.categories.map(a=>[a.key,a.price!=null||a.notForSale===!0])),s=new Set;at(e,t,n),e.theme?.logoUrl!==void 0&&!tt(e.theme.logoUrl)&&t.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let c=tt,g=(a,A,p,v={})=>{if(A===void 0)return;if(!A||typeof A!="object"||Array.isArray(A)){t.push({severity:"error",code:"invalid-seat-view-metadata",message:`${p} view metadata is invalid`,...v});return}let h=A;a||n.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${p} view metadata has no image`,...v});let L=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);h.projection!==void 0&&h.projection!=="equirectangular"&&t.push({severity:"error",code:"invalid-seat-view-projection",message:`${p} view projection must be equirectangular`,...v}),h.coverage!==void 0&&!L.has(h.coverage)&&t.push({severity:"error",code:"invalid-seat-view-coverage",message:`${p} view coverage is invalid`,...v});let M=(k,P,R)=>typeof k=="number"&&Number.isFinite(k)&&k>=P&&k<=R;if(h.initialBearingDeg!==void 0&&!M(h.initialBearingDeg,-360,360)&&t.push({severity:"error",code:"invalid-seat-view-bearing",message:`${p} view bearing must be between -360\xB0 and 360\xB0`,...v}),h.initialPitchDeg!==void 0&&!M(h.initialPitchDeg,-90,90)&&t.push({severity:"error",code:"invalid-seat-view-pitch",message:`${p} view pitch must be between -90\xB0 and 90\xB0`,...v}),h.capturedAt!==void 0&&(typeof h.capturedAt!="string"||h.capturedAt.length>40||!Number.isFinite(Date.parse(h.capturedAt)))&&t.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${p} view capture date is invalid`,...v}),h.sourceLabel!==void 0&&(typeof h.sourceLabel!="string"||h.sourceLabel.trim().length>100)&&t.push({severity:"error",code:"invalid-seat-view-source",message:`${p} view source label is invalid`,...v}),h.previewUrl!==void 0&&!c(h.previewUrl)&&t.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${p} view preview URL is invalid`,...v}),h.variants!==void 0){let k=Array.isArray(h.variants)?h.variants:[];if(!Array.isArray(h.variants)||k.length<1||k.length>4)t.push({severity:"error",code:"invalid-seat-view-variants",message:`${p} view variants must contain between 1 and 4 tiers`,...v});else{let P=new Set;for(let R of k){if(!R||typeof R!="object"||!c(R.url)||!Number.isInteger(R.width)||R.width<1||R.width>12e3||!Number.isInteger(R.height)||R.height<1||R.height>12e3||R.width!==R.height*2||typeof R.sha256!="string"||!/^[a-f0-9]{64}$/.test(R.sha256)||P.has(R.width)){t.push({severity:"error",code:"invalid-seat-view-variant",message:`${p} view variant is not a unique immutable 2:1 equirectangular tier`,...v});break}P.add(R.width)}}}for(let[k,P]of[["width",h.sourceWidth],["height",h.sourceHeight],["preview width",h.previewWidth],["preview height",h.previewHeight]])P!==void 0&&(!Number.isInteger(P)||P<1||P>32768)&&t.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${p} view source ${k} is invalid`,...v});h.captureEyeHeightM!==void 0&&!M(h.captureEyeHeightM,.5,3)&&t.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${p} capture eye height must be between 0.5 m and 3 m`,...v}),h.eventConfigurationId!==void 0&&(typeof h.eventConfigurationId!="string"||!h.eventConfigurationId.trim()||h.eventConfigurationId.length>100)&&t.push({severity:"error",code:"invalid-seat-view-configuration",message:`${p} event configuration id is invalid`,...v}),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&t.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${p} event configuration version is invalid`,...v}),h.eventConfigurationVersion!==void 0&&!h.eventConfigurationId&&t.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${p} event configuration version requires an id`,...v})},d=(a,A,p={})=>{if(a===void 0)return;let v=P=>{t.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${A} confidence evidence ${P}`,...p})};if(!a||typeof a!="object"||Array.isArray(a)){v("is invalid");return}let h=a;h.schema!=="seatlayer.seat-confidence/1"&&v("has an unsupported schema");let L=(P,R)=>typeof P=="string"&&P.normalize("NFKC").trim()===P&&P.length>0&&P.length<=R;L(h.evidenceId,120)||v("has an invalid evidence id"),L(h.modelVersion,120)||v("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(h.evidenceKind)||v("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(h.modelLevel)||v("has an invalid model level");let M=h.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(M)||v("has an invalid reality level"),h.eventConfigurationId!==void 0&&!L(h.eventConfigurationId,100)&&v("has an invalid event configuration id"),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&v("has an invalid event configuration version"),h.status!==void 0&&!new Set(["draft","approved","retracted"]).has(h.status)&&v("has an invalid publication status"),h.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(h.basisSha256)&&v("has an invalid venue basis SHA-256"),h.basisSha256!==void 0&&h.status!=="approved"&&v("can carry a venue basis SHA-256 only after approval");for(let[P,R]of[["assessment",h.assessedAt],["expiry",h.validUntil]])R!==void 0&&(!L(R,40)||!Number.isFinite(Date.parse(R)))&&v(`has an invalid ${P} date`);h.approvedByRole!==void 0&&!L(h.approvedByRole,100)&&v("has an invalid approving organization or role"),h.sourceLabel!==void 0&&!L(h.sourceLabel,120)&&v("has an invalid source label"),h.limitations!==void 0&&(!Array.isArray(h.limitations)||h.limitations.length>6||h.limitations.some(P=>!L(P,160)))&&v("has invalid limitations"),h.evidenceKind==="synthetic-model"&&(h.modelLevel!=="generated"||M!=="none")&&v("cannot describe synthetic data as verified or reality checked"),h.modelLevel!=="generated"&&(!h.assessedAt||!h.approvedByRole)&&v("requires an assessment date and approving organization or role for verified model levels"),h.modelLevel==="configuration-verified"&&!h.eventConfigurationId&&v("requires an event configuration id for configuration verification"),M!=="none"&&(!h.assessedAt||!h.sourceLabel)&&v("requires an assessment date and source for reality evidence"),M==="actual-build-checked"&&(h.modelLevel!=="configuration-verified"||!h.eventConfigurationId)&&v("requires a configuration-verified model and event configuration for an actual-build check");let k=h.modeledTarget;k!==void 0&&(!k||typeof k!="object"||Array.isArray(k)?v("has an invalid modeled target"):((!L(k.label,80)||!L(k.methodLabel,100))&&v("has invalid modeled-target labels"),(!Number.isInteger(k.totalRayCount)||k.totalRayCount<1||k.totalRayCount>1e3||!Number.isInteger(k.clearRayCount)||k.clearRayCount<0||k.clearRayCount>k.totalRayCount)&&v("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(k.classification)||v("has an invalid modeled-target classification"),k.occluderLabels!==void 0&&(!Array.isArray(k.occluderLabels)||k.occluderLabels.length>10||k.occluderLabels.some(P=>!L(P,100)))&&v("has invalid modeled-target occluders")))};g(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),d(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!c(e.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let a of e.floors??[])a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${a.name}" has an invalid view-from-seat image URL`}),g(a.viewFromSeatUrl,a.viewFromSeatMeta,`Floor "${a.name}"`,{floorId:a.id}),d(a.confidenceEvidence,`Floor "${a.name}"`,{floorId:a.id});let l=e.floors?.length?e.floors.flatMap(a=>a.objects):e.objects;for(let a of l)if((a.type==="row"||a.type==="section")&&(a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&t.push({severity:"error",code:a.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${a.type==="row"?"Row":"Section"} "${a.label}" has an invalid view-from-seat image URL`,objectId:a.id}),g(a.viewFromSeatUrl,a.viewFromSeatMeta,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id}),d(a.confidenceEvidence,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id})),a.type==="row"&&a.segmentedRow&&(a.segmentedRow.viewFromSeatUrl!==void 0&&!c(a.segmentedRow.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${a.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:a.id}),g(a.segmentedRow.viewFromSeatUrl,a.segmentedRow.viewFromSeatMeta,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id}),d(a.segmentedRow.confidenceEvidence,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id})),a.type==="row"||a.type==="table")for(let A of a.overrides??[])A.viewFromSeatUrl!==void 0&&!c(A.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${A.index+1} has an invalid view-from-seat image URL`,objectId:a.id,seatIndices:[A.index]}),g(A.viewFromSeatUrl,A.viewFromSeatMeta,`Seat ${A.index+1}`,{objectId:a.id,seatIndices:[A.index]}),d(A.confidenceEvidence,`Seat ${A.index+1}`,{objectId:a.id,seatIndices:[A.index]});let f=new Set;for(let a of e.categories){f.has(a.key)&&t.push({severity:"error",code:"duplicate-category-key",message:`Category key "${a.key}" is used more than once`,categoryKey:a.key}),f.add(a.key);let A=new Set;for(let p of a.tiers??[]){if(A.has(p.id)&&t.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${p.id}" is used more than once in category "${a.key}"`,categoryKey:a.key}),p.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(p.restriction)&&t.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${p.name}" has an unknown restriction`,categoryKey:a.key}),p.buyerMessage!=null&&(!p.buyerMessage.trim()||p.buyerMessage.length>240)&&t.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${p.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:a.key}),p.currency!=null&&!/^[A-Z]{3}$/.test(p.currency)&&t.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${p.name}" must use a three-letter ISO currency`,categoryKey:a.key}),p.applicability!=null){let v=p.applicability.seatLabels,h=p.applicability.accessibility;(v!==void 0&&(!Array.isArray(v)||!v.length||v.length>1e4||v.some(L=>typeof L!="string"||!L.trim()||L.length>160)||new Set(v).size!==v.length)||h!==void 0&&(!Array.isArray(h)||!h.length||h.some(L=>!r.has(L))||new Set(h).size!==h.length))&&t.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${p.name}" has invalid seat applicability`,categoryKey:a.key})}p.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(p.evidence.provenance)||!p.evidence.sourceDescription.trim()||p.evidence.sourceDescription.length>240||p.evidence.capturedAt!==void 0&&(p.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(p.evidence.capturedAt))))&&t.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${p.name}" has invalid evidence provenance`,categoryKey:a.key}),A.add(p.id)}mn(a)||t.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${a.label||a.key} has incomplete or invalid reference evidence`,categoryKey:a.key})}let y=new Map,u=new Map,m=[],w=new Map,b=0,I=0,C=new Set;for(let a of e.floors??[])at(a,t,n,a.id),C.has(a.id)&&t.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${a.id}" is used more than once`,floorId:a.id}),C.add(a.id),a.baseHeightM!==void 0&&(!Number.isFinite(a.baseHeightM)||a.baseHeightM<H||a.baseHeightM>K)&&t.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${a.name}" base height must be between ${H} and ${K} metres`,floorId:a.id});let S=e.floors&&e.floors.length?e.floors.flatMap(a=>a.objects):e.objects;bn(e,t);let x=new Set;for(let a of S)x.has(a.id)&&t.push({severity:"error",code:"duplicate-object-id",message:`Object id "${a.id}" is used more than once`,objectId:a.id}),x.add(a.id);let O=new Set;for(let a of e.zones??[])O.has(a.id)&&t.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${a.id}" is used more than once`}),O.add(a.id),a.focalPoint!==void 0&&(!Number.isFinite(a.focalPoint.x)||!Number.isFinite(a.focalPoint.y))&&t.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${a.label}" must use a finite focal point`});let E=new Map;for(let a of S)if(!(a.type!=="section"||!a.zone)){if(e.zones?.length&&!O.has(a.zone)){t.push({severity:"error",code:"unknown-section-zone",message:`Section "${a.displayLabel??a.label}" references unknown zone "${a.zone}"`,objectId:a.id});continue}E.has(a.zone)||E.set(a.zone,a)}for(let[a,A]of E){let p=e.zones?.find(v=>v.id===a);p&&(p?.focalPoint||n.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${p?.label??a}" uses the legacy floor focal; set its own focal point before publishing`,objectId:A.id}))}for(let a of S)if((a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea")&&gn(a,t),Wo(a)){if(b++,I+=a.type==="booth"?1:a.type==="row"?Ce(a):a.bookAsWhole||a.variableOccupancy?a.seatCount:yn(a).length,y.get(a.label)!==void 0?a.type!=="row"&&t.push({severity:"error",code:"duplicate-object-label",message:`Label "${a.label}" is used by more than one object`,objectId:a.id}):y.set(a.label,a.id),o.has(a.categoryKey)?s.add(a.categoryKey):t.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.type==="row"){be(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),a.seatCount<1&&t.push({severity:"error",code:"empty-row",message:`Row "${a.label}" has no seats`,objectId:a.id});let p=new Set;for(let v of a.overrides??[]){(v.accessibility??[]).filter(k=>!r.has(k)).length&&t.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${a.label}" seat ${v.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[v.index]}),(!Number.isInteger(v.index)||v.index<0||v.index>=a.seatCount||p.has(v.index))&&t.push({severity:"error",code:"invalid-seat-override",message:`Row "${a.label}" has a duplicated or out-of-range seat override`,objectId:a.id,...Number.isInteger(v.index)?{seatIndices:[v.index]}:{}}),p.add(v.index);let L=v.wheelchairSpaceType,M=v.accessible===!0||v.accessibility?.includes("wheelchair");L!==void 0&&L!=="seat-present"&&L!=="no-seat"?t.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${a.label}" seat ${v.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[v.index]}):L&&(!M||v.skip)&&t.push({severity:"error",code:"invalid-wheelchair-space",message:v.skip?`Row "${a.label}" seat ${v.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${a.label}" seat ${v.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[v.index]})}for(let v of Zo(a))de(v.label)&&t.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${v.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id,seatIndices:[v.index]}),u.get(v.label)!==void 0?m.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${v.label}" is used more than once`,objectId:a.id,seatIndices:[v.index]}):u.set(v.label,a.id)}else if(a.type==="table"){let p=a.bookAsWhole===!0||a.variableOccupancy===!0;if(a.seatCountsBySide){let M=["top","bottom","left","right"],k=Object.keys(a.seatCountsBySide),P=M.every(D=>Number.isInteger(a.seatCountsBySide[D])&&a.seatCountsBySide[D]>=0&&a.seatCountsBySide[D]<=40),R=P?M.reduce((D,_n)=>D+a.seatCountsBySide[_n],0):Number.NaN;(a.shape!=="rect"||k.length!==M.length||k.some(D=>!M.includes(D))||!P||R!==a.seatCount||R<1||R>40)&&t.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${a.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${a.seatCount}-chair capacity`,objectId:a.id})}p&&a.overrides?.length&&t.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${a.label}" cannot carry individual-chair overrides`,objectId:a.id,seatIndices:a.overrides.map(M=>M.index)});let v=new Set;for(let M of a.overrides??[]){(M.accessibility??[]).filter(D=>!r.has(D)).length&&t.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${a.label}" chair ${M.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[M.index]}),(!Number.isInteger(M.index)||M.index<0||M.index>=a.seatCount||v.has(M.index))&&t.push({severity:"error",code:"invalid-seat-override",message:`Table "${a.label}" has a duplicated or out-of-range chair override`,objectId:a.id,...Number.isInteger(M.index)?{seatIndices:[M.index]}:{}}),v.add(M.index),M.categoryKey&&!o.has(M.categoryKey)?t.push({severity:"error",code:"unknown-category",message:`Table "${a.label}" chair ${M.index+1} references unknown category "${M.categoryKey}"`,objectId:a.id,seatIndices:[M.index],categoryKey:M.categoryKey}):M.categoryKey&&s.add(M.categoryKey);let P=M.wheelchairSpaceType,R=M.accessible===!0||M.accessibility?.includes("wheelchair");P!==void 0&&P!=="seat-present"&&P!=="no-seat"?t.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${a.label}" chair ${M.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[M.index]}):P&&(!R||M.skip)&&t.push({severity:"error",code:"invalid-wheelchair-space",message:M.skip?`Table "${a.label}" chair ${M.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${a.label}" chair ${M.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[M.index]})}a.bookAsWhole&&a.variableOccupancy?t.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${a.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:a.id}):a.variableOccupancy?(!Number.isInteger(a.minOccupancy)||!Number.isInteger(a.maxOccupancy)||a.minOccupancy<1||a.maxOccupancy<a.minOccupancy||a.maxOccupancy>a.seatCount)&&t.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" needs whole-number minimum and maximum guests from 1 to its ${a.seatCount}-chair capacity`,objectId:a.id}):(a.minOccupancy!=null||a.maxOccupancy!=null)&&t.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" has guest bounds without variable-occupancy selling`,objectId:a.id}),be(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(a.shape==="round"&&a.radius==null||a.shape==="rect"&&(a.width==null||a.height==null)||a.seatCount<1)&&t.push({severity:"error",code:"bad-table",message:`Table "${a.label}" is missing required dimensions or seats`,objectId:a.id});let L=p?[{label:a.label,index:void 0}]:yn(a);for(let M of L)de(M.label)&&t.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${M.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),u.get(M.label)!==void 0?m.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${M.label}" is used more than once; grouped table labels must be unique`,objectId:a.id,...M.index===void 0?{}:{seatIndices:[M.index]}}):u.set(M.label,a.id)}else if(a.type==="booth"){be(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${a.label}" has invalid reference-inventory provenance`,objectId:a.id});let p=a.label;de(p)&&t.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${p}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),u.get(p)!==void 0?m.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${p}" is used more than once`,objectId:a.id}):u.set(p,a.id)}}else if(a.type==="gaArea"){if(!Le(a))t.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${a.label}" has invalid joined-area inventory provenance`,objectId:a.id});else for(let h of We(a))u.get(h)!==void 0?m.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${h}" is used more than once`,objectId:a.id}):u.set(h,a.id);be(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(!W(a.points)||Math.abs(ee(a.points))<=1e-7||oe(a.points))&&t.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});let p=a.holes??[],v=Array.isArray(p)&&p.length<=64?p.findIndex(h=>!Array.isArray(h)||h.length>512||!W(h)||Math.abs(ee(h))<=1e-7||oe(h)?!0:!h.flatMap((M,k)=>{let P=h[(k+1)%h.length];return[M,{x:(M.x+P.x)/2,y:(M.y+P.y)/2}]}).every(M=>ne(M,a.points))):0;if(v>=0)t.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${a.label}" has a cutout outside its outline or with invalid geometry`,objectId:a.id,holeIndex:v});else if(p.some((h,L)=>p.slice(L+1).some(M=>me(h,M)))){let h=p.findIndex((L,M)=>p.slice(M+1).some(k=>me(L,k)));t.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${a.label}" has overlapping cutout polygons`,objectId:a.id,holeIndex:h})}o.has(a.categoryKey)?s.add(a.categoryKey):t.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.capacity<1&&t.push({severity:"error",code:"empty-ga",message:`GA area "${a.label}" has zero capacity`,objectId:a.id}),(!Number.isInteger(a.capacity)||a.capacity>X)&&t.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${a.label}" capacity must be a whole number from 1 to ${X}`,objectId:a.id}),b++,I+=Math.max(0,Math.floor(a.capacity))}else if(a.type==="section"){if(a.elevation!==void 0&&(!Number.isInteger(a.elevation)||a.elevation<Ge||a.elevation>q)){let v=Number.isInteger(a.elevation)&&a.elevation>q&&a.elevation<=Ke;n.push({severity:"warning",code:v?"legacy-section-elevation":"invalid-section-elevation",message:v?`Section "${a.label}" uses legacy tier ${a.elevation}; set an exact height before normalizing it to tier ${q}`:`Section "${a.label}" elevation must be a whole-number tier from ${Ge} to ${q}`,objectId:a.id})}if(a.height!==void 0&&(!Number.isFinite(a.height)||a.height<H||a.height>K)&&t.push({severity:"error",code:"invalid-section-height",message:`Section "${a.label}" exact height must be between ${H} and ${K} metres`,objectId:a.id}),a.rake!==void 0&&(!Number.isFinite(a.rake)||a.rake<xe||a.rake>Ie)&&t.push({severity:"error",code:"invalid-section-rake",message:`Section "${a.label}" rake must be between ${xe}\xB0 and ${Ie}\xB0`,objectId:a.id}),a.surfaceKind!==void 0&&a.surfaceKind!=="flat"&&a.surfaceKind!=="rakedRows"&&t.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${a.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:a.id}),!W(a.outline)||Math.abs(ee(a.outline))<=1e-7||oe(a.outline)){t.push({severity:"error",code:"invalid-section-outline",message:`Section "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});continue}if(a.outlinePath){let v=[];try{v=St(a.outlinePath)}catch{}(!Ne(a.outlinePath)||!v.length||Math.hypot(a.outlinePath.start.x-a.outline[0].x,a.outlinePath.start.y-a.outline[0].y)>1e-4||!W(v)||Math.abs(ee(v))<=1e-7||oe(v))&&t.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${a.label}" has an invalid or inconsistent curved outline path`,objectId:a.id,edgeIndex:cn(a)})}if(a.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(a.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(a.referenceSource.regionId))&&t.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${a.label}" has invalid opaque reference provenance`,objectId:a.id}),pn(a)||t.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${a.label}" has incomplete or mismatched non-sellable evidence`,objectId:a.id}),a.logicalSectionId!==void 0&&!a.logicalSectionId.trim())t.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${a.label}" has an empty logical section id`,objectId:a.id});else if(a.logicalSectionId){let v=JSON.stringify({displayLabel:a.displayLabel??null,entrance:a.entrance??null,viewFromSeatUrl:a.viewFromSeatUrl??null,viewFromSeatMeta:a.viewFromSeatMeta??null,confidenceEvidence:a.confidenceEvidence??null,zone:a.zone??null,labelStyle:a.labelPresentation?.labelStyle??null,labelVisible:a.labelPresentation?.visible!==!1}),h=w.get(a.logicalSectionId);h&&(h.label!==a.label||h.semanticSignature!==v)?t.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${a.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:a.id}):h||w.set(a.logicalSectionId,{label:a.label,semanticSignature:v})}let A=a.holes??[];if(!Array.isArray(A)||A.length>64){t.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an invalid opening collection`,objectId:a.id});continue}let p=-1;for(let v=0;v<A.length;v++){let h=A[v];if(!Array.isArray(h)||h.length>512||!W(h)||Math.abs(ee(h))<=1e-7||oe(h)){p=v;break}if(!h.flatMap((M,k)=>{let P=h[(k+1)%h.length];return[M,{x:(M.x+P.x)/2,y:(M.y+P.y)/2}]}).every(M=>ne(M,a.outline))){p=v;break}}if(p>=0)t.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an opening outside its outline or with an invalid shape`,objectId:a.id,holeIndex:p});else if(A.some((v,h)=>A.slice(h+1).some(L=>me(v,L)))){let v=A.findIndex((h,L)=>A.slice(L+1).some(M=>me(h,M)));t.push({severity:"error",code:"overlapping-section-holes",message:`Section "${a.label}" has overlapping openings`,objectId:a.id,holeIndex:v})}}let T=e.floors?.length?e.floors.map(a=>a.objects):[e.objects];for(let a of T){let A=a.filter(p=>p.type==="section");for(let p of a.filter(v=>v.type==="text")){let v=p.iconKey;v!==void 0&&!nn(v)&&t.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${p.text||p.id}" references an unknown symbol`,objectId:p.id});let h=p.fontFamily;h!==void 0&&(typeof h!="string"||h.normalize("NFKC").trim()!==h||h.length<1||h.length>120)&&t.push({severity:"error",code:"invalid-text-font-family",message:`Text "${p.text||p.id}" font family must contain 1 to 120 normalized characters`,objectId:p.id});let L=p.background;(p.width!==void 0&&(!Number.isFinite(p.width)||p.width<40||p.width>1200)||p.align!==void 0&&!["left","center","right"].includes(p.align)||p.lineHeight!==void 0&&(!Number.isFinite(p.lineHeight)||p.lineHeight<.8||p.lineHeight>3)||p.letterSpacing!==void 0&&(!Number.isFinite(p.letterSpacing)||p.letterSpacing<-2||p.letterSpacing>20)||p.opacity!==void 0&&(!Number.isFinite(p.opacity)||p.opacity<.1||p.opacity>1)||L!==void 0&&(!/^#[0-9a-f]{6}$/i.test(L.color)||L.padding!==void 0&&(!Number.isFinite(L.padding)||L.padding<0||L.padding>40)||L.cornerRadius!==void 0&&(!Number.isFinite(L.cornerRadius)||L.cornerRadius<0||L.cornerRadius>40)||L.opacity!==void 0&&(!Number.isFinite(L.opacity)||L.opacity<.1||L.opacity>1)))&&t.push({severity:"error",code:"invalid-text-layout",message:`Text "${p.text||p.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:p.id})}for(let p of a.filter(v=>v.type==="shape")){if(p.eventConfigurationIds!==void 0){let L=p.eventConfigurationIds;Array.isArray(L)&&L.length>0&&L.length<=20&&L.every(k=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>=1&&k.length<=100)&&new Set(L).size===L.length||t.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${p.label||p.id}" must reference 1 to 20 unique event configuration ids`,objectId:p.id})}if(p.heightM!==void 0&&(!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50)&&t.push({severity:"error",code:"invalid-shape-height",message:`Shape "${p.label||p.id}" height must be between 0.05 m and 50 m`,objectId:p.id}),p.stroke!==void 0&&(!p.stroke||typeof p.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(p.stroke.color)||!Number.isFinite(p.stroke.width)||p.stroke.width<.5||p.stroke.width>40)&&t.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${p.label||p.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:p.id}),(p.lineCap!==void 0||p.lineJoin!==void 0||p.startEnding!==void 0||p.endEnding!==void 0)&&!it(p.kind)?t.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${p.label||p.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:p.id}):it(p.kind)&&(p.lineCap!==void 0&&!on.includes(p.lineCap)||p.lineJoin!==void 0&&!rn.includes(p.lineJoin)||p.startEnding!==void 0&&!rt.includes(p.startEnding)||p.endEnding!==void 0&&!rt.includes(p.endEnding))&&t.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${p.label||p.id}" has an unsupported line cap, join, or ending`,objectId:p.id}),p.kind==="polygon"){let L=Jt(p.points??[]);L.ok||t.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${p.label||p.id}" has invalid polygon geometry: ${L.message}`,objectId:p.id})}let h=un(p);if(h){for(let L of A)if(ln(h,L.outline)){t.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${p.label??p.id}" overlaps section "${L.label}"`,objectId:p.id});break}}}}I>Ee&&t.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${I} bookable units; the maximum is ${Ee}`}),t.push(...m.slice(0,5)),m.length>5&&t.push({severity:"error",code:"duplicate-seat-label",message:`${m.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let a of fe(e)){let A=a.families[0]?.targets[0];n.push({severity:"warning",code:"category-inventory-family-conflict",message:nt(a),categoryKey:a.categoryKey,...A?{objectId:A.id,floorId:A.floorId}:{},relatedObjectIds:a.objectIds,categoryInventoryFamilies:a.families})}e.focalPoint||n.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),b===0&&n.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let a of s)if(i.get(a)===!1){let A=e.categories.find(p=>p.key===a);n.push({severity:"warning",code:"unpriced-category",message:`Category "${A?.label??a}" is used but has no price`,categoryKey:a})}return[...t,...n]}var qo=9,Sn="#f7f8fb",Qo="#f5f6f8",wn="#8b93a7",Jo="#0b1220",er="#0b1220",tr="#ffffff",nr=100;function j(e,t=2){let n=10**t;return Math.round(e*n)/n}function vn(e){let t=Y(e);if(!t)return null;let n=u=>{let m=u/255;return m<=.04045?m/12.92:((m+.055)/1.055)**2.4},o=n(t[0]),r=n(t[1]),i=n(t[2]),s=(.4124*o+.3576*r+.1805*i)/.95047,c=(.2126*o+.7152*r+.0722*i)/1,g=(.0193*o+.1192*r+.9505*i)/1.08883,d=u=>u>.008856?Math.cbrt(u):7.787*u+16/116,l=d(s),f=d(c),y=d(g);return[116*f-16,500*(l-f),200*(f-y)]}function or(e,t){let n=vn(e),o=vn(t);return!n||!o?null:Math.hypot(n[0]-o[0],n[1]-o[1],n[2]-o[2])}function _(e){return{source:"quality",...e}}function rr(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function ct(e){return qo*V(e.theme?.seatScale??1,.7,1.6)}function Cn(e){let t=[];for(let n of e.objects)n.type==="row"?t.push(...F(n)):n.type==="table"&&t.push(...G(n));return t}function ir(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of e)for(let o of n.objects)o.type==="row"?t.rowSeats+=F(o).length:o.type==="table"?t.tableSeats+=G(o).length:o.type==="booth"?t.booths+=1:o.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(o.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function N(e,t){e.filter(n=>n.code===t.code).length<nr&&e.push(t)}function ar(e,t,n){let o=ct(e),r=2*o,i=2.3*o,s=0,c=0,g=1/0;for(let d of t){let l=new Map(d.objects.filter(b=>b.type==="row").map(b=>[b.id,b])),f=b=>{let I=d.objects.find(E=>E.id===b);if(!I||I.type!=="row"&&I.type!=="table")return"another seating object";let C=I.type==="row"?F(I):G(I),S=C.length?{x:C.reduce((E,T)=>E+T.x,0)/C.length,y:C.reduce((E,T)=>E+T.y,0)/C.length}:I.type==="row"?I.origin:I.center,x=d.objects.find(E=>E.type==="section"&&U(S,E.outline,E.holes)),O=I.type==="row"?`Row \u201C${I.label}\u201D`:`Table \u201C${I.label}\u201D`;return x?.type==="section"?`${O} in \u201C${x.label}\u201D`:O},y=Cn(d);s+=y.length;let u=i,m=new Map,w=new Map;for(let b of y){let I=Math.floor(b.x/u),C=Math.floor(b.y/u);for(let O=-1;O<=1;O++)for(let E=-1;E<=1;E++){let T=m.get(`${I+O}:${C+E}`)??[];for(let a of T){c++;let A=Math.hypot(b.x-a.x,b.y-a.y);if(g=Math.min(g,A),A>=i)continue;let v=(b.rowId<a.rowId?[b.rowId,a.rowId]:[a.rowId,b.rowId]).join("|"),h=w.get(v);(!h||A<h.distance)&&w.set(v,{a:b,b:a,distance:A})}}let S=`${I}:${C}`,x=m.get(S)??[];x.push(b),m.set(S,x)}for(let b of w.values()){let I=b.a.rowId===b.b.rowId,C=l.get(b.a.rowId),S=l.get(b.b.rowId),x=!I&&C?.segmentedRow?.repeatLabelOnComponents===!0&&S?.segmentedRow?.repeatLabelOnComponents===!0&&C.segmentedRow.groupId===S.segmentedRow.groupId,O=b.distance<r?"error":"warning";if(x&&O==="warning")continue;let E=O==="error"?"seat-overlap":"seat-cramped",T=f(b.a.rowId),a=f(b.b.rowId),A=j(O==="error"?r:i);N(n,_({severity:O,code:E,dimension:"geometry",title:I?`${T} has seats too close together`:`${T} and ${a} are too close together`,message:`The closest seats are ${j(b.distance)} chart units apart; at least ${A} are required.`,action:I?`Increase the seat spacing for ${T}, or use Review safe fixes.`:`Move ${T} or ${a} until they no longer overlap.`,objectId:b.a.rowId,relatedObjectIds:I?[b.a.rowId]:[b.a.rowId,b.b.rowId],floorId:d.id,measured:j(b.distance),minimum:j(O==="error"?r:i),autoFixable:I}))}}return{seats:s,checkedSeatPairs:c,minimumSeatDistance:Number.isFinite(g)?j(g):null}}function ke(e){let{width:t,height:n}=ht(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:n};let o=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}].map(r=>{let i=vt(r,e.rotation);return{x:e.position.x+i.x,y:e.position.y+i.y}});return Bt(o)}function Mn(e,t,n=0){return e.x<t.x+t.width+n&&e.x+e.width+n>t.x&&e.y<t.y+t.height+n&&e.y+e.height+n>t.y}function st(e,t,n){let o=V(t.x,e.x,e.x+e.width),r=V(t.y,e.y,e.y+e.height);return(t.x-o)**2+(t.y-r)**2<n**2}function sr(e,t,n){let o=ct(e),r=0;for(let i of t){let s=i.objects.filter(g=>g.type==="text"),c=Cn(i);r+=s.length;for(let g=0;g<s.length;g++){let d=s[g],l=ke(d),f=c.find(y=>st(l,y,o));f&&N(n,_({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps seat ${f.label}`,objectId:d.id,relatedObjectIds:[d.id,f.rowId],floorId:i.id,autoFixable:!0}));for(let y=0;y<g;y++){let u=s[y];Mn(l,ke(u),2)&&N(n,_({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps text \u201C${u.text}\u201D`,objectId:d.id,relatedObjectIds:[d.id,u.id],floorId:i.id,autoFixable:!0}))}}}return r}function cr(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function lr(e,t,n){let o=new Map;for(let i of t)for(let s of i.objects){let c=s.type,g=c==="row"||c==="table"||c==="booth"||c==="gaArea",d=g||c==="section";if(g&&!s.categoryKey.trim()){let l=c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth";N(n,_({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${l} \u201C${s.label||s.id}\u201D has no category`,message:`${l} \u201C${s.label||s.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:s.id,floorId:i.id,autoFixable:!1}))}if(d){let l=(s.type==="section"?s.displayLabel??s.label:s.label)??"";if(l.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let f=cr(l),y=o.get(f);y&&y.raw!==l?N(n,_({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${l}\u201D and \u201C${y.raw}\u201D read as the same label`,message:`Labels \u201C${l}\u201D and \u201C${y.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:s.id,relatedObjectIds:[s.id,y.id],floorId:i.id,autoFixable:!1})):y||o.set(f,{id:s.id,raw:l})}}else{let f=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";N(n,_({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${f} has no label`,message:`${f} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:s.id,floorId:i.id,autoFixable:!1}))}}}let r=[];for(let i of t){let s=i.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of i.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||s.some(d=>U(Q(d),c.outline,c.holes)))){if(c.referenceSource){r.push({id:c.id,floorId:i.id});continue}N(n,_({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:i.id,autoFixable:!1}))}}if(r.length&&N(n,_({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(i=>i.id),floorId:r[0].floorId,autoFixable:!1})),e.floors&&e.floors.length>1)for(let i of e.floors)i.objects.length===0&&N(n,_({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${i.name}\u201D is empty`,message:`Floor \u201C${i.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:i.id,autoFixable:!1}))}var ur=5,dr=16;function fr(e,t,n){for(let o of t){let r=o.focalPoint??e.focalPoint;if(r)for(let i of o.objects){if(i.type!=="section"||i.outline.length<3)continue;let{rake:s}=ce(i);if(s<ur)continue;let c=i.outline.map(y=>Math.hypot(y.x-r.x,y.y-r.y)),g=Math.max(...c);if(g<=0)continue;let d=(g-Math.min(...c))/g;if(s*d<=dr)continue;let f=i.displayLabel??i.label;N(n,_({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${f}\u201D is too deep for a single rake`,message:`Section \u201C${f}\u201D spans ${Math.round(d*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully \u2014 a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:i.id,floorId:o.id,autoFixable:!1}))}}}function gr(e,t,n){let o=e.theme?.background??Sn,r=Qo,i=new Map;for(let d of t)for(let l of d.objects){if(l.type!=="gaArea")continue;let f=i.get(l.categoryKey)??[];f.push({id:l.id,floorId:d.id}),i.set(l.categoryKey,f)}for(let d of e.categories){let l=$(d.color,o),f=$(d.color,r);if(l==null||f==null){N(n,_({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${d.label}\u201D does not use a supported hex color`,categoryKey:d.key}));continue}let y=Math.min(l,f);y<3&&N(n,_({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${d.label}\u201D is hard to see`,message:`Category \u201C${d.label}\u201D reaches only ${j(y)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${d.label}\u201D until this warning clears.`,categoryKey:d.key,measured:j(y),minimum:3,autoFixable:!1}));let u=i.get(d.key)??[];if(u.length){let m=et(d.color,o,Je),w=et(d.color,r,Je),b=Math.min($(m,o)??0,$(w,r)??0);b<3&&N(n,_({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${d.label}\u201D reaches only ${j(b)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:u[0].id,categoryKey:d.key,floorId:u[0].floorId,relatedObjectIds:u.map(I=>I.id),measured:j(b),minimum:3,autoFixable:!1}))}}for(let d=0;d<e.categories.length;d++)for(let l=0;l<d;l++){let f=e.categories[d],y=e.categories[l],u=or(f.color,y.color);u!=null&&u<25&&N(n,_({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${f.label}\u201D and \u201C${y.label}\u201D look too similar`,message:`Categories \u201C${f.label}\u201D and \u201C${y.label}\u201D are only \u0394E ${j(u)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:f.key,measured:j(u),minimum:25,autoFixable:!1}))}for(let d of t){let l=d.objects.filter(f=>f.type==="text");for(let f of l){let y=f.color??e.theme?.textColor??wn,u=$(y,o),m=f.fontSize>=18?3:4.5;(u==null||u<m)&&N(n,_({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${f.text}\u201D has ${j(u??0)}:1 contrast against the chart background; ${m}:1 is required`,objectId:f.id,floorId:d.id,measured:j(u??0),minimum:m,autoFixable:!0}))}}if(e.theme?.selectionColor){let d=$(e.theme.selectionColor,o);(d==null||d<3)&&N(n,_({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${j(d??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:j(d??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let d=$(e.theme.textColor,o);(d==null||d<3)&&N(n,_({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${j(d??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:j(d??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??Jo,c=new Map,g=(d,l,f)=>{let y=c.get(d)??new Map,u=y.get(l)??[];u.push(f),y.set(l,u),c.set(d,y)};for(let d of t)for(let l of d.objects)if(l.type==="row")for(let f of ge(l).keys())g(f,"seat",l.id);else if(l.type==="table")for(let f of ge(l).keys())g(f,"table seat",l.id);else l.type==="booth"&&g(l.categoryKey,"booth",l.id);for(let d of e.categories){let l=c.get(d.key);if(l)for(let[f,y]of l){let u=f==="booth"?zt:Ut,m=Xt(Vt,600),w=Yt(d.color,s),b=$(w,d.color);(b==null||b<m)&&N(n,_({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${f==="booth"?"Booth":f==="seat"?"Seat":"Table-seat"} labels use ${u}u type and have ${j(b??0)}:1 contrast on category \u201C${d.label}\u201D; ${m}:1 is required for small text`,objectId:y[0],relatedObjectIds:y,measured:j(b??0),minimum:m,autoFixable:!0}))}}}function pr(e,t){for(let n of e){let o=n.objects.filter(r=>r.type==="section");if(!(o.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let s=Q(r),c=o.filter(u=>U(s,u.outline,u.holes)),g=new Map;for(let u of c){let m=u.logicalSectionId??u.id,w=g.get(m)??[];w.push(u),g.set(m,w)}if(g.size<2)continue;let d=[...g.values()],l=d.map(u=>`Section \u201C${u[0].displayLabel??u[0].label}\u201D`),f=l.length===2?l.join(" and "):`${l.slice(0,-1).join(", ")}, and ${l[l.length-1]}`,y=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";N(t,_({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${y} \u201C${r.label}\u201D belongs to more than one section`,message:`${y} \u201C${r.label}\u201D has its center inside ${f}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:r.id,relatedObjectIds:[r.id,...d.flatMap(u=>u.map(m=>m.id))],floorId:n.id,autoFixable:!1}))}}}var mr={structure:20,geometry:30,contrast:25,labels:15,navigation:10},br={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function yr(e){let t={...mr};for(let r of e){let i=r.severity==="error"?10:2;t[r.dimension]=Math.max(0,t[r.dimension]-(br[r.code]??i))}let n=Object.values(t).reduce((r,i)=>r+i,0),o=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:t,errorFree:e.every(r=>r.severity!=="error"),grade:o}}var hr=new Set(["unpriced-category","object-uncategorized"]);function xn(e,t={}){let n=He(e),o=hn(e).filter(l=>l.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(l=>{let f=l.objectId?n.find(m=>m.objects.some(w=>w.id===l.objectId))?.id:void 0,y=l.code==="category-inventory-family-conflict",u=y?e.categories.find(m=>m.key===l.categoryKey):void 0;return _({...l,...y?{severity:"error",title:`Category \u201C${u?.label??l.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...t.requireExplicitZoneFocals&&l.code==="missing-zone-focal-point"?{severity:"error"}:{},...f?{floorId:f}:{},source:"structural",dimension:rr(l),autoFixable:y})}),r=ar(e,n,o),i=ir(n),s=sr(e,n,o);if(lr(e,n,o),pr(n,o),fr(e,n,o),gr(e,n,o),n.reduce((l,f)=>l+f.objects.filter(y=>y.type==="row"||y.type==="table"||y.type==="booth"||y.type==="gaArea").length,0)===0){let l=new Set(["missing-focal-point","no-bookables"]);for(let f=o.length-1;f>=0;f--)l.has(o[f].code)&&o.splice(f,1)}if(t.requirePricedInventory)for(let l=0;l<o.length;l++)hr.has(o[l].code)&&(o[l]={...o[l],severity:"error"});let g=o.filter(l=>l.severity==="error"),d=o.filter(l=>l.severity==="warning");return{issues:o,errors:g,warnings:d,metrics:{floors:n.length,objects:n.reduce((l,f)=>l+f.objects.length,0),seats:r.seats,bookableUnits:i.bookableUnits,inventoryByKind:i.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:yr(o),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function vr(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let n=ae(F(e));e.seatSpacing=j(t,3);let o=ae(F(e));return e.origin.x=j(e.origin.x+n.x-o.x,3),e.origin.y=j(e.origin.y+n.y-o.y,3),!0}function xr(e,t){if(e.seatCount<2)return!1;let n=!1;if(e.shape==="round"){let o=V(e.seatArc??360,0,360),r=(o>=360?360/e.seatCount:o/(e.seatCount-1))*Math.PI/180;if(r>0){let i=t/(2*Math.sin(r/2)),s=Math.max(1,i-16);(e.radius??40)<s&&(e.radius=j(s,3),n=!0)}}else{let o=ue(e),r=Math.max(o.top,o.bottom),i=Math.max(o.left,o.right);r>1&&(e.width??80)/r<t&&(e.width=j(r*t,3),n=!0),i>1&&(e.height??50)/i<t&&(e.height=j(i*t,3),n=!0)}return n}function Ir(e){return[er,tr].map(n=>({color:n,minimum:Math.min(...e.map(o=>$(n,o)??0))})).sort((n,o)=>o.minimum-n.minimum)[0].color}function In(e,t,n){let o=ke(e),r=0;for(let i of t)i.type==="row"?r+=F(i).filter(s=>st(o,s,n)).length:i.type==="table"?r+=G(i).filter(s=>st(o,s,n)).length:i.type==="text"&&i.id!==e.id&&Mn(o,ke(i),2)&&r++;return r}function Sr(e,t,n){if(In(e,t,n)===0)return!1;let r={...e.position},i=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let c=1;c<=12;c++)for(let[g,d]of s)if(e.position={x:j(r.x+g*i*c,3),y:j(r.y+d*i*c,3)},In(e,t,n)===0)return!0;return e.position=r,!1}function En(e){let t=JSON.parse(JSON.stringify(e)),n=xn(t),o=[],r=ot(t);if(r.changed){t=r.doc;for(let l of r.changes){let f=r.before.find(u=>u.categoryKey===l.categoryKey),y=f?.families.map(u=>u.label).join(", ")??"inventory families";o.push({code:"category-inventory-family-conflict",objectId:f?.objectIds[0],message:`Split category \u201C${l.categoryLabel}\u201D across ${y}; preserved its commercial metadata and reassigned ${l.reassignments.length} affected object${l.reassignments.length===1?"":"s"}`})}}let i=ct(t),s=2.5*i,c=He(t);for(let l of c)for(let f of l.objects)if(f.type==="row"){let y=f.seatSpacing;vr(f,s)&&o.push({code:y<2*i?"seat-overlap":"seat-cramped",objectId:f.id,message:`Expanded ${f.id} to the ${j(s)}u target pitch while preserving its centre`})}else f.type==="table"&&xr(f,s)&&o.push({code:"seat-cramped",objectId:f.id,message:`Expanded ${f.id} so its perimeter seats meet the ${j(s)}u target pitch`});let g=t.theme?.background??Sn;for(let l of c)for(let f of l.objects){if(f.type!=="text")continue;let y=f.color??t.theme?.textColor??wn,u=f.fontSize>=18?3:4.5;($(y,g)??0)<u&&(f.color=Ir([g]),o.push({code:"text-contrast-low",objectId:f.id,message:`Changed ${f.id} to the highest-contrast black/white ink`}))}for(let l of c){let f=l.objects.filter(y=>y.type==="text");for(let y of f)Sr(y,l.objects,i)&&o.push({code:"label-collision",objectId:y.id,message:`Moved ${y.id} to the nearest collision-free deterministic label position`})}t.floors?.length&&(t.objects=t.floors[0].objects);let d=xn(t);return{doc:t,changed:o.length>0,fixes:o,before:n,after:d}}function Oe(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function lt(e){return Oe(e).reduce((t,n)=>n.type==="row"?t+Ce(n):n.type==="table"?t+$t(n):n.type==="gaArea"?t+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?t+1:t,0)}function wr(e){let t={};for(let o of e.categories??[])t[o.key]=0;let n=(o,r)=>{r>0&&(t[o]=(t[o]??0)+r)};for(let o of Oe(e))if(o.type==="row")for(let r of F(o))n(r.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)n(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let r of G(o))n(r.categoryKey,1);else o.type==="gaArea"?n(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&n(o.categoryKey,1);return t}function Pn(e){if(!e.template)return null;let t=Oe(e),n=t.filter(g=>g.type==="row"||g.type==="table"||g.type==="gaArea");if(!n.length)return null;let r=t.filter(g=>g.type==="booth").length+n.reduce((g,d)=>g+(d.type==="table"?2:1),0),i=lt(e),s=Math.max(r+1,Math.min(5e4,i*4)),c=[.5,1,1.5,2].map(g=>V(Math.round(i*g),r,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,g=>g.toUpperCase()),min:r,max:s,presets:["S","M","L","XL"].map((g,d)=>({size:g,seats:c[d]}))}}function Ln(e){let t=F(e);return t.length?ae(t):{...e.origin}}function Cr(e,t){let n=Pn(e);if(!n)return structuredClone(e);let o=structuredClone(e),r=Oe(o),i=r.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea"),s=r.filter(u=>u.type==="booth").length,c=Math.max(n.min,Math.min(n.max,Math.round(t))),g=c-s,d=i.map((u,m)=>{let w=u.type==="gaArea"?Math.max(0,Math.floor(u.capacity)):u.seatCount,b=u.type==="table"?2:1;return{object:u,index:m,current:w,minimum:b,value:b,fraction:0}}),l=d.reduce((u,m)=>u+m.minimum,0),f=Math.max(0,g-l),y=d.reduce((u,m)=>u+Math.max(1,m.current-m.minimum),0);for(let u of d){let m=f*Math.max(1,u.current-u.minimum)/y,w=Math.floor(m);u.value+=w,u.fraction=m-w}f=g-d.reduce((u,m)=>u+m.value,0),d.sort((u,m)=>m.fraction-u.fraction||u.index-m.index);for(let u=0;u<f;u++)d[u%d.length].value++;d.sort((u,m)=>u.index-m.index);for(let u of d)if(u.object.type==="row"){let m=Ln(u.object);u.object.seatCount=u.value;let w=Ln(u.object);u.object.origin.x+=m.x-w.x,u.object.origin.y+=m.y-w.y}else if(u.object.type==="table"){let m=u.object;if(m.seatCountsBySide){let w=["top","bottom","left","right"],b=ue(m),I=w.reduce((x,O)=>x+b[O],0)||1,C=w.map((x,O)=>{let E=u.value*b[x]/I;return{side:x,index:O,value:Math.floor(E),fraction:E-Math.floor(E)}}),S=u.value-C.reduce((x,O)=>x+O.value,0);C.sort((x,O)=>O.fraction-x.fraction||x.index-O.index);for(let x=0;x<S;x++)C[x%C.length].value+=1;C.sort((x,O)=>x.index-O.index),m.seatCountsBySide={top:C[0].value,bottom:C[1].value,left:C[2].value,right:C[3].value},m.sides=w.filter(x=>m.seatCountsBySide[x]>0)}m.seatCount=u.value,m.overrides&&(m.overrides=m.overrides.filter(w=>w.index<u.value),m.overrides.length||delete m.overrides)}else u.object.capacity=u.value;return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:c},o=En(o).doc,o.template={family:e.template.family,targetSeats:lt(o)},o}function re(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function Mr(e,t,n){let o=new Map;for(let s of e){if(s.kind==="booth")continue;let c=o.get(s.rowId);c?c.push(s):o.set(s.rowId,[s])}let r=s=>n.has(s.id)||t(s.id)!=="free",i=[];for(let s of o.values())if(!(s.length<3)){s.sort((c,g)=>re(c.id)-re(g.id));for(let c=1;c<s.length-1;c++){let g=s[c];if(r(g))continue;let d=s[c-1],l=s[c+1];re(g.id)-re(d.id)!==1||re(l.id)-re(g.id)!==1||!r(d)||!r(l)||!n.has(d.id)&&!n.has(l.id)||i.push(g)}}return i}var dt=1,ft=100;function An(e,t){if(!Number.isInteger(t)||t<dt||t>ft)return null;let n=e.rotation*Math.PI/180,o={x:Math.cos(n),y:Math.sin(n)},r={x:-o.y,y:o.x};return Array.from({length:t},(i,s)=>{let c=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+r.x*s*e.rowGap+o.x*c,y:e.origin.y+r.y*s*e.rowGap+o.y*c},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function ut(e,t=e.rowCount){let n=An(e,t);return n?.length?Q(n[n.length-1]):null}function Er(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let n=ut(e,1);if(!n)return null;let o=e.rotation*Math.PI/180,r={x:-Math.sin(o),y:Math.cos(o)},i=(t.x-n.x)*r.x+(t.y-n.y)*r.y,s=Math.max(dt,Math.min(ft,Math.round(i/e.rowGap)+1)),c=ut(e,s);return c?{rowCount:s,edgePoint:c}:null}function Lr(e,t){return e.length!==t.rowCount?!1:[...e].sort((o,r)=>(o.rowBlockGeneration?.rowIndex??1/0)-(r.rowBlockGeneration?.rowIndex??1/0)).every((o,r)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===t.groupId&&i.rowIndex===r&&i.signature===t.signature&&JSON.stringify(i)===JSON.stringify({...t,rowIndex:r})})}var Ca=1,Ma=300,Ea=330;function kn(e,t){if(e.path||!Number.isInteger(t)||t<1||t>300)return null;let n=e.seatCount>1?e.curve/(e.seatCount-1):0;return{...e,seatCount:t,curve:n*(t-1)}}function On(e,t=e.seatCount){let n=kn(e,t);if(!n)return null;if(t===1)return{...n.origin};let o=n.rotation*Math.PI/180,r=n.curve/(t-1)*Math.PI/180,i,s;if(Math.abs(r)<1e-9)i=(t-1)*n.seatSpacing,s=0;else{let c=n.seatSpacing/(2*Math.sin(Math.abs(r)/2)),g=r*(t-1);i=c*Math.sin(g),s=-c+c*Math.cos(g)}return{x:n.origin.x+i*Math.cos(o)-s*Math.sin(o),y:n.origin.y+i*Math.sin(o)+s*Math.cos(o)}}function Pr(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=e.seatCount>1?e.curve/(e.seatCount-1):0,o=Math.abs(n)<1e-9?300:Math.min(300,Math.floor(330/Math.abs(n))+1),r=null;for(let i=1;i<=Math.max(1,o);i+=1){let s=On(e,i);if(!s)continue;let c=Math.hypot(s.x-t.x,s.y-t.y),g=n*(i-1);(!r||c<r.distance||c===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:g,endpoint:s,distance:c})}return r}var ie=class extends Error{constructor(n,o){super(o);this.objectId=n;this.name="GroupedTableProjectionError"}};function Ar(e){let t=e.minOccupancy,n=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(n)||t<1||n<t||n>e.seatCount)throw new ie(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:n}}function kr(e,t){if(t!==2)return[];let n=[];for(let o of Me(e)){if(o.type!=="table"||!o.bookAsWhole&&!o.variableOccupancy)continue;if(o.bookAsWhole&&o.variableOccupancy)throw new ie(o.id,`Table "${o.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(o.seatCount)||o.seatCount<1||!o.label.trim())throw new ie(o.id,"Grouped tables require a label and at least one chair");let r=o.variableOccupancy?"variable":"whole",i=r==="variable"?Ar(o):{min:o.seatCount,max:o.seatCount};n.push({objectId:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},categoryKey:o.categoryKey,mode:r,capacity:o.seatCount,minOccupancy:i.min,maxOccupancy:i.max,chairs:G(o)})}return n}function Rn(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function Te(e,t){let n=e.applicability;return n?!(n.seatLabels?.length&&!n.seatLabels.includes(t.label)||n.accessibility?.length&&!n.accessibility.some(o=>t.accessibility?.includes(o))):!0}function Or(e,t){return(e.categories.find(n=>n.key===t.categoryKey)?.tiers??[]).filter(n=>Te(n,t))}function gt(e,t,n){let o=e.categories.find(i=>i.key===t.categoryKey)?.tiers;if(!o?.length)return{kind:"none"};let r=n==null?o.find(i=>Te(i,t)):o.find(i=>i.id===n&&Te(i,t));return r?{kind:"resolved",tier:r}:{kind:"invalid"}}function Tr(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function Tn(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),n=Number(t);return Number.isInteger(n)?n:void 0}function Rr(e,t){if(!Tr(e,t))return!1;let n=Tn(e),o=Tn(t);return n!=null&&o!=null&&Math.abs(n-o)===1}function jn(e,t){if(!t.length)return null;let n=new Map(Xe(e,{resolveEyeHeights:!1}).map(s=>[s.label,s])),o=t.flatMap(s=>{let c=n.get(s.label);return c?[{selection:s,seat:c}]:[]}),r=o.map(({seat:s})=>s).filter(s=>s.accessibility?.includes("wheelchair")),i=[];for(let{selection:s,seat:c}of o){let g=gt(e,c,s.tierId),d=g.kind==="resolved"?g.tier:void 0;(c.accessibility?.includes("companion")||d?.restriction==="companion")&&!r.some(f=>f.id!==c.id&&Rr(c,f))&&i.push(c.label)}return i.length?{code:"companion_pair_required",labels:i,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function jr(e,t){if(!t.length)return null;let n=new Map(Xe(e,{resolveEyeHeights:!1}).map(s=>[s.label,s])),o=new Set(e.categories.filter(s=>s.notForSale).map(s=>s.key)),r=[],i=[];for(let s of t){let c=n.get(s.label);if(!c)continue;if(o.has(c.categoryKey)){r.push(c.label);continue}gt(e,c,s.tierId).kind==="invalid"&&i.push(c.label)}return r.length?{code:"not_for_sale",labels:r,message:"These seats are not for sale."}:i.length?Rn(i):jn(e,t)}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,GroupedTableProjectionError,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,applicableTicketTiers,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,gaAreasOf,gaInventorySegments,gaUnitLabel,gaUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowTerminalEndpoint,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});
1
+ "use strict";var Ne=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Yn=Object.prototype.hasOwnProperty;var Zn=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})},Wn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Xn(t))!Yn.call(e,r)&&r!==n&&Ne(e,r,{get:()=>t[r],enumerable:!(o=Hn(t,r))||o.enumerable});return e};var qn=e=>Wn(Ne({},"__esModule",{value:!0}),e);var Yr={};Zn(Yr,{CATEGORY_INVENTORY_FAMILIES:()=>Oe,GroupedTableProjectionError:()=>se,MAX_DIRECT_ROW_SWEEP:()=>bt,MAX_EVENT_INVENTORY:()=>Ae,MAX_GA_CAPACITY:()=>X,MAX_ROW_BLOCK_ROWS:()=>mt,MAX_ROW_SEATS:()=>W,MIN_ROW_BLOCK_ROWS:()=>gt,MIN_ROW_SEATS:()=>Z,applicableTicketTiers:()=>zr,capacityControl:()=>jn,categoryCapacity:()=>jr,chartCapacity:()=>ft,companionSelectionIssue:()=>zn,describeCategoryInventoryConflict:()=>it,effectiveSeatOwnerCategoryCounts:()=>me,gaAreasOf:()=>To,gaInventorySegments:()=>qe,gaUnitLabel:()=>Ut,gaUnitLabels:()=>Qe,groupedTableInventory:()=>Ur,growJoinedGAInventory:()=>Ro,inspectCategoryInventoryConflicts:()=>ge,intactRowBlockMembers:()=>Fr,isGaUnitLabel:()=>pe,pickBestAvailable:()=>xt,pickBestAvailableInventory:()=>Qn,remediateCategoryInventoryConflicts:()=>at,resizeChartCapacity:()=>_r,resolveRowBlockCount:()=>$r,resolveRowStartCapacity:()=>Gr,resolveRowTerminalCapacity:()=>Br,resolveTicketTierForSeat:()=>yt,rowBlockEdgePoint:()=>pt,rowBlockPreviewRows:()=>_n,rowStartEndpoint:()=>Gn,rowTerminalEndpoint:()=>Bn,rowWithStartCapacity:()=>Dn,rowWithTerminalCapacity:()=>Fn,strandedSingles:()=>Nr,ticketOptionNotApplicableIssue:()=>Un,ticketSelectionIssue:()=>Xr,ticketTierAppliesToSeat:()=>_e,validGAInventorySegments:()=>ke});module.exports=qn(Yr);function $e(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let n=e.id.lastIndexOf(":");if(n<0)return t;let o=Number(e.id.slice(n+1));return Number.isFinite(o)?o:t}function xe(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function ht(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function vt(e,t){return e.find(n=>n.focalPoint)?.focalPoint??t}function Fe(e){return e.commercial?.premium===!0}function xt(e,t,n){let o=Math.floor(n.qty);if(!Number.isFinite(o)||o<=0)return{labels:[],reason:"sold_out"};let{categoryKey:r,zoneId:i,focal:s,preferPremium:c}=n,p=new Map,d=[];if(e.forEach((u,b)=>{let w=t.has(u.label)&&(!r||u.categoryKey===r)&&(!i||u.zoneId===i),m=u.logicalRowId??u.rowId,S=p.get(m);S||(S=[],p.set(m,S)),S.push({seat:u,index:$e(u,b),elig:w}),w&&d.push(u)}),d.length===0)return{labels:[],reason:"sold_out"};let l=null,f=u=>{if(!l)return!0;if(c&&u.nonPremium!==l.nonPremium)return u.nonPremium<l.nonPremium;if(u.orphan!==l.orphan)return u.orphan<l.orphan;if(u.d2!==l.d2)return u.d2<l.d2;let b=u.rowId.localeCompare(l.rowId);return b!==0?b<0:u.startIndex<l.startIndex};for(let[u,b]of p){let w=[...b].sort((S,C)=>S.index-C.index),m=0;for(;m<w.length;){if(!w[m].elig){m++;continue}let S=m;for(;S<w.length&&w[S].elig&&(S===m||w[S].index===w[S-1].index+1);)S++;let C=S-m;for(let x=0;x+o<=C;x++){let I=x,O=C-(x+o),L=I===1||O===1?1:0,R=w.slice(m+x,m+x+o).map(P=>P.seat),a={labels:R.map(P=>P.label),seats:R,rowId:u,startIndex:w[m+x].index,orphan:L,nonPremium:c?R.reduce((P,g)=>P+(Fe(g)?0:1),0):0,d2:xe(ht(R),vt(R,s))};f(a)&&(l=a)}m=S}}return l?{labels:l.labels}:d.length<o?{labels:[],reason:"not_enough_together"}:{labels:d.map((u,b)=>({seat:u,i:b,d2:xe(u,u.focalPoint??s)})).sort((u,b)=>{if(c){let m=Fe(u.seat)?0:1,S=Fe(b.seat)?0:1;if(m!==S)return m-S}if(u.d2!==b.d2)return u.d2-b.d2;let w=(u.seat.logicalRowId??u.seat.rowId).localeCompare(b.seat.logicalRowId??b.seat.rowId);return w!==0?w:$e(u.seat,u.i)-$e(b.seat,b.i)}).slice(0,o).map(u=>u.seat.label)}}function Qn(e,t,n,o){let r=Math.floor(o.qty),i=xt(e,n,o),c=t.filter(f=>f.bookingMode==="whole"&&f.capacity===r&&n.has(f.label)&&(!o.categoryKey||f.categoryKey===o.categoryKey)&&(!o.zoneId||f.zoneId===o.zoneId)).map(f=>({table:f,d2:xe(f.center,f.focalPoint??o.focal)})).sort((f,y)=>f.d2-y.d2||f.table.label.localeCompare(y.table.label))[0];if(!c)return i;if(!i.labels.length)return{labels:[c.table.label]};let p=new Map(e.map(f=>[f.label,f])),d=i.labels.map(f=>p.get(f)).filter(f=>!!f),l=d.length?xe(ht(d),vt(d,o.focal)):Number.POSITIVE_INFINITY;return c.d2<l?{labels:[c.table.label]}:i}var St=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Jn(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/St(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let c of i.split(/\s+/)){let p=c.length;s&&s+1+p<=o?s+=1+p:(r+=Math.max(1,Math.ceil(p/o)),s=p%o)}}return Math.max(1,r)}function It(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(c=>c.length))*St(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=Jn(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var eo=Math.PI/180;function B(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function to(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,s=e.y-t.y;return{x:t.x+i*o-s*r,y:t.y+i*r+s*o}}function wt(e,t){return to(e,{x:0,y:0},t*eo)}function ce(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function Ct(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function Mt(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[Ct(e,.5)];let o=Array.from({length:n+1},(p,d)=>Ct(e,d/n)),r=new Float64Array(o.length);for(let p=1;p<o.length;p+=1){let d=o[p].x-o[p-1].x,l=o[p].y-o[p-1].y;r[p]=r[p-1]+Math.hypot(d,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],c=1;for(let p=0;p<t;p+=1){let d=i*p/(t-1);for(;c<r.length-1&&r[c]<d;)c+=1;let l=r[c-1],f=r[c],y=f===l?0:(d-l)/(f-l);s.push({x:o[c-1].x+(o[c].x-o[c-1].x)*y,y:o[c-1].y+(o[c].y-o[c-1].y)*y})}return s}function K(e,t,n){return Math.max(t,Math.min(n,e))}var q=Math.PI*2;function le(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function no(e,t,n){let o=t-e;if(n){for(;o<0;)o+=q;for(;o>=q;)o-=q}else{for(;o>0;)o-=q;for(;o<=-q;)o+=q}return o}function De(e){if(e.version!==1||e.closed!==!0||!le(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!le(n.end))return!1;if(n.kind==="line"){if(B(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!le(n.control1)||!le(n.control2)||B(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!le(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(B(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(B(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||B(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return B(t,e.start)<=1e-4}function oo(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function Lt(e,t=2){if(!De(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let s=Math.atan2(r.y-i.center.y,r.x-i.center.x),c=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),p=no(s,c,i.clockwise),d=Math.max(2,Math.ceil(Math.abs(p)*i.radius/n));for(let l=1;l<=d;l+=1){let f=s+p*l/d;o.push({x:i.center.x+Math.cos(f)*i.radius,y:i.center.y+Math.sin(f)*i.radius})}}else{let s=B(r,i.control1)+B(i.control1,i.control2)+B(i.control2,i.end),c=Math.max(2,Math.ceil(s/n));for(let p=1;p<=c;p+=1)o.push(oo(r,i,p/c))}r=i.end}return B(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var oi=4/3;function Et(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((y,u)=>y.segmentedRow.componentIndex-u.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,c=i[0]?.segmentedRow;if(!c||!(s>=2&&i.length===s&&c?.boundaryBefore==="start"&&i.every((y,u)=>y.segmentedRow?.kind==="segmented-row-v1"&&y.segmentedRow.groupId===o&&y.segmentedRow.componentCount===s&&y.segmentedRow.componentIndex===u&&y.segmentedRow.repeatLabelOnComponents===c.repeatLabelOnComponents&&(u===0?y.segmentedRow.boundaryBefore==="start":y.segmentedRow.boundaryBefore!=="start")&&y.segmentedRow.displayLabel===c.displayLabel)))continue;let d=i.reduce((y,u)=>y+u.seatCount,0),l=0,f=0;for(let y of i)y.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(y.id,{groupId:o,adjacencyOffset:l,displayOffset:f,displayLabel:c.displayLabel,totalSeats:d,canonical:i[0],viewFromSeatUrl:c.viewFromSeatUrl,viewFromSeatMeta:c.viewFromSeatMeta,confidenceEvidence:c.confidenceEvidence}),l+=y.seatCount,f+=y.seatCount}return t}var ro="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var io="abcdefghijklmnopqrstuvwxyz";function ao(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function Be(e,t=!1){let n=t?io:ro;return ao(Math.max(0,Math.floor(e)-1),n)}var so=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Pt(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of so)for(;t>=o;)n+=r,t-=o;return n}function co(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function Ge(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",c=e.seatNumbering?.endAt,p=e.seatCount;if(i==="updown"||i==="updown-descending"){let u=Math.ceil(p/2),b=i==="updown"?t<u?n+2*t:n-1+2*(p-t):t<u?n+2*(u-1-t):n+1+2*(t-u);return`${s}${b}`}let d=i==="odd"||i==="even"?2:r,l=c!=null&&Number.isFinite(c)?c-(p-1)*d:n,f=o==="center"?co(p)[t]:o==="rtl"?p-1-t:t,y;switch(i){case"odd":{let u=l%2===1?l:l+1;y=String(u+f*2);break}case"even":{let u=l%2===0?l:l+1;y=String(u+f*2);break}case"roman":y=Pt(l+f*r);break;case"letters-upper":y=Be(l+f*r,!1);break;case"letters-lower":y=Be(l+f*r,!0);break;default:y=String(l+f*r);break}return`${s}${y}`}function lo(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Se(e,t,n){return n?.label??`${e.label}-${Ge(e,t)}`}function Ke(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Ge(e,t)}`;let r=lo(n),i=n.displayOffset+t;return`${n.displayLabel}-${Ge(r,i)}`}var Ie=.02291666666666667,li=1/Ie,uo=58,At=uo*Ie,ze=0,Q=3,H=0,U=120,we=0,Ce=45,Ve=7,Me=1.2;function Ue(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function fo(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Ve?e:Q}function ue(e,t={}){let n=Ue(t.floorBaseHeightM,H,U,0),o=Math.min(U,n+fo(e.elevation)*At),r=e.height===void 0?o:Ue(e.height,H,U,o),i=Ue(e.rake,we,Ce,0);return{height:r,rake:i}}function kt(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Ot(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],c=s.x-i.x,p=s.y-i.y,d=c*c+p*p,l=d>1e-12?((t-i.x)*c+(n-i.y)*p)/d:0;l<0?l=0:l>1&&(l=1);let f=Math.hypot(t-(i.x+l*c),n-(i.y+l*p));f<o&&(o=f)}return o}function po(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Rt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function He(e,t){let n=1/0;for(let o of kt(e)){let r=Ot(t,o.x,o.y);r<n&&(n=r)}for(let o of kt(t)){let r=Ot(e,o.x,o.y);r<n&&(n=r)}return n}function go(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let f=Math.hypot(l.x-n,l.y-o);f>r&&(r=f,i=l)}let s=i.x-n,c=i.y-o,p=Math.hypot(s,c);p>1e-9?(s/=p,c/=p):(s=1,c=0);let d=e.map((l,f)=>({p:l,i:f,t:(l.x-n)*s+(l.y-o)*c})).sort((l,f)=>l.t-f.t);return{pts:d.map(l=>l.p),seatIndices:d.map(l=>t[l.i])}}function mo(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let C of e)n+=C.x,o+=C.y;n/=t,o/=t;let r=0,i=0,s=0,c=0,p=0,d=0,l=0;for(let C of e){let x=C.x-n,I=C.y-o;r+=x*x,s+=I*I,i+=x*I,c+=x*x*x,p+=I*I*I,d+=x*I*I,l+=I*x*x}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let y=(c+d)/2,u=(p+l)/2,b=(y*s-u*i)/f,w=(u*r-y*i)/f,m=b+n,S=w+o;return!Number.isFinite(m)||!Number.isFinite(S)?null:{cx:m,cy:S}}var bo=.15;function yo(e){if(e.length<2)return null;let t=e.map(C=>{let x=0,I=0;for(let O of C.pts)x+=O.x,I+=O.y;return{x:x/C.pts.length,y:I/C.pts.length}}),n=0,o=0;for(let C of t)n+=C.x,o+=C.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let C of t){let x=C.x-n,I=C.y-o;r+=x*x,i+=x*I,s+=I*I}let c=r+s,p=r*s-i*i,d=c/2+Math.sqrt(Math.max(0,c*c/4-p)),l,f;Math.abs(i)>1e-12?(l=d-s,f=i):r>=s?(l=1,f=0):(l=0,f=1);let y=Math.hypot(l,f);if(!(y>1e-12))return null;l/=y,f/=y;let u=1/0,b=-1/0,w=[];for(let C of e){let x=1/0,I=-1/0;for(let O of C.pts){let L=O.x*l+O.y*f;L<x&&(x=L),L>I&&(I=L),L<u&&(u=L),L>b&&(b=L)}w.push(I-x)}let m=b-u;return m>1e-9?(w.sort((C,x)=>C-x),w[Math.min(w.length-1,Math.floor(w.length*.9))]/m<=ho?{x:l,y:f}:null):null}var ho=.35;function Tt(e,t,n,o){let r=new Map;for(let m of n){let S=t[m],C=S.rowId||`__seat-${m}`,x=r.get(C);x||(x={pts:[],idx:[]},r.set(C,x)),x.pts.push({x:S.x,y:S.y}),x.idx.push(m)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[m,S]of r){let C=go(S.pts,S.idx),x=0;for(let I of C.pts)x+=Math.hypot(I.x-o.x,I.y-o.y);i.push({id:m,pts:C.pts,seatIndices:C.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/C.pts.length})}let s=i.map(m=>po(m.pts)),c=[];for(let m=0;m<i.length;m++){let S=1/0;for(let C=0;C<i.length;C++){if(m===C||Rt(s[m],s[C])>=S)continue;let x=He(i[m].pts,i[C].pts);x<S&&(S=x)}Number.isFinite(S)&&c.push(S)}c.sort((m,S)=>m-S);let p=c.length?c[Math.floor(c.length/2)]:1,d=Math.max(p*1.8,1e-6),l=i.map(()=>[]);for(let m=0;m<i.length;m++)for(let S=m+1;S<i.length;S++)Rt(s[m],s[S])>d||He(i[m].pts,i[S].pts)<=d&&(l[m].push(S),l[S].push(m));let f=0;for(let m=0;m<i.length;m++){if(i[m].blockId!==-1)continue;let S=f++,C=[m];for(i[m].blockId=S;C.length;){let x=C.pop();for(let I of l[x])i[I].blockId===-1&&(i[I].blockId=S,C.push(I))}}let y=new Map;for(let m of i){let S=y.get(m.blockId)??[];S.push(m),y.set(m.blockId,S)}let u=[];for(let m of i){if(m.pts.length<4)continue;let S=mo(m.pts);S&&(!Number.isFinite(S.cx)||!Number.isFinite(S.cy)||u.push({x:S.cx,y:S.cy}))}let b=u.length>=2?(()=>{let m=u.map(x=>x.x).sort((x,I)=>x-I),S=u.map(x=>x.y).sort((x,I)=>x-I),C=Math.floor(u.length/2);return{cx:m[C],cy:S[C]}})():null;if(b){let m=L=>Math.hypot(L.x-b.cx,L.y-b.cy),S=1/0,C=-1/0,x=[];for(let L of i){let R=1/0,a=-1/0;for(let P of L.pts){let g=m(P);g<R&&(R=g),g>a&&(a=g)}x.push(a-R),R<S&&(S=R),a>C&&(C=a)}let I=C-S;x.sort((L,R)=>L-R);let O=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(I>1e-9&&O/I<=bo){let L=i.map(A=>{let T=0;for(let D of A.pts)T+=m(D);return{row:A,radius:T/A.pts.length}}),R=0,a=0;for(let A of L)R+=A.radius,a+=A.row.focalDistance;R/=L.length,a/=L.length;let P=0;for(let A of L)P+=(A.radius-R)*(A.row.focalDistance-a);if(P<0)for(let A of L)A.radius=-A.radius;let v=1/0;for(let A of L)A.radius<v&&(v=A.radius);L.sort((A,T)=>A.radius-T.radius);let h=-1,E=-1/0,M=I/Math.max(1,L.length)*.5,k=[];for(let A of L)A.radius-E>M&&(h++,E=A.radius),A.row.ordinal=h,A.row.blockDepth=A.radius-v,k.push(A.row);return{sectionId:e,rows:k,blockCount:f}}}let w=[];for(let[,m]of y){let S=yo(m);if(S){let C=I=>{let O=0;for(let L of I.pts)O+=L.x*S.x+L.y*S.y;return O/I.pts.length};m.sort((I,O)=>C(I)-C(O)),m.length>=2&&m[0].focalDistance>m[m.length-1].focalDistance&&m.reverse();let x=0;for(let I=0;I<m.length;I++)I>0&&(x+=He(m[I-1].pts,m[I].pts)),m[I].ordinal=I,m[I].blockDepth=x,w.push(m[I])}else{let C=1/0;for(let x of m)x.focalDistance<C&&(C=x.focalDistance);m.sort((x,I)=>x.focalDistance-I.focalDistance);for(let x=0;x<m.length;x++)m[x].ordinal=x,m[x].blockDepth=Math.max(0,m[x].focalDistance-C),w.push(m[x])}}return{sectionId:e,rows:w,blockCount:f}}var vo=/^\d{4}-\d{2}-\d{2}$/;function xo(e){let t=Date.parse(e);return Number.isFinite(t)?vo.test(e)?t+864e5:t:null}function So(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=xo(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Io(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function wo(e){return e.status!=="draft"&&e.status!=="retracted"}function Co(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function jt(e,t={}){return!!e&&wo(e)&&Io(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Co(e,t.activeBasisSha256)&&So(e,t.now)}function Dt(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Le=Math.PI/180;var de=16;function Ye(e,t,n,o){let r=n*Le,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function Mo(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return Mt(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let d=0;d<t;d++)s.push(Ye(d*n,0,r,i));return s}let c=o/(t-1)*Le,p=n/(2*Math.sin(Math.abs(c)/2));for(let d=0;d<t;d++){let l=d*c,f=p*Math.sin(l),y=-p+p*Math.cos(l);s.push(Ye(f,y,r,i))}return s}function Lo(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Ee(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function Eo(e,t){let n=Lo(e);return Mo(e).map((o,r)=>{let i=n.get(r),s=Dt(i),c=Se(e,r,i),p={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:c,displayLabel:Ke(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(p).some(d=>d!==void 0&&d!==!1&&d!=="")?p:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function F(e){let t=[];for(let n of Eo(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function fe(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Bt(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,f,y,u)=>{let b=o.get(l),w=Dt(b),m=b?.label??`${e.label}-${l+1}`,S=e.displayLabel??e.label;return{index:l,label:m,displayLabel:b?.displayLabel??`${S}-${l+1}`,x:f+(b?.dx??0),y:y+(b?.dy??0),categoryKey:b?.categoryKey??e.categoryKey,skipped:!!b?.skip,accessible:w.length>0,accessibility:w,wheelchairSpaceType:b?.wheelchairSpaceType,commercial:b?.commercial,glyph:b?.glyph,viewUrl:b?.viewFromSeatUrl,viewMeta:b?.viewFromSeatUrl?b.viewFromSeatMeta:void 0,labelStyle:b?.labelStyle,...u?{side:u}:{}}};if(e.shape==="round"){let l=(e.radius??40)+de,f=e.rotation*Le,y=Math.max(0,Math.min(360,e.seatArc??360));if(y>=360||n===1){for(let m=0;m<n;m++){let S=f+m/n*2*Math.PI;t.push(r(m,e.center.x+l*Math.cos(S),e.center.y+l*Math.sin(S)))}return t}let u=y*Le,b=(2*Math.PI-u)/2,w=f+b;for(let m=0;m<n;m++){let S=w+m/(n-1)*u;t.push(r(m,e.center.x+l*Math.cos(S),e.center.y+l*Math.sin(S)))}return t}let i=e.width??80,s=e.height??50,c=fe(e),p=["top","bottom","left","right"],d=0;for(let l of p){let f=c[l];for(let y=0;y<f;y++){let u,b;l==="top"?(u=-i/2+(y+.5)*i/f,b=-s/2-de):l==="bottom"?(u=-i/2+(y+.5)*i/f,b=s/2+de):l==="left"?(u=-i/2-de,b=-s/2+(y+.5)*s/f):(u=i/2+de,b=-s/2+(y+.5)*s/f);let w=Ye(u,b,e.rotation,e.center);t.push(r(d++,w.x,w.y,l))}}return t}function Gt(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Bt(e).filter(t=>!t.skipped).length}function G(e){return Bt(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function Po(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function _t(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,p=t[r].y;s>e.y!=p>e.y&&e.x<(c-i)*(e.y-s)/(p-s)+i&&(n=!n)}return n}function Ao(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),c=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=c+1e-7})}function z(e,t,n){return _t(e,t)&&!(n??[]).some(o=>_t(e,o)||Ao(e,o))}function Xe(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function J(e){switch(e.type){case"row":{let t=F(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return Xe(e.points);case"section":return Xe(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?Xe(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Nt(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function ko(e,t){if(e.type!=="gaArea"||!Nt(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>Nt(r,o[i]))}function Oo(e,t){let n=e.filter(s=>s.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=J(t);return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(ko(t,s)||z(r,s.outline,s.holes))):void 0)??n.find(s=>z(r,s.outline,s.holes))}function Ze(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Pe(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function $t(e,t,n,o,r,i,s,c,p){let d=[],l=Et(e),f=b=>!b?.eventConfigurationId||b.eventConfigurationId===o&&(b.eventConfigurationVersion===void 0||b.eventConfigurationVersion===p),y=b=>jt(b,{activeConfigurationId:o,activeConfigurationVersion:p,activeBasisSha256:r,now:c}),u=(b,w)=>y(b)?{...b,coverage:w}:void 0;for(let b of e){let w=[];if(b.type==="row"?w=F(b):b.type==="table"?w=G(b):b.type==="booth"&&(w=Po(b)),!w.length)continue;for(let I of w)I.viewUrl&&!f(I.viewMeta)&&(I.viewUrl=void 0,I.viewMeta=void 0);if(b.type==="row"){let I=l.get(b.id);if(I){let O=new Map((b.overrides??[]).map(L=>[L.index,L]));for(let L of w){let R=Number(L.id.slice(L.id.lastIndexOf(":")+1));if(!Number.isInteger(R))continue;L.logicalRowId=I.groupId,L.logicalSeatIndex=I.adjacencyOffset+R,O.get(R)?.displayLabel||(L.displayLabel=Ke(b,R,I)),!L.viewUrl&&I.viewFromSeatUrl&&f(I.viewFromSeatMeta)&&(L.viewUrl=I.viewFromSeatUrl,L.viewMeta=I.viewFromSeatMeta);let a=O.get(R)?.confidenceEvidence;L.confidenceEvidence=u(a,"exact-seat")??u(b.confidenceEvidence,"row-representative")??u(I.confidenceEvidence,"row-representative")}}}let m=Oo(e,b),S=m?.viewFromSeatUrl,x=(m?.zone?t?.find(I=>I.id===m.zone):void 0)?.focalPoint??n;for(let I of w){if(!I.confidenceEvidence){let O=Number(I.id.slice(I.id.lastIndexOf(":")+1)),L=(b.type==="row"||b.type==="table")&&Number.isInteger(O)?b.overrides?.find(R=>R.index===O)?.confidenceEvidence:void 0;I.confidenceEvidence=u(L,"exact-seat")??(b.type==="row"?u(b.confidenceEvidence,"row-representative"):void 0)}I.confidenceEvidence??=u(m?.confidenceEvidence,"section-representative")??(s?u(s.evidence,s.coverage):void 0),!I.viewUrl&&S&&f(m?.viewFromSeatMeta)&&(I.viewUrl=S,I.viewMeta=m?.viewFromSeatMeta),!I.viewUrl&&i&&f(i.meta)&&(I.viewUrl=i.url,I.viewMeta=i.meta),m&&(I.sectionId=m.logicalSectionId??m.id),m?.zone&&(I.zoneId=m.zone),x&&(I.focalPoint={...x})}d.push(...w)}return d}function We(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,c=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,p=$t(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,c,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Ft(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,p);for(let d of p)d.floorId=r.id;o.push(...p)}return o}let n=$t(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Ft(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Ft(e,t,n,o){let r=e.filter(l=>l.type==="section"),i=n>0||r.some(l=>l.height!==void 0||l.rake!==void 0||(l.elevation??0)>0);if(!r.length||!i||!t){for(let l of o)l.eyeHeightM=n+Me;return}let s=new Array(o.length),c=new Map,p=new Map;for(let l=0;l<o.length;l++){let f=o[l],u=(f.sectionId?r.find(w=>w.id===f.sectionId)??r.find(w=>w.logicalSectionId===f.sectionId&&z({x:f.x,y:f.y},w.outline,w.holes)):void 0)??r.find(w=>z({x:f.x,y:f.y},w.outline,w.holes))??null;if(s[l]=u,!u)continue;c.has(u.id)||c.set(u.id,ue(u,{floorBaseHeightM:n}));let b=p.get(u.id);b?b.push(l):p.set(u.id,[l])}let d=new Array(o.length).fill(void 0);for(let[l,f]of p){let y=c.get(l);if(!y)continue;let u=y.rake>0?Math.tan(y.rake*Math.PI/180):0,b=Tt(l,o,f,t);for(let w of b.rows){let m=w.blockDepth*Ie*u,S=y.height+m;for(let C of w.seatIndices)d[C]=S}}for(let l=0;l<o.length;l++){let f=o[l],y=s[l];if(!y){f.eyeHeightM=n+Me;continue}let u=c.get(y.id);f.eyeHeightM=(d[l]??u.height)+Me}}var Kt="__sl_ga__",X=1e5,Ae=1e5;function Ut(e,t){return`${Kt}${encodeURIComponent(e)}__${t+1}`}function ke(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>X||(n+=r.count,n>X))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(c=>r.startIndex<c.end&&s>c.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function qe(e){let t=Math.min(X,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:ke(e)?e.inventorySegments.map(n=>({...n})):[]}function Qe(e){return qe(e).flatMap(t=>Array.from({length:t.count},(n,o)=>Ut(t.sourceAreaId,t.startIndex+o)))}function Ro(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let n=qe(e);if(!n.length)return;let o=t-e.capacity;if(!o)return n;let i=n.filter(c=>c.sourceAreaId===e.id).reduce((c,p)=>Math.max(c,p.startIndex+p.count),0),s=n[n.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===i)s.count+=o;else{if(n.length>=256)return;n.push({sourceAreaId:e.id,startIndex:i,count:o})}return n}function To(e){return Pe(e).filter(t=>t.type==="gaArea")}function pe(e){return e.startsWith(Kt)}var jo=.15,_o=1.6;function zt(e){return K(e??1,jo,_o)}var No=/^#?([\da-f]{3}|[\da-f]{6})$/i;function ee(e){let t=No.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function Vt(e,t){let n=i=>{let s=ee(i);if(!s)return null;let c=C=>{let x=C/255;return x<=.04045?x/12.92:((x+.055)/1.055)**2.4},p=c(s[0]),d=c(s[1]),l=c(s[2]),f=(.4124*p+.3576*d+.1805*l)/.95047,y=.2126*p+.7152*d+.0722*l,u=(.0193*p+.1192*d+.9505*l)/1.08883,b=C=>C>.008856?Math.cbrt(C):7.787*C+16/116,w=b(f),m=b(y),S=b(u);return[116*m-16,500*(w-m),200*(m-S)]},o=n(e),r=n(t);return o&&r?Math.hypot(o[0]-r[0],o[1]-r[1],o[2]-r[2]):null}function Je(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function et(e){return .2126*Je(e[0])+.7152*Je(e[1])+.0722*Je(e[2])}function $(e,t){let n=ee(e),o=ee(t);if(!n||!o)return null;let r=et(n),i=et(o);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function $o(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=!0,s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function Ht(e){let t=$o(e);return t?Fo(t):null}function Fo(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var Zt=7;var Wt=10;var nt=.85,qt=12,Qt=4.5,Do=3,Xt="#000000",Yt="#ffffff",Bo=24,Go=18.67;function Jt(e,t=400){return e>=Bo||t>=700&&e>=Go?Do:Qt}var Ko={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},Ai=Ko.wheelchair;var tt=$;function ot(e,t,n){let o=ee(e),r=ee(t);if(!o||!r)return t;let i=Math.max(0,Math.min(1,n));return`#${o.map((c,p)=>Math.round(c*i+r[p]*(1-i))).map(c=>c.toString(16).padStart(2,"0")).join("")}`}function en(e,t,n=Qt){let o=tt(t,e);if(o!=null&&o>=n)return t;let r=tt(Xt,e)??0,i=tt(Yt,e)??0;return r===0&&i===0?t:r>=i?Xt:Yt}var te=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],Oi=new Map(te.map(e=>[e.key,e]));var Uo=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],Ri=new Map(Uo.map(e=>[e.key,e]));var zo=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],Ti=new Set(zo);var Vo=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Ho=/[\s"'<>`\\]/;function rt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Vo.test(e);if(Ho.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Xo(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function ne(e){return Xo(e)*2}var Oe=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function tn(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function Yo(e){return Oe.find(t=>t.key===e)}function me(e){let t=new Map,n=Math.max(0,Math.floor(e.seatCount)),o=new Map((e.overrides??[]).filter(i=>Number.isInteger(i.index)&&i.index>=0&&i.index<e.seatCount).map(i=>[i.index,i])),r=(i,s=1)=>{i&&s>0&&t.set(i,(t.get(i)??0)+s)};r(e.categoryKey,n-o.size);for(let i of o.values())i.skip||r(i.categoryKey??e.categoryKey);return t}function Zo(e){return e.type==="row"||e.type==="table"?[...me(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function nn(e){return Oe.find(t=>t.objectType===e.type)??null}function on(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ge(e){let t=new Map;for(let r of tn(e))for(let i of r.objects){if(!on(i))continue;let s=nn(i);for(let c of Zo(i)){let p=t.get(c)??new Map,d=p.get(s.key)??[];if(!d.some(l=>l.id===i.id)){let l=i.displayLabel||i.label||i.id;d.push({id:i.id,label:l,type:s.objectType,floorId:r.id})}p.set(s.key,d),t.set(c,p)}}let n=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...t.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let i=t.get(r);if(!i||i.size<2)return[];let s=Oe.flatMap(c=>{let p=i.get(c.key);return p?.length?[{family:c.key,label:c.label,objectType:c.objectType,targets:p}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:s,objectIds:[...new Set(s.flatMap(c=>c.targets.map(p=>p.id)))]}]})}function it(e){let t=e.families.map(n=>`${n.label} (${n.targets.map(o=>o.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory \u2014 ${t}. Each category can belong to only one kind \u2014 use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function rn(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Wo(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?`--${t}`:`--${t}-${o}`,s=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(s))return n.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function qo(e,t,n){for(let o=1;o<=1e4;o+=1){let r=o===1?` (${t})`:` (${t} ${o})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,c=rn(s);if(!n.has(c))return n.add(c),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function Qo(e,t,n,o){let r=Yo(t);return{...structuredClone(e),key:Wo(e.key,r.suffix,n),label:qo(e.label,r.labelSuffix,o)}}function Jo(e,t,n){let o=[];for(let r of tn(e))for(let i of r.objects){if(!on(i))continue;let s=nn(i),c=n.get(s.key);if(!(!c||c===t))if(i.type==="row"||i.type==="table"){let p=[];i.categoryKey===t&&(i.categoryKey=c);for(let d of i.overrides??[])d.categoryKey===t&&(d.categoryKey=c,p.push(d.index));(i.categoryKey===c||p.length)&&o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:c,...p.length?{seatOverrideIndices:p.sort((d,l)=>d-l)}:{}})}else i.categoryKey===t&&(i.categoryKey=c,o.push({family:s.key,floorId:r.id,objectId:i.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:c}))}return o}function at(e){let t=structuredClone(e),n=ge(t);if(!n.length)return{doc:t,changed:!1,changes:[],before:n,after:n};let o=new Set(t.categories.map(c=>c.key)),r=new Set(t.categories.map(c=>rn(c.label))),i=[];for(let c of n){let p=t.categories.findIndex(b=>b.key===c.categoryKey);if(p<0)continue;let d=t.categories[p],l=c.families[0].family,f=new Map([[l,d.key]]),y=c.families.slice(1).map(b=>{let w=Qo(d,b.family,o,r);return f.set(b.family,w.key),{family:b.family,key:w.key,label:w.label,category:w}});t.categories.splice(p+1,0,...y.map(b=>b.category));let u=Jo(t,d.key,f);i.push({categoryKey:d.key,categoryLabel:d.label,retainedFamily:l,clones:y.map(({family:b,key:w,label:m})=>({family:b,key:w,label:m})),reassignments:u})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=ge(t);return{doc:t,changed:i.length>0,changes:i,before:n,after:s}}function er(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function be(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function Re(e,t,n){let o=be(t,n,e);return Math.abs(o)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function tr(e,t,n,o){let r=be(e,t,n),i=be(e,t,o),s=be(n,o,e),c=be(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)?!0:Math.abs(r)<=1e-7&&Re(n,e,t)||Math.abs(i)<=1e-7&&Re(o,e,t)||Math.abs(s)<=1e-7&&Re(e,n,o)||Math.abs(c)<=1e-7&&Re(t,n,o)}function nr(e){return e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n.x*r.y-r.x*n.y},0)}function or(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&tr(e[t],e[n],e[o],e[r]))return!0}}return!1}function an(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>er(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(nr(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:or(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var sn="M13 4.6a1.6 1.6 0 1 0-3.2 0 1.6 1.6 0 0 0 3.2 0 M11 6.5V13h5l2.4 6 M15 16.4A5 5 0 1 1 9 11.3",cn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:"M16 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0 M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:"M15 5a3 3 0 1 0-6 0 3 3 0 0 0 6 0 M12 8l-4 10h8l-4-10 M10 18v4 M14 18v4"},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:sn},{key:"first-aid",label:"First aid",group:"facilities",path:"M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z M12 8v8 M8 12h8"},{key:"coat-check",label:"Coat check",group:"facilities",path:"M12 6a2 2 0 0 1 0-4 2 2 0 0 1 1.6 3.2L21 13H3l8.4-7.8 M3 13h18"},{key:"atm",label:"ATM / cash",group:"facilities",path:"M2 6h20v12H2V6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0 M6 9h.01 M18 15h.01"},{key:"info",label:"Info point",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M12 11v5 M12 8h.01"},{key:"lost-found",label:"Lost & found",group:"facilities",path:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14 M16 16l5 5 M9 8.5a2 2 0 1 1 3 1.7c-.8.5-1 .8-1 1.8 M11 15h.01"},{key:"restrooms",label:"Restrooms",group:"facilities",path:"M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M9 18v-3.5a3 3 0 0 1 6 0V18"},{key:"charging",label:"Charging point",group:"facilities",path:"M3 8h13v8H3V8Z M16 10h3v4h-3 M9.6 9l-2 3.5h2.5l-1.5 3"},{key:"smoking",label:"Smoking area",group:"facilities",path:"M2 15h13v3H2v-3Z M18 16h2 M19 8c0 1 1 1.5 1 2.5S19 12 19 13"},{key:"no-smoking",label:"No smoking",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M5.6 5.6l12.8 12.8 M7 13h6v2H7v-2Z"},{key:"food",label:"Food",group:"food-drink",path:"M7 3v6a2 2 0 0 0 4 0V3 M9 11v10 M17 3c-1.6 1-2.2 3-2.2 6 0 2 .9 3.2 2.2 3.6V21"},{key:"bar",label:"Bar",group:"food-drink",path:"M4 5h16l-8 8-8-8Z M12 13v6 M8 20h8"},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 8h13v4a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8Z M17 9h2a2 2 0 0 1 0 4h-2 M8 2v2 M11 2v2 M4 21h14"},{key:"water",label:"Water / drinks",group:"food-drink",path:"M12 22a7 7 0 0 1-7-7c0-5 7-12 7-12s7 7 7 12a7 7 0 0 1-7 7Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:"M6 8h12l-1 12H7L6 8Z M9 8V6a3 3 0 0 1 6 0v2"},{key:"screen",label:"Screen",group:"facilities",path:"M3 4h18v12H3V4Z M9 20h6 M12 16v4 M10 8l4 2-4 2V8Z"},{key:"sound-booth",label:"Sound booth",group:"facilities",path:"M6 4v16 M6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4 M12 4v16 M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M18 4v16 M18 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4"},{key:"entrance",label:"Entrance",group:"navigation",path:"M14 3h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-5 M3 12h11 M10 8l4 4-4 4"},{key:"exit",label:"Exit",group:"navigation",path:"M10 3H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h5 M14 12h7 M17 8l4 4-4 4"},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:"M14 4.6a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0 M12.5 8l-3.5 2 1.6 3.6-2 4.4 M12.5 10l3.5 1.5 M9 10.5l-3.5 1 M15 12h6 M18 9l3 3-3 3"},{key:"stairs",label:"Stairs",group:"navigation",path:"M3 20v-4h4v-4h4v-4h4V4h5"},{key:"elevator",label:"Elevator",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M8 11l1.5-2 1.5 2 M8 14l1.5 2 1.5-2 M15 8v8"},{key:"parking",label:"Parking",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M9 17V7h4a3 3 0 0 1 0 6H9"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:sn},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:"M8 20a4 4 0 0 1-2-3c0-1 .5-2 .5-3a4.5 4.5 0 1 1 9 0c0 1.4-1 2-2 2.4-1.2.5-1.5 1-1.5 2.2 M17 6a5 5 0 0 1 1 6 M19.5 4a8 8 0 0 1 1.2 9"}];var rr=new Map(cn.map(e=>[e.key,e]));function ln(e){return typeof e=="string"&&rr.has(e)}var Gi=cn.map(e=>e.key);var un=["butt","round","square"],dn=["miter","round","bevel"],st=["none","arrow"];function ct(e){return e==="line"||e==="polyline"}function Y(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function oe(e,t,n){let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>1e-7)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-1e-7)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+1e-7}function re(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],s=t[o];if(oe(e,i,s))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function V(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function pn(e,t,n,o){let r=V(e,t,n),i=V(e,t,o),s=V(n,o,e),c=V(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)?!0:Math.abs(r)<=1e-7&&oe(n,e,t)||Math.abs(i)<=1e-7&&oe(o,e,t)||Math.abs(s)<=1e-7&&oe(e,n,o)||Math.abs(c)<=1e-7&&oe(t,n,o)}function ie(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o+=1){let r=(o+1)%e.length;if(!(t===o||n===o||r===t)&&pn(e[t],e[n],e[o],e[r]))return!0}}return!1}function ye(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(pn(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return re(e[0],t)||re(t[0],e)}function fn(e,t){return!t.some((n,o)=>oe(e,n,t[(o+1)%t.length]))&&re(e,t)}function gn(e){let t=e.outlinePath;if(!t?.segments.length)return;let n=i=>Number.isFinite(i.x)&&Number.isFinite(i.y),o=(i,s)=>Math.hypot(i.x-s.x,i.y-s.y);if(!n(t.start))return 0;let r=t.start;for(let i=0;i<t.segments.length;i++){let s=t.segments[i];if(!s||!n(s.end)||o(r,s.end)<=1e-9||s.kind==="bezier"&&(!n(s.control1)||!n(s.control2)))return i;if(s.kind==="arc"){if(!n(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return i;let c=Math.max(1e-4,s.radius*1e-4);if(Math.abs(o(r,s.center)-s.radius)>c||Math.abs(o(s.end,s.center)-s.radius)>c)return i}r=s.end}return o(r,t.start)>1e-4,t.segments.length-1}function ir(e,t,n,o){let r=V(e,t,n),i=V(e,t,o),s=V(n,o,e),c=V(n,o,t);return(r>1e-7&&i<-1e-7||r<-1e-7&&i>1e-7)&&(s>1e-7&&c<-1e-7||s<-1e-7&&c>1e-7)}function mn(e,t){for(let n=0;n<e.length;n+=1)for(let o=0;o<t.length;o+=1)if(ir(e[n],e[(n+1)%e.length],t[o],t[(o+1)%t.length]))return!0;return e.some(n=>fn(n,t))||t.some(n=>fn(n,e))}function bn(e){return e.role!=="reference-focal"||!e.points||!Y(e.points)?null:e.points}function yn(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}function vn(e,t){if(e.displayLabel!==void 0){let n=e.displayLabel.normalize("NFKC").trim();(!n||n!==e.displayLabel||n.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let n=e.displayType.normalize("NFKC").trim();(!n||n!==e.displayType||n.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}}function hn(e,t,n,o){let r=e.crop,i=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||i)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...o?{floorId:o}:{}})}function lt(e,t,n,o){let r=e.referenceImage,i=e.backgroundImage;r&&(hn(r,"reference",t,o),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...o?{floorId:o}:{}})),i&&(hn(i,i.assetId?"legacy reference":"buyer background",t,o),!i.assetId&&!i.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...o?{floorId:o}:{}}),i.assetId&&n.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...o?{floorId:o}:{}})),yn(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...o?{floorId:o}:{}})}function he(e){let t=new Set(te.map(n=>n.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(n=>!!n.trim()&&n.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=te.length&&new Set(e.accessibility.counts.map(n=>n.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(n=>t.has(n.type)&&Number.isInteger(n.count)&&n.count>0&&["user-confirmed","authoritative-source"].includes(n.evidence)&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240))}function xn(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function Sn(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function In(e){let t=e.referenceDirectSeatImport;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(t.familyId)}function wn(e,t){let n=e.floors?.length?e.floors.map(i=>({id:i.id,objects:i.objects})):[{id:"floor-0",objects:e.objects}],o=new Map,r=new Map;for(let i of n){let s=i.objects.filter(d=>d.type==="row"),c=new Map,p=new Map;for(let d of s){if(d.segmentedRow){let l=c.get(d.segmentedRow.groupId)??[];l.push(d),c.set(d.segmentedRow.groupId,l)}if(d.rowBlockGeneration){let l=p.get(d.rowBlockGeneration.groupId)??[];l.push(d),p.set(d.rowBlockGeneration.groupId,l)}d.segmentedRow&&d.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${d.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:d.id,floorId:i.id})}for(let[d,l]of c){let f=o.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" cannot span multiple floors`,objectId:l[0].id,floorId:i.id}),o.set(d,i.id);let y=l.slice().sort((S,C)=>S.segmentedRow.componentIndex-C.segmentedRow.componentIndex),u=y[0]?.segmentedRow,b=u?.componentCount??0,w=u?JSON.stringify({displayLabel:u.displayLabel,repeatLabelOnComponents:u.repeatLabelOnComponents,displayType:u.displayType,labelPresentation:u.labelPresentation,viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence,smoothing:u.smoothing}):"";u&&b>=2&&b<=64&&y.length===b&&u.boundaryBefore==="start"&&y.every((S,C)=>{let x=S.segmentedRow;return x.kind==="segmented-row-v1"&&x.groupId===d&&x.componentCount===b&&x.componentIndex===C&&(C===0?x.boundaryBefore==="start":x.boundaryBefore!=="start")&&x.displayLabel.normalize("NFKC").trim()===x.displayLabel&&x.displayLabel.length>0&&x.displayLabel.length<=80&&JSON.stringify({displayLabel:x.displayLabel,repeatLabelOnComponents:x.repeatLabelOnComponents,displayType:x.displayType,labelPresentation:x.labelPresentation,viewFromSeatUrl:x.viewFromSeatUrl,viewFromSeatMeta:x.viewFromSeatMeta,confidenceEvidence:x.confidenceEvidence,smoothing:x.smoothing})===w})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${d}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:l[0]?.id,floorId:i.id})}for(let[d,l]of p){let f=r.get(d);f&&f!==i.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:l[0].id,floorId:i.id}),r.set(d,i.id)}}}function sr(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function cr(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:Se(e,o,r),index:o})}return t}function Cn(e){let t=[],n=new Map((e.overrides??[]).map(o=>[o.index,o]));for(let o=0;o<e.seatCount;o++){let r=n.get(o);r?.skip||t.push({label:r?.label??`${e.label}-${o+1}`,index:o})}return t}function Mn(e){let t=[];e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&t.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let n=[],o=new Set(e.categories.map(a=>a.key)),r=new Set(te.map(a=>a.key)),i=new Map(e.categories.map(a=>[a.key,a.price!=null||a.notForSale===!0])),s=new Set;lt(e,t,n),e.theme?.logoUrl!==void 0&&!rt(e.theme.logoUrl)&&t.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let c=rt,p=(a,P,g,v={})=>{if(P===void 0)return;if(!P||typeof P!="object"||Array.isArray(P)){t.push({severity:"error",code:"invalid-seat-view-metadata",message:`${g} view metadata is invalid`,...v});return}let h=P;a||n.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${g} view metadata has no image`,...v});let E=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);h.projection!==void 0&&h.projection!=="equirectangular"&&t.push({severity:"error",code:"invalid-seat-view-projection",message:`${g} view projection must be equirectangular`,...v}),h.coverage!==void 0&&!E.has(h.coverage)&&t.push({severity:"error",code:"invalid-seat-view-coverage",message:`${g} view coverage is invalid`,...v});let M=(k,A,T)=>typeof k=="number"&&Number.isFinite(k)&&k>=A&&k<=T;if(h.initialBearingDeg!==void 0&&!M(h.initialBearingDeg,-360,360)&&t.push({severity:"error",code:"invalid-seat-view-bearing",message:`${g} view bearing must be between -360\xB0 and 360\xB0`,...v}),h.initialPitchDeg!==void 0&&!M(h.initialPitchDeg,-90,90)&&t.push({severity:"error",code:"invalid-seat-view-pitch",message:`${g} view pitch must be between -90\xB0 and 90\xB0`,...v}),h.capturedAt!==void 0&&(typeof h.capturedAt!="string"||h.capturedAt.length>40||!Number.isFinite(Date.parse(h.capturedAt)))&&t.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${g} view capture date is invalid`,...v}),h.sourceLabel!==void 0&&(typeof h.sourceLabel!="string"||h.sourceLabel.trim().length>100)&&t.push({severity:"error",code:"invalid-seat-view-source",message:`${g} view source label is invalid`,...v}),h.previewUrl!==void 0&&!c(h.previewUrl)&&t.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${g} view preview URL is invalid`,...v}),h.variants!==void 0){let k=Array.isArray(h.variants)?h.variants:[];if(!Array.isArray(h.variants)||k.length<1||k.length>4)t.push({severity:"error",code:"invalid-seat-view-variants",message:`${g} view variants must contain between 1 and 4 tiers`,...v});else{let A=new Set;for(let T of k){if(!T||typeof T!="object"||!c(T.url)||!Number.isInteger(T.width)||T.width<1||T.width>12e3||!Number.isInteger(T.height)||T.height<1||T.height>12e3||T.width!==T.height*2||typeof T.sha256!="string"||!/^[a-f0-9]{64}$/.test(T.sha256)||A.has(T.width)){t.push({severity:"error",code:"invalid-seat-view-variant",message:`${g} view variant is not a unique immutable 2:1 equirectangular tier`,...v});break}A.add(T.width)}}}for(let[k,A]of[["width",h.sourceWidth],["height",h.sourceHeight],["preview width",h.previewWidth],["preview height",h.previewHeight]])A!==void 0&&(!Number.isInteger(A)||A<1||A>32768)&&t.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${g} view source ${k} is invalid`,...v});h.captureEyeHeightM!==void 0&&!M(h.captureEyeHeightM,.5,3)&&t.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${g} capture eye height must be between 0.5 m and 3 m`,...v}),h.eventConfigurationId!==void 0&&(typeof h.eventConfigurationId!="string"||!h.eventConfigurationId.trim()||h.eventConfigurationId.length>100)&&t.push({severity:"error",code:"invalid-seat-view-configuration",message:`${g} event configuration id is invalid`,...v}),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&t.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${g} event configuration version is invalid`,...v}),h.eventConfigurationVersion!==void 0&&!h.eventConfigurationId&&t.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${g} event configuration version requires an id`,...v})},d=(a,P,g={})=>{if(a===void 0)return;let v=A=>{t.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${P} confidence evidence ${A}`,...g})};if(!a||typeof a!="object"||Array.isArray(a)){v("is invalid");return}let h=a;h.schema!=="seatlayer.seat-confidence/1"&&v("has an unsupported schema");let E=(A,T)=>typeof A=="string"&&A.normalize("NFKC").trim()===A&&A.length>0&&A.length<=T;E(h.evidenceId,120)||v("has an invalid evidence id"),E(h.modelVersion,120)||v("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(h.evidenceKind)||v("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(h.modelLevel)||v("has an invalid model level");let M=h.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(M)||v("has an invalid reality level"),h.eventConfigurationId!==void 0&&!E(h.eventConfigurationId,100)&&v("has an invalid event configuration id"),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&v("has an invalid event configuration version"),h.status!==void 0&&!new Set(["draft","approved","retracted"]).has(h.status)&&v("has an invalid publication status"),h.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(h.basisSha256)&&v("has an invalid venue basis SHA-256"),h.basisSha256!==void 0&&h.status!=="approved"&&v("can carry a venue basis SHA-256 only after approval");for(let[A,T]of[["assessment",h.assessedAt],["expiry",h.validUntil]])T!==void 0&&(!E(T,40)||!Number.isFinite(Date.parse(T)))&&v(`has an invalid ${A} date`);h.approvedByRole!==void 0&&!E(h.approvedByRole,100)&&v("has an invalid approving organization or role"),h.sourceLabel!==void 0&&!E(h.sourceLabel,120)&&v("has an invalid source label"),h.limitations!==void 0&&(!Array.isArray(h.limitations)||h.limitations.length>6||h.limitations.some(A=>!E(A,160)))&&v("has invalid limitations"),h.evidenceKind==="synthetic-model"&&(h.modelLevel!=="generated"||M!=="none")&&v("cannot describe synthetic data as verified or reality checked"),h.modelLevel!=="generated"&&(!h.assessedAt||!h.approvedByRole)&&v("requires an assessment date and approving organization or role for verified model levels"),h.modelLevel==="configuration-verified"&&!h.eventConfigurationId&&v("requires an event configuration id for configuration verification"),M!=="none"&&(!h.assessedAt||!h.sourceLabel)&&v("requires an assessment date and source for reality evidence"),M==="actual-build-checked"&&(h.modelLevel!=="configuration-verified"||!h.eventConfigurationId)&&v("requires a configuration-verified model and event configuration for an actual-build check");let k=h.modeledTarget;k!==void 0&&(!k||typeof k!="object"||Array.isArray(k)?v("has an invalid modeled target"):((!E(k.label,80)||!E(k.methodLabel,100))&&v("has invalid modeled-target labels"),(!Number.isInteger(k.totalRayCount)||k.totalRayCount<1||k.totalRayCount>1e3||!Number.isInteger(k.clearRayCount)||k.clearRayCount<0||k.clearRayCount>k.totalRayCount)&&v("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(k.classification)||v("has an invalid modeled-target classification"),k.occluderLabels!==void 0&&(!Array.isArray(k.occluderLabels)||k.occluderLabels.length>10||k.occluderLabels.some(A=>!E(A,100)))&&v("has invalid modeled-target occluders")))};p(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),d(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!c(e.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let a of e.floors??[])a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${a.name}" has an invalid view-from-seat image URL`}),p(a.viewFromSeatUrl,a.viewFromSeatMeta,`Floor "${a.name}"`,{floorId:a.id}),d(a.confidenceEvidence,`Floor "${a.name}"`,{floorId:a.id});let l=e.floors?.length?e.floors.flatMap(a=>a.objects):e.objects;for(let a of l)if((a.type==="row"||a.type==="section")&&(a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&t.push({severity:"error",code:a.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${a.type==="row"?"Row":"Section"} "${a.label}" has an invalid view-from-seat image URL`,objectId:a.id}),p(a.viewFromSeatUrl,a.viewFromSeatMeta,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id}),d(a.confidenceEvidence,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id})),a.type==="row"&&a.segmentedRow&&(a.segmentedRow.viewFromSeatUrl!==void 0&&!c(a.segmentedRow.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${a.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:a.id}),p(a.segmentedRow.viewFromSeatUrl,a.segmentedRow.viewFromSeatMeta,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id}),d(a.segmentedRow.confidenceEvidence,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id})),a.type==="row"||a.type==="table")for(let P of a.overrides??[])P.viewFromSeatUrl!==void 0&&!c(P.viewFromSeatUrl)&&t.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${P.index+1} has an invalid view-from-seat image URL`,objectId:a.id,seatIndices:[P.index]}),p(P.viewFromSeatUrl,P.viewFromSeatMeta,`Seat ${P.index+1}`,{objectId:a.id,seatIndices:[P.index]}),d(P.confidenceEvidence,`Seat ${P.index+1}`,{objectId:a.id,seatIndices:[P.index]});let f=new Set;for(let a of e.categories){f.has(a.key)&&t.push({severity:"error",code:"duplicate-category-key",message:`Category key "${a.key}" is used more than once`,categoryKey:a.key}),f.add(a.key);let P=new Set;for(let g of a.tiers??[]){if(P.has(g.id)&&t.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${g.id}" is used more than once in category "${a.key}"`,categoryKey:a.key}),g.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(g.restriction)&&t.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${g.name}" has an unknown restriction`,categoryKey:a.key}),g.buyerMessage!=null&&(!g.buyerMessage.trim()||g.buyerMessage.length>240)&&t.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${g.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:a.key}),g.currency!=null&&!/^[A-Z]{3}$/.test(g.currency)&&t.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${g.name}" must use a three-letter ISO currency`,categoryKey:a.key}),g.applicability!=null){let v=g.applicability.seatLabels,h=g.applicability.accessibility;(v!==void 0&&(!Array.isArray(v)||!v.length||v.length>1e4||v.some(E=>typeof E!="string"||!E.trim()||E.length>160)||new Set(v).size!==v.length)||h!==void 0&&(!Array.isArray(h)||!h.length||h.some(E=>!r.has(E))||new Set(h).size!==h.length))&&t.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${g.name}" has invalid seat applicability`,categoryKey:a.key})}g.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(g.evidence.provenance)||!g.evidence.sourceDescription.trim()||g.evidence.sourceDescription.length>240||g.evidence.capturedAt!==void 0&&(g.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(g.evidence.capturedAt))))&&t.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${g.name}" has invalid evidence provenance`,categoryKey:a.key}),P.add(g.id)}Sn(a)||t.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${a.label||a.key} has incomplete or invalid reference evidence`,categoryKey:a.key}),In(a)||t.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${a.label||a.key} has invalid direct-seat import provenance`,categoryKey:a.key})}let y=new Map,u=new Map,b=[],w=new Map,m=0,S=0,C=new Set;for(let a of e.floors??[])lt(a,t,n,a.id),C.has(a.id)&&t.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${a.id}" is used more than once`,floorId:a.id}),C.add(a.id),a.baseHeightM!==void 0&&(!Number.isFinite(a.baseHeightM)||a.baseHeightM<H||a.baseHeightM>U)&&t.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${a.name}" base height must be between ${H} and ${U} metres`,floorId:a.id});let x=e.floors&&e.floors.length?e.floors.flatMap(a=>a.objects):e.objects;wn(e,t);let I=new Set;for(let a of x)I.has(a.id)&&t.push({severity:"error",code:"duplicate-object-id",message:`Object id "${a.id}" is used more than once`,objectId:a.id}),I.add(a.id);let O=new Set;for(let a of e.zones??[])O.has(a.id)&&t.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${a.id}" is used more than once`}),O.add(a.id),a.focalPoint!==void 0&&(!Number.isFinite(a.focalPoint.x)||!Number.isFinite(a.focalPoint.y))&&t.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${a.label}" must use a finite focal point`});let L=new Map;for(let a of x)if(!(a.type!=="section"||!a.zone)){if(e.zones?.length&&!O.has(a.zone)){t.push({severity:"error",code:"unknown-section-zone",message:`Section "${a.displayLabel??a.label}" references unknown zone "${a.zone}"`,objectId:a.id});continue}L.has(a.zone)||L.set(a.zone,a)}for(let[a,P]of L){let g=e.zones?.find(v=>v.id===a);g&&(g?.focalPoint||n.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${g?.label??a}" uses the legacy floor focal; set its own focal point before publishing`,objectId:P.id}))}for(let a of x)if((a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea")&&vn(a,t),sr(a)){if(m++,S+=a.type==="booth"?1:a.type==="row"?Ee(a):a.bookAsWhole||a.variableOccupancy?a.seatCount:Cn(a).length,y.get(a.label)!==void 0?a.type!=="row"&&t.push({severity:"error",code:"duplicate-object-label",message:`Label "${a.label}" is used by more than one object`,objectId:a.id}):y.set(a.label,a.id),o.has(a.categoryKey)?s.add(a.categoryKey):t.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.type==="row"){he(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),a.seatCount<1&&t.push({severity:"error",code:"empty-row",message:`Row "${a.label}" has no seats`,objectId:a.id});let g=new Set;for(let v of a.overrides??[]){(v.accessibility??[]).filter(k=>!r.has(k)).length&&t.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${a.label}" seat ${v.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[v.index]}),(!Number.isInteger(v.index)||v.index<0||v.index>=a.seatCount||g.has(v.index))&&t.push({severity:"error",code:"invalid-seat-override",message:`Row "${a.label}" has a duplicated or out-of-range seat override`,objectId:a.id,...Number.isInteger(v.index)?{seatIndices:[v.index]}:{}}),g.add(v.index);let E=v.wheelchairSpaceType,M=v.accessible===!0||v.accessibility?.includes("wheelchair");E!==void 0&&E!=="seat-present"&&E!=="no-seat"?t.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${a.label}" seat ${v.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[v.index]}):E&&(!M||v.skip)&&t.push({severity:"error",code:"invalid-wheelchair-space",message:v.skip?`Row "${a.label}" seat ${v.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${a.label}" seat ${v.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[v.index]})}for(let v of cr(a))pe(v.label)&&t.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${v.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id,seatIndices:[v.index]}),u.get(v.label)!==void 0?b.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${v.label}" is used more than once`,objectId:a.id,seatIndices:[v.index]}):u.set(v.label,a.id)}else if(a.type==="table"){let g=a.bookAsWhole===!0||a.variableOccupancy===!0;if(a.seatCountsBySide){let M=["top","bottom","left","right"],k=Object.keys(a.seatCountsBySide),A=M.every(D=>Number.isInteger(a.seatCountsBySide[D])&&a.seatCountsBySide[D]>=0&&a.seatCountsBySide[D]<=40),T=A?M.reduce((D,Vn)=>D+a.seatCountsBySide[Vn],0):Number.NaN;(a.shape!=="rect"||k.length!==M.length||k.some(D=>!M.includes(D))||!A||T!==a.seatCount||T<1||T>40)&&t.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${a.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${a.seatCount}-chair capacity`,objectId:a.id})}g&&a.overrides?.length&&t.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${a.label}" cannot carry individual-chair overrides`,objectId:a.id,seatIndices:a.overrides.map(M=>M.index)});let v=new Set;for(let M of a.overrides??[]){(M.accessibility??[]).filter(D=>!r.has(D)).length&&t.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${a.label}" chair ${M.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[M.index]}),(!Number.isInteger(M.index)||M.index<0||M.index>=a.seatCount||v.has(M.index))&&t.push({severity:"error",code:"invalid-seat-override",message:`Table "${a.label}" has a duplicated or out-of-range chair override`,objectId:a.id,...Number.isInteger(M.index)?{seatIndices:[M.index]}:{}}),v.add(M.index),M.categoryKey&&!o.has(M.categoryKey)?t.push({severity:"error",code:"unknown-category",message:`Table "${a.label}" chair ${M.index+1} references unknown category "${M.categoryKey}"`,objectId:a.id,seatIndices:[M.index],categoryKey:M.categoryKey}):M.categoryKey&&s.add(M.categoryKey);let A=M.wheelchairSpaceType,T=M.accessible===!0||M.accessibility?.includes("wheelchair");A!==void 0&&A!=="seat-present"&&A!=="no-seat"?t.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${a.label}" chair ${M.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[M.index]}):A&&(!T||M.skip)&&t.push({severity:"error",code:"invalid-wheelchair-space",message:M.skip?`Table "${a.label}" chair ${M.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${a.label}" chair ${M.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[M.index]})}a.bookAsWhole&&a.variableOccupancy?t.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${a.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:a.id}):a.variableOccupancy?(!Number.isInteger(a.minOccupancy)||!Number.isInteger(a.maxOccupancy)||a.minOccupancy<1||a.maxOccupancy<a.minOccupancy||a.maxOccupancy>a.seatCount)&&t.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" needs whole-number minimum and maximum guests from 1 to its ${a.seatCount}-chair capacity`,objectId:a.id}):(a.minOccupancy!=null||a.maxOccupancy!=null)&&t.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" has guest bounds without variable-occupancy selling`,objectId:a.id}),he(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(a.shape==="round"&&a.radius==null||a.shape==="rect"&&(a.width==null||a.height==null)||a.seatCount<1)&&t.push({severity:"error",code:"bad-table",message:`Table "${a.label}" is missing required dimensions or seats`,objectId:a.id});let E=g?[{label:a.label,index:void 0}]:Cn(a);for(let M of E)pe(M.label)&&t.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${M.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),u.get(M.label)!==void 0?b.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${M.label}" is used more than once; grouped table labels must be unique`,objectId:a.id,...M.index===void 0?{}:{seatIndices:[M.index]}}):u.set(M.label,a.id)}else if(a.type==="booth"){he(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${a.label}" has invalid reference-inventory provenance`,objectId:a.id});let g=a.label;pe(g)&&t.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${g}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),u.get(g)!==void 0?b.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${g}" is used more than once`,objectId:a.id}):u.set(g,a.id)}}else if(a.type==="gaArea"){if(!ke(a))t.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${a.label}" has invalid joined-area inventory provenance`,objectId:a.id});else for(let h of Qe(a))u.get(h)!==void 0?b.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${h}" is used more than once`,objectId:a.id}):u.set(h,a.id);he(a.referenceInventorySource)||t.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(!Y(a.points)||Math.abs(ne(a.points))<=1e-7||ie(a.points))&&t.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});let g=a.holes??[],v=Array.isArray(g)&&g.length<=64?g.findIndex(h=>!Array.isArray(h)||h.length>512||!Y(h)||Math.abs(ne(h))<=1e-7||ie(h)?!0:!h.flatMap((M,k)=>{let A=h[(k+1)%h.length];return[M,{x:(M.x+A.x)/2,y:(M.y+A.y)/2}]}).every(M=>re(M,a.points))):0;if(v>=0)t.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${a.label}" has a cutout outside its outline or with invalid geometry`,objectId:a.id,holeIndex:v});else if(g.some((h,E)=>g.slice(E+1).some(M=>ye(h,M)))){let h=g.findIndex((E,M)=>g.slice(M+1).some(k=>ye(E,k)));t.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${a.label}" has overlapping cutout polygons`,objectId:a.id,holeIndex:h})}o.has(a.categoryKey)?s.add(a.categoryKey):t.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.capacity<1&&t.push({severity:"error",code:"empty-ga",message:`GA area "${a.label}" has zero capacity`,objectId:a.id}),(!Number.isInteger(a.capacity)||a.capacity>X)&&t.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${a.label}" capacity must be a whole number from 1 to ${X}`,objectId:a.id}),m++,S+=Math.max(0,Math.floor(a.capacity))}else if(a.type==="section"){if(a.elevation!==void 0&&(!Number.isInteger(a.elevation)||a.elevation<ze||a.elevation>Q)){let v=Number.isInteger(a.elevation)&&a.elevation>Q&&a.elevation<=Ve;n.push({severity:"warning",code:v?"legacy-section-elevation":"invalid-section-elevation",message:v?`Section "${a.label}" uses legacy tier ${a.elevation}; set an exact height before normalizing it to tier ${Q}`:`Section "${a.label}" elevation must be a whole-number tier from ${ze} to ${Q}`,objectId:a.id})}if(a.height!==void 0&&(!Number.isFinite(a.height)||a.height<H||a.height>U)&&t.push({severity:"error",code:"invalid-section-height",message:`Section "${a.label}" exact height must be between ${H} and ${U} metres`,objectId:a.id}),a.rake!==void 0&&(!Number.isFinite(a.rake)||a.rake<we||a.rake>Ce)&&t.push({severity:"error",code:"invalid-section-rake",message:`Section "${a.label}" rake must be between ${we}\xB0 and ${Ce}\xB0`,objectId:a.id}),a.surfaceKind!==void 0&&a.surfaceKind!=="flat"&&a.surfaceKind!=="rakedRows"&&t.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${a.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:a.id}),!Y(a.outline)||Math.abs(ne(a.outline))<=1e-7||ie(a.outline)){t.push({severity:"error",code:"invalid-section-outline",message:`Section "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});continue}if(a.outlinePath){let v=[];try{v=Lt(a.outlinePath)}catch{}(!De(a.outlinePath)||!v.length||Math.hypot(a.outlinePath.start.x-a.outline[0].x,a.outlinePath.start.y-a.outline[0].y)>1e-4||!Y(v)||Math.abs(ne(v))<=1e-7||ie(v))&&t.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${a.label}" has an invalid or inconsistent curved outline path`,objectId:a.id,edgeIndex:gn(a)})}if(a.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(a.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(a.referenceSource.regionId))&&t.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${a.label}" has invalid opaque reference provenance`,objectId:a.id}),xn(a)||t.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${a.label}" has incomplete or mismatched non-sellable evidence`,objectId:a.id}),a.logicalSectionId!==void 0&&!a.logicalSectionId.trim())t.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${a.label}" has an empty logical section id`,objectId:a.id});else if(a.logicalSectionId){let v=JSON.stringify({displayLabel:a.displayLabel??null,entrance:a.entrance??null,viewFromSeatUrl:a.viewFromSeatUrl??null,viewFromSeatMeta:a.viewFromSeatMeta??null,confidenceEvidence:a.confidenceEvidence??null,zone:a.zone??null,labelStyle:a.labelPresentation?.labelStyle??null,labelVisible:a.labelPresentation?.visible!==!1}),h=w.get(a.logicalSectionId);h&&(h.label!==a.label||h.semanticSignature!==v)?t.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${a.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:a.id}):h||w.set(a.logicalSectionId,{label:a.label,semanticSignature:v})}let P=a.holes??[];if(!Array.isArray(P)||P.length>64){t.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an invalid opening collection`,objectId:a.id});continue}let g=-1;for(let v=0;v<P.length;v++){let h=P[v];if(!Array.isArray(h)||h.length>512||!Y(h)||Math.abs(ne(h))<=1e-7||ie(h)){g=v;break}if(!h.flatMap((M,k)=>{let A=h[(k+1)%h.length];return[M,{x:(M.x+A.x)/2,y:(M.y+A.y)/2}]}).every(M=>re(M,a.outline))){g=v;break}}if(g>=0)t.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an opening outside its outline or with an invalid shape`,objectId:a.id,holeIndex:g});else if(P.some((v,h)=>P.slice(h+1).some(E=>ye(v,E)))){let v=P.findIndex((h,E)=>P.slice(E+1).some(M=>ye(h,M)));t.push({severity:"error",code:"overlapping-section-holes",message:`Section "${a.label}" has overlapping openings`,objectId:a.id,holeIndex:v})}}let R=e.floors?.length?e.floors.map(a=>a.objects):[e.objects];for(let a of R){let P=a.filter(g=>g.type==="section");for(let g of a.filter(v=>v.type==="text")){let v=g.iconKey;v!==void 0&&!ln(v)&&t.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${g.text||g.id}" references an unknown symbol`,objectId:g.id});let h=g.fontFamily;h!==void 0&&(typeof h!="string"||h.normalize("NFKC").trim()!==h||h.length<1||h.length>120)&&t.push({severity:"error",code:"invalid-text-font-family",message:`Text "${g.text||g.id}" font family must contain 1 to 120 normalized characters`,objectId:g.id});let E=g.background;(g.width!==void 0&&(!Number.isFinite(g.width)||g.width<40||g.width>1200)||g.align!==void 0&&!["left","center","right"].includes(g.align)||g.lineHeight!==void 0&&(!Number.isFinite(g.lineHeight)||g.lineHeight<.8||g.lineHeight>3)||g.letterSpacing!==void 0&&(!Number.isFinite(g.letterSpacing)||g.letterSpacing<-2||g.letterSpacing>20)||g.opacity!==void 0&&(!Number.isFinite(g.opacity)||g.opacity<.1||g.opacity>1)||E!==void 0&&(!/^#[0-9a-f]{6}$/i.test(E.color)||E.padding!==void 0&&(!Number.isFinite(E.padding)||E.padding<0||E.padding>40)||E.cornerRadius!==void 0&&(!Number.isFinite(E.cornerRadius)||E.cornerRadius<0||E.cornerRadius>40)||E.opacity!==void 0&&(!Number.isFinite(E.opacity)||E.opacity<.1||E.opacity>1)))&&t.push({severity:"error",code:"invalid-text-layout",message:`Text "${g.text||g.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:g.id})}for(let g of a.filter(v=>v.type==="shape")){if(g.eventConfigurationIds!==void 0){let E=g.eventConfigurationIds;Array.isArray(E)&&E.length>0&&E.length<=20&&E.every(k=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>=1&&k.length<=100)&&new Set(E).size===E.length||t.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${g.label||g.id}" must reference 1 to 20 unique event configuration ids`,objectId:g.id})}if(g.heightM!==void 0&&(!Number.isFinite(g.heightM)||g.heightM<.05||g.heightM>50)&&t.push({severity:"error",code:"invalid-shape-height",message:`Shape "${g.label||g.id}" height must be between 0.05 m and 50 m`,objectId:g.id}),g.stroke!==void 0&&(!g.stroke||typeof g.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(g.stroke.color)||!Number.isFinite(g.stroke.width)||g.stroke.width<.5||g.stroke.width>40)&&t.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${g.label||g.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:g.id}),(g.lineCap!==void 0||g.lineJoin!==void 0||g.startEnding!==void 0||g.endEnding!==void 0)&&!ct(g.kind)?t.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${g.label||g.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:g.id}):ct(g.kind)&&(g.lineCap!==void 0&&!un.includes(g.lineCap)||g.lineJoin!==void 0&&!dn.includes(g.lineJoin)||g.startEnding!==void 0&&!st.includes(g.startEnding)||g.endEnding!==void 0&&!st.includes(g.endEnding))&&t.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${g.label||g.id}" has an unsupported line cap, join, or ending`,objectId:g.id}),g.kind==="polygon"){let E=an(g.points??[]);E.ok||t.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${g.label||g.id}" has invalid polygon geometry: ${E.message}`,objectId:g.id})}let h=bn(g);if(h){for(let E of P)if(mn(h,E.outline)){t.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${g.label??g.id}" overlaps section "${E.label}"`,objectId:g.id});break}}}}S>Ae&&t.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${S} bookable units; the maximum is ${Ae}`}),t.push(...b.slice(0,5)),b.length>5&&t.push({severity:"error",code:"duplicate-seat-label",message:`${b.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let a of ge(e)){let P=a.families[0]?.targets[0];n.push({severity:"warning",code:"category-inventory-family-conflict",message:it(a),categoryKey:a.categoryKey,...P?{objectId:P.id,floorId:P.floorId}:{},relatedObjectIds:a.objectIds,categoryInventoryFamilies:a.families})}e.focalPoint||n.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),m===0&&n.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let a of s)if(i.get(a)===!1){let P=e.categories.find(g=>g.key===a);n.push({severity:"warning",code:"unpriced-category",message:`Category "${P?.label??a}" is used but has no price`,categoryKey:a})}return[...t,...n]}var lr=9,Pn="#f7f8fb",ur="#f5f6f8",An="#8b93a7",dr="#0b1220",fr="#0b1220",pr="#ffffff",gr=100;function j(e,t=2){let n=10**t;return Math.round(e*n)/n}function _(e){return{source:"quality",...e}}function mr(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function dt(e){return lr*zt(e.theme?.seatScale)}function kn(e){let t=[];for(let n of e.objects)n.type==="row"?t.push(...F(n)):n.type==="table"&&t.push(...G(n));return t}function br(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of e)for(let o of n.objects)o.type==="row"?t.rowSeats+=F(o).length:o.type==="table"?t.tableSeats+=G(o).length:o.type==="booth"?t.booths+=1:o.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(o.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function N(e,t){e.filter(n=>n.code===t.code).length<gr&&e.push(t)}function yr(e,t,n){let o=dt(e),r=2*o,i=2.3*o,s=0,c=0,p=1/0;for(let d of t){let l=new Map(d.objects.filter(m=>m.type==="row").map(m=>[m.id,m])),f=m=>{let S=d.objects.find(L=>L.id===m);if(!S||S.type!=="row"&&S.type!=="table")return"another seating object";let C=S.type==="row"?F(S):G(S),x=C.length?{x:C.reduce((L,R)=>L+R.x,0)/C.length,y:C.reduce((L,R)=>L+R.y,0)/C.length}:S.type==="row"?S.origin:S.center,I=d.objects.find(L=>L.type==="section"&&z(x,L.outline,L.holes)),O=S.type==="row"?`Row \u201C${S.label}\u201D`:`Table \u201C${S.label}\u201D`;return I?.type==="section"?`${O} in \u201C${I.label}\u201D`:O},y=kn(d);s+=y.length;let u=i,b=new Map,w=new Map;for(let m of y){let S=Math.floor(m.x/u),C=Math.floor(m.y/u);for(let O=-1;O<=1;O++)for(let L=-1;L<=1;L++){let R=b.get(`${S+O}:${C+L}`)??[];for(let a of R){c++;let P=Math.hypot(m.x-a.x,m.y-a.y);if(p=Math.min(p,P),P>=i)continue;let v=(m.rowId<a.rowId?[m.rowId,a.rowId]:[a.rowId,m.rowId]).join("|"),h=w.get(v);(!h||P<h.distance)&&w.set(v,{a:m,b:a,distance:P})}}let x=`${S}:${C}`,I=b.get(x)??[];I.push(m),b.set(x,I)}for(let m of w.values()){let S=m.a.rowId===m.b.rowId,C=l.get(m.a.rowId),x=l.get(m.b.rowId),I=!S&&C?.segmentedRow?.repeatLabelOnComponents===!0&&x?.segmentedRow?.repeatLabelOnComponents===!0&&C.segmentedRow.groupId===x.segmentedRow.groupId,O=!!C?.referenceScan&&!!x?.referenceScan&&C.referenceScan.assetId===x.referenceScan.assetId&&C.referenceScan.sectionId===x.referenceScan.sectionId,L=m.distance<r?"error":"warning";if((I||O)&&L==="warning")continue;let R=L==="error"?"seat-overlap":"seat-cramped",a=f(m.a.rowId),P=f(m.b.rowId),g=j(L==="error"?r:i);N(n,_({severity:L,code:R,dimension:"geometry",title:S?`${a} has seats too close together`:`${a} and ${P} are too close together`,message:`The closest seats are ${j(m.distance)} chart units apart; at least ${g} are required.`,action:S?`Increase the seat spacing for ${a}, or use Review safe fixes.`:`Move ${a} or ${P} until they no longer overlap.`,objectId:m.a.rowId,relatedObjectIds:S?[m.a.rowId]:[m.a.rowId,m.b.rowId],floorId:d.id,measured:j(m.distance),minimum:j(L==="error"?r:i),autoFixable:S}))}}return{seats:s,checkedSeatPairs:c,minimumSeatDistance:Number.isFinite(p)?j(p):null}}function Te(e){let{width:t,height:n}=It(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:n};let o=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}].map(r=>{let i=wt(r,e.rotation);return{x:e.position.x+i.x,y:e.position.y+i.y}});return Ht(o)}function On(e,t,n=0){return e.x<t.x+t.width+n&&e.x+e.width+n>t.x&&e.y<t.y+t.height+n&&e.y+e.height+n>t.y}function ut(e,t,n){let o=K(t.x,e.x,e.x+e.width),r=K(t.y,e.y,e.y+e.height);return(t.x-o)**2+(t.y-r)**2<n**2}function hr(e,t,n){let o=dt(e),r=0;for(let i of t){let s=i.objects.filter(p=>p.type==="text"),c=kn(i);r+=s.length;for(let p=0;p<s.length;p++){let d=s[p],l=Te(d),f=c.find(y=>ut(l,y,o));f&&N(n,_({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps seat ${f.label}`,objectId:d.id,relatedObjectIds:[d.id,f.rowId],floorId:i.id,autoFixable:!0}));for(let y=0;y<p;y++){let u=s[y];On(l,Te(u),2)&&N(n,_({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${d.text}\u201D overlaps text \u201C${u.text}\u201D`,objectId:d.id,relatedObjectIds:[d.id,u.id],floorId:i.id,autoFixable:!0}))}}}return r}function vr(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function xr(e,t,n){let o=new Map;for(let i of t)for(let s of i.objects){let c=s.type,p=c==="row"||c==="table"||c==="booth"||c==="gaArea",d=p||c==="section";if(p&&!s.categoryKey.trim()){let l=c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth";N(n,_({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${l} \u201C${s.label||s.id}\u201D has no category`,message:`${l} \u201C${s.label||s.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:s.id,floorId:i.id,autoFixable:!1}))}if(d){let l=(s.type==="section"?s.displayLabel??s.label:s.label)??"";if(l.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let f=vr(l),y=o.get(f);y&&y.raw!==l?N(n,_({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${l}\u201D and \u201C${y.raw}\u201D read as the same label`,message:`Labels \u201C${l}\u201D and \u201C${y.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:s.id,relatedObjectIds:[s.id,y.id],floorId:i.id,autoFixable:!1})):y||o.set(f,{id:s.id,raw:l})}}else{let f=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";N(n,_({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${f} has no label`,message:`${f} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:s.id,floorId:i.id,autoFixable:!1}))}}}let r=[];for(let i of t){let s=i.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of i.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||s.some(d=>z(J(d),c.outline,c.holes)))){if(c.referenceSource){r.push({id:c.id,floorId:i.id});continue}N(n,_({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:i.id,autoFixable:!1}))}}if(r.length&&N(n,_({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(i=>i.id),floorId:r[0].floorId,autoFixable:!1})),e.floors&&e.floors.length>1)for(let i of e.floors)i.objects.length===0&&N(n,_({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${i.name}\u201D is empty`,message:`Floor \u201C${i.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:i.id,autoFixable:!1}))}var Sr=5,Ir=16;function wr(e,t,n){for(let o of t){let r=o.focalPoint??e.focalPoint;if(r)for(let i of o.objects){if(i.type!=="section"||i.outline.length<3)continue;let{rake:s}=ue(i);if(s<Sr)continue;let c=i.outline.map(y=>Math.hypot(y.x-r.x,y.y-r.y)),p=Math.max(...c);if(p<=0)continue;let d=(p-Math.min(...c))/p;if(s*d<=Ir)continue;let f=i.displayLabel??i.label;N(n,_({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${f}\u201D is too deep for a single rake`,message:`Section \u201C${f}\u201D spans ${Math.round(d*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully \u2014 a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:i.id,floorId:o.id,autoFixable:!1}))}}}function Cr(e,t,n){let o=e.theme?.background??Pn,r=ur,i=new Map;for(let d of t)for(let l of d.objects){if(l.type!=="gaArea")continue;let f=i.get(l.categoryKey)??[];f.push({id:l.id,floorId:d.id}),i.set(l.categoryKey,f)}for(let d of e.categories){let l=$(d.color,o),f=$(d.color,r);if(l==null||f==null){N(n,_({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${d.label}\u201D does not use a supported hex color`,categoryKey:d.key}));continue}let y=Math.min(l,f);y<3&&N(n,_({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${d.label}\u201D is hard to see`,message:`Category \u201C${d.label}\u201D reaches only ${j(y)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${d.label}\u201D until this warning clears.`,categoryKey:d.key,measured:j(y),minimum:3,autoFixable:!1}));let u=i.get(d.key)??[];if(u.length){let b=ot(d.color,o,nt),w=ot(d.color,r,nt),m=Math.min($(b,o)??0,$(w,r)??0);m<3&&N(n,_({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${d.label}\u201D reaches only ${j(m)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:u[0].id,categoryKey:d.key,floorId:u[0].floorId,relatedObjectIds:u.map(S=>S.id),measured:j(m),minimum:3,autoFixable:!1}))}}for(let d=0;d<e.categories.length;d++)for(let l=0;l<d;l++){let f=e.categories[d],y=e.categories[l],u=Vt(f.color,y.color);u!=null&&u<25&&N(n,_({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${f.label}\u201D and \u201C${y.label}\u201D look too similar`,message:`Categories \u201C${f.label}\u201D and \u201C${y.label}\u201D are only \u0394E ${j(u)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:f.key,measured:j(u),minimum:25,autoFixable:!1}))}for(let d of t){let l=d.objects.filter(f=>f.type==="text");for(let f of l){let y=f.color??e.theme?.textColor??An,u=$(y,o),b=f.fontSize>=18?3:4.5;(u==null||u<b)&&N(n,_({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${f.text}\u201D has ${j(u??0)}:1 contrast against the chart background; ${b}:1 is required`,objectId:f.id,floorId:d.id,measured:j(u??0),minimum:b,autoFixable:!0}))}}if(e.theme?.selectionColor){let d=$(e.theme.selectionColor,o);(d==null||d<3)&&N(n,_({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${j(d??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:j(d??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let d=$(e.theme.textColor,o);(d==null||d<3)&&N(n,_({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${j(d??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:j(d??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??dr,c=new Map,p=(d,l,f)=>{let y=c.get(d)??new Map,u=y.get(l)??[];u.push(f),y.set(l,u),c.set(d,y)};for(let d of t)for(let l of d.objects)if(l.type==="row")for(let f of me(l).keys())p(f,"seat",l.id);else if(l.type==="table")for(let f of me(l).keys())p(f,"table seat",l.id);else l.type==="booth"&&p(l.categoryKey,"booth",l.id);for(let d of e.categories){let l=c.get(d.key);if(l)for(let[f,y]of l){let u=f==="booth"?Wt:Zt,b=Jt(qt,600),w=en(d.color,s),m=$(w,d.color);(m==null||m<b)&&N(n,_({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${f==="booth"?"Booth":f==="seat"?"Seat":"Table-seat"} labels use ${u}u type and have ${j(m??0)}:1 contrast on category \u201C${d.label}\u201D; ${b}:1 is required for small text`,objectId:y[0],relatedObjectIds:y,measured:j(m??0),minimum:b,autoFixable:!0}))}}}function Mr(e,t){for(let n of e){let o=n.objects.filter(r=>r.type==="section");if(!(o.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let s=J(r),c=o.filter(u=>z(s,u.outline,u.holes)),p=new Map;for(let u of c){let b=u.logicalSectionId??u.id,w=p.get(b)??[];w.push(u),p.set(b,w)}if(p.size<2)continue;let d=[...p.values()],l=d.map(u=>`Section \u201C${u[0].displayLabel??u[0].label}\u201D`),f=l.length===2?l.join(" and "):`${l.slice(0,-1).join(", ")}, and ${l[l.length-1]}`,y=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";N(t,_({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${y} \u201C${r.label}\u201D belongs to more than one section`,message:`${y} \u201C${r.label}\u201D has its center inside ${f}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:r.id,relatedObjectIds:[r.id,...d.flatMap(u=>u.map(b=>b.id))],floorId:n.id,autoFixable:!1}))}}}var Lr={structure:20,geometry:30,contrast:25,labels:15,navigation:10},Er={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function Pr(e){let t={...Lr};for(let r of e){let i=r.severity==="error"?10:2;t[r.dimension]=Math.max(0,t[r.dimension]-(Er[r.code]??i))}let n=Object.values(t).reduce((r,i)=>r+i,0),o=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:t,errorFree:e.every(r=>r.severity!=="error"),grade:o}}var Ar=new Set(["unpriced-category","object-uncategorized"]);function Ln(e,t={}){let n=Ze(e),o=Mn(e).filter(l=>l.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(l=>{let f=l.objectId?n.find(b=>b.objects.some(w=>w.id===l.objectId))?.id:void 0,y=l.code==="category-inventory-family-conflict",u=y?e.categories.find(b=>b.key===l.categoryKey):void 0;return _({...l,...y?{severity:"error",title:`Category \u201C${u?.label??l.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...t.requireExplicitZoneFocals&&l.code==="missing-zone-focal-point"?{severity:"error"}:{},...f?{floorId:f}:{},source:"structural",dimension:mr(l),autoFixable:y})}),r=yr(e,n,o),i=br(n),s=hr(e,n,o);if(xr(e,n,o),Mr(n,o),wr(e,n,o),Cr(e,n,o),n.reduce((l,f)=>l+f.objects.filter(y=>y.type==="row"||y.type==="table"||y.type==="booth"||y.type==="gaArea").length,0)===0){let l=new Set(["missing-focal-point","no-bookables"]);for(let f=o.length-1;f>=0;f--)l.has(o[f].code)&&o.splice(f,1)}if(t.requirePricedInventory)for(let l=0;l<o.length;l++)Ar.has(o[l].code)&&(o[l]={...o[l],severity:"error"});let p=o.filter(l=>l.severity==="error"),d=o.filter(l=>l.severity==="warning");return{issues:o,errors:p,warnings:d,metrics:{floors:n.length,objects:n.reduce((l,f)=>l+f.objects.length,0),seats:r.seats,bookableUnits:i.bookableUnits,inventoryByKind:i.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:Pr(o),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function kr(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let n=ce(F(e));e.seatSpacing=j(t,3);let o=ce(F(e));return e.origin.x=j(e.origin.x+n.x-o.x,3),e.origin.y=j(e.origin.y+n.y-o.y,3),!0}function Or(e,t){if(e.seatCount<2)return!1;let n=!1;if(e.shape==="round"){let o=K(e.seatArc??360,0,360),r=(o>=360?360/e.seatCount:o/(e.seatCount-1))*Math.PI/180;if(r>0){let i=t/(2*Math.sin(r/2)),s=Math.max(1,i-16);(e.radius??40)<s&&(e.radius=j(s,3),n=!0)}}else{let o=fe(e),r=Math.max(o.top,o.bottom),i=Math.max(o.left,o.right);r>1&&(e.width??80)/r<t&&(e.width=j(r*t,3),n=!0),i>1&&(e.height??50)/i<t&&(e.height=j(i*t,3),n=!0)}return n}function Rr(e){return[fr,pr].map(n=>({color:n,minimum:Math.min(...e.map(o=>$(n,o)??0))})).sort((n,o)=>o.minimum-n.minimum)[0].color}function En(e,t,n){let o=Te(e),r=0;for(let i of t)i.type==="row"?r+=F(i).filter(s=>ut(o,s,n)).length:i.type==="table"?r+=G(i).filter(s=>ut(o,s,n)).length:i.type==="text"&&i.id!==e.id&&On(o,Te(i),2)&&r++;return r}function Tr(e,t,n){if(En(e,t,n)===0)return!1;let r={...e.position},i=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let c=1;c<=12;c++)for(let[p,d]of s)if(e.position={x:j(r.x+p*i*c,3),y:j(r.y+d*i*c,3)},En(e,t,n)===0)return!0;return e.position=r,!1}function Rn(e){let t=JSON.parse(JSON.stringify(e)),n=Ln(t),o=[],r=at(t);if(r.changed){t=r.doc;for(let l of r.changes){let f=r.before.find(u=>u.categoryKey===l.categoryKey),y=f?.families.map(u=>u.label).join(", ")??"inventory families";o.push({code:"category-inventory-family-conflict",objectId:f?.objectIds[0],message:`Split category \u201C${l.categoryLabel}\u201D across ${y}; preserved its commercial metadata and reassigned ${l.reassignments.length} affected object${l.reassignments.length===1?"":"s"}`})}}let i=dt(t),s=2.5*i,c=Ze(t);for(let l of c)for(let f of l.objects)if(f.type==="row"){let y=f.seatSpacing;kr(f,s)&&o.push({code:y<2*i?"seat-overlap":"seat-cramped",objectId:f.id,message:`Expanded ${f.id} to the ${j(s)}u target pitch while preserving its centre`})}else f.type==="table"&&Or(f,s)&&o.push({code:"seat-cramped",objectId:f.id,message:`Expanded ${f.id} so its perimeter seats meet the ${j(s)}u target pitch`});let p=t.theme?.background??Pn;for(let l of c)for(let f of l.objects){if(f.type!=="text")continue;let y=f.color??t.theme?.textColor??An,u=f.fontSize>=18?3:4.5;($(y,p)??0)<u&&(f.color=Rr([p]),o.push({code:"text-contrast-low",objectId:f.id,message:`Changed ${f.id} to the highest-contrast black/white ink`}))}for(let l of c){let f=l.objects.filter(y=>y.type==="text");for(let y of f)Tr(y,l.objects,i)&&o.push({code:"label-collision",objectId:y.id,message:`Moved ${y.id} to the nearest collision-free deterministic label position`})}t.floors?.length&&(t.objects=t.floors[0].objects);let d=Ln(t);return{doc:t,changed:o.length>0,fixes:o,before:n,after:d}}function je(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function ft(e){return je(e).reduce((t,n)=>n.type==="row"?t+Ee(n):n.type==="table"?t+Gt(n):n.type==="gaArea"?t+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?t+1:t,0)}function jr(e){let t={};for(let o of e.categories??[])t[o.key]=0;let n=(o,r)=>{r>0&&(t[o]=(t[o]??0)+r)};for(let o of je(e))if(o.type==="row")for(let r of F(o))n(r.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)n(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let r of G(o))n(r.categoryKey,1);else o.type==="gaArea"?n(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&n(o.categoryKey,1);return t}function jn(e){if(!e.template)return null;let t=je(e),n=t.filter(p=>p.type==="row"||p.type==="table"||p.type==="gaArea");if(!n.length)return null;let r=t.filter(p=>p.type==="booth").length+n.reduce((p,d)=>p+(d.type==="table"?2:1),0),i=ft(e),s=Math.max(r+1,Math.min(5e4,i*4)),c=[.5,1,1.5,2].map(p=>K(Math.round(i*p),r,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,p=>p.toUpperCase()),min:r,max:s,presets:["S","M","L","XL"].map((p,d)=>({size:p,seats:c[d]}))}}function Tn(e){let t=F(e);return t.length?ce(t):{...e.origin}}function _r(e,t){let n=jn(e);if(!n)return structuredClone(e);let o=structuredClone(e),r=je(o),i=r.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea"),s=r.filter(u=>u.type==="booth").length,c=Math.max(n.min,Math.min(n.max,Math.round(t))),p=c-s,d=i.map((u,b)=>{let w=u.type==="gaArea"?Math.max(0,Math.floor(u.capacity)):u.seatCount,m=u.type==="table"?2:1;return{object:u,index:b,current:w,minimum:m,value:m,fraction:0}}),l=d.reduce((u,b)=>u+b.minimum,0),f=Math.max(0,p-l),y=d.reduce((u,b)=>u+Math.max(1,b.current-b.minimum),0);for(let u of d){let b=f*Math.max(1,u.current-u.minimum)/y,w=Math.floor(b);u.value+=w,u.fraction=b-w}f=p-d.reduce((u,b)=>u+b.value,0),d.sort((u,b)=>b.fraction-u.fraction||u.index-b.index);for(let u=0;u<f;u++)d[u%d.length].value++;d.sort((u,b)=>u.index-b.index);for(let u of d)if(u.object.type==="row"){let b=Tn(u.object);u.object.seatCount=u.value;let w=Tn(u.object);u.object.origin.x+=b.x-w.x,u.object.origin.y+=b.y-w.y}else if(u.object.type==="table"){let b=u.object;if(b.seatCountsBySide){let w=["top","bottom","left","right"],m=fe(b),S=w.reduce((I,O)=>I+m[O],0)||1,C=w.map((I,O)=>{let L=u.value*m[I]/S;return{side:I,index:O,value:Math.floor(L),fraction:L-Math.floor(L)}}),x=u.value-C.reduce((I,O)=>I+O.value,0);C.sort((I,O)=>O.fraction-I.fraction||I.index-O.index);for(let I=0;I<x;I++)C[I%C.length].value+=1;C.sort((I,O)=>I.index-O.index),b.seatCountsBySide={top:C[0].value,bottom:C[1].value,left:C[2].value,right:C[3].value},b.sides=w.filter(I=>b.seatCountsBySide[I]>0)}b.seatCount=u.value,b.overrides&&(b.overrides=b.overrides.filter(w=>w.index<u.value),b.overrides.length||delete b.overrides)}else u.object.capacity=u.value;return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:c},o=Rn(o).doc,o.template={family:e.template.family,targetSeats:ft(o)},o}function ae(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function Nr(e,t,n){let o=new Map;for(let s of e){if(s.kind==="booth")continue;let c=o.get(s.rowId);c?c.push(s):o.set(s.rowId,[s])}let r=s=>n.has(s.id)||t(s.id)!=="free",i=[];for(let s of o.values())if(!(s.length<3)){s.sort((c,p)=>ae(c.id)-ae(p.id));for(let c=1;c<s.length-1;c++){let p=s[c];if(r(p))continue;let d=s[c-1],l=s[c+1];ae(p.id)-ae(d.id)!==1||ae(l.id)-ae(p.id)!==1||!r(d)||!r(l)||!n.has(d.id)&&!n.has(l.id)||i.push(p)}}return i}var gt=1,mt=100;function _n(e,t){if(!Number.isInteger(t)||t<gt||t>mt)return null;let n=e.rotation*Math.PI/180,o={x:Math.cos(n),y:Math.sin(n)},r={x:-o.y,y:o.x};return Array.from({length:t},(i,s)=>{let c=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+r.x*s*e.rowGap+o.x*c,y:e.origin.y+r.y*s*e.rowGap+o.y*c},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function pt(e,t=e.rowCount){let n=_n(e,t);return n?.length?J(n[n.length-1]):null}function $r(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let n=pt(e,1);if(!n)return null;let o=e.rotation*Math.PI/180,r={x:-Math.sin(o),y:Math.cos(o)},i=(t.x-n.x)*r.x+(t.y-n.y)*r.y,s=Math.max(gt,Math.min(mt,Math.round(i/e.rowGap)+1)),c=pt(e,s);return c?{rowCount:s,edgePoint:c}:null}function Fr(e,t){return e.length!==t.rowCount?!1:[...e].sort((o,r)=>(o.rowBlockGeneration?.rowIndex??1/0)-(r.rowBlockGeneration?.rowIndex??1/0)).every((o,r)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===t.groupId&&i.rowIndex===r&&i.signature===t.signature&&JSON.stringify(i)===JSON.stringify({...t,rowIndex:r})})}function Nn(e){let t=(e%360+360)%360,n=t>=180?t-360:t;return Object.is(n,-0)||Math.abs(n)<1e-9?0:n}var Z=1,W=300,bt=330;function ve(e){return e.seatCount>1?e.curve/(e.seatCount-1):0}function $n(e,t){let n=e.rotation*Math.PI/180,o=ve(e)*Math.PI/180,r,i;if(Math.abs(o)<1e-9)r=t*e.seatSpacing,i=0;else{let s=e.seatSpacing/(2*Math.sin(Math.abs(o)/2)),c=o*t;r=s*Math.sin(c),i=-s+s*Math.cos(c)}return{x:e.origin.x+r*Math.cos(n)-i*Math.sin(n),y:e.origin.y+r*Math.sin(n)+i*Math.cos(n)}}function Dr(e,t,n){let o=(e??[]).map(r=>({...r,index:r.index+t})).filter(r=>r.index>=0&&r.index<n);return o.length?o:void 0}function Fn(e,t){if(e.path||!Number.isInteger(t)||t<Z||t>W)return null;let n=ve(e);return{...e,seatCount:t,curve:n*(t-1)}}function Dn(e,t){if(e.path||!Number.isInteger(t)||t<Z||t>W)return null;let n=ve(e),o=e.seatCount-t,r=-o;return{...e,origin:$n(e,o),rotation:Nn(e.rotation-n*o),seatCount:t,curve:n*(t-1),overrides:Dr(e.overrides,r,t)}}function Bn(e,t=e.seatCount){let n=Fn(e,t);return n?$n(n,t-1):null}function Gn(e,t=e.seatCount){return Dn(e,t)?.origin??null}function Br(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=ve(e),o=Math.abs(n)<1e-9?W:Math.min(W,Math.floor(bt/Math.abs(n))+1),r=null;for(let i=Z;i<=Math.max(Z,o);i+=1){let s=Bn(e,i);if(!s)continue;let c=Math.hypot(s.x-t.x,s.y-t.y),p=n*(i-1);(!r||c<r.distance||c===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:p,endpoint:s,distance:c})}return r}function Gr(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let n=ve(e),o=Math.abs(n)<1e-9?W:Math.min(W,Math.floor(bt/Math.abs(n))+1),r=null;for(let i=Z;i<=Math.max(Z,o);i+=1){let s=Gn(e,i);if(!s)continue;let c=Math.hypot(s.x-t.x,s.y-t.y),p=n*(i-1);(!r||c<r.distance||c===r.distance&&i<r.seatCount)&&(r={seatCount:i,curve:p,endpoint:s,distance:c})}return r}var se=class extends Error{constructor(n,o){super(o);this.objectId=n;this.name="GroupedTableProjectionError"}};function Kr(e){let t=e.minOccupancy,n=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(n)||t<1||n<t||n>e.seatCount)throw new se(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:n}}function Ur(e,t){if(t!==2)return[];let n=[];for(let o of Pe(e)){if(o.type!=="table"||!o.bookAsWhole&&!o.variableOccupancy)continue;if(o.bookAsWhole&&o.variableOccupancy)throw new se(o.id,`Table "${o.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(o.seatCount)||o.seatCount<1||!o.label.trim())throw new se(o.id,"Grouped tables require a label and at least one chair");let r=o.variableOccupancy?"variable":"whole",i=r==="variable"?Kr(o):{min:o.seatCount,max:o.seatCount};n.push({objectId:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},categoryKey:o.categoryKey,mode:r,capacity:o.seatCount,minOccupancy:i.min,maxOccupancy:i.max,chairs:G(o)})}return n}function Un(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function _e(e,t){let n=e.applicability;return n?!(n.seatLabels?.length&&!n.seatLabels.includes(t.label)||n.accessibility?.length&&!n.accessibility.some(o=>t.accessibility?.includes(o))):!0}function zr(e,t){return(e.categories.find(n=>n.key===t.categoryKey)?.tiers??[]).filter(n=>_e(n,t))}function yt(e,t,n){let o=e.categories.find(i=>i.key===t.categoryKey)?.tiers;if(!o?.length)return{kind:"none"};let r=n==null?o.find(i=>_e(i,t)):o.find(i=>i.id===n&&_e(i,t));return r?{kind:"resolved",tier:r}:{kind:"invalid"}}function Vr(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function Kn(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),n=Number(t);return Number.isInteger(n)?n:void 0}function Hr(e,t){if(!Vr(e,t))return!1;let n=Kn(e),o=Kn(t);return n!=null&&o!=null&&Math.abs(n-o)===1}function zn(e,t){if(!t.length)return null;let n=new Map(We(e,{resolveEyeHeights:!1}).map(s=>[s.label,s])),o=t.flatMap(s=>{let c=n.get(s.label);return c?[{selection:s,seat:c}]:[]}),r=o.map(({seat:s})=>s).filter(s=>s.accessibility?.includes("wheelchair")),i=[];for(let{selection:s,seat:c}of o){let p=yt(e,c,s.tierId),d=p.kind==="resolved"?p.tier:void 0;(c.accessibility?.includes("companion")||d?.restriction==="companion")&&!r.some(f=>f.id!==c.id&&Hr(c,f))&&i.push(c.label)}return i.length?{code:"companion_pair_required",labels:i,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function Xr(e,t){if(!t.length)return null;let n=new Map(We(e,{resolveEyeHeights:!1}).map(s=>[s.label,s])),o=new Set(e.categories.filter(s=>s.notForSale).map(s=>s.key)),r=[],i=[];for(let s of t){let c=n.get(s.label);if(!c)continue;if(o.has(c.categoryKey)){r.push(c.label);continue}yt(e,c,s.tierId).kind==="invalid"&&i.push(c.label)}return r.length?{code:"not_for_sale",labels:r,message:"These seats are not for sale."}:i.length?Un(i):zn(e,t)}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,GroupedTableProjectionError,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,applicableTicketTiers,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,gaAreasOf,gaInventorySegments,gaUnitLabel,gaUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowStartCapacity,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowStartEndpoint,rowTerminalEndpoint,rowWithStartCapacity,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});