@seatlayer/core 0.104.0 → 0.105.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{chunk-GUNNA5LB.js → chunk-4LW4TZZR.js} +1 -1
  2. package/dist/{chunk-IEBXXGQC.js → chunk-4SHLBEG5.js} +1 -1
  3. package/dist/{chunk-URW7MSCJ.js → chunk-522ENS2Q.js} +1 -1
  4. package/dist/{chunk-4522UUXG.js → chunk-7Q366RVM.js} +1 -1
  5. package/dist/{chunk-EE2CVYFJ.js → chunk-DDQWZ323.js} +1 -1
  6. package/dist/{chunk-P2BTUNG6.js → chunk-DO545QTN.js} +1 -1
  7. package/dist/{chunk-P6ASVG3X.js → chunk-EYJ5T5JM.js} +1 -1
  8. package/dist/{chunk-KYPY7GWB.js → chunk-GCIZT3CV.js} +1 -1
  9. package/dist/{chunk-HIU4MMID.js → chunk-GZYHULZY.js} +1 -1
  10. package/dist/chunk-TGHNVDWA.js +1 -0
  11. package/dist/chunk-VHFSP53L.js +1 -0
  12. package/dist/{chunk-PBXGWYB4.js → chunk-VSX4JWN7.js} +1 -1
  13. package/dist/core/cdnAsset.cjs +1 -1
  14. package/dist/core/cdnAsset.d.cts +28 -1
  15. package/dist/core/cdnAsset.d.ts +28 -1
  16. package/dist/core/cdnAsset.js +1 -1
  17. package/dist/core/chart-ops/index.cjs +1 -1
  18. package/dist/core/chart-ops/index.d.cts +40 -1
  19. package/dist/core/chart-ops/index.d.ts +40 -1
  20. package/dist/core/chart-ops/index.js +1 -1
  21. package/dist/core/inventory/index.d.cts +2 -2
  22. package/dist/core/inventory/index.d.ts +2 -2
  23. package/dist/core/inventory/index.js +1 -1
  24. package/dist/core/layout/index.cjs +1 -1
  25. package/dist/core/layout/index.d.cts +2 -2
  26. package/dist/core/layout/index.d.ts +2 -2
  27. package/dist/core/layout/index.js +1 -1
  28. package/dist/core/quality/index.d.cts +2 -2
  29. package/dist/core/quality/index.d.ts +2 -2
  30. package/dist/core/quality/index.js +1 -1
  31. package/dist/core/render-assets/index.js +1 -1
  32. package/dist/core/sections/index.d.cts +1 -1
  33. package/dist/core/sections/index.d.ts +1 -1
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.d.cts +10 -12
  36. package/dist/index.d.ts +10 -12
  37. package/dist/index.js +1 -1
  38. package/dist/{renderedQuality-D62MKRV8.d.cts → renderedQuality-C7NrTR19.d.cts} +1 -1
  39. package/dist/{renderedQuality-DZOIkUX_.d.ts → renderedQuality-q5he_9Bt.d.ts} +1 -1
  40. package/dist/{renderer-BIR1jJrt.d.cts → renderer-BZuro9aF.d.cts} +7 -0
  41. package/dist/{renderer-CiPst9uA.d.ts → renderer-DIEE9JhZ.d.ts} +7 -0
  42. package/dist/{tableSizing-BnlXRH_v.d.ts → tableSizing-D-vDBFpb.d.ts} +1 -1
  43. package/dist/{tableSizing-DuRJVaJs.d.cts → tableSizing-saWGNPZM.d.cts} +1 -1
  44. package/dist/{ticketRestrictions-BBZ5mbsi.d.cts → ticketRestrictions-BNemUVPU.d.cts} +1 -1
  45. package/dist/{ticketRestrictions-BEHxDUyd.d.ts → ticketRestrictions-DUuUJygM.d.ts} +1 -1
  46. package/dist/view3d/index.d.cts +1 -1
  47. package/dist/view3d/index.d.ts +1 -1
  48. package/dist/view3d/index.js +1 -1
  49. package/dist/view3d/scene/scene.worker.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/chunk-6YTPIDLM.js +0 -1
  52. package/dist/chunk-FOYQOIWG.js +0 -1
@@ -1 +1 @@
1
- import{f as D}from"./chunk-IEBXXGQC.js";import{g as A,i as P}from"./chunk-UKODEMIM.js";import{C as M,Ma as w,N as v,Oa as C,Pa as S,Ra as O,Sa as j}from"./chunk-HKVCBUON.js";function x(r){return r.floors?.length?r.floors.flatMap(o=>o.objects):r.objects}function B(r){return x(r).reduce((o,n)=>n.type==="row"?o+w(n):n.type==="table"?o+O(n):n.type==="gaArea"?o+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?o+1:o,0)}function G(r){let o={};for(let a of r.categories??[])o[a.key]=0;let n=(a,s)=>{s>0&&(o[a]=(o[a]??0)+s)};for(let a of x(r))if(a.type==="row")for(let s of C(a))n(s.categoryKey,1);else if(a.type==="table")if(a.bookAsWhole||a.variableOccupancy)n(a.categoryKey,Math.max(0,Math.round(a.seatCount)));else for(let s of j(a))n(s.categoryKey,1);else a.type==="gaArea"?n(a.categoryKey,Math.max(0,Math.floor(a.capacity))):a.type==="booth"&&n(a.categoryKey,1);return o}function _(r){if(!r.template)return null;let o=x(r),n=o.filter(c=>c.type==="row"||c.type==="table"||c.type==="gaArea");if(!n.length)return null;let s=o.filter(c=>c.type==="booth").length+n.reduce((c,l)=>c+(l.type==="table"?2:1),0),y=B(r),h=Math.max(s+1,Math.min(5e4,y*4)),d=[.5,1,1.5,2].map(c=>v(Math.round(y*c),s,h));return{family:r.template.family,display:r.template.family.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()),min:s,max:h,presets:["S","M","L","XL"].map((c,l)=>({size:c,seats:d[l]}))}}function R(r){let o=C(r);return o.length?M(o):{...r.origin}}function N(r,o){let n=_(r);if(!n)return structuredClone(r);let a=structuredClone(r),s=x(a),y=s.filter(t=>t.type==="row"||t.type==="table"||t.type==="gaArea"),h=s.filter(t=>t.type==="booth").length,d=Math.max(n.min,Math.min(n.max,Math.round(o))),c=d-h,l=y.map((t,e)=>{let u=t.type==="gaArea"?Math.max(0,Math.floor(t.capacity)):t.seatCount,p=t.type==="table"?2:1;return{object:t,index:e,current:u,minimum:p,value:p,fraction:0}}),K=l.reduce((t,e)=>t+e.minimum,0),g=Math.max(0,c-K),T=l.reduce((t,e)=>t+Math.max(1,e.current-e.minimum),0);for(let t of l){let e=g*Math.max(1,t.current-t.minimum)/T,u=Math.floor(e);t.value+=u,t.fraction=e-u}g=c-l.reduce((t,e)=>t+e.value,0),l.sort((t,e)=>e.fraction-t.fraction||t.index-e.index);for(let t=0;t<g;t++)l[t%l.length].value++;l.sort((t,e)=>t.index-e.index);for(let t of l)if(t.object.type==="row"){let e=R(t.object);t.object.seatCount=t.value;let u=R(t.object);t.object.origin.x+=e.x-u.x,t.object.origin.y+=e.y-u.y}else if(t.object.type==="table"){let e=t.object;if(e.seatCountsBySide){let u=["top","bottom","left","right"],p=S(e),z=u.reduce((i,f)=>i+p[f],0)||1,m=u.map((i,f)=>{let b=t.value*p[i]/z;return{side:i,index:f,value:Math.floor(b),fraction:b-Math.floor(b)}}),L=t.value-m.reduce((i,f)=>i+f.value,0);m.sort((i,f)=>f.fraction-i.fraction||i.index-f.index);for(let i=0;i<L;i++)m[i%m.length].value+=1;m.sort((i,f)=>i.index-f.index),e.seatCountsBySide={top:m[0].value,bottom:m[1].value,left:m[2].value,right:m[3].value},e.sides=u.filter(i=>e.seatCountsBySide[i]>0)}e.seatCount=t.value,e.overrides&&(e.overrides=e.overrides.filter(u=>u.index<t.value),e.overrides.length||delete e.overrides)}else{let e=t.object;e.capacity=P(e)?Math.min(t.value,A):t.value,e.variableOccupancy&&(e.maxOccupancy=Math.min(e.maxOccupancy??e.capacity,e.capacity),e.minOccupancy=Math.min(e.minOccupancy??1,e.maxOccupancy)),e.wheelchairPlaces&&(e.wheelchairPlaces=Math.min(e.wheelchairPlaces,e.capacity))}return a.floors?.length&&(a.objects=a.floors[0].objects),a.template={family:a.template.family,targetSeats:d},a=D(a).doc,a.template={family:r.template.family,targetSeats:B(a)},a}export{B as a,G as b,_ as c,N as d};
1
+ import{f as D}from"./chunk-4SHLBEG5.js";import{g as A,i as P}from"./chunk-UKODEMIM.js";import{C as M,Ma as w,N as v,Oa as C,Pa as S,Ra as O,Sa as j}from"./chunk-HKVCBUON.js";function x(r){return r.floors?.length?r.floors.flatMap(o=>o.objects):r.objects}function B(r){return x(r).reduce((o,n)=>n.type==="row"?o+w(n):n.type==="table"?o+O(n):n.type==="gaArea"?o+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?o+1:o,0)}function G(r){let o={};for(let a of r.categories??[])o[a.key]=0;let n=(a,s)=>{s>0&&(o[a]=(o[a]??0)+s)};for(let a of x(r))if(a.type==="row")for(let s of C(a))n(s.categoryKey,1);else if(a.type==="table")if(a.bookAsWhole||a.variableOccupancy)n(a.categoryKey,Math.max(0,Math.round(a.seatCount)));else for(let s of j(a))n(s.categoryKey,1);else a.type==="gaArea"?n(a.categoryKey,Math.max(0,Math.floor(a.capacity))):a.type==="booth"&&n(a.categoryKey,1);return o}function _(r){if(!r.template)return null;let o=x(r),n=o.filter(c=>c.type==="row"||c.type==="table"||c.type==="gaArea");if(!n.length)return null;let s=o.filter(c=>c.type==="booth").length+n.reduce((c,l)=>c+(l.type==="table"?2:1),0),y=B(r),h=Math.max(s+1,Math.min(5e4,y*4)),d=[.5,1,1.5,2].map(c=>v(Math.round(y*c),s,h));return{family:r.template.family,display:r.template.family.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()),min:s,max:h,presets:["S","M","L","XL"].map((c,l)=>({size:c,seats:d[l]}))}}function R(r){let o=C(r);return o.length?M(o):{...r.origin}}function N(r,o){let n=_(r);if(!n)return structuredClone(r);let a=structuredClone(r),s=x(a),y=s.filter(t=>t.type==="row"||t.type==="table"||t.type==="gaArea"),h=s.filter(t=>t.type==="booth").length,d=Math.max(n.min,Math.min(n.max,Math.round(o))),c=d-h,l=y.map((t,e)=>{let u=t.type==="gaArea"?Math.max(0,Math.floor(t.capacity)):t.seatCount,p=t.type==="table"?2:1;return{object:t,index:e,current:u,minimum:p,value:p,fraction:0}}),K=l.reduce((t,e)=>t+e.minimum,0),g=Math.max(0,c-K),T=l.reduce((t,e)=>t+Math.max(1,e.current-e.minimum),0);for(let t of l){let e=g*Math.max(1,t.current-t.minimum)/T,u=Math.floor(e);t.value+=u,t.fraction=e-u}g=c-l.reduce((t,e)=>t+e.value,0),l.sort((t,e)=>e.fraction-t.fraction||t.index-e.index);for(let t=0;t<g;t++)l[t%l.length].value++;l.sort((t,e)=>t.index-e.index);for(let t of l)if(t.object.type==="row"){let e=R(t.object);t.object.seatCount=t.value;let u=R(t.object);t.object.origin.x+=e.x-u.x,t.object.origin.y+=e.y-u.y}else if(t.object.type==="table"){let e=t.object;if(e.seatCountsBySide){let u=["top","bottom","left","right"],p=S(e),z=u.reduce((i,f)=>i+p[f],0)||1,m=u.map((i,f)=>{let b=t.value*p[i]/z;return{side:i,index:f,value:Math.floor(b),fraction:b-Math.floor(b)}}),L=t.value-m.reduce((i,f)=>i+f.value,0);m.sort((i,f)=>f.fraction-i.fraction||i.index-f.index);for(let i=0;i<L;i++)m[i%m.length].value+=1;m.sort((i,f)=>i.index-f.index),e.seatCountsBySide={top:m[0].value,bottom:m[1].value,left:m[2].value,right:m[3].value},e.sides=u.filter(i=>e.seatCountsBySide[i]>0)}e.seatCount=t.value,e.overrides&&(e.overrides=e.overrides.filter(u=>u.index<t.value),e.overrides.length||delete e.overrides)}else{let e=t.object;e.capacity=P(e)?Math.min(t.value,A):t.value,e.variableOccupancy&&(e.maxOccupancy=Math.min(e.maxOccupancy??e.capacity,e.capacity),e.minOccupancy=Math.min(e.minOccupancy??1,e.maxOccupancy)),e.wheelchairPlaces&&(e.wheelchairPlaces=Math.min(e.wheelchairPlaces,e.capacity))}return a.floors?.length&&(a.objects=a.floors[0].objects),a.template={family:a.template.family,targetSeats:d},a=D(a).doc,a.template={family:r.template.family,targetSeats:B(a)},a}export{B as a,G as b,_ as c,N as d};
@@ -1 +1 @@
1
- import{k as c,l as u}from"./chunk-URW7MSCJ.js";import{$a as s,Oa as h,Sa as b}from"./chunk-HKVCBUON.js";var l=class extends Error{constructor(n,t,r={}){super(t);this.code=n;this.details=r;this.name="ChartOperationError"}};function P(e,o){let n=s(e),t=o?n.find(r=>r.id===o):n[0];if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o}`,{floorId:o});return{floorId:t.id,objects:t.objects}}function D(e,o){if(!e.categories.some(n=>n.key===o))throw new l("category_not_found",`Unknown chart category: ${o}. Call get_chart to list valid category keys.`,{categoryKey:o})}function y(e,o,n,t){let r=new Set([...t,...e.categories.map(i=>i.key),...e.zones?.map(i=>i.id)??[],...e.floors?.map(i=>i.id)??[],...e.floors?.length?e.floors.flatMap(i=>i.objects.map(a=>a.id)):e.objects.map(i=>i.id)]);for(let i=0;i<100;i++){let a=n(o);if(a&&!r.has(a))return t.add(a),a}throw new l("id_generation_failed",`Unable to allocate a unique ${o} id`)}function L(e){let o=e.slice().sort((i,a)=>i.x-a.x||i.y-a.y);if(o.length<3)return o;let n=(i,a,f)=>(a.x-i.x)*(f.y-i.y)-(a.y-i.y)*(f.x-i.x),t=[];for(let i of o){for(;t.length>=2&&n(t[t.length-2],t[t.length-1],i)<=0;)t.pop();t.push(i)}let r=[];for(let i=o.length-1;i>=0;i--){let a=o[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return t.pop(),r.pop(),t.concat(r)}function C(e,o){if(!e.length)return e;let n={x:e.reduce((t,r)=>t+r.x,0)/e.length,y:e.reduce((t,r)=>t+r.y,0)/e.length};return e.map(t=>{let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i)||1;return{x:t.x+r/a*o,y:t.y+i/a*o}})}function O(e){let o=[];for(let t of e)t.type==="row"?o.push(...h(t).map(r=>({x:r.x,y:r.y}))):t.type==="table"?o.push(...b(t).map(r=>({x:r.x,y:r.y}))):t.type==="gaArea"?o.push(...t.points):t.type==="booth"&&o.push(t.center);if(o.length<3)return null;let n=C(L(o),22);return n.length>=3?n:null}function z(e,o){let n=P(e,o),t=s(e).find(r=>r.id===n.floorId);return{...e,objects:n.objects,floors:void 0,focalPoint:t.focalPoint,referenceImage:t.referenceImage,backgroundImage:t.backgroundImage}}var p=24,m=80;function v(e,o){let n=e.normalize("NFKC").trim();if(n.length>p)throw new l("invalid_operation",`${o} displayed type must be at most ${p} characters`);return n}function H(e,o){if(e.displayType===void 0)return!1;let n=v(e.displayType,o);return n?(e.displayType=n,!1):(delete e.displayType,!0)}function A(e,o){if(e.displayLabel===void 0)return!1;let n=e.displayLabel.normalize("NFKC").trim();if(n.length>m)throw new l("invalid_operation",`${o} displayed label must be at most ${m} characters`);return n?(e.displayLabel=n,!1):(delete e.displayLabel,!0)}function d(e,o){let n=e.trim().toLowerCase();if(!/^#[0-9a-f]{6}$/.test(n))throw new l("invalid_operation",`${o} must use a six-digit hex color`);return n}function x(e,o){if(!Number.isFinite(e)||e<c||e>u)throw new l("invalid_operation",`${o} label size must be from ${c} to ${u}`)}function $(e,o){e.size!==void 0&&e.size!==null&&x(e.size,o),e.color!==void 0&&e.color!==null&&d(e.color,`${o} label color`)}function k(e,o){if(e?.positionPreset!==void 0&&!["start","end","both","none"].includes(e.positionPreset))throw new l("invalid_operation",`${o} label positionPreset must be one of start, end, both, none`);let n=e?.labelStyle;n&&(n.size!==void 0&&x(n.size,o),n.color!==void 0&&d(n.color,`${o} label color`))}function E(e,o){let n=e?structuredClone(e):{},t=n.labelStyle?{...n.labelStyle}:{};return o.size===null?delete t.size:o.size!==void 0&&(t.size=o.size),o.color===null?delete t.color:o.color!==void 0&&(t.color=d(o.color,"Label color")),t.size===void 0&&t.color===void 0?delete n.labelStyle:n.labelStyle=t,o.visible!==void 0&&(n.visible=o.visible),Object.keys(n).length?n:void 0}function T(e,o,n){let t=o.normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Zone labels must contain 1 to 80 characters");if((e.zones??[]).some(r=>r.id!==n&&r.label.normalize("NFKC").trim().toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Zone label already exists: ${t}`);return t}function N(e,o){if(!Number.isFinite(e?.x)||!Number.isFinite(e?.y))throw new l("invalid_operation",`${o} must contain finite x and y values`);return{x:e.x,y:e.y}}function U(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}var B=Math.PI/180,Z=Math.PI/180;function K(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="gaArea"?Math.max(0,Math.floor(e.capacity)):e.type==="booth"?1:0}function _(e){if(e.floors?.length){let o=e.floors[0];e.objects=o.objects,e.focalPoint=o.focalPoint,e.referenceImage=o.referenceImage,e.backgroundImage=o.backgroundImage}return e}var S=0,g=120,w=4;function F(e){if(!Number.isFinite(e)||e<S||e>g)throw new l("invalid_operation","Floor base height must be a number from 0 to 120 metres")}function X(e,o){let n=s(e);if(n.length>=5)throw new l("invalid_operation","A chart can contain at most five physical floors");let t=(o.name??String(n.length+1)).normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(I=>I.name.toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${t}`);e.floors?.length||(e.floors=[{id:"floor-0",name:"1",objects:e.objects,baseHeightM:0,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]);let i=e.floors[e.floors.length-1].baseHeightM??Math.min(g,(e.floors.length-1)*w),a=Math.min(g,i+w),f=y(e,"floor",o.idFactory,new Set);return e.floors.push({id:f,name:t,baseHeightM:a,objects:[],focalPoint:{...e.focalPoint}}),_(e),{changed:!0,floorId:f,floorCount:e.floors.length,baseHeightM:a}}function q(e,o){let n=s(e),t=n.find(a=>a.id===o.floorId);if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let r=o.name.normalize("NFKC").trim();if(!r||r.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(a=>a.id!==t.id&&a.name.toLocaleLowerCase("en")===r.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${r}`);let i=t.name!==r;return i&&(t.name=r),{changed:i,floorId:t.id,floorName:r}}function V(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart has an implicit base height of 0 metres");let n=e.floors.find(r=>r.id===o.floorId);if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});F(o.baseHeightM);let t=n.baseHeightM!==o.baseHeightM;return t&&(n.baseHeightM=o.baseHeightM,n.physical3dProvenance={...n.physical3dProvenance,baseHeightM:{status:"confirmed",source:"user-review",note:"Physical floor height reviewed through the shared Designer/Copilot operation."}}),{changed:t,floorId:n.id,baseHeightM:o.baseHeightM}}function W(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart cannot remove its only floor");let n=e.floors.findIndex(r=>r.id===o.floorId);if(n<0)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let[t]=e.floors.splice(n,1);if(e.floors.length===1){let[r]=e.floors;e.objects=r.objects,e.focalPoint=r.focalPoint,e.referenceImage=r.referenceImage,e.backgroundImage=r.backgroundImage,e.floors=void 0}else _(e);return{changed:!0,floorId:t.id,removedObjects:t.objects.length,floorCount:s(e).length}}export{l as a,P as b,D as c,y as d,O as e,z as f,v as g,H as h,A as i,d as j,$ as k,k as l,E as m,T as n,N as o,U as p,B as q,Z as r,K as s,_ as t,g as u,w as v,X as w,q as x,V as y,W as z};
1
+ import{k as c,l as u}from"./chunk-522ENS2Q.js";import{$a as s,Oa as h,Sa as b}from"./chunk-HKVCBUON.js";var l=class extends Error{constructor(n,t,r={}){super(t);this.code=n;this.details=r;this.name="ChartOperationError"}};function P(e,o){let n=s(e),t=o?n.find(r=>r.id===o):n[0];if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o}`,{floorId:o});return{floorId:t.id,objects:t.objects}}function D(e,o){if(!e.categories.some(n=>n.key===o))throw new l("category_not_found",`Unknown chart category: ${o}. Call get_chart to list valid category keys.`,{categoryKey:o})}function y(e,o,n,t){let r=new Set([...t,...e.categories.map(i=>i.key),...e.zones?.map(i=>i.id)??[],...e.floors?.map(i=>i.id)??[],...e.floors?.length?e.floors.flatMap(i=>i.objects.map(a=>a.id)):e.objects.map(i=>i.id)]);for(let i=0;i<100;i++){let a=n(o);if(a&&!r.has(a))return t.add(a),a}throw new l("id_generation_failed",`Unable to allocate a unique ${o} id`)}function L(e){let o=e.slice().sort((i,a)=>i.x-a.x||i.y-a.y);if(o.length<3)return o;let n=(i,a,f)=>(a.x-i.x)*(f.y-i.y)-(a.y-i.y)*(f.x-i.x),t=[];for(let i of o){for(;t.length>=2&&n(t[t.length-2],t[t.length-1],i)<=0;)t.pop();t.push(i)}let r=[];for(let i=o.length-1;i>=0;i--){let a=o[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return t.pop(),r.pop(),t.concat(r)}function C(e,o){if(!e.length)return e;let n={x:e.reduce((t,r)=>t+r.x,0)/e.length,y:e.reduce((t,r)=>t+r.y,0)/e.length};return e.map(t=>{let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i)||1;return{x:t.x+r/a*o,y:t.y+i/a*o}})}function O(e){let o=[];for(let t of e)t.type==="row"?o.push(...h(t).map(r=>({x:r.x,y:r.y}))):t.type==="table"?o.push(...b(t).map(r=>({x:r.x,y:r.y}))):t.type==="gaArea"?o.push(...t.points):t.type==="booth"&&o.push(t.center);if(o.length<3)return null;let n=C(L(o),22);return n.length>=3?n:null}function z(e,o){let n=P(e,o),t=s(e).find(r=>r.id===n.floorId);return{...e,objects:n.objects,floors:void 0,focalPoint:t.focalPoint,referenceImage:t.referenceImage,backgroundImage:t.backgroundImage}}var p=24,m=80;function v(e,o){let n=e.normalize("NFKC").trim();if(n.length>p)throw new l("invalid_operation",`${o} displayed type must be at most ${p} characters`);return n}function H(e,o){if(e.displayType===void 0)return!1;let n=v(e.displayType,o);return n?(e.displayType=n,!1):(delete e.displayType,!0)}function A(e,o){if(e.displayLabel===void 0)return!1;let n=e.displayLabel.normalize("NFKC").trim();if(n.length>m)throw new l("invalid_operation",`${o} displayed label must be at most ${m} characters`);return n?(e.displayLabel=n,!1):(delete e.displayLabel,!0)}function d(e,o){let n=e.trim().toLowerCase();if(!/^#[0-9a-f]{6}$/.test(n))throw new l("invalid_operation",`${o} must use a six-digit hex color`);return n}function x(e,o){if(!Number.isFinite(e)||e<c||e>u)throw new l("invalid_operation",`${o} label size must be from ${c} to ${u}`)}function $(e,o){e.size!==void 0&&e.size!==null&&x(e.size,o),e.color!==void 0&&e.color!==null&&d(e.color,`${o} label color`)}function k(e,o){if(e?.positionPreset!==void 0&&!["start","end","both","none"].includes(e.positionPreset))throw new l("invalid_operation",`${o} label positionPreset must be one of start, end, both, none`);let n=e?.labelStyle;n&&(n.size!==void 0&&x(n.size,o),n.color!==void 0&&d(n.color,`${o} label color`))}function E(e,o){let n=e?structuredClone(e):{},t=n.labelStyle?{...n.labelStyle}:{};return o.size===null?delete t.size:o.size!==void 0&&(t.size=o.size),o.color===null?delete t.color:o.color!==void 0&&(t.color=d(o.color,"Label color")),t.size===void 0&&t.color===void 0?delete n.labelStyle:n.labelStyle=t,o.visible!==void 0&&(n.visible=o.visible),Object.keys(n).length?n:void 0}function T(e,o,n){let t=o.normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Zone labels must contain 1 to 80 characters");if((e.zones??[]).some(r=>r.id!==n&&r.label.normalize("NFKC").trim().toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Zone label already exists: ${t}`);return t}function N(e,o){if(!Number.isFinite(e?.x)||!Number.isFinite(e?.y))throw new l("invalid_operation",`${o} must contain finite x and y values`);return{x:e.x,y:e.y}}function U(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}var B=Math.PI/180,Z=Math.PI/180;function K(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="gaArea"?Math.max(0,Math.floor(e.capacity)):e.type==="booth"?1:0}function _(e){if(e.floors?.length){let o=e.floors[0];e.objects=o.objects,e.focalPoint=o.focalPoint,e.referenceImage=o.referenceImage,e.backgroundImage=o.backgroundImage}return e}var S=0,g=120,w=4;function F(e){if(!Number.isFinite(e)||e<S||e>g)throw new l("invalid_operation","Floor base height must be a number from 0 to 120 metres")}function X(e,o){let n=s(e);if(n.length>=5)throw new l("invalid_operation","A chart can contain at most five physical floors");let t=(o.name??String(n.length+1)).normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(I=>I.name.toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${t}`);e.floors?.length||(e.floors=[{id:"floor-0",name:"1",objects:e.objects,baseHeightM:0,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]);let i=e.floors[e.floors.length-1].baseHeightM??Math.min(g,(e.floors.length-1)*w),a=Math.min(g,i+w),f=y(e,"floor",o.idFactory,new Set);return e.floors.push({id:f,name:t,baseHeightM:a,objects:[],focalPoint:{...e.focalPoint}}),_(e),{changed:!0,floorId:f,floorCount:e.floors.length,baseHeightM:a}}function q(e,o){let n=s(e),t=n.find(a=>a.id===o.floorId);if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let r=o.name.normalize("NFKC").trim();if(!r||r.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(a=>a.id!==t.id&&a.name.toLocaleLowerCase("en")===r.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${r}`);let i=t.name!==r;return i&&(t.name=r),{changed:i,floorId:t.id,floorName:r}}function V(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart has an implicit base height of 0 metres");let n=e.floors.find(r=>r.id===o.floorId);if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});F(o.baseHeightM);let t=n.baseHeightM!==o.baseHeightM;return t&&(n.baseHeightM=o.baseHeightM,n.physical3dProvenance={...n.physical3dProvenance,baseHeightM:{status:"confirmed",source:"user-review",note:"Physical floor height reviewed through the shared Designer/Copilot operation."}}),{changed:t,floorId:n.id,baseHeightM:o.baseHeightM}}function W(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart cannot remove its only floor");let n=e.floors.findIndex(r=>r.id===o.floorId);if(n<0)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let[t]=e.floors.splice(n,1);if(e.floors.length===1){let[r]=e.floors;e.objects=r.objects,e.focalPoint=r.focalPoint,e.referenceImage=r.referenceImage,e.backgroundImage=r.backgroundImage,e.floors=void 0}else _(e);return{changed:!0,floorId:t.id,removedObjects:t.objects.length,floorCount:s(e).length}}export{l as a,P as b,D as c,y as d,O as e,z as f,v as g,H as h,A as i,d as j,$ as k,k as l,E as m,T as n,N as o,U as p,B as q,Z as r,K as s,_ as t,g as u,w as v,X as w,q as x,V as y,W as z};
@@ -0,0 +1 @@
1
+ var f=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let n=import.meta.url;if(typeof n=="string"&&n)return n}catch{}})(),s=/\/seatlayer-js@[^/]+\//;function o(n,t,r){let e=new URL(`./${n}`,t);if(!r||!s.test(e.pathname))return[e.href];let i=new URL(e.href);return i.pathname=e.pathname.replace(s,`/seatlayer-js@${r}/`),i.href===e.href?[e.href]:[i.href,e.href]}function c(n){let t=f??(typeof location<"u"?location.href:void 0);if(!t)throw new Error(`seatlayer: cannot resolve the ${n} asset URL`);return t}function u(){return typeof __SEATLAYER_SDK_VERSION__<"u"?__SEATLAYER_SDK_VERSION__:void 0}function a(n){return o(n,c(n),u())[0]}async function _(n,t=r=>import(r)){let r=o(n,c(n),u()),e;for(let i of r)try{return await t(i)}catch(d){e=d}throw e}export{f as a,o as b,a as c,_ as d};
@@ -0,0 +1 @@
1
+ import{l as X}from"./chunk-TFYAMLCK.js";import{O as _,Xa as T,Ya as j,cb as $,eb as B,fb as v}from"./chunk-HKVCBUON.js";var W=.08,N=.045;function Y(t){return`__floor__:${encodeURIComponent(t)}`}function L(t,n,r){return{...t,objects:n,floors:void 0,...r?{focalPoint:r}:{},referenceImage:void 0,backgroundImage:void 0}}function U(t,n,r){let s=t.focalPoint??n.focalPoint;return s?s.x:r.x+r.width/2}function G(t){let n=t.floors??[];if(!n.length)return[];let r=n.map(e=>v(L(t,e.objects,e.focalPoint),{freeText:"exclude"})),c=Math.max(1,...r.map(e=>e.width))*W,o=0;return n.map((e,i)=>{let a=r[i],l=o-(a.y+a.height);return o-=a.height+c,{floorId:e.id,label:e.name??e.id,level:i,levelBadge:i===0?"G":String(i),translation:{x:-U(e,t,a),y:l},bounds:a}})}function H(t,n,r,s){let c=n==="name"?t.label:t.levelBadge;if(!c)return[];let o=Math.max(1,r*N),e=t.bounds.x+t.translation.x-o*2.4,i=t.bounds.y+t.translation.y+o*.4,a=`floor-level-${t.floorId}`;if(n==="name")return[{type:"text",id:`${a}-text`,text:c,position:{x:e,y:i},fontSize:o,rotation:0,color:s,bold:!0}];let l=o*.95,h={type:"shape",id:`${a}-badge`,kind:"ellipse",x:e-l*.35,y:i-l*.3,width:l*2,height:l*2,fill:"transparent",stroke:{color:s,width:Math.max(1,o*.09)},opacity:.8},p={type:"text",id:`${a}-text`,text:c,position:{x:h.x,y:h.y+l-o/2},width:l*2,align:"center",lineHeight:1,fontSize:o,rotation:0,color:s,bold:!0};return[h,p]}function it(t,n={}){let r=t.floors;if(!r||r.length<2)return t;let s=G(t),c=[];r.forEach((l,h)=>{let{x:p,y:x}=s[h].translation;for(let b of l.objects)h>0&&b.type==="shape"&&b.role==="stage"||c.push($(b,p,x))});let o={...t,objects:c,floors:void 0},e=v(o,{freeText:"exclude"}),i=Math.max(1,e.width,e.height),a=t.theme?.textColor??"#94a3b8";for(let l of s)c.push(...H(l,n.labelStyle??"number",i,a));return{...o,objects:c,referenceImage:void 0,backgroundImage:void 0}}function ct(t){if(!t.floors||t.floors.length<2)return t;let n=!t.zones?.length,r=new Set,s=t.floors.flatMap(o=>o.objects.flatMap(e=>{if(e.type==="shape"&&e.role==="stage"){let i=JSON.stringify([e.kind,e.x,e.y,e.width,e.height,e.points,e.rotation??0,e.label,e.heightM,e.eventConfigurationIds]);if(r.has(i))return[];r.add(i)}return n&&e.type==="section"?[{...e,zone:Y(o.id)}]:[e]})),c=n?t.floors.map(o=>({id:Y(o.id),label:o.name,focalPoint:{...o.focalPoint}})):t.zones;return{...t,objects:s,zones:c,floors:void 0,referenceImage:void 0,backgroundImage:X(t)}}function V(t){return t.floorOverview==="combined"?"combined":"separated"}function lt(t){let n=t.floors??[];if(n.length<2||n.some(c=>!c.objects.some(o=>Z.has(o.type))))return"separated";let r=z.get(t);if(r)return r;let s=K(t)?"separated":"combined";return z.set(t,s),s}var Z=new Set(["row","table","booth","gaArea","section"]),q=.1,D=18,z=new WeakMap;function K(t){let n=t.floors??[],r=(o,e)=>`${Math.floor(o/D)}:${Math.floor(e/D)}`,s=n.map(o=>{let e=B(L(t,o.objects,o.focalPoint)).map(a=>({x:a.x,y:a.y})),i={areas:[],seats:new Map};for(let a of o.objects)a.type==="section"&&a.outline?.length>=3&&i.areas.push({outer:a.outline,holes:a.holes}),a.type==="gaArea"&&a.points?.length>=3&&i.areas.push({outer:a.points,holes:a.holes});for(let a of e){let l=r(a.x,a.y),h=i.seats.get(l);h?h.push(a):i.seats.set(l,[a])}return{seats:e,footprint:i}}),c=(o,e)=>{let i=Math.floor(o.x/D),a=Math.floor(o.y/D);for(let l=-1;l<=1;l+=1)for(let h=-1;h<=1;h+=1)for(let p of e.seats.get(`${i+l}:${a+h}`)??[])if(Math.hypot(p.x-o.x,p.y-o.y)<D)return!0;return!1};return s.some((o,e)=>{if(!o.seats.length)return!1;let i=s.filter((l,h)=>h!==e).map(l=>l.footprint),a=0;for(let l of o.seats)i.some(h=>h.areas.some(p=>T(l,p.outer,p.holes))||c(l,h))&&(a+=1);return a/o.seats.length>q})}var R="level-context:";function ht(t,n){let r=t.floors??[];if(r.length<2||V(t)!=="combined")return[];let s="#8a93a6",c=[],o=r.find(i=>i.id===n),e=o?v(L(t,o.objects,o.focalPoint),{freeText:"exclude"}):null;for(let i of r){if(i.id===n)continue;let a=0;for(let x of i.objects){let b=x.type==="section"?x.outline:x.type==="gaArea"?x.points:null;if(!b||b.length<3)continue;let d={type:"shape",id:`${R}${i.id}:${a++}`,kind:"polygon",label:"",points:b.map(m=>({...m})),fill:"transparent",stroke:{color:s,width:1.5},opacity:.35};c.push(d)}let l=v(L(t,i.objects,i.focalPoint),{freeText:"exclude"});if(!a||!e||!J(l,e))continue;let h=c.filter(x=>x.type==="shape"&&x.id.startsWith(`${R}${i.id}:`)&&!!x.points),p=h.reduce((x,b)=>Q(b.points)>Q(x.points)?b:x,h[0]);c.push({type:"text",id:`${R}${i.id}:name`,text:i.name??i.id,position:j(p.points,void 0),fontSize:Math.max(1,Math.max(e.width,e.height)*.024),rotation:0,color:s,opacity:.6})}return c}function J(t,n){return t.x>=n.x&&t.y>=n.y&&t.x+t.width<=n.x+n.width&&t.y+t.height<=n.y+n.height}function Q(t){let n=t.map(s=>s.x),r=t.map(s=>s.y);return(Math.max(...n)-Math.min(...n))*(Math.max(...r)-Math.min(...r))}function ft(t){let n=t.floors;if(!n?.length)return null;let r=n.find(o=>o.objects.some(e=>e.type==="shape"&&e.role==="stage"));if(r)return r.id;let s=n[0],c=-1;for(let o of n){let e=v(L(t,o.objects,o.focalPoint),{freeText:"exclude"}),i=e.width*e.height;i>c&&(c=i,s=o)}return s.id}var ut=640;function mt(t,n){return(t.floors?.length??0)<2?null:"all"}var tt=9;function et(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let n=t.width/2,r=t.height/2,s=t.rotation??0;if(!s)return{hx:n,hy:r};let c=s*Math.PI/180,o=Math.abs(Math.cos(c)),e=Math.abs(Math.sin(c));return{hx:n*o+r*e,hy:n*e+r*o}}function nt(t,n,r){let s=n-t.seat.x,c=r-t.seat.y;if(t.shape.kind==="circle")return s*s+c*c<=t.shape.r*t.shape.r;let o=t.shape.rotation??0,e=s,i=c;if(o){let a=-o*Math.PI/180,l=Math.cos(a),h=Math.sin(a);e=s*l-c*h,i=s*h+c*l}return Math.abs(e)<=t.shape.width/2&&Math.abs(i)<=t.shape.height/2}function ot(t,n,r,s,c){if(t.shape.kind==="circle"){let d=Math.min(Math.max(t.seat.x,n),s),m=Math.min(Math.max(t.seat.y,r),c),y=t.seat.x-d,g=t.seat.y-m;return y*y+g*g<=t.shape.r*t.shape.r}let o=t.shape.rotation??0;if(!o)return t.seat.x-t.hx<=s&&t.seat.x+t.hx>=n&&t.seat.y-t.hy<=c&&t.seat.y+t.hy>=r;let e=o*Math.PI/180,i=Math.cos(e),a=Math.sin(e),l=t.shape.width/2,h=t.shape.height/2,p=[[-l,-h],[l,-h],[l,h],[-l,h]].map(([d,m])=>[t.seat.x+d*i-m*a,t.seat.y+d*a+m*i]),x=[[n,r],[s,r],[s,c],[n,c]],b=[[1,0],[0,1],[i,a],[-a,i]];for(let[d,m]of b){let y=1/0,g=-1/0;for(let[O,k]of p){let f=O*d+k*m;f<y&&(y=f),f>g&&(g=f)}let S=1/0,I=-1/0;for(let[O,k]of x){let f=O*d+k*m;f<S&&(S=f),f>I&&(I=f)}if(g<S||I<y)return!1}return!0}function yt(t,n={}){let r=n.seatRadius??tt,s=t.length,c=new Array(s),o=1/0,e=1/0,i=-1/0,a=-1/0,l=0;for(let f=0;f<s;f++){let u=t[f],F=n.shapeOf?.(u)??{kind:"circle",r},{hx:w,hy:M}=et(F);c[f]={seat:u,shape:F,hx:w,hy:M},u.x-w<o&&(o=u.x-w),u.y-M<e&&(e=u.y-M),u.x+w>i&&(i=u.x+w),u.y+M>a&&(a=u.y+M),w>l&&(l=w),M>l&&(l=M)}s===0&&(o=0,e=0,i=0,a=0);let h=l>0?l*4:1,p=Math.max(i-o,0),x=Math.max(a-e,0),b=Math.max(64,n.maxCells??s*4),d=h,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);for(;m*y>b&&(m>1||y>1);)d*=2,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);let g=m*y,S=new Int32Array(g+1),I=0;for(let f=0;f<s;f++){let u=c[f],F=_(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),w=_(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=_(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),E=_(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=E;P++)for(let C=F;C<=w;C++)S[P*m+C+1]++,I++}for(let f=0;f<g;f++)S[f+1]+=S[f];let O=new Int32Array(I),k=S.slice(0,g);for(let f=0;f<s;f++){let u=c[f],F=_(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),w=_(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=_(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),E=_(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=E;P++)for(let C=F;C<=w;C++){let A=P*m+C;O[k[A]++]=f}}return{seats:t,entries:c,minX:o,minY:e,cell:d,cols:m,rows:y,cellStart:S,items:O,stamp:new Int32Array(s),epoch:0}}function pt(t,n,r={}){let{cols:s,rows:c,cell:o,minX:e,minY:i,cellStart:a,items:l,entries:h}=t,p=Math.floor((n.x-e)/o),x=Math.floor((n.y-i)/o);if(p<0||x<0||p>=s||x>=c)return null;let b=x*s+p,d=a[b+1],m=-1,y=1/0;for(let g=a[b];g<d;g++){let S=l[g],I=h[S];if(r.filter&&!r.filter(I.seat.id,I.seat)||!nt(I,n.x,n.y))continue;let O=n.x-I.seat.x,k=n.y-I.seat.y,f=O*O+k*k;(f<y||f===y&&S<m)&&(y=f,m=S)}return m<0?null:h[m].seat.id}function bt(t,n,r,s={}){if(!(r>0))return null;let{cols:c,rows:o,cell:e,minX:i,minY:a,cellStart:l,items:h,entries:p}=t,x=Math.max(0,Math.floor((n.x-r-i)/e)),b=Math.min(c-1,Math.floor((n.x+r-i)/e)),d=Math.max(0,Math.floor((n.y-r-a)/e)),m=Math.min(o-1,Math.floor((n.y+r-a)/e));if(x>b||d>m)return null;let y=-1,g=r*r,S=t.stamp,I=++t.epoch;for(let O=d;O<=m;O++){let k=O*c;for(let f=x;f<=b;f++){let u=k+f,F=l[u+1];for(let w=l[u];w<F;w++){let M=h[w];if(S[M]===I)continue;S[M]=I;let E=p[M];if(s.filter&&!s.filter(E.seat.id,E.seat))continue;let P=n.x-E.seat.x,C=n.y-E.seat.y,A=P*P+C*C;(A<g||A===g&&M<y)&&(g=A,y=M)}}}return y<0?null:p[y].seat.id}function gt(t,n,r={}){let s=Math.min(n.x,n.x+n.width),c=Math.max(n.x,n.x+n.width),o=Math.min(n.y,n.y+n.height),e=Math.max(n.y,n.y+n.height),i=r.mode??"center",{cols:a,rows:l,cell:h,minX:p,minY:x,cellStart:b,items:d,entries:m}=t,y=Math.max(0,Math.floor((s-p)/h)),g=Math.min(a-1,Math.floor((c-p)/h)),S=Math.max(0,Math.floor((o-x)/h)),I=Math.min(l-1,Math.floor((e-x)/h));if(y>g||S>I)return[];let O=[],k=t.stamp,f=++t.epoch;for(let u=S;u<=I;u++){let F=u*a;for(let w=y;w<=g;w++){let M=F+w,E=b[M+1];for(let P=b[M];P<E;P++){let C=d[P];if(k[C]===f)continue;k[C]=f;let A=m[C];if(r.filter&&!r.filter(A.seat.id,A.seat))continue;(i==="center"?A.seat.x>=s&&A.seat.x<=c&&A.seat.y>=o&&A.seat.y<=e:ot(A,s,o,c,e))&&O.push(C)}}}return O.sort((u,F)=>u-F),O.map(u=>m[u].seat.id)}function Mt(t){let n=t.cols*t.rows,r=0,s=0;for(let o=0;o<n;o++){let e=t.cellStart[o+1]-t.cellStart[o];e>0&&r++,e>s&&(s=e)}let c=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:n,occupiedCells:r,refs:c,maxPerCell:s,meanPerOccupiedCell:r?c/r:0}}export{W as a,Y as b,G as c,it as d,ct as e,V as f,lt as g,q as h,R as i,ht as j,ft as k,ut as l,mt as m,tt as n,yt as o,pt as p,bt as q,gt as r,Mt as s};
@@ -1 +1 @@
1
- import{e as m}from"./chunk-URW7MSCJ.js";var b={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},w=new Map(m.map(e=>[e.key,e.label]));function k(e){return`picker.access.${e}`}function x(e){let t=[],r=e.boothType;r&&Object.prototype.hasOwnProperty.call(b,r)&&t.push({key:`booth:${r}`,icon:"booth",titleKey:`picker.boothType.${r}`,titleFallback:b[r],tone:"place"});let a=e.wheelchairSpaceType;for(let n of e.accessibility??[]){if(n==="wheelchair"&&a)continue;let s=w.get(n);s&&t.push({key:`access:${n}`,icon:n,titleKey:k(n),titleFallback:s,tone:"access"})}a==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):a==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let o=e.commercial;o?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),o?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),o?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let c=o?.note?.trim();if(c){let n=t.find(s=>s.tone==="warn"||s.tone==="premium");n?n.note=c:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:c})}let i=typeof e.entrance=="string"?e.entrance.trim():"";return i&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:i}),t}var f=/^[\p{L}\p{N}]{1,4}$/u,d=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function F(e,t){let r=t?.trim();if(!r)return e;let a=e.toLocaleLowerCase("en-US"),o=r.toLocaleLowerCase("en-US");if(a.startsWith(`${o} `)){let i=e.slice(r.length).trim();if(f.test(i))return i}let c=d.exec(e);if(c){let i=c[1].toLocaleLowerCase("en-US"),n=c[2].trim();if((o.startsWith(i)||i.startsWith(o))&&f.test(n))return n}return e}function A(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function R(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function M(e){let t=Number.isFinite(e)&&e>0?e:4;return Math.min(64,Math.max(18,t*5))}function N(e){let t=e.points;if(!t||t.length<2)return null;let r=t.reduce((n,s)=>n+s.x,0)/t.length,a=t.reduce((n,s)=>n+s.y,0)/t.length,o=(e.rotation??0)*Math.PI/180,c=t[0].x-r,i=t[0].y-a;return{x:r+c*Math.cos(o)-i*Math.sin(o),y:a+c*Math.sin(o)+i*Math.cos(o)}}function P(e,t,r){let a=[];if(e.length<2||!(t>0)||!(r>=0))return a;let o=!0,c=t;for(let i=0;i<e.length-1;i+=1){let n=e[i],s=e[i+1],p=Math.hypot(s.x-n.x,s.y-n.y);if(p<1e-9)continue;let y=(s.x-n.x)/p,h=(s.y-n.y)/p,l=0;for(;l<p-1e-9;){let u=Math.min(c,p-l);o&&a.push([{x:n.x+y*l,y:n.y+h*l},{x:n.x+y*(l+u),y:n.y+h*(l+u)}]),l+=u,c-=u,c<=1e-9&&(o=!o,c=o?t:r)}}return a}export{k as a,x as b,F as c,A as d,R as e,M as f,N as g,P as h};
1
+ import{e as m}from"./chunk-522ENS2Q.js";var b={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},w=new Map(m.map(e=>[e.key,e.label]));function k(e){return`picker.access.${e}`}function x(e){let t=[],r=e.boothType;r&&Object.prototype.hasOwnProperty.call(b,r)&&t.push({key:`booth:${r}`,icon:"booth",titleKey:`picker.boothType.${r}`,titleFallback:b[r],tone:"place"});let a=e.wheelchairSpaceType;for(let n of e.accessibility??[]){if(n==="wheelchair"&&a)continue;let s=w.get(n);s&&t.push({key:`access:${n}`,icon:n,titleKey:k(n),titleFallback:s,tone:"access"})}a==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):a==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let o=e.commercial;o?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),o?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),o?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let c=o?.note?.trim();if(c){let n=t.find(s=>s.tone==="warn"||s.tone==="premium");n?n.note=c:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:c})}let i=typeof e.entrance=="string"?e.entrance.trim():"";return i&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:i}),t}var f=/^[\p{L}\p{N}]{1,4}$/u,d=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function F(e,t){let r=t?.trim();if(!r)return e;let a=e.toLocaleLowerCase("en-US"),o=r.toLocaleLowerCase("en-US");if(a.startsWith(`${o} `)){let i=e.slice(r.length).trim();if(f.test(i))return i}let c=d.exec(e);if(c){let i=c[1].toLocaleLowerCase("en-US"),n=c[2].trim();if((o.startsWith(i)||i.startsWith(o))&&f.test(n))return n}return e}function A(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function R(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function M(e){let t=Number.isFinite(e)&&e>0?e:4;return Math.min(64,Math.max(18,t*5))}function N(e){let t=e.points;if(!t||t.length<2)return null;let r=t.reduce((n,s)=>n+s.x,0)/t.length,a=t.reduce((n,s)=>n+s.y,0)/t.length,o=(e.rotation??0)*Math.PI/180,c=t[0].x-r,i=t[0].y-a;return{x:r+c*Math.cos(o)-i*Math.sin(o),y:a+c*Math.sin(o)+i*Math.cos(o)}}function P(e,t,r){let a=[];if(e.length<2||!(t>0)||!(r>=0))return a;let o=!0,c=t;for(let i=0;i<e.length-1;i+=1){let n=e[i],s=e[i+1],p=Math.hypot(s.x-n.x,s.y-n.y);if(p<1e-9)continue;let y=(s.x-n.x)/p,h=(s.y-n.y)/p,l=0;for(;l<p-1e-9;){let u=Math.min(c,p-l);o&&a.push([{x:n.x+y*l,y:n.y+h*l},{x:n.x+y*(l+u),y:n.y+h*(l+u)}]),l+=u,c-=u,c<=1e-9&&(o=!o,c=o?t:r)}}return a}export{k as a,x as b,F as c,A as d,R as e,M as f,N as g,P as h};
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},a=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of s(t))!d.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(o=u(t,n))||o.enumerable});return e};var p=e=>a(c({},"__esModule",{value:!0}),e);var m={};f(m,{SEATLAYER_MODULE_URL:()=>i,cdnAssetUrl:()=>l});module.exports=p(m);var L={},i=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let e=L.url;if(typeof e=="string"&&e)return e}catch{}})();function l(e){let t=i??(typeof location<"u"?location.href:void 0);if(!t)throw new Error(`seatlayer: cannot resolve the ${e} asset URL`);return new URL(`./${e}`,t).href}0&&(module.exports={SEATLAYER_MODULE_URL,cdnAssetUrl});
1
+ "use strict";var s=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var E=(n,e)=>{for(var r in e)s(n,r,{get:e[r],enumerable:!0})},m=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!p.call(n,i)&&i!==r&&s(n,i,{get:()=>e[i],enumerable:!(t=_(e,i))||t.enumerable});return n};var S=n=>m(s({},"__esModule",{value:!0}),n);var R={};E(R,{SEATLAYER_MODULE_URL:()=>u,cdnAssetCandidates:()=>o,cdnAssetUrl:()=>g,importCdnAsset:()=>h});module.exports=S(R);var A={},u=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let n=A.url;if(typeof n=="string"&&n)return n}catch{}})(),c=/\/seatlayer-js@[^/]+\//;function o(n,e,r){let t=new URL(`./${n}`,e);if(!r||!c.test(t.pathname))return[t.href];let i=new URL(t.href);return i.pathname=t.pathname.replace(c,`/seatlayer-js@${r}/`),i.href===t.href?[t.href]:[i.href,t.href]}function d(n){let e=u??(typeof location<"u"?location.href:void 0);if(!e)throw new Error(`seatlayer: cannot resolve the ${n} asset URL`);return e}function f(){return typeof __SEATLAYER_SDK_VERSION__<"u"?__SEATLAYER_SDK_VERSION__:void 0}function g(n){return o(n,d(n),f())[0]}async function h(n,e=r=>import(r)){let r=o(n,d(n),f()),t;for(let i of r)try{return await e(i)}catch(a){t=a}throw t}0&&(module.exports={SEATLAYER_MODULE_URL,cdnAssetCandidates,cdnAssetUrl,importCdnAsset});
@@ -25,11 +25,38 @@
25
25
  * import time.
26
26
  */
27
27
  declare const SEATLAYER_MODULE_URL: string | undefined;
28
+ /**
29
+ * Where to load `path` from, best first, for a bundle loaded from `moduleUrl`.
30
+ *
31
+ * A script tag on the major alias (`/seatlayer-js@0/seatlayer-buyer.js`) is
32
+ * 302'd to the pinned release, but `document.currentScript.src` is the tag's
33
+ * attribute, so the bundle saw itself at `@0` and every lazy asset resolved
34
+ * under the alias: locale bundles 404 there (the buyer fell back to English),
35
+ * and the 3D, view-from-seat and checkout chunks each paid a second 302 and
36
+ * could resolve to a NEWER release than the running bundle across a release
37
+ * (2026-09-29). The bundle knows its own version, so it asks for THAT release
38
+ * directory first.
39
+ *
40
+ * The relative URL stays as the fallback, exactly as it was, so the worst case
41
+ * is today's behaviour: a page whose CSP allows only the `@0/` path (CSP
42
+ * ignores the path after a redirect, so the old URL passed where a direct
43
+ * pinned URL may not), or any failure of the pinned request. A bundle NOT
44
+ * served from a release directory (a self-hosted or proxied copy) gets only
45
+ * its relative URL, as before.
46
+ */
47
+ declare function cdnAssetCandidates(path: string, moduleUrl: string, version: string | undefined): string[];
28
48
  /**
29
49
  * Absolute URL of a sibling lazy asset in this bundle's pinned CDN directory.
30
50
  * `path` is relative to the bundle, so both `'seatlayer-view3d.mjs'` and
31
51
  * `'i18n/de.mjs'` resolve correctly.
32
52
  */
33
53
  declare function cdnAssetUrl(path: string): string;
54
+ /**
55
+ * Import a sibling lazy asset: the pinned release directory first, then, only
56
+ * if that import fails, the bundle-relative URL every earlier release used.
57
+ * The last failure is the one thrown, so a caller's own fallback (English, a
58
+ * retryable 3D load) behaves as before.
59
+ */
60
+ declare function importCdnAsset<T>(path: string, load?: (url: string) => Promise<unknown>): Promise<T>;
34
61
 
35
- export { SEATLAYER_MODULE_URL, cdnAssetUrl };
62
+ export { SEATLAYER_MODULE_URL, cdnAssetCandidates, cdnAssetUrl, importCdnAsset };
@@ -25,11 +25,38 @@
25
25
  * import time.
26
26
  */
27
27
  declare const SEATLAYER_MODULE_URL: string | undefined;
28
+ /**
29
+ * Where to load `path` from, best first, for a bundle loaded from `moduleUrl`.
30
+ *
31
+ * A script tag on the major alias (`/seatlayer-js@0/seatlayer-buyer.js`) is
32
+ * 302'd to the pinned release, but `document.currentScript.src` is the tag's
33
+ * attribute, so the bundle saw itself at `@0` and every lazy asset resolved
34
+ * under the alias: locale bundles 404 there (the buyer fell back to English),
35
+ * and the 3D, view-from-seat and checkout chunks each paid a second 302 and
36
+ * could resolve to a NEWER release than the running bundle across a release
37
+ * (2026-09-29). The bundle knows its own version, so it asks for THAT release
38
+ * directory first.
39
+ *
40
+ * The relative URL stays as the fallback, exactly as it was, so the worst case
41
+ * is today's behaviour: a page whose CSP allows only the `@0/` path (CSP
42
+ * ignores the path after a redirect, so the old URL passed where a direct
43
+ * pinned URL may not), or any failure of the pinned request. A bundle NOT
44
+ * served from a release directory (a self-hosted or proxied copy) gets only
45
+ * its relative URL, as before.
46
+ */
47
+ declare function cdnAssetCandidates(path: string, moduleUrl: string, version: string | undefined): string[];
28
48
  /**
29
49
  * Absolute URL of a sibling lazy asset in this bundle's pinned CDN directory.
30
50
  * `path` is relative to the bundle, so both `'seatlayer-view3d.mjs'` and
31
51
  * `'i18n/de.mjs'` resolve correctly.
32
52
  */
33
53
  declare function cdnAssetUrl(path: string): string;
54
+ /**
55
+ * Import a sibling lazy asset: the pinned release directory first, then, only
56
+ * if that import fails, the bundle-relative URL every earlier release used.
57
+ * The last failure is the one thrown, so a caller's own fallback (English, a
58
+ * retryable 3D load) behaves as before.
59
+ */
60
+ declare function importCdnAsset<T>(path: string, load?: (url: string) => Promise<unknown>): Promise<T>;
34
61
 
35
- export { SEATLAYER_MODULE_URL, cdnAssetUrl };
62
+ export { SEATLAYER_MODULE_URL, cdnAssetCandidates, cdnAssetUrl, importCdnAsset };
@@ -1 +1 @@
1
- import{a,b}from"../chunk-FOYQOIWG.js";export{a as SEATLAYER_MODULE_URL,b as cdnAssetUrl};
1
+ import{a,b,c,d}from"../chunk-TGHNVDWA.js";export{a as SEATLAYER_MODULE_URL,b as cdnAssetCandidates,c as cdnAssetUrl,d as importCdnAsset};